View Full Version : Rotate TPL's?
proprod
06-11-2006, 08:46 AM
Hey there all...
Good question for you. Would there be a way to alternate tpls that are called when the directory page is loaded? Like a random tpl call. So, for example, when the main page is refreshed, a different rightside.tpl is loaded. You could have a rightside.tpl, rightside1.tpl, rightside2.tpl, and so on... I know it sounds odd.. but how difficult?
:D
Here is a simple suggestion...
Add in your PHP file an array that you will populate will all available templates. I'd say you place it in init.php somewhere on the bottom of the file.
Content visible to registered users only.
This will assign each time the page loads a random template to the template variable random_tpl
Now you can call it in your preferred template file with:
Content visible to registered users only.
That's all ;)
Boby
Jama62
06-11-2006, 07:23 PM
Nice... Thats a cool mod to implement. When someone get this working let us know. I personally want to see it in action.
proprod
06-11-2006, 07:56 PM
Content visible to registered users only.
Boby, this works great! Thank you so much. frozenminds added to front page as a recommended visit :) But, one thing now... in IE I get this error when the page is finished loading:
Content visible to registered users only.
Any ideas on that?
Also, this mod is working on the directory listed below. At the bottom, under sponsors, the sponsored ads change each time the page is loaded. I know there is banner rotation codes, but this seems easier. Plus, this could be implemented on things like header.tpl to alternate logos and what not :D
Thanks again, boby and let me know what you make of that IE error. I don't seem to get that in FireFox.
Content visible to registered users only.
Wow, thanks man! This is nice :)
Content visible to registered users only.
Hmm, yeah the error is because of my AJAX category mod. It displays because the script searches for a tag ID that is only on the submit page available. It was reported in the thread where I published the mod. Tonight I hope I can get a PC with IE (I am running Linux and don't have IE) and will check it out and hope to fix it ;)
Don't bother to much, it's actually not an error, it's more some sort of notice.
I checked your source code, and you have an error in your meta tags:
Content visible to registered users only.
You have to close the tag:
Content visible to registered users only.
And you maybe want to change all your HTML tags to lowercase and also the elements to be XHTML compliant. ;)
Boby
proprod
06-11-2006, 10:47 PM
Content visible to registered users only.
Thanks for the suggestions and the catch on the error in the meta tag there. Changed all to lower case. And my dumb-self was wondering why my title wasn't being picked up by meta tag analyzers :rolleyes: Appreciate all of your help :D
And here is the update on the mod for the Javascript errors:
http://www.phplinkdirectory.com/forum/showthread.php?p=23349#post23349
Just replace the js file and look ... no more errors ;)
Boby
proprod
06-12-2006, 05:52 AM
Content visible to registered users only.
Wonderful! Thanks again :D
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.