I've gotten OpenX to work on my board. I am getting occasional MySQL errors I don't know how to get around though. The MySQL errors don't seem to affect my forum members, but the emails are kind of annoying and I would like to know if anyone knows how to fix it.
If someone else already posted this then I apologize. My work around was an amalgamation of ideas I got reading this forum, the OpenX forums and vBulletin manual.
I got my PHP Invocation code from OpenX and modified it slightly and created a plugin in the vBulletin Admin.
Log into the Admin. Plugins & Products -> Add New Plugin
Product: vBulletin
Hook Location: global_start
Title: OpenX
Execution Order: 5
Plugin PHP Code:
Code:
$tz = date_default_timezone_get();
define('MAX_PATH', '/home/website/openx');
if (@include_once(MAX_PATH . '/www/delivery/alocal.php')) {
if (!isset($phpAds_context)) {
$phpAds_context = array();
}
$phpAds_raw = view_local('', 0, 3, 0, '', '', '0', $phpAds_context, '');
}
date_default_timezone_set($tz);
Then I added $phpAds_raw[html] to my header template where I wanted the banner to appear. In my case I just replaced the <ad ... /> tag I previously inserted when installing phpAdsNew vBulletin plugin.
* If you are using PHP4 then the code will be slightly different.
See: http://forum.openx.org/index.php?showtopic=503421161&pid=71517&st=0&#entr y71517
I originally didn't have the timezone code in on my forum and it was making my forum times show UTC. I found that post and can confirm it works.
Anyone know how to fix the MySQL errors. I get a couple errors every hour that are similar too:
Code:
Database error in vBulletin 3.7.3:
Invalid SQL:
SELECT post.postid
FROM post AS post
WHERE post.threadid = 5560
AND post.visible = 1
ORDER BY post.dateline
LIMIT 0, 15;
MySQL Error : Table 'openads.post' doesn't exist
Error Number : 1146
Edit: I should note I had to remove the comments from the Invocation code to get it to work on my forum. The banners wouldn't appear until I did so.