Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Random Banner.

Asked Modified Viewed 2,049 times
S
Sherby
S
Sherby 10
  • Junior Member, joined since
  • Contributed 13 posts on the community forums.
  • Started 6 threads in the forums
  • Started this discussions
asked
Junior Member

Hi, i need some help with my website, i need to make it display a new banner each time someone access the website or refreshes it. Problem is i don't know how and i can't find any information on google on how to do so. Is there any way how to do it?
Note that my website current banner is displaying from the current theme i have for the website. Heres the example:
<?php
if (!defined("IN_FUSION"wink) { die("Access Denied"wink; }

define("THEME_BULLET", "<span class='bullet'>&middot;</span>"wink;

require_once INCLUDES."theme_functions_include.php";

function render_page($license=false) {

global $settings, $main_style, $locale;

//Header

echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
echo "<td align='center' class='full-header'><img src='".THEME."images/banner5.png'></td>\n";
echo "</tr>\n</table>\n";

echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
echo "<td class='sub-header-left'></td>\n";
echo "<td class='sub-header'>".showsublinks(" ".THEME_BULLET." ", "white"wink."</td>\n";
echo "<td align='right' class='sub-header'>".showsubdate()."</td>\n";
echo "<td class='sub-header-right'></td>\n";
echo "</tr>\n</table>\n";

===

This is from my theme php file.

Thanks.
0 replies

6 posts

H
HaYaLeT
H
  • Senior Member, joined since
  • Contributed 262 posts on the community forums.
  • Started 28 threads in the forums
answered
Senior Member

S
Sherby
S
Sherby 10
  • Junior Member, joined since
  • Contributed 13 posts on the community forums.
  • Started 6 threads in the forums
  • Started this discussions
answered
Junior Member

I don't think it's the same thing i want
0 replies
H
HaYaLeT
H
  • Senior Member, joined since
  • Contributed 262 posts on the community forums.
  • Started 28 threads in the forums
answered
Senior Member

Ok chang this code

echo "<td align='center' class='full-header'><img src='".THEME."images/banner5.png'></td>\n";


to this

echo "<td align='center' class='full-header'><img src='".THEME."images/".rand(1,6).".png' alt='' border='0'></td>\n";


1- you can chang png to gif or jpg
2- you can chang 1,6 to other (this is mean showing random 6 images-the page is refreshed)
3- add 6 images to your THEME images folder..images names should be same this 1.png,2.png... or 1.jpg,2.jpg e.t.c

Ok! Done!
0 replies
S
Sherby
S
Sherby 10
  • Junior Member, joined since
  • Contributed 13 posts on the community forums.
  • Started 6 threads in the forums
  • Started this discussions
answered
Junior Member

Oh dude, thanks alot!! Much appreciated.
0 replies
H
HaYaLeT
H
  • Senior Member, joined since
  • Contributed 262 posts on the community forums.
  • Started 28 threads in the forums
answered
Senior Member

You are welcome ;)
0 replies
A
afoster
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
answered
Senior Member

Would your suggested code (with some modifications) work with the following theme.php code?

//Header
   echo "<div class='center $main_style' style='background-color:#e7e4e3;width:".THEME_WIDTH.";'>\n";
   echo "<div class='floatfix'>\n";
   echo "<div class='full-header floatfix'>\n\n".showbanners()."</div>\n";
   echo "<div class='sub-header floatfix'>\n";
   echo "<div style='float:left;'>".showsublinks("","menu")."</div>\n";
   echo "<div style='float:right;'>".showsubdate()."</div>\n";
   echo "</div></div>\n";
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 6 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

A
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
H
H
  • Senior Member, joined since
  • Contributed 262 posts on the community forums.
  • Started 28 threads in the forums
S
S
Sherby 10
  • Junior Member, joined since
  • Contributed 13 posts on the community forums.
  • Started 6 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet