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
Hey,
I just upgraded and I was running a PHP banner rotation in the footer include on my site.
Since upgrading, it no logner displays the banner ads.. just the coding. Has this been disabled in version 6... it worked fine in 5.5.1. Work arounds?

-----Here's my footer file----

<p align = center>
<?
/*


PLEASE KEEP THE CREDITS INTACT WHEN DISTRIBUTING THIS SCRIPT
USE AT YOUR OWN RISK WITH NO SUPPORT OR GUARANTEES
USE IT FOR PUBLIC, PRIVATE, PROFIT AT NO CHARGE

AD_ROTATOR IN PHP3
BY: MARK DONCHEK
E: [][email protected][/]
W: www.MARKDONLINE.COM

This script is ideal for rotating a few ads on a small site without comittiing to an elaborate
database system. Since each ad is stored in its own include file,
it can contain HTML, quotes, semicolons, etc which may throw other scripts off.


1. Simply cut and paste all of this code in a php doc where you want your ad to appear.
2. create an include file for each ad.
3. copy all necessary code for the ad into its respective include.
4. change the var $randomnumber to accomodate the number of ads you have.
where 'x' = one less than the number of ads you have:
*/

srand((double)microtime()*1000000);
$randomnumber = rand(0,20); // change the second number if need be (see number 4 above)

/*
5. change "your_path/any_ad.inc" for each ad you have
6. alter the number of elseifs to accomodate the number of includes if necessary (ads).
*/



$include0 = "/home/measurection/htdocs/banners/ad0.inc";
$include1 = "/home/measurection/htdocs/banners/ad1.inc";
$include2 = "/home/measurection/htdocs/banners/ad2.inc";
$include3 = "/home/measurection/htdocs/banners/ad3.inc";
$include4 = "/home/measurection/htdocs/banners/ad4.inc";
$include5 = "/home/measurection/htdocs/banners/ad5.inc";
$include6 = "/home/measurection/htdocs/banners/ad6.inc";
$include7 = "/home/measurection/htdocs/banners/ad7.inc";
$include8 = "/home/measurection/htdocs/banners/ad8.inc";
$include9 = "/home/measurection/htdocs/banners/ad9.inc";
$include10 = "/home/measurection/htdocs/banners/ad10.inc";
$include11 = "/home/measurection/htdocs/banners/ad11.inc";
$include12 = "/home/measurection/htdocs/banners/ad12.inc";
$include13 = "/home/measurection/htdocs/banners/ad13.inc";
$include14 = "/home/measurection/htdocs/banners/ad14.inc";
$include15 = "/home/measurection/htdocs/banners/ad15.inc";
$include16 = "/home/measurection/htdocs/banners/ad16.inc";
$include17 = "/home/measurection/htdocs/banners/ad17.inc";
$include18 = "/home/measurection/htdocs/banners/ad18.inc";
$include19 = "/home/measurection/htdocs/banners/ad19.inc";
$include20 = "/home/measurection/htdocs/banners/ad20.inc";

if ($randomnumber== "0") {
include ("$include0");

} else if ($randomnumber== "1") {
include("$include1");

} else if ($randomnumber== "2") {
include("$include2");

} else if ($randomnumber== "3") {
include("$include3");

} else if ($randomnumber== "4") {
include("$include4");

} else if ($randomnumber== "5") {
include("$include5");

} else if ($randomnumber== "6") {
include("$include6");

} else if ($randomnumber== "7") {
include("$include7");

} else if ($randomnumber== "8") {
include("$include8");

} else if ($randomnumber== "9") {
include("$include9");

} else if ($randomnumber== "10") {
include("$include10");

} else if ($randomnumber== "11") {
include("$include11");

} else if ($randomnumber== "12") {
include("$include12");

} else if ($randomnumber== "13") {
include("$include13");

} else if ($randomnumber== "14") {
include("$include14");

} else if ($randomnumber== "15") {
include("$include15");

} else if ($randomnumber== "16") {
include("$include16");

} else if ($randomnumber== "17") {
include("$include17");

} else if ($randomnumber== "18") {
include("$include18");

} else if ($randomnumber== "19") {
include("$include19");

} else if ($randomnumber== "20") {
include("$include20");

} else {

echo ("ERROR: A random num is being generated out of range, or not at all ");
}
?>

Sponsored Links
Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
The way the footer has to be included into the templates currently, the php code won't get parsed in here. It has to get read in like a standard file for inclusion in the ubbt_footer.tmpl file.

What you need to do is edit your ubbt_footer.tmpl file. You'll see in here where it has a $footerfile variable. Basically it looks like this:

$footerfile
</body>
</html>
UBBTPRINT;
/* UBBTREMARK */ ?>


You would need to change that section, to look like this:

$footerfile
UBBTPRINT;

>> insert all of your php banner code here <<

echo <<<UBBTPRINT
</body>
</html>
UBBTPRINT;
/* UBBTREMARK */ ?>


UBB.threads Developer
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Good to know. Thanks!

