UBB.Dev
Posted By: JoshPet Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 04/28/2003 10:40 AM
Mod Name / Version: Banner Ad Rotator 1.0

Description: This is a simple rotation tool, which pulls banners (or content) from a private forum and feeds it randomly into a box at the top of your site, just above your menu bar. There is an option to stick a particular banner, rather than using the random rotation, in the event of something you wish to promote, like a special or a sale.

Working Under: UBB.Threads 6.2-6.3

Mod Status: Beta

Any pre-requisites: none

Author(s): JoshPet

Date: 2/24/03

Credits: Commissioned by www.drugbuyers.com

Files Altered: ubbt.inc.php

New Files: bannerad.php

Database Altered: none

Info/Instructions: This allows you to store, add, edit or delete your banners just by adding or removing them from a "hidden" forum. Simple Interface. Verified instructions work fine for 6.3.



Attached File
77955-BannerAdRotator1.0.zip  (306 downloads)
Posted By: LS1TECH Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 07/16/2003 1:45 AM
Josh, I did the changes to my site to show some large banners at the top, but they are not showing up. Could you look at my page? www.LS1TECH.com

Thanks
Posted By: Ian_W Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 07/16/2003 10:04 AM
You have no code header section for the banners - although I have not looked at this hack - my suggestion is to check the bits relevant to adding the banners to the tmpl files.
Posted By: filamballa Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 09/04/2003 8:19 AM
Hey Josh Installed this mod but when I paste HTML it doesn't translate. I see the code appear on top. I verified that HTML is turned on.. amy I missing something?
Posted By: JoshPet Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 09/05/2003 12:07 AM
If you enable HTML and can see what you posted in the forum.... then it should work.
Posted By: msula Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 09/05/2003 12:37 AM
Could this be easily adapated to say put the banner in ubbt_footer.tmpl rather than just at the top of every page?
Posted By: JoshPet Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 09/05/2003 12:39 AM
Yeah, at measurection I actually use it at the top and bottom. You'll see how you simply "include" the file right below the menu bar.... you can do the same before the ubbt_footer.tmpl.
Posted By: msula Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 09/05/2003 2:02 AM
Great.. I just had a few local businesses who asked about putting a small banner on the site.. and about 10 minutes later I see this hack Perfect timing
Posted By: filamballa Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 09/05/2003 2:08 AM
I enabled HTML in the Forum but when I paste HTML on the post window the CODE doesn't translate.

Posted By: JoshPet Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 09/05/2003 2:39 AM
Do you have a link so I can see what code you're trying to use?

Although if you are having trouble posting HTML in your forums.... you'll have to work out that issue first.
Posted By: filamballa Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 09/05/2003 3:43 AM
The Banners forum has HTML enabled. I pasted the code below and it shows up just like this.


<iframe marginwidth="0" marginheight="0" width="120" height="240" scrolling="no" frameborder="0" src="http://rcm.amazon.com/e/cm?o=1&l=as1&f=ifr&t=filambasketba-20&p=8&asins=B000067J2V&IS2=1<1=_blank"><MAP NAME="boxmap-p8"><AREA SHAPE="RECT" COORDS="14, 200, 103, 207" HREF="http://rcm.amazon.com/e/cm/privacy-policy.html?o=1" ><AREA COORDS="0,0,10000,10000" HREF="http://www.amazon.com/exec/obidos/redirect-home/filambasketba-20" ></MAP><img src="http://rcm-images.amazon.com/images/G/01/rcm/120x240.gif" width="120" height="240" border="0" usemap="#boxmap-p8" alt="Shop at Amazon.com"></iframe>

You should still have access to the site.

http://www.filambasketball.com

/EDITED

Thanks for everyone's help. I figured it out.
Posted By: monkeyra Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 10/28/2003 5:07 PM
HELP!
What does this mean?

Parse error: parse error in /home/fordmond/public_html/ubbthreads/bannerad.php on line 92

Posted By: omegatron Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 10/28/2003 5:32 PM
Check for an error like a missing } " ;

I have not downloaded this one but if there was something you had to edit when installing the hack in that file I would look at the lines you edited because sometimes the error can be thrown down the page like when parentheses is missed. Now a missing ; or " should be on the line stated.

