PDA

View Full Version : Adding Rotating Banner


mickalo
Sun 1st Apr '01, 12:23pm
I'm sure this topic has been asked many times, and I've search thru most of the forums here, and haven't quiet figured out how to do this.

We are trying to insert a rotating banner script so that it's displayed on top of every page of the forum. We've tried entering the following tag:

<?php virtual("/cgi-bin/adwizard/display.cgi") ?>

into the various templates, with no luck. I would greatly appreciate any assistance.

TIA ;)

Mickalo

p.s. this is version 1.15.

Mike Sullivan
Sun 1st Apr '01, 2:30pm
You'll have to turn on PHP parsing in the header and put the code there (without the <?php ?> ). IIRC, virtual() outputs directly so you'll have to use something to prevent it from outputting and assign it to $header (output buffering)

mickalo
Sun 1st Apr '01, 2:42pm
Originally posted by Ed Sullivan
You'll have to turn on PHP parsing in the header and put the code there (without the <?php ?> ). IIRC, virtual() outputs directly so you'll have to use something to prevent it from outputting and assign it to $header (output buffering)

Hi Ed,

Being somewhat new to PHP, strickly a Perl programmer, could you possibly supply an example. Where exactly is this $header assigned?? Should I use something else then the virtual() ..?

thanks

Mickalo

Mike Sullivan
Sun 1st Apr '01, 3:01pm
The simplest way:
$header = implode('', file('http://www.domain.com/cgi-bin/adwizard/display.cgi'));

Make sure you include the http part! A different way is to use output buffering but I don't really feel like going into that right now :)

mickalo
Sun 1st Apr '01, 3:09pm
thanks Ed.

Now where exactly does this code go:

$header = implode('', file('http://www.domain.com/cgi-bin/adwizard/display.cgi'));


Do I replace what's currently in the header template now with this code?? Or where ever the $header variable is used in the various templates??

Sorry for all the question, but I'm still quiet new to this! ;)

Again, thank for your help.

Mickalo

Mike Sullivan
Sun 1st Apr '01, 3:22pm
You'll have to change your header template to work under PHP syntax, assigning everything to $header:
$header = "blah";
$header .= implode('', file('http://www.domain.com/cgi-bin/adwizard/display.cgi'));
$header .= "blah \"blah\" blah";

mickalo
Sun 1st Apr '01, 3:37pm
Ok, I made the changes, but apparently something still isn't quiet right. Now I get the error message:
<b>
Parse error: parse error in global.php on line 793
</b>

Is there something I may have missed. I enabled the parse header in the option settings.

Mike Sullivan
Sun 1st Apr '01, 3:42pm
Then you're header probably doesn't validate -- did you escape the quotes (\") and backslashes (\\)?

mickalo
Sun 1st Apr '01, 4:02pm
Ed,

Much thanks! I was finally able to get it to work now! I forgot about escaping some double quotes, that was causing the error. It works perfectly now!

Appreciate your help and quick responses!! Great support.

Cheers,

Mickalo :D