![]() |
|
Thread Tools |
#1
|
||||
|
||||
Random Image Forum Side Block?
I'm looking for code that will go to a designated directory "/images/ads/sideblock" and grab like 4 or 5 images and place them randomly there.
I found this code and tried to use it as php on a sideblock but I got an error. I'm not a codr so I though I'd ask you guys that are... Any help would be awesome... Thanks...
No members have liked this post.
|
#2
|
||||
|
||||
first, are the files in this directory named in any specific order? (i.e.: img_1.jpg, img_2..)?
No members have liked this post.
|
#3
|
|||
|
|||
http://www.alistapart.com/articles/randomizer/
The link to the code is near the bottom. Just copy and paste to notepad and save as rotate. php Make a folder in your ftp and note the path to get to it. Drop your ads in there. Drop a copy of the rotate.php file in there with them. From the block setup select html. Put the path to the rotate.php file in as the code and save. Now every time you refresh the page from the browser or leave and come back to the page with the blocks, the rotate.php gets called. It selects a pic at random and displays it. If you want to show different ads in different blocks you'll have to make more than one folder with your ads in them. Put the rotate.php in each folder and call for them from the different block setups. Otherwise if you call for the same rotate.php file from different blocks they all would show the same ad at the same time. I would say go look at my site to see it in action but alas animeappeal is no more thanks to crappy hosting.
__________________
Working on new projects and expanding our horizons. Come by and see what we're up to now.
No members have liked this post.
|
#4
|
|||
|
|||
Originally Posted by DivisionByZero
No they're not![]()
--------------- Added 28 Jun 2012 at 17:19 ---------------
Originally Posted by setishock
Will that allow multiple ads as pictured? One on top of the other?
![]()
No members have liked this post.
|
#5
|
|||
|
|||
I had 2 stacked in one block at one time. The block will expand vertically to hold what you cram in there. They all have to be the same width though.
I had the code stacked something like this: url blah blah blah /br url blah blah blah Not real complicated.
__________________
Working on new projects and expanding our horizons. Come by and see what we're up to now.
No members have liked this post.
|
#6
|
|||
|
|||
If I have 10 images and want to have 5 at a time in there randomly and do it that way I could have duplicate images correct?
No members have liked this post.
|
#7
|
|||
|
|||
Say you have 100 ad pics. Make five folders and drop 20 pics in each along with the rotate.php file.
In the sidebar block setting choose html. Using the path to each one of the folders you get this: url path to folder 1 rotate.php url path to folder 2 rotate.php And so on till you have 5 url's stacked. Click save. That should take care of it. You have to have separate url's to separate folders or you get dups.
__________________
Working on new projects and expanding our horizons. Come by and see what we're up to now.
The following members like this post: DetroitYES
|
#8
|
|||
|
|||
great info guys....ty. works like a charm
![]() Is there any way to hyper link the banners so people can click on them? No members have liked this post.
|
#9
|
||||
|
||||
Originally Posted by setishock
Alternatively, he could remove the item from the array with unset() once it was used but this is probably easier if he isn't code savvy...
![]()
No members have liked this post.
|
![]() |
«
Previous Thread
|
Next Thread
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 12:41.