Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.

Attachments
77955-BannerAdRotator1.0.zip (0 Bytes, 306 downloads)

Last edited by JoshPet; 04/28/2003 3:42 AM.
Sponsored Links
Joined: Apr 2003
Posts: 1
Lurker
Lurker
Offline
Joined: Apr 2003
Posts: 1
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

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
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.


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Aug 2003
Posts: 24
Newbie
Newbie
Offline
Joined: Aug 2003
Posts: 24
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?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
If you enable HTML and can see what you posted in the forum.... then it should work.

Sponsored Links
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Could this be easily adapated to say put the banner in ubbt_footer.tmpl rather than just at the top of every page?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
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

Joined: Aug 2003
Posts: 24
Newbie
Newbie
Offline
Joined: Aug 2003
Posts: 24
I enabled HTML in the Forum but when I paste HTML on the post window the CODE doesn't translate.


Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.

Sponsored Links
Joined: Aug 2003
Posts: 24
Newbie
Newbie
Offline
Joined: Aug 2003
Posts: 24
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.

Last edited by filamballa; 09/05/2003 12:21 AM.
Joined: Jun 2001
Posts: 356
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 356
HELP!
What does this mean?

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


Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
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";

Joined: Jun 2001
Posts: 356
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 356
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!

Joined: Jun 2001
Posts: 356
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 356
[]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

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
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.

Joined: Jun 2001
Posts: 356
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 356
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.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
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.

Joined: Jun 2001
Posts: 356
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 356
[]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

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
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.

Joined: Mar 2003
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2003
Posts: 118
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.

Last edited by TampaInsider; 11/02/2003 12:48 AM.
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.

Joined: Mar 2003
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2003
Posts: 118
Great, that worked just fine.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Cool.... for some people it needs to be above. Very odd.

Joined: Mar 2003
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2003
Posts: 118
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.

Joined: Mar 2003
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2003
Posts: 118
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.

Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
Will this rotator work with 6.4.1? Anyone tested it?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yes,

I'm using it on several 6.4 installs. Not sure if the instructions work word for word, but it should be fine.

Joined: Jun 2001
Posts: 356
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 356
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

Joined: Jun 2003
Posts: 1
Lurker
Lurker
Offline
Joined: Jun 2003
Posts: 1
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

Joined: Aug 2000
Posts: 1,290
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,290
Will this work on 6.5.1.1 ?


- Custom Web Development
http://www.JCSWebDev.com

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)