|
Forum > PHP Code Discussion
creating a "rotating" banner effect thru code
(1/2) > >>
Smoky:
ICH, is there any way i could make a banner rotate, without the iframe, might have to post up my code for the single banner.. cant tonight, tired and going to be sore tomorrow, but what im wanting it to switch out banners, (only 2) as the pages turn.. should be able to but im not sure on the how..
here is the code after all lol...
--- Code: --- <body><div id="wrapper">'; // TinyPortal start if($context['TPortal']['fixed_width']!=0) echo '<table align="center" width="'.$context['TPortal']['fixed_width'].'" cellpadding="0" cellspacing="0" border="0"><tr><td>';
echo ' <table width="100%" cellpadding="0" cellspacing="0" border="0" class="top"> <tr> <td height="32">'; if (empty($settings['header_logo_url'])) echo ' <img src="', $settings['images_url'], '/sr-logo.jpg" id="logo" alt="" />';
else echo '<img src="', $settings['header_logo_url'], '" style="header" alt="', $context['forum_name'], '" />';
echo ' </td> </tr> <tr> <td height="32" align="right">';
--- End code ---
would appreciate it very much if i can get this done without using the iframe, and just including it into the images folder where the other one is.. :azn: :P
IchBin™:
In order to get it to be random you'll have to use an array and then just shuffle. If I remember right JPDeni posted something similar to this on TP.net not too long ago. But remember, random doesn't mean that it will be different on each page. It could mean, it will show the same logo 2,3,4 times in a row, before it randomly hits the other logo. So if you're looking for something that will go back and forth in its "randomness" on each page, then that would be code a little different.
This should do a random logo.
--- Code: ---<body><div id="wrapper">'; // TinyPortal start if($context['TPortal']['fixed_width']!=0) echo '<table align="center" width="'.$context['TPortal']['fixed_width'].'" cellpadding="0" cellspacing="0" border="0"><tr><td>';
echo ' <table width="100%" cellpadding="0" cellspacing="0" border="0" class="top"> <tr> <td height="32">'; $logo = array ( 'sr-logo.jpg', 'sr-logo2.jpg' ); shuffle($random); if (empty($settings['header_logo_url'])) echo ' <img src="', $settings['images_url'], '/',$logo[0],'" id="logo" alt="" />';
else echo '<img src="', $settings['header_logo_url'], '" style="header" alt="', $context['forum_name'], '" />
--- End code ---
Smoky:
will try that and let you know how i like it.. thanks ICH.. :coolsmiley:
Jdustine17:
I just want to say thank you for the information that you have been shared about banners just like Custom banner, vinyl banners and others. Many thanks... :coolsmiley:
IchBin™:
Did someone mention Vinyl banners? lol I'm assuming your attempt to spam my board with a link failed because you cannot post links here until I've confirmed you are not a spammer. hahahahaha
Ichbin +1 Spammers -1
Navigation
[0] Message Index
[#] Next page
|