The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to use sessions with scripts called from php_include
Hi
I have a banner rotation script that is called from php_include. It works fine, but I would like the banners rotate only once every user session. How do I do this? Sorry, but I'm a n00b in php. Please help. Thanks |
#2
|
|||
|
|||
anyone?
|
#3
|
||||
|
||||
Please wait at least 24 hours before bumping posts
|
#4
|
|||
|
|||
I was told 12 hrs at vBulletin.com
Now, .org has their own rules? Where can I read them bloody rules, so when I get a reply back in my thread, it is actually useful! Thanks |
#5
|
|||
|
|||
Here's the simple script (banner.php) I made to rotate banners.
Code:
<?php srand((float) microtime() * 10); $input = array( "<img src=\"$stylevar[imgdir_misc]/banner1.jpg\" width=\"480\" height=\"60\" />", "<img src=\"$stylevar[imgdir_misc]/banner2.jpg\" width=\"480\" height=\"60\" />", "<img src=\"$stylevar[imgdir_misc]/banner3.jpg\" width=\"480\" height=\"60\" />" ); $rand_keys = array_rand($input, 3); echo $input[$rand_keys[0]] . "\n"; ?> Code:
ob_start(); include_once("banner.php"); $randomlogo = ob_get_contents(); ob_end_clean(); Thanks Aurous |
#6
|
|||
|
|||
I just came up with an idea, but I have no clue how to implement this.
I can call the script mentioned above by a cron job every couple hrs, and make the output store in my database. Then make another php script that will call the html tags in the database. I dont know if this is a very smart idea. If someone can come up with a better suggestion then please let me know. Thanks Aurous |
#7
|
|||
|
|||
anyone?
|
#8
|
|||
|
|||
*bump*
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|