This is in the instructions


If you wish to use a board keyword other than "banners" you can edit the $boardkeyword
variable at the top of the included bannerad.php file.


####
#### Add a config variable
####

In your admin menu, edit the config file.
Scroll to the very bottom, into the box of extra/unknown variables, add this:
$config['banner'] = '';


Did you edit the banner keyword to something else? Did you add the variable above to the admin control panel?

If you edited the variable in the bannerad.php file make sure you have it like this "newname";
Posted By: monkeyra Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 10/28/2003 7:53 PM
Oh Poo!
I've re-hacked the ubbt.inc file from afresh, and it hasnt made any difference. I still get the same error.
Help me Oh Knowledgeable ones! lol!
Posted By: monkeyra Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 10/28/2003 8:00 PM
[]Omegatron said:


Did you edit the banner keyword to something else? Did you add the variable above to the admin control panel?

If you edited the variable in the bannerad.php file make sure you have it like this "newname"; [/]


nope and yep m8
Posted By: omegatron Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 10/28/2003 10:11 PM
Line 30 of file bannerad.php should read

$boardkeyword = "banners";

I just downloaded the hack and it reads

$boardkeyword = "banner";


So I suspect this is your error.
Posted By: monkeyra Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 10/28/2003 11:11 PM
you've lost me completley now m8, sorry. Line 30 i get this


"// and the HTML for the banner in the body of the post"


also, in my bannerad.php i dont have a link which reads $boardkeyword = "banner";. I did a search abd it didnt come up with anything as a doublecheck.
Posted By: omegatron Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 10/29/2003 12:21 AM
By default the program has a keyword of banners. The one in the install file has banner. I opened the zip and checked. If your line 30 is not what I stated I highly suggest downloading another copy from here.

Make sure you have the banner keyword set with the variable that needs to be set in the config.inc.php file and the one set in the bannerad.php file.
Posted By: monkeyra Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 10/29/2003 1:32 AM
[]JoshPet said:

Info/Instructions: This allows you to store, add, edit or delete your banners just by adding or removing them from a "hidden" forum. Simple Interface. Verified instructions work fine for 6.3.

[/]

Is anyone here running this on 6.2?
I still cant get it to work omegatron
Posted By: omegatron Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 10/29/2003 1:43 AM
Simpliest thing to do is uninstall the hack and start over reading all directions. This is installed on several sites.

You already stated your board keyword is empty so I would start there. Follow the directions to the letter.
Posted By: TheInsider Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 11/02/2003 7:20 AM
I am getting that parse error on line 92 like the guy above... I dont see where anything is missing.

error: Parse error: parse error in /home/tampains/public_html/ubbthreads/bannerad.php on line 92


Here is what I have:

80 // If we found the banner, we'll send the output
81 // otherwise there just won't be a box.
82 if ($Banner) {
83 echo <<<BANNER
84 $tbopen
85 <tr>
86 <td align="center" class="darktable">
87 <b>Support Our Site - $Title</b>
88 </td>
89 </tr>
90 <td align="center" class="lighttable">
91 $Banner
92 </td>
93 </tr>
94 $tbclose
95 <br />
96 BANNER;
97 }


My board keyword and config variable are set correctly.

Any idea?

Update: Actually no matter what changes I make or whatever I still get the same error. I dont know what's up.
Posted By: JoshPet Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 11/02/2003 8:09 AM
Some servers seem to not like HTML inside the echo statements like that. Try this:

80 // If we found the banner, we'll send the output
81 // otherwise there just won't be a box.
82 if ($Banner) {
83 echo "
84 $tbopen
85 <tr>
86 <td align="center" class="darktable">
87 <b>Support Our Site - $Title</b>
88 </td>
89 </tr>
90 <td align="center" class="lighttable">
91 $Banner
92 </td>
93 </tr>
94 $tbclose
95 <br />
96 ";
97 }


Note the change in the echo statements and that a \ was added before each quote mark.
Posted By: TheInsider Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 11/02/2003 8:20 AM
Great, that worked just fine.
Posted By: JoshPet Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 11/02/2003 8:28 AM
Cool.... for some people it needs to be above. Very odd.
Posted By: TheInsider Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 11/02/2003 8:34 AM
That's why we have you around

