Jump to content


Photo

List X banners in random order.


  • Please log in to reply
2 replies to this topic

#1 willdikuloz

willdikuloz
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 16 May 2006 - 01:34 AM

Is there a script/snippet to show X amount of banners in random order?

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 16 May 2006 - 01:47 AM

No, you'll have to write it yourself and people here will probably help you when you run into a problem. Post whatever code you've already written, telling what's wrong with it. If you want some hints to get you started then you'll have to post some specific information, e.g. where are the filenames for these banners - in a database, in a text file, in an array, nowhere yet. How will 'x' be detemined? etc., etc.
Legend has it that reading the manual never killed anyone.
My site

#3 php_joe

php_joe
  • Members
  • PipPipPip
  • Advanced Member
  • 175 posts

Posted 20 May 2006 - 02:43 AM

[!--quoteo(post=374174:date=May 16 2006, 09:34 AM:name=willdikuloz)--][div class=\'quotetop\']QUOTE(willdikuloz @ May 16 2006, 09:34 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Is there a script/snippet to show X amount of banners in random order?
[/quote]

I found this at [a href=\"http://www.hawkee.com\" target=\"_blank\"]http://www.hawkee.com[/a]:

<?
$random_text = array("Random Text 1",
                    "Random Text 2",
                    "Random Text 3",
                    "Random Text 4",
                    "Random Text 5");
srand(time());
$sizeof = count($random_text);
$random = (rand()%$sizeof);
print("$random_text[$random]");
?>

[url=http://darkswordsguide.com][/url]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users