Joined: Apr 2001
Posts: 18
User
User
Offline
Joined: Apr 2001
Posts: 18
Doesn't work for me.

This is what I want to put in the footer.

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<tr></tr>
<td align="center" valign="top">
<?
view ('', 10, '_blank', '', '0');
?>
</td>
<td align="center" valign="top">
<?
view ('', 15, '_blank', '', '0');
?>
</td>
<td align="center" valign="top">
<?
view ('', 12, '_blank', '', '0');
?>
</td>
<td align="center" valign="top">
<?
view ('', 11, '_blank', '', '0');
?>
</td>
</tr>
</table>

I have put a line in ubbt.inc.php that is required and it works with the header but the footer.

/stefan

Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
The reason that doesn't work is that area is right in the middle of a print block. It doesn't break out of that print block until you get to the UBBTPRINT; statement. You need to break out of the print statement and then add your php code like the example above. It's in php mode already so no need for the end/start php tags.


UBB.threads Developer
Sponsored Links
Joined: Apr 2001
Posts: 18
User
User
Offline
Joined: Apr 2001
Posts: 18
This is what I have in the file right now but still it doesn't work.

<? //UBBTREMARK
echo <<<UBBTPRINT
<br />
<table width="{$theme['tablewidth']}" align="center" class="tablesurround" cellpadding=
"1" cellspacing="1">
<tr>
<td>
<table width="100%" class="tableborders" cellpadding="{$theme['cellpading']}" cellspaci
ng="{$theme['cellspacing']}">
<tr class="darktable">
<td>
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td align="left">
<a href="mailto:{$config['emailaddy']}">{$config['emailtitle']}</a>
{$template['privacy_statement']}
</td>
<td align="right">
<a href="{$config['homeurl']}">{$config['urltitle']}</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p align ="center" style="font-size: 9px;"><a href="http://www.infopop.com/landing/goto
.php?a=ubb.threads"><img src="{$config['images']}/powered_by2.gif" border="0" alt="*" /
></a><br />
UBB.threads™ $VERSION
</p>
$debug
$footerfile
UBBTPRINT;

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<tr></tr>
<td align="center" valign="top">

view ('', 10, '_blank', '', '0');

</td>
<td align="center" valign="top">

view ('', 15, '_blank', '', '0');

</td>
<td align="center" valign="top">

view ('', 12, '_blank', '', '0');

</td>
<td align="center" valign="top">

view ('', 11, '_blank', '', '0');

</td>
</tr>
</table>

echo <<<UBBTPRINT
</body>
</html>
UBBTPRINT;
/* UBBTREMARK */ ?>

Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
Ok, you're escaping out of print mode properly but then trying to print while in straight php mode smile That block should look like this:

<? //UBBTREMARK
echo <<<UBBTPRINT
<br />
<table width="{$theme['tablewidth']}" align="center" class="tablesurround" cellpadding=
"1" cellspacing="1">
<tr>
<td>
<table width="100%" class="tableborders" cellpadding="{$theme['cellpading']}" cellspaci
ng="{$theme['cellspacing']}">
<tr class="darktable">
<td>
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td align="left">
<a href="mailto:{$config['emailaddy']}">{$config['emailtitle']}</a>
{$template['privacy_statement']}
</td>
<td align="right">
<a href="{$config['homeurl']}">{$config['urltitle']}</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p align ="center" style="font-size: 9px;"><a href="http://www.infopop.com/landing/goto
.php?a=ubb.threads"><img src="{$config['images']}/powered_by2.gif" border="0" alt="*" /
></a><br />
UBB.threads™ $VERSION
</p>
$debug
$footerfile

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<tr></tr>
<td align="center" valign="top">
UBBTPRINT;

view ('', 10, '_blank', '', '0');

echo <<<UBBTPRINT
</td>
<td align="center" valign="top">
UBBTPRINT;

view ('', 15, '_blank', '', '0');

echo <<<UBBTPRINT
</td>
<td align="center" valign="top">
UBBTPRINT;

view ('', 12, '_blank', '', '0');

echo <<<UBBTPRINT
</td>
<td align="center" valign="top">
UBBTPRINT;

view ('', 11, '_blank', '', '0');

echo <<<UBBTPRINT
</td>
</tr>
</table>


</body>
</html>
UBBTPRINT;
/* UBBTREMARK */ ?>


UBB.threads Developer
Joined: Apr 2002
Posts: 56
Power User
Power User
Joined: Apr 2002
Posts: 56
when I call my bann.inc it tries to refernce all the files to the /ubbthreads dir rather than the one its called from... but if you include it in other pages (i.e. our front one it works fine) and in the beta it worked fine???

Joined: Apr 2002
Posts: 56
Power User
Power User
Joined: Apr 2002
Posts: 56
anyone? I'll need to go back to the beta if this isn't resolved by the weekend!

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Simply use absolute urls, that should do the job:

http://www.yourdomain/images/banner.jpg instead of /images/banner.jpg

Sponsored Links

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
isaac
isaac
California
Posts: 1,157
Joined: July 2001
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
WebGuy 2
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)