PDA

View Full Version : Please Help! phpinclude_start gone...


ThePimp
07-15-2005, 02:04 PM
I just upgraded to Beta4, and my PHP Includes Start has disappeared. This section housed my PHP code that included my banner rotator.

I need the variable $banner to be evaulated as:
include("location/banner.php");

So, that in my header template, I can place the $banner variable and have it include my banner rotator.

Can someone please explain how to do this?

Thank you in advance!

Zachery
07-15-2005, 02:19 PM
Yes it is!

Use the hook "global_start" isntead :)

Xenon
07-15-2005, 04:20 PM
when will the devs bring that template back?

when you include different headers in different styles, it's not nice to have styleids hardcoded in the global hook.

phpinclude is needed!

ThePimp
07-15-2005, 08:50 PM
Yes it is!

Use the hook "global_start" isntead :)

Yes, I have read about that, but it doesn't seem to work.

I start a new plugin called "banner", hooked to global_start...
In that plugin, I put:
include("location/banner.php");

I have also tried:
$banner=include("location/banner.php");

Neither work when called as $banner in any of the pages. (The reason I'm asking for help.)

Thanks in advance.

merk
07-16-2005, 03:00 AM
try using $GLOBALS['banner'].

Also, did your banner script use output buffering in phpinclude? You will still need to do that in global_start.

ThePimp
07-16-2005, 09:22 AM
try using $GLOBALS['banner'].

Also, did your banner script use output buffering in phpinclude? You will still need to do that in global_start.


I opened the header template and changed $banner to $GLOBALS['banner']... And get the following error:

The following error occurred when attempting to evaluate this template:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /web/www.mysite.com/html/includes/adminfunctions_template.php(3504) : eval()'d code on line 59

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

Still looking for a solution for this, does anyone have a way to do this?

merk
07-16-2005, 10:36 PM
Sorry.

$GLOBALS[banner].

ThePimp
07-17-2005, 07:43 PM
Sorry.

$GLOBALS[banner].

Hmm... Ok, I tried that and can get some sort of an output, but the "include" function doesn't seem to work.

$banner=include('file.php'); (Doesn't work, it just doesn't show up)

include('file.php'); (there is no variable to be called using this)

I've tried a few different ways, and can't seem to include a file with the Global_Start for some reason.

Any other suggestions? I'm using PHPAdsNew and outputting a PHP file for the rotation.

ThePimp
07-18-2005, 10:49 PM
Anyone?

Link14716
07-18-2005, 10:53 PM
ob_start();
include("location/banner.php");
$banner = ob_get_contents();
ob_end_clean();

Use $banner in your header template.

ThePimp
07-18-2005, 11:39 PM
ob_start();
include("location/banner.php");
$banner = ob_get_contents();
ob_end_clean();

Use $banner in your header template.

So, the ob_start code works in the plugin system? Just set it up the same as before, but put it in the plugin, hooked to the GLOBAL_START?

amykhar
07-18-2005, 11:53 PM
If you would rather have a template, you could have a plugin that evaluates the template.

Link14716
07-19-2005, 02:59 AM
So, the ob_start code works in the plugin system? Just set it up the same as before, but put it in the plugin, hooked to the GLOBAL_START?

Yes. Everything* works in the plugin system.

*Just about.

mikexxx
08-02-2005, 12:00 PM
Any other suggestions? I'm using PHPAdsNew and outputting a PHP file for the rotation.


I'm also using PHPAdsNew. Is this working for you? I am still having problems whit it.

ob_start();

if (@include(getenv('DOCUMENT_ROOT').'http://www.mydomain.com/phpads/phpadsnew.inc.php'))
{
if (!isset($phpAds_context))
{
$phpAds_context = array();
$phpAds_raw = view_raw ('zone:1', 0, '', '', '0', $phpAds_context);

$phpAds_context2 = array();
$phpAds_raw2 = view_raw ('zone:2', 0, '', '', '0', $phpAds_context2);

$phpAds_context3 = array();
$phpAds_raw3 = view_raw ('zone:3', 0, '', '', '0', $phpAds_context3);

$phpAds_context4 = array();
$phpAds_raw4 = view_raw ('zone:4', 0, '', '', '0', $phpAds_context4);

$phpAds_context7 = array();
$phpAds_raw7 = view_raw ('zone:7', 0, '', '', '0', $phpAds_context7);

}
}

ob_end_clean();