![]() |
Rotate your logos
This template mod randomly picks an image from a specified folder to be used as the forum logo.
In your phpinclude-template, add this code: PHP Code:
and in your header-template, change { titleimage} to $titleimage That should be it, really. |
Thanks again Sparkz. It's installed and working great.
|
Hmm. I've noticed that it occasionally pushes a null to the client (img src=""). I'm thinking this could either be because the random function goes beyond the bounds of the array or the directory read is actually picking up a blank. I'm afraid to just go fooling around with coding languages I haven't learned yet so I'm going to stay away from modifying your code.
Please help. |
Nice but maybe need some work on it as when u refresh a few times a blank image wit the red cross appears ;)
|
Hmm, sorry about that.
Change PHP Code:
PHP Code:
|
You can also use DHTML by putting the code in the head bit :-/
|
There are probably tons of way to do this.
I just happen to know and like PHP, so that's why I chose to do it like this. |
Besides, this saves bandwidth, as it is server side.
Using DHTML, you'd have to pass the whole list if images to the client, plus the code to actually do the pick which image to show. |
nice work sparkz very impressive :D
|
well works like a charm i gave this 10 outta 10 m8 well done :) nice simple and very effective :D
|
Nifty! It's all fixed.
You get a big shiny golden star in my book! |
Quote:
Nice 'hack' though :bunny: |
If you only have a few images to rotate, you could just set the content of $logos manually. Would result in a bit less processing time.
Something like: PHP Code:
|
Excellent! I upgraded to the predefined array and it is noticably faster.
|
Is there anyway that I can get it show the random image plus a link for each one. Basically, all I need is another variable that just displays the filename, without the directory, and extensions.
|
Anyone? [BUMP]
|
Try this:
PHP Code:
|
Worked perfect, thanks.
|
My pleasure :D
|
Just looked at your site... Like what you did with this mod :)
|
I have gotten this working succesfully on another skin and works beautifully.
I have tho another skin that it does not work on. The code from the skin that doesn't work DOES work in any of the pre existing things so I know its not the array that is killing it here. Is there anything that would interfere with this mod from working? |
Hmm - as long as you have the code in the header it _should_ work. I don't really use it myself, so I haven't tested it to much.
|
|
All times are GMT. The time now is 07:55 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|