I bought a couple of PHP books... I am taking a contract job in Iraq soon and will have plenty of time to hone my PHP skills while I'm there.
Posted By: TheInsider Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 11/02/2003 7:47 PM
I took your Mod and instead of putting the display in the ubbt.inc.php file I put it into the header.php include file. This way it shows up on the top right of my screen where I have blank space anyways.

Here is what my /includes/header.php file looks like for anyone else interested. I did change some table properties in the header.php and in the Mod to get this how I wanted it to look. I took out the table properties in the Mod all together since it was going into a table already.

You can look on my website to see how it looks.

Code
  <br /><table border="0" cellpadding="1" cellspacing="0" width="95%" class="tablesurround" align="center"> <br /><tr> <br /><td align="center"> <br /><table border="0" cellpadding="1" cellspacing="0" width="100%" class="tableborders" align="center"> <br /><tr> <br /><td align="center"> <br /><table border="0" cellpadding="0" cellspacing="0" width="70%" align="left"> <br /><tr> <br /><img src="http://www.tampainsider.com/images/tampains_logo.gif"><br /></tr> <br /><br /><table border="0" cellpadding="0" cellspacing="0" width="30%"><br /><tr valign="middle"><br /><br /><?<br />	$boardkeyword = "banners";<br />	<br /><br />// -----------------------------------------------<br />// End of variables - do not edit below this line<br /><br /><br /><br />// ---------------<br />// Lets pull a random banner ad - by JoshPet<br /><br />	if ($config['banners']) {<br />		$query = "<br />			SELECT B_Subject,B_Body<br />			FROM {$config['tbprefix']}Posts<br />			WHERE B_Board = '$boardkeyword'<br />			AND B_Number = {$config['banners']}<br />		";<br />	}<br />	else {<br />		$query = "<br />			SELECT COUNT(*)<br />			FROM {$config['tbprefix']}Posts<br />			WHERE B_Board = '$boardkeyword'<br />		";<br />		$sth = $dbh -> do_query($query);<br />	   list($totalcount) = $dbh -> fetch_array($sth);<br />   	   $dbh -> finish_sth($sth);<br /><br />		$RandNumber = 0;<br />		if ($totalcount > 1) {<br />			$RandNumber = rand(0,($totalcount -1));<br />		}			<br /><br />		$query = "<br />			SELECT B_Subject,B_Body<br />			FROM {$config['tbprefix']}Posts<br />			WHERE B_Board = '$boardkeyword'<br />			LIMIT $RandNumber,1<br />		";<br />	}<br />		$sth = $dbh -> do_query($query);<br />		list ($Title,$Banner)= $dbh -> fetch_array($sth);<br />		$dbh -> finish_sth($sth);<br /><br />    $html = new html;<br />    list($tbopen,$tbclose) = $this -> table_wrapper();<br /><br />// If we found the banner, we'll send the output<br />// otherwise there just won't be a box.<br />if ($Banner) {<br />echo "<br /><b><font color=\"blue\"><u>Did You Know...</u> - <i>$Banner</i></b></font><br />";<br />}<br />?><br /></tr><br /></table><br />


Thanks for the great Mod Josh.
Posted By: Gregori Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 01/30/2004 12:50 AM
Will this rotator work with 6.4.1? Anyone tested it?
Posted By: JoshPet Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 01/30/2004 1:48 AM
Yes,

I'm using it on several 6.4 installs. Not sure if the instructions work word for word, but it should be fine.
Posted By: monkeyra Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 05/20/2004 4:24 PM
thought i'd try this hack again, looks like i needed that little amendment at the end as well, works ok now, on 6.4
Posted By: Earpman Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 03/16/2005 2:22 AM
Will this work on version 6.5b4?

I am having trouble finding the config file to edit, doesn't look like you can edit it in the new control panel.

Ron
Posted By: J.C. Re: Beta-[6.2-6.3] Banner Ad Rotator 1.0 - 07/11/2005 11:04 PM
Will this work on 6.5.1.1 ?
© UBB.Developers