I am getting that parse error on line 92 like the guy above... I dont see where anything is missing. <br /> <br />error: Parse error: parse error in /home/tampains/public_html/ubbthreads/bannerad.php on line 92 <br /> <br /> <br />Here is what I have: <br /> <br />80 // If we found the banner, we'll send the output <br />81 // otherwise there just won't be a box. <br />82 if ($Banner) { <br />83 echo <<<BANNER <br />84 $tbopen <br />85 <tr> <br />86 <td align="center" class="darktable"> <br />87 <b>Support Our Site - $Title</b> <br />88 </td> <br />89 </tr> <br />90 <td align="center" class="lighttable"> <br />91 $Banner <br />92 </td> <br />93 </tr> <br />94 $tbclose <br />95 <br /> <br />96 BANNER; <br />97 } <br /> <br /> <br />My board keyword and config variable are set correctly. <br /> <br />Any idea? <br /> <br />Update: Actually no matter what changes I make or whatever I still get the same error. I dont know what's up.
JoshPet
I type Like navaho
Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Some servers seem to not like HTML inside the echo statements like that. Try this:<br /><br />80 // If we found the banner, we'll send the output<br />81 // otherwise there just won't be a box.<br />82 if ($Banner) {<br />83 echo "<br />84 $tbopen<br />85 <tr><br />86 <td align=\"center\" class=\"darktable\"><br />87 <b>Support Our Site - $Title</b><br />88 </td><br />89 </tr><br />90 <td align=\"center\" class=\"lighttable\"><br />91 $Banner<br />92 </td><br />93 </tr><br />94 $tbclose<br />95 <br /><br />96 ";<br />97 }<br /><br /><br />Note the change in the echo statements and that a \ was added before each quote mark. <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
That's why we have you around <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /> <br /><br />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.
_________________________
Always looking for that next great thing...
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.<br /><br />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. <br /><br />You can look on my website to see how it looks.<br /><br />
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 />
<br /><br />Thanks for the great Mod Josh.
_________________________
Always looking for that next great thing...
JoshPet
I type Like navaho
Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Yes,<br /><br />I'm using it on several 6.4 installs. Not sure if the instructions work word for word, but it should be fine. <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
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 <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
Will this work on version 6.5b4?<br /><br />I am having trouble finding the config file to edit, doesn't look like you can edit it in the new control panel.<br /><br />Ron