Can You Write JavaScript ????

Discussion in 'JavaScript' started by geekazoid, Oct 23, 2006.

  1. #1
    I cant pay you but i will put a link to your website on everypage of my website ( over 500 pages )

    I need a script

    I want to display a random picture on my website everyday with a hyperlink on each picture ( each hyperlink would be differant ) and a small text hyperlink underneath

    I have come up with an idea on how this would work and how i can rotate through every picture in my folder using script i just need someone to write it for me.

    Here's my idea .....

    I need a script to.....

    add the date + the month + the year

    and then minus 2000 from your answer

    then times that number by 64

    you will end up with a large number

    then i want to get just the last 3 digits of that number and that number is the number of the picture that day
    So it will look something like this

    
    12th + 9 + 2006 = 2027
    
    2027 - 2000 = 27 
    
    27 x 64 
    
    27 x 64 = 1728
    
    the last 3 digits are 728 
    
    so out of my 1000 differant pictures it would show picture 728 which is hyperlinked to page "picture 728" on my website
    PHP:
    Is this easy to do ? Can anyone do this ?
     
    geekazoid, Oct 23, 2006 IP
  2. geekazoid

    geekazoid Peon

    Messages:
    208
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I forgot to mention i would like this is java script so i can give it to other people to put on their websites :D
     
    geekazoid, Oct 23, 2006 IP
  3. Evoleto

    Evoleto Well-Known Member

    Messages:
    253
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #3
    I can do this for you, please provide more details
     
    Evoleto, Oct 23, 2006 IP
  4. geekazoid

    geekazoid Peon

    Messages:
    208
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    What else do you need to know and i will tell ya ?
     
    geekazoid, Oct 24, 2006 IP
  5. PrateekSaxena

    PrateekSaxena Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You are such a traitor!
     
    PrateekSaxena, Oct 24, 2006 IP
  6. geekazoid

    geekazoid Peon

    Messages:
    208
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If someone is kind enough to do it for free why would i pay you ? I said i havent the money to pay
     
    geekazoid, Oct 24, 2006 IP
  7. geniosity

    geniosity Peon

    Messages:
    293
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #7
    do you still need this done? I've created one... send me a PM if you do. not sure if it's perfect, but works off of your spec.
     
    geniosity, Oct 24, 2006 IP
  8. Morishani

    Morishani Peon

    Messages:
    239
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Enjoy :)
    
    function return_num()
    	{
    	var date = new Date();
    	num = (date.getFullYear() - 2000 + date.getDate() + date.getMonth())*64%1000;
    	return num;
    	}
    function do_image()
    	{
    	num = return_num();
    	html = "<a href=\"picture_"+num+".html\"><img src=\"images/"+num+".jpg\" /></a>";
    	return html;
    	}
    document.write(do_image());
    PHP:
    (Thats obviously, Javascript)

    Use document.write(do_image()); where ever you need :)
     
    Morishani, Oct 25, 2006 IP
  9. Ronal

    Ronal Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Ronal, Oct 26, 2006 IP
  10. datropics

    datropics Peon

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #10
    Morishani's script seems solid -
     
    datropics, Oct 26, 2006 IP
  11. PrateekSaxena

    PrateekSaxena Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Hello,

    I am really sorry for calling you a traitor. I was being very greedy. If I was in your position then I too would have gotten the job done for free. Thus, I would like you to please accept my apology for being greedy and then abusing you.

    Really Sorry,
    Prateek Saxena
     
    PrateekSaxena, Oct 27, 2006 IP