Simple banner rotation script

Discussion in 'Programming' started by tony84, May 28, 2007.

  1. champ_rock

    champ_rock Peon

    Messages:
    3,349
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #21
    is it working now???
     
    champ_rock, Jun 2, 2007 IP
  2. sumit270

    sumit270 Active Member

    Messages:
    227
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    58
    #22
    for ads management you can use the open ads software.
     
    sumit270, Jun 2, 2007 IP
  3. tony84

    tony84 Well-Known Member

    Messages:
    1,864
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    140
    #23
    ive tried a few combinations i still havnt managed to get it working.

    also ive looked at the software you mentioned and it is a little advanced for what i need, ive used it in the past on other sites and probably will use it if needs be in the future but its way above what i actually need at the minute, ideally i would like to get this script to work.
     
    tony84, Jun 3, 2007 IP
  4. champ_rock

    champ_rock Peon

    Messages:
    3,349
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #24
    i have again modified the code. this should definately work
    
    <?php
    $a='<script type="text/javascript"><!--
    google_ad_client = "pub-00000000";
    google_ad_width = 728;
    google_ad_height = 90;
    google_ad_format = "728x90_as";
    google_ad_type = "text";
    google_ad_channel = "";
    google_color_border = "666666";
    google_color_bg = "666666";
    google_color_link = "ffffff";
    google_color_text = "ffffff";
    google_color_url = "f29935";
    //-->
    
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>';
    
    
    $b='<script type="text/javascript"><!--
    google_ad_client = "pub-00000022200";
    google_ad_width = 728;
    google_ad_height = 90;
    google_ad_format = "728x90_as";
    google_ad_type = "text";
    google_ad_channel = "";
    google_color_border = "666666";
    google_color_bg = "666666";
    google_color_link = "ffffff";
    google_color_text = "ffffff";
    google_color_url = "f29935";
    //-->
    
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>';
    
    
    $var = rand(1,2);
    
    if ($var==1) { 
    echo $a;
    } 
    else {
    echo $b; 
    }
    ?>
    Code (markup):
     
    champ_rock, Jun 3, 2007 IP
  5. tony84

    tony84 Well-Known Member

    Messages:
    1,864
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    140
    #25
    its showing the code on the actual site ive put a screenshot below
     

    Attached Files:

    tony84, Jun 3, 2007 IP
  6. champ_rock

    champ_rock Peon

    Messages:
    3,349
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #26
    i think i got ur problem. ur file is apparently a html file

    due to which it is not parsing the php code properly.

    i suggest u place this code seperately in another file named .php and then use the following command in ur html file

    <?php
    include ('ads.php'); ?>
     
    champ_rock, Jun 3, 2007 IP
  7. tony84

    tony84 Well-Known Member

    Messages:
    1,864
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    140
    #27
    no the file is .php its aclubbers guide.net/index.php without the space is the page
     
    tony84, Jun 3, 2007 IP
  8. champ_rock

    champ_rock Peon

    Messages:
    3,349
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #28
    can u please PM or post here the php code of that file?
     
    champ_rock, Jun 3, 2007 IP
  9. tony84

    tony84 Well-Known Member

    Messages:
    1,864
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    140
    #29
    <p align="center"><?php
    $a='<script type="text/javascript"><!--
    google_ad_client = "pub-5768";
    google_ad_width = 728;
    google_ad_height = 90;
    google_ad_format = "728x90_as";
    google_ad_type = "text";
    google_ad_channel = "";
    google_color_border = "666666";
    google_color_bg = "666666";
    google_color_link = "ffffff";
    google_color_text = "ffffff";
    google_color_url = "f29935";
    //-->
    
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>';
    
    
    $b='<script type="text/javascript"><!--
    google_ad_client = "pub-9104";
    google_ad_width = 728;
    google_ad_height = 90;
    google_ad_format = "728x90_as";
    google_ad_type = "text";
    google_ad_channel = "";
    google_color_border = "666666";
    google_color_bg = "666666";
    google_color_link = "ffffff";
    google_color_text = "ffffff";
    google_color_url = "f29935";
    //-->
    
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>';
    
    
    $var = rand(1,2);
    
    if ($var==1) { 
    echo $a;
    } 
    else {
    echo $b; 
    }
    ?>
    PHP:
    thats th code i used i copied it exactly
     
    tony84, Jun 3, 2007 IP
  10. champ_rock

    champ_rock Peon

    Messages:
    3,349
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #30
    no i am asking for the php code of the entire file because what i suspect is that the <?php is already open before and due to which there is some problem
     
    champ_rock, Jun 3, 2007 IP
  11. tony84

    tony84 Well-Known Member

    Messages:
    1,864
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    140
    #31
    ah right, well the site runs on mybb so i open up seperate files of which im putting that code into just the header, i dont think i can get the whole code of the page
     
    tony84, Jun 3, 2007 IP
  12. champ_rock

    champ_rock Peon

    Messages:
    3,349
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #32
    give me the header.php (i think there should exist such a file )
     
    champ_rock, Jun 3, 2007 IP
  13. tony84

    tony84 Well-Known Member

    Messages:
    1,864
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    140
    #33
    <a name="top" id="top"></a>
    <table border="0" width="100%" cellspacing="0" cellpadding="0" background="cus/header_tile.gif" height="144">
    	<tr>
    		<td width="503" valign="top"><a href="index.php"><img border="0" src="cus/headeer_left.gif"></a></td>
    		<td valign="top">&nbsp;</td>
    		<td valign="top" width="538">
    		<img border="0" src="cus/headeer_right.gif"></td>
    	</tr>
    	<tr>
    		<td valign="top" colspan="3" bgcolor="#000000">
    		<p align="center"><font face="Verdana" size="4" color="#FFFFFF">
    		<a href="portal.php">Portal</a>&nbsp;&nbsp; |&nbsp;&nbsp; <a href="http://www.aclubbersguide.net/misc.php?action=ttbox">Photos</a>&nbsp;&nbsp; |&nbsp;&nbsp; 
    <a href="http://www.aclubbersguide.net/contact.php">Contact Us</a>&nbsp;&nbsp; |&nbsp;&nbsp; <a href="index.php">Forums</a>&nbsp;&nbsp; |&nbsp;&nbsp; <a href="http://www.aclubbersguide.net/forumdisplay.php?fid=2">Music News</a>&nbsp;&nbsp; |&nbsp;&nbsp; 
    <a href="links.php">Links</a></font><font size="4" face="Verdana"></font></p></td>
    	</tr>
    </table><p align="center"><?php
    $a='<script type="text/javascript"><!--
    google_ad_client = "pub-768";
    google_ad_width = 728;
    google_ad_height = 90;
    google_ad_format = "728x90_as";
    google_ad_type = "text";
    google_ad_channel = "";
    google_color_border = "666666";
    google_color_bg = "666666";
    google_color_link = "ffffff";
    google_color_text = "ffffff";
    google_color_url = "f29935";
    //-->
    
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>';
    
    
    $b='<script type="text/javascript"><!--
    google_ad_client = "pub-9301836188050104";
    google_ad_width = 728;
    google_ad_height = 90;
    google_ad_format = "728x90_as";
    google_ad_type = "text";
    google_ad_channel = "";
    google_color_border = "666666";
    google_color_bg = "666666";
    google_color_link = "ffffff";
    google_color_text = "ffffff";
    google_color_url = "f29935";
    //-->
    
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>';
    
    
    $var = rand(1,2);
    
    if ($var==1) { 
    echo $a;
    } 
    else {
    echo $b; 
    }
    ?>
    </p>
    </div></div>
    	<div id="container">
    		<div id="header">
    	<table width="100%"  border="0">
           <tr>
              <td><div class="logo"><a href="{$mybb->settings['bburl']}/index.php"></a></div></td>
               <td><div class="logo" align="right">{$easybanner}</div> </td>
            </tr>
        </table>
    			<div id="panel"><br />{$welcomeblock}
    			</div>
    		</div><br class="clear" />
    		<div id="content">{$bannedwarning}
    			{$bbclosedwarning}
    			{$unreadreports}
    Code (markup):
     
    tony84, Jun 3, 2007 IP
  14. tony84

    tony84 Well-Known Member

    Messages:
    1,864
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    140
    #34
    sorted it now, thanks for help all
     
    tony84, Jun 3, 2007 IP
  15. ariffin246

    ariffin246 Well-Known Member

    Messages:
    247
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #35
    Lookin For This Long Time

    Finally Got IT

    Thx !!!
     
    ariffin246, Jun 5, 2007 IP
  16. champ_rock

    champ_rock Peon

    Messages:
    3,349
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #36
    please let us know if it works for u because apparently Tony had a hard time figuring it out :(
     
    champ_rock, Jun 5, 2007 IP
  17. ariffin246

    ariffin246 Well-Known Member

    Messages:
    247
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #37
    The Code Worked on A Php Page Wen I Tried
    But I havent Test it on html page

    I Will test And Let U Know ASAP
     
    ariffin246, Jun 6, 2007 IP
  18. Investor1

    Investor1 Well-Known Member

    Messages:
    950
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    125
    #38
    Can anyone make me a set of banner rotators

    Its going to be in a 2x4 box. and the banners is 468x60

    Easy to manage in a IPS bord.

    Investor1
     
    Investor1, Jun 7, 2007 IP
  19. tony84

    tony84 Well-Known Member

    Messages:
    1,864
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    140
    #39
    it worked the only reason i had a problem was becase i was implamenting it on mybb - you have to add something to 1 of the files included with mybb before it works, the code itself though worked on its on, on a normal page without any problems
     
    tony84, Jun 7, 2007 IP