PDA

View Full Version : Included PHP changes time on posts


malmazan
10-28-2009, 11:38 AM
Hi all:

I have a small puzzling issue with what should be a simple PHP inclusion.

I have included a php file (a simple snippet to call an OpenX an ad) a per documentation http://www.vbulletin.com/docs/html/templates_externalfiles

The post times are now 4 hours late (i.e., if you just finished publishing a post, its time is 4 hours later than the time indicated at the bottom of the page for the local time). Disabling the plugin cures the problem.

I have pasted the plugin and the php below:

ob_start();
include('/home/root/myfile.php');
$includedphp = ob_get_contents();
ob_end_clean();


Where the php file is just an OpenX ad call:
<?php
//<!--/* OpenX Local Mode Tag v2.8.1 */-->

define('MAX_PATH', '/home/root/openx');
if (@include_once(MAX_PATH . '/www/delivery/alocal.php')) {
if (!isset($phpAds_context)) {
$phpAds_context = array();
}
$source='', $withtext='', $context='', $charset='')
$phpAds_raw = view_local('', 0, 35, 0, '', '', '0', $phpAds_context, '');
}
echo $phpAds_raw['html'];
?>

Lynne
10-28-2009, 02:50 PM
Go through your added code (like you are adding alocal.php) and see if TIMENOW gets redefined or if any time variable is used at all. It could be a conflict in variable names.

malmazan
10-29-2009, 05:01 AM
Apparently it's a known bug in OpenX, as I learned.