Random Image Selector.

Discussion in 'Programming' started by andymayo, Jun 17, 2008.

  1. andymayo

    andymayo Guest

    Messages:
    652
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #21
    Thank you every 1!!! it all works except 1 part...

    that code wont work as an include.. WHY?!?! lmao

    plz respond.
     
    andymayo, Jul 8, 2008 IP
  2. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #22
    Sorry, could nto follow. What you mean by this post ?

    regards
     
    Vooler, Jul 8, 2008 IP
  3. David Pankhurst

    David Pankhurst Member

    Messages:
    39
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #23
    David Pankhurst, Jul 8, 2008 IP
  4. andymayo

    andymayo Guest

    Messages:
    652
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #24
    vooler

    ist just this include code that i can gte to work. the script is good.
     
    andymayo, Jul 9, 2008 IP
  5. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #25
    Just a suggestion, don't put an end ?> tag in the script (referring to this post: http://forums.digitalpoint.com/member.php?u=177972)

    That way you can't err and put a space or similar after it, because it isn't there.

    Also try not to use short tags, they're yucky.

    Dan
     
    Danltn, Jul 13, 2008 IP
  6. SnoozZz

    SnoozZz Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #26
    SnoozZz, Jul 14, 2008 IP
  7. SnoozZz

    SnoozZz Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
  8. SnoozZz

    SnoozZz Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #28
    This should also work.....

    <?php 
    
    $ban1 = "type banner url here";
    $url1 = "type url here"; 
    $ban2 = "type banner url here";
    $url2 = "type url here"; 
    $ban3 = "type banner url here";
    $url3 = "type url here";
    //etc.
    
    $randomNum = rand (1,3);	//change the 3 to the amount of banners you have.
    
    //Select the banner of the random number
    $image = ${'ban'.$randomNum};
    
    //Url of the random number
    $url= ${'url'.$randomNum};
    
    //Prints out the link of the banner and the image of the banner
    Print "<a href=".$url." mce_href=".$url."><img src=".$image." border=0></a>";
    ?>
    
    PHP:
     
    SnoozZz, Jul 14, 2008 IP
  9. andymayo

    andymayo Guest

    Messages:
    652
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #29
    dude I HAVE THE WORKING SCRIPT.... i want it to be used in my VB forums now.
     
    andymayo, Jul 15, 2008 IP
  10. SnoozZz

    SnoozZz Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #30
    ok good luck
     
    SnoozZz, Jul 15, 2008 IP
  11. andymayo

    andymayo Guest

    Messages:
    652
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #31
    :( i need a lot of that.. no one knows how to do it.
     
    andymayo, Jul 16, 2008 IP
  12. SnoozZz

    SnoozZz Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #32
    have you tried putting an Iframe on the page you want the banner to display
    <iframe src="the randomiser page url here" width=200 height=200 noresize scrolling="no" align="left" frameborder="0"></iframe>
    HTML:
    just change width and height to your image size...maybe i'm not understanding all of this very well
     
    SnoozZz, Jul 16, 2008 IP
  13. SnoozZz

    SnoozZz Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #33
    he means to say thanks for the help.

    in his forum he wants the images to display at the top.
     
    SnoozZz, Jul 16, 2008 IP
  14. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #34
    I dont know much about templates structure of forum software, so I don't want to just guess which may result in forum layout corrupted.

    regards
     
    Vooler, Jul 16, 2008 IP
  15. SnoozZz

    SnoozZz Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #35
    SnoozZz, Jul 16, 2008 IP
  16. andymayo

    andymayo Guest

    Messages:
    652
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #36
    andymayo, Jul 17, 2008 IP