View Full Version : phpAdsNew Banner Ads integration (advertisements, classified ads, Adsense, etc.)
ianwilcox
08-05-2007, 02:46 PM
Does this work with 3.6.8 ?
Raffaele
08-06-2007, 01:43 AM
I have followed the instructions but i do not see the image in the right corner is there a way i can troubleshoot this or maybe one of you folks can help me with this and i'm willing to pay for your services to...
Thank you,
RV
Ohh yahh i forgot i'm using VB3.6.8
Got it fixed with the latest version of Openads 2.3.36-beta Thnak you for the help
RV
quasan
08-06-2007, 11:56 AM
after installing the 3.6.8 update my banners were gone
irishblacknight
08-06-2007, 11:59 AM
after installing the 3.6.8 update my banners were gone
Is the code still in your template? Or did you overwrite it?
quasan
08-06-2007, 12:06 PM
ok ok :) already got it ;) my fault^^
I killed my right column template *blush*
sapper6fd
08-29-2007, 05:30 AM
Does this work with the latest version of phpadsnew / openads and vBulletin 3.6.8???
rpainter
09-05-2007, 06:36 PM
This is a great hack. Just installed on my 3.6.8 forum, and it is working great.
heynurse
09-18-2007, 11:43 PM
I'm wondering if anyone has this working using OpenAds 2.4 the latest stable version of OpenAds? I'd love to hear some feedback on successful implemtations of VB and OA :)
In the server settings, the path to the openads installation, must this be the full path on the server?
ie my site is install in /var/www/vhosts/domain/httpdocs/forum
OpenAds is installed at the same level as the forum, so not inside the vbulletin directory.
So do I need to put in the entire path, or just ../forum?
MediaHound
10-02-2007, 05:46 AM
When I go to edit my template, I cannot get the header template to save the code: <ad what="zone:1" /> I click save and it takes me to a page that merely reads "Style Manager" and that's basically all there is on the page. If I change the ad code a bit and remove a lessthan or a greaterthan symbol to break the tag, it will save! This is really odd, it seems as if the saving utility is parsing the text and it breaks if it does not like it.
I think pxcmedia had the same problem on page 29 on this thread, post #432. (I have a different vb version than him though)
I want to put it off on the right side of the header, you know, between these tags:
<td align="$stylevar[right]">
</td>
Can someone post their header template so I can see where you put it?
Does anyone know why the template editor utility is selective on what it will save and what it chokes on?
This is a real bummer because I got as far as installing both Openads and this mod but cant get my banners on the forum. I can get them to show on a test page though with my invocation code... I just can't edit my header template!
Thanks in advance!
chrisarmstrong
10-02-2007, 07:25 PM
When I go to edit my template, I cannot get the header template to save the code: <ad what="zone:1" /> I click save and it takes me to a page that merely reads "Style Manager" and that's basically all there is on the page. If I change the ad code a bit and remove a lessthan or a greaterthan symbol to break the tag, it will save! This is really odd, it seems as if the saving utility is parsing the text and it breaks if it does not like it.
Just fought with the same issue. Make sure you have no trailing / on the end of your "Location of phpAdsNew" setting.
So it needs to be:
/var/www/vhosts/yoursite.com/httpdocs/phpads
MediaHound
10-06-2007, 01:20 PM
Thanks Chris, that fixed my problem. I corrected the path to my installation and the style manager was able to save the page and reload to the style manager properly.
Anne Lise
10-07-2007, 10:26 PM
ok ok :) already got it ;) my fault^^
I killed my right column template *blush*
My right column is there, but the ads are disespeared with 3.6.8
I'm using phpadsnew 2,0,8. I use the link <ad what="zone:11" />
Paradise-Bodies
10-08-2007, 11:27 AM
How to set it up to show ads in forums and on "no forum" sides?
For forums i use
<if condition="$foruminfo['forumid']==22"><ad what="zone:forummanipedi" /><else />
<if condition="$foruminfo['forumid']==33"><ad what="zone:forummanipedi" /><else />
<if condition="$foruminfo['forumid']==34"><ad what="zone:forummanipedi" /><else />
<if condition="$foruminfo['forumid']==35"><ad what="zone:forummanipedi" /><else />
<if condition="$foruminfo['forumid']==36"><ad what="zone:forummanipedi" /><else />
<if condition="$foruminfo['forumid']==37"><ad what="zone:forummanipedi" /><else />
<if condition="$foruminfo['forumid']==38"><ad what="zone:forummanipedi" /><else />
</if>
</if>
</if>
</if>
</if>
</if>
</if>
But how to set up a default zone that shows on the startpage and the rest?
obmob
10-24-2007, 03:52 PM
This is a nice integration, will see if it still works in 3.6.8 :D
Kooldino
10-26-2007, 06:53 PM
I cant get phpadsnew or openads website (http://www.openads.org/) to save my life. I've been trying for days and they just won't load. Am I alone here?
hdraye
10-26-2007, 07:05 PM
it works here :)
Kooldino
10-29-2007, 06:52 PM
I'm pretty thoroughly confused by this entire thing.
I installed OpenAds, and I installed this plugin.
I pointed the product to the full http: url of the openads installation.
I edited my header template and tried to add in an <ad ... /> tag, and when I tried to save it, it spat out:
Warning: view_ad(/home/.cedarsprings/kooldino/evoxforums.com/forums/includes/lib-xmlrpc-class.inc.php) [function.view-ad]: failed to open stream: No such file or directory in /includes/init.php(329) : eval()'d code on line 88
I searched through my directories, and there is no file named "lib-xmlrpc-class.inc.php" anywhere.
Now, I'm not sure how to tell if OpenAds is setup correctly, so I made a stupid little html page with the javascript code generation...
http://www.evoxforums.com/forums/openads/www/wtf.html
Help?
Kooldino
11-01-2007, 06:21 PM
Anyone? Bueller?
Kooldino
11-06-2007, 08:25 PM
I could really use some help here...where am I supposed to find lib-xmlrpc-class.inc.php?
DreyerMedia
11-07-2007, 05:07 PM
Is it possible to use this mod when you have openads installed on a remote server?
This hack serves me very well, hovever I have found, that it cause overloading of server (not this addon but open ads maybe)
There is a recomendation to move plugin to files.... I would like to give it a try, but how ??? :)
Thank you!
al-moslem
11-27-2007, 08:06 AM
Dear All,
I installed this good hack, and it was working fine, but suddenly the home page of the forum and the admin login page gives me this error:
Fatal error: Call to undefined function view_ad() in /home/XXXXXXX/public_html/vb/global.php(563) : eval()'d code on line 15
How can I remove this hack manually, because I can login to AdminCP and remove it from there.
Please assist me.
Regards,
Hoffi
12-02-2007, 12:37 PM
Disbale Hoos in your config File. Just Comment that one Line out near at the End of the File.
TenPercenter
12-12-2007, 08:45 PM
Is there a way to utilize either of these two local invocation options?
"Don't show the banner again on the same page"
"Don't show a banner from the same campaign again on the same page"
I want to run a string small banners up one column using a single zone, and I'd like to have no banners repeated on any one page load. This gives me a true randomized banner selction even when i have banners from many different campaigns and publishers.
TomasDR
12-30-2007, 09:50 PM
I have been using this addon for a while and it has worked fine. Today I added my first flash banner and it doesn't display.
I get an error 'FlashObject' is undefined. Or in Firefox FlashObject is not defined.
The view source is the following:
<!-- BEGIN ad 96495895 -->
<div id='m3_0869ec791522e23bbf6e5d350caab773' style='display: inline;'><img src='http://ads.xxxxxxx.com/www/images/1x1.gif' alt='New York Shark Bar' title='New York Shark Bar' border='0' /></div>
<script type='text/javascript'> <!--// <![CDATA[ var fo = new FlashObject('http://ads.xxxxxxx.com/www/delivery/ai.php?filename=sharkbar.swf&contenttype=swf&clickTARGET=_blank&clickTAG=http://ads.xxxxxxx.com/www/delivery/ck.php?oaparams=2__bannerid=14__zoneid=1__cb=bb83a 83d89', 'mymovie', '468', '60', '8'); fo.addParam('wmode','transparent'); fo.write('m3_0869ec791522e23bbf6e5d350caab773'); // ]]> --></script><div id='beacon_14' style='position: absolute; left: 0px; top: 0px; visibility: hidden;'><img src='http://ads.xxxxxxx.com/www/delivery/lg.php?bannerid=14&campaignid=8&zoneid=1&channel_ids=,&cb=bb83a83d89' width='0' height='0' alt='' style='width: 0px; height: 0px;' /></div><!-- END ad 96495895 -->
Any ideas?
Fred.
01-06-2008, 07:55 PM
I use this plugin from the begin, and now i want to disable the plugin for a moment. (openads update)
when i disable the plugin, i get a blank forum page with no info or error?
How can i resolve this?
Raptor
01-16-2008, 09:15 PM
can the banners be added using this mod:
https://vborg.vbsupport.ru/showthread.php?t=154361
flOid
01-25-2008, 04:38 PM
XML-RPC isn't working anymore with the newest Openads versions.
An update would be nice...
Kalina
02-21-2008, 09:00 AM
Yeah, Openads, which is now OpenX, is not working with this anymore. :(
Been searching all night for a solution.
computer1
02-23-2008, 09:19 AM
I get this erryror when I try to put this code to my header
<ad what="zone:1" />
I run the newest version off php news
Database error in vBulletin 3.6.8:
Invalid SQL:
SELECT title, styleid, dateline, username, template_un
FROM template
WHERE templateid = 606;
MySQL Error : Table 'advbanner.template' doesn't exist
Error Number : 1146
Fred.
04-06-2008, 01:02 PM
I use this plugin from the begin, and now i want to disable the plugin for a moment. (upgrade)
when i disable the plugin, i get a blank forum page with no info or error?
How can i resolve this?
*edit*
Plugin removed and updated to openx 2.4.4 :-)
LWillmann
04-09-2008, 11:49 AM
Yeah, Openads, which is now OpenX, is not working with this anymore. :(
Been searching all night for a solution.
I had to write myself a half-arsed product that isn't pretty to get my ads on the site to get it to work with the newer versions when I couldn't get this working with a new site.
I have a site that this has been running on for two years, and I've upgraded the board and it's still working. But I'm terrified to upgrade the ad software for fear of breaking it.
But I have discovered a problem with what appears to be template caching. It appears that the template that has the ads in it is being cached (and I don't want this) so my adviews aren't being properly counted.
obmob
05-14-2008, 12:03 AM
This is working on 3.7? o.o
Trana
05-14-2008, 03:52 AM
Ack, this doesn't work in 3.7.0? I upgraded and my banners are gone.
Does anybody know if somebody is working on a 3.7/OpenX version of this?
Ramsesx
05-25-2008, 07:56 PM
An easy way to get vb3.7 working with openx, you only need to paste the openx created java script zone code into the place you wish your banner to be.
Tapage
06-17-2008, 09:52 PM
An easy way to get vb3.7 working with openx, you only need to paste the openx created java script zone code into the place you wish your banner to be.
I'm running 3.6.8 would be the same .. ?
Tapage
06-17-2008, 09:54 PM
How I can paste the code .. or better my question is where ..
Ramsesx
06-22-2008, 09:34 AM
I'm running 3.6.8 would be the same .. ?
Sure, should working on all websites.
How I can paste the code .. or better my question is where ..
Go first into your openx admin area f.ex. yoursiteurlopenx/www/admin/dashboard.php
After -->Inventory ---> Direct Selection
There should be the Bannercode.
Will be only there if you created a campaign and zone.
You can change the code from default php to javascript tag (Please choose the type of banner invocation).
You only need to add this javascript to the place you want to show the banner.
In my case I added it into the header template.
<tr>
<td width="25" align="$stylevar[left]"> </td>
<td align="$stylevar[right]"><div align="left"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" alt="$vboptions[bbtitle]" width="468" height="60" border="0" /></a></div>
<td>
<!--/* OpenX Javascript Tag v2.5.67-beta */-->
...........
</td>
<tr>
<td width="20" align="$stylevar[left]"> </td>
<td align="$stylevar[right]"> <div id="buttons_outer">
<div id="buttons_inner">
<div id="buttons">
montsa007
06-23-2008, 03:23 AM
Will this work on 3.6.10??
Tapage
06-23-2008, 04:11 PM
Sure, should working on all websites.
Go first into your openx admin area f.ex. yoursiteurlopenx/www/admin/dashboard.php
After -->Inventory ---> Direct Selection
There should be the Bannercode.
Will be only there if you created a campaign and zone.
You can change the code from default php to javascript tag (Please choose the type of banner invocation).
You only need to add this javascript to the place you want to show the banner.
In my case I added it into the header template.
<tr>
<td width="25" align="$stylevar[left]"> </td>
<td align="$stylevar[right]"><div align="left"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" alt="$vboptions[bbtitle]" width="468" height="60" border="0" /></a></div>
<td>
<!--/* OpenX Javascript Tag v2.5.67-beta */-->
...........
</td>
<tr>
<td width="20" align="$stylevar[left]"> </td>
<td align="$stylevar[right]"> <div id="buttons_outer">
<div id="buttons_inner">
<div id="buttons">
Thanks dude . . I will do it in my forum ( already have the java tag in open X ) and report it back here .. !
jw00dy
07-24-2008, 04:48 AM
I screwed up and upgraded to OpenX 2.6 and something with the invocation code has changed making this not work anymore :(
The M.I.P. if you are out there, would you mind helping get this fixed. I am not a coder, so fixing it myself ... well it wouldn't happen.
I can help with the new invocation codes etc since I have them...
Help!
To everyone else, don't upgrade to 2.6 unless you don't want to serve ads any more...
Dennis B
08-05-2008, 03:00 AM
Alright, got it working here with 3.7.2 and openx 2.6.0. :up:
Remove this hack entirely, but before you do it, make note of the "search strings", the "XYZ" that go into every <ad what="XYZ">
Follow Ramsesx instructions above, just don't forget to paste each old "search string", the "XYZ" that went into <ad what="XYZ">, into the "Banner selection" box when getting the javascript.That's it! :D
jw00dy
08-06-2008, 09:18 PM
This is a work around, but not quite a fix. I ended up canning 2.6 and going back. I had to recreate everything, but I'm back in business...
If you want it to work with the <ad what="adsf"> tag only, don't go to 2.6.
Dennis B
08-07-2008, 11:28 AM
Oh yes, that's exactly the case, it's just one way of getting it to work, I never implied it to be a fix. :)
slo_chewie
09-15-2008, 10:01 PM
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:
$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&#entry71517
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:
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.
LWillmann
09-16-2008, 11:32 AM
Could that be the maintenance script that's run by OpenX? You might want to check into the maintenance queries that OpenX runs and see if there's something to it.
slo_chewie
09-16-2008, 02:56 PM
Ha, you are correct. That error was from the Maintenance script.
Disabled the automatic maintenance, edited my previous openads cron to work with openx and it's all good now.
Edit: Nevermind disabled the maintenance script and I still get the errors. You are correct though it seems to be a cron or vbulletin task. Happens like clock work at 9, 29, and 49 minutes after every hour.
Blackhat
09-30-2008, 08:45 PM
I just added this and it works, but am I supposed to get an sql error anytime soon ? :)
guys, it seems like by using the javascript (which is what I am trying to get off of) we are making this thing less efficient. in fact i don't know what the point of having this mod is if we are putting in the javascript. the <ad variable call is gone right? i was interested in using the mod (<ad variable) so as to eliminate the additional http calls from the java script. using openx 2.6.4 and vb 3.7.3. am i missing some point somewhere? thanks.
shadowdancer36
10-14-2008, 05:53 PM
No updates for this hack huh?
LWillmann
11-13-2008, 02:18 AM
I have a new way to make this work. Granted it's not as pretty as this, but it does work, and I have been using it on one website for over a year without any problems.
I created a new plugin, I called it 'OpenAds Integration'
It's hooked in the vBulletin product at the init_startup (I've tested it 3.6.8 PL2 and 3.7.4)
Here is the code for it:
if (@include(getenv('DOCUMENT_ROOT').'/location for your OpenAds install/phpadsnew.inc.php'))
{
if (!isset($phpAds_context))
{
$phpAds_context = array();
}
$phpAds_head41 = view_raw ('zone:2', 0, '', '', '0', $phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_head41['bannerid']);
$phpAds_side01 = view_raw ('zone:1', 0, '', '', '0', $phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_side01['bannerid']);
$phpAds_side02 = view_raw ('zone:1', 0, '', '', '0', $phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_side02['bannerid']);
$phpAds_side03 = view_raw ('zone:1', 0, '', '', '0', $phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_side03['bannerid']);
.
.
.
.
//** initialize as many AdBanners as you want here ***
}
Then in my templates, where ever I want a random banner to appear, I enter this code:
$phpAds_side01[html]
And I get the banner and associated code on the page.
There are a few drawbacks to this option... If you have a side column on your site and you display 50 ads, you have to build an array in this plugin for 50 ads, and then you have to enter the 50 entries into your template.
But this could be just a launching point for some other coder to pick up and run with it. I've tried to build a 'bits' system before and failed. I would imagine that you could extend what I've done and make it better pretty easily.
I know it's not what exactly what people have been hoping for, but hopefully it's a step in the right direction.
Marvin Hlavac
11-17-2008, 02:01 PM
if (@include(getenv('DOCUMENT_ROOT').'/location for your OpenAds install/phpadsnew.inc.php'))
{
if (!isset($phpAds_context))
{
$phpAds_context = array();
}
$phpAds_head41 = view_raw ('zone:2', 0, '', '', '0', $phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_head41['bannerid']);
$phpAds_side01 = view_raw ('zone:1', 0, '', '', '0', $phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_side01['bannerid']);
$phpAds_side02 = view_raw ('zone:1', 0, '', '', '0', $phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_side02['bannerid']);
$phpAds_side03 = view_raw ('zone:1', 0, '', '', '0', $phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_side03['bannerid']);
.
.
.
.
//** initialize as many AdBanners as you want here ***
}
Would you be so kind and tell me step-by-step where exactly to place the above code, and how to do it? I'd appreciate it very much.
I have spent three days attempting to show ads on my vB forum using OpenX. I have no luck at all, but I admit I don't have much technical knowledge in this area.
LWillmann
11-17-2008, 03:22 PM
Would you be so kind and tell me step-by-step where exactly to place the above code, and how to do it? I'd appreciate it very much.
I have spent three days attempting to show ads on my vB forum using OpenX. I have no luck at all, but I admit I don't have much technical knowledge in this area.
In your ACP, you have to go to the Plugin Manager, and Add a New Plugin.
For that new product, you choose the Vbulletin Product
For the Hook Location, you choose "init_startup" (3.7.4 is alphabetized so it should be easy to find)
Give the new plugin a name "OpenAds Integration" for example.
Execution Order 5 is ok by default (I've never changed the order number).
Copy the code from my large php code box into the Plugin PHP Code box.
A few notes about the plugin part:
$phpAds_side01 = view_raw ('zone:1', 0, '', '', '0', $phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_side01['bannerid']);
These lines go in pairs. You have to have the two to work together.
If you want to run just two ads, then you can run have just phpAds_side01, and phpAds_side02. But you have to make the change in BOTH lines.
If you want to add more banners, just copy and pase more pairs, and increase the numbers. You don't want duplicate numbers, or you might run into issues.
NOTE the zone:1 part. You will have different zones in your OpenAds/OpenX install. This Zone number will correspond to the Zone you want to pull the ads from.
So, if your side ads are in zone 1, and your header ads are in zone 2, then you need to note that in these lines.
In my sample lines, my header zone is 3, my paying sponsors are in zone 2 and my site banner exchange is zone 1.
Once you make the code changes you need to, click Save to save the new plugin.
Then go to the template editor.
Edit the appropriate template, and place the code I showed in the smaller box:
$phpAds_side01[html]
do display the proper ad number.
In my case, on my right column of ads, I have a table with say 10 boxes, so I start at the top with that 01, and then the next row is 02, then 03, 04 etc on to 10. Even if I don't have 10 advertisers it's ok. The boxes stay hidden for me, unless I use a border on the table, until I ad an advertiser. When I ad the next advertiser in that zone, the ad automatically pops up and I didn't have to make a change to the templates or coding at all.
If I want more, just ad more to my array (the plugin pairs of lines for that zone) and then I can ad more to that table, and it will work.
Does this make it any easier?
Marvin Hlavac
11-18-2008, 09:06 AM
Yes, it is working for me now! I thank you very much, LWillmann. After 4 days of frustration, your solution finally made it work for me. I suggest you copy & paste your above step-by-step guide to a new thread.
Again, thank you very kindly for taking the time to share this with everyone!
LWillmann
11-18-2008, 11:10 AM
I think I will.
I will do a better write up and will post a new mod thread with this in it.
Marvin Hlavac
11-18-2008, 04:09 PM
That would be excellent!
Now that I am able to display a banner exactly where I need it, my next step is going to be to make the link to work. For some reason, when I click the banner, I'm directed to a non-existent URL.
Here's an example:
http://www.example.com/openx/www/delivery/ck.php?oaparams=2__bannerid=3__zoneid=0__log=no__c b=fc0c60228e__oadest=http://www.example.com/
Is this how the URL is supposed to look (real domain substituted by example.com)?
LWillmann
11-18-2008, 04:51 PM
Those settings are done in OpenAds/OpenX, in the Advertiser Settings, Campaign/Banner Settings You'll have to go there to verify that everything is configured correctly.
meadwench
11-25-2008, 02:15 PM
You can also put ads in threads and between categories:
To put in threads:
http://www.vbulletin.com/forum/showthread.php?t=157022
To put between categories:
http://www.vbulletin.com/forum/showthread.php?t=225587
I've done this, and the space to show the ad is showing up, but the ad is not. My header and footer ads show up great, but the ads inside the forum itself don't.
I've tried putting in the link for my header ads, since I know they work, but it doesn't work inside the threads and categories.
Anyone got any ideas?
My site: http://www.gotmead.com/forum/index.php
Vicky Rowe
Gotmead.com
funinthesun
02-04-2009, 10:19 PM
I've tried all the methods posted on here but can't get OpenX to work with 3.8.1 without getting a parse syntax error. Any ideas?
stardotstar
05-20-2009, 10:37 AM
I have localmode calls working well (very fast page loads) but I am getting time skew despite the vb clock, server clock and all other services being correctly set. whenever I do a
<ad what="zone:1" />
The post bit timestamps are all back in time by the amount of the GMT offset... (+10) very strange. If I take the invocation out the times go back to normal. Interestingly enough the time stamp at the bottom of the board is correct. I wonder if the plugin is writing a UTC time to a local variable that then is built into the post bit...
Any one with any idea on help would be appreciated in the mean time I will continue to hack away at it - I am on 3.8.2.
Man, its sooo fast! I have to get it working!
I notice that if I use "detailed" as a time setting in the vB options I get a correct result... Must be a variable getting reset somehow... Any ideas?
stardotstar
05-20-2009, 11:06 AM
OK I think I can see where this is happening but just don't know how to track it down - it is possible that this is specific to 3.8.2 and I would be very willing to write up my method for getting it to work if I can get this time issue sorted.
The Time skew occurs if and only if there is a local mode invocation called using the <ad /> code.
I can put
<ad what="zone:1" /> in the footer or header, refer to it from an ad location or whatever but so long as there is a reference to this tag the time jumps back 10 hours.
So when I look at the plugin called
Ad tag callback
I see that its hook is at the template_compile and this tells me that it is a likely cause of elements of the time being rewritten...
Interestingly the time statement at the bottom of the board is always correctly displayed and if I switch the time mode to "detailed" I get the correct time (ie 1 minute ago) for a post just made instead of a 10 hour shift into the past... BUT in the PM inbox the time shift is still evident.
This is the plugin code:
if (!function_exists('_tag_callback'))
{
/**
* Callback-function for process_template_tag() which "parses" arguments and returns PHP code for eval
*
* @param string Options/arguments of tag
* @param string Name of function to call
* @param array Associative array of argument names and default values
*
* @return string
*/
function _tag_callback($options, $functionhandle, $arglist)
{
$options = stripslashes($options);
trim($options);
trim($functionhandle);
if (!function_exists('replace_template_variables'))
{
require_once(DIR . '/includes/functions_misc.php');
}
$param = array();
if (is_array($arglist))
{
reset($arglist);
foreach ($arglist AS $key => $val)
{
if (preg_match('#'.$key.'=([\\\]["\'])(.*?)\1#', $options, $matches))
{
$param[] = $matches[2];
}
else
{
// default argument
$param[] = $val;
}
}
}
foreach ($param AS $argument)
{
if ($return == '')
{
$return = '" . ' . $functionhandle . '(';
}
else
{
$return .= ', ';
}
// Surround variables with {} - not failsafe, but should do the job in most cases
$argument = preg_replace('#\$([a-z0-9_>-]+)((\[\'.*?\'\])+)#i', '{$\\1\\2}', $argument);
// {{$foo}} --> {$foo}
$argument = preg_replace('#(\{+)\$(.*?)(\}+)#i', '{$\\2}', $argument);
// Replace legacy variable names in templates with their modern equivalents
$argument = replace_template_variables($argument, true);
$return .= '"' . $argument . '"';
}
$return .= ') . "';
return $return;
}
}
if (!function_exists('process_template_tag'))
{
/**
* Processes user-defined tags <tagname [argument="foo" ...]/> into myfunction() PHP code for eval
*
* @param string Title of tag
* @param string Un-parsed template HTML
* @param string Name of function to call
* @param array Associative array of argument names and default values, order must be the same as for the function specified previously
*
* @return string
*/
function process_template_tag($tagname, $text, $functionhandle='', $arglist)
{
if ($functionhandle == '')
{
// No function specified - remove tag
return preg_replace("#<{$tagname}\s?/?>|<{$tagname}\s.*?/?>#si", '', $text);
}
else
{
return preg_replace("#<({$tagname})(\s+(.*?)/?)>#sie", "_tag_callback('\\3', \$functionhandle, \$arglist)", $text);
}
}
}
$template = process_template_tag('ad', $template, 'view_ad', array('what' => '', 'clientid' => 0, 'target' => '', 'source' => '', 'withtext' => 0) );
can anyone see anything that might cause the effect on time display in postbit and elsewhere in the templates?
Does anyone think I am on the right track or is it futile troubleshooting this wonderful but rather antiquated (for 3.5) implementation now?>
stardotstar
05-22-2009, 10:03 AM
Guys, I am not sure how much interest there is for this mod to be adapted to work with 3.8.2 but I for one have spent some considerable time getting it to work with only one issue - the clock is set back to UTC during the callout to the ad server when using local mode. I can't see any reason why it will not work as advertised with vB3.8.2 using javascript invocation.
It is a great mod and one that with a little patience rewards the effort to implement.
Much thanks to the developer, not just for the hack but also the inspiration and opportunity to learn so miuch more about plugin integration while trying to fix what is a bug with openx - not a problem with this great hack.
If The M.I.P is still monitoring this thread I would offer, in exchange for some tips to work around the UTC problem (I have many threads about posing possible work arounds but have not got any workable answers or come up with a solution myself yet) I will make every effort to update the plugin for 3.8.2 or at the very least write a step by step integration guide for 3.8.2 and openx2.8.
I know that this is an easy thing to work around for a programmer but the problem is finding one who can see the context quickly enough to make the fix!
Just putting it out there The M.I.P. thanks for the great work on this inspired product and thanks for reading everyone!
Will
jw00dy
05-22-2009, 11:28 PM
I am interested for sure.
bertwrld
05-27-2009, 05:16 PM
I get a shifted time as well, a fix would be great.
stardotstar
05-28-2009, 09:31 AM
I have detailed the nature of the problem here:
https://vborg.vbsupport.ru/showthread.php?t=214263
that links to a couple of alternative attempts to glean what info i can about the nature of the tz problem and the openx bug that is allegedly responsible.
Not much in the way of progress toward a solution I am afraid as yet.
bertwrld
05-31-2009, 03:35 PM
Curious as to any luck with this as of yet?
stardotstar
06-01-2009, 01:58 AM
Not yet, following various leads; I'll be sure to keep you updated of progress.
bertwrld
06-02-2009, 07:47 PM
Right on, thanks.
The java delivery def uses a lot of resources.
stardotstar
06-06-2009, 11:04 AM
I have a fresh vB3.8.2 with no other mods but this and two themes, one implements the <ad/> tag and another doesn't. The board is natively set to UTC+10 and I have added the time zone to the time stamps when viewing the only post on the board in each style it can be seen that when the ads are on the time stamp is UTC and when off reverts to board time. Board time is correctly reported at the bottom of the main page for the user in either case.
I continue to drill down on this.
I am certain it has something to do with the local mode bug in openX but this still shouldn't throw vB - there must be some way of protecting the local variables in vB so that they are not zapped with the call out to openX by a simple plugin.
By the By, something to be aware of is that if you use the disable hooks in config.php to check your board functionality with the way that this plugin works the <ad/> tags break the templates calling for view_ad which (with hooks disabled) is an undefined function - yielding thus a fatal error.
Fatal error: Call to undefined function view_ad() in /var/www/archq/forums/global.php(614) : eval()'d code on line 1
This applies to disabling the plugin/hook system via the ACP or as below in config.php:
define('DISABLE_HOOKS', true);
this should be worked around with this mod but that is a secondary concern! Just be aware of it if using since it is sometimes necessary to disable the plugin system that way when problems are being worked on with vB.com folks.
bertwrld
06-06-2009, 02:54 PM
Thanks for taking the time to try and get this working.
bertwrld
06-13-2009, 03:17 PM
well, i finally decided to just install a older version of openads.
It works fine with this plugin and does the trick for me.
IF the time problems get fixed, then i might try to upgrade to the new openads
stardotstar
06-14-2009, 04:12 AM
That is good news as a fall back - I have set my board to time display detailed so they get a relative take on the time stamp - but it is far from a workable solution. I have too much running on openX and am going to pursue this to the bitter end :)
Cheers,
Will
stardotstar
06-15-2009, 02:27 AM
OK.... Drum roll:
The fix is almost absurdly simple.
You have to specify the openads timezone variable before making the callout.
I can only confirm this for vB3.8.3, phpAdsNew Banner Ads Integration 1.0.4, openX 2.8 and php5 so please don't go jumping into your plugins and stuffing up boards without backups and copying and pasting the original code to a text editor.
The line needed is the spec of the local server timezone for your host:
OA_setTimeZone('Australia/Sydney');
in my case.
To fix this problem with Local Mode (not xml-rpc) method calls to openX 2.8 you need edit the plugin:
view ad function
http://www.sourcepoint.com.au/outlinks/view_ad_function.png
http://www.sourcepoint.com.au/outlinks/edit_view_ad_function.png
Select all in the plugin code box and replace with this:
if (!function_exists('view_ad'))
{
/**
* Calls view_raw function from phpAdsNew either locally or via xml-rpc to get HTML advertisement code, see phpAdsNew for infos.
*
* @param string Zone name (zone:x) or keywords (keyword1|keyword2|...)
* @param integer Client-ID
* @param string Target
* @param string Source
* @param integer Withtext
*
* @return string
*/
function view_ad($what, $clientid = 0, $target = '', $source = '', $withtext = 0)
{
global $vbulletin;
static $panpath;
if (!$panpath)
{
trim($vbulletin->options['panpath']);
$panpath = @parse_url($vbulletin->options['panpath']);
}
// Calculate an identifier for the requested ad - this could be used to cache banners retrieved via xmlrpc in future versions
$adid = sprintf('%u', crc32($what . $clientid . $target . $source . $withtext));
if ($vbulletion->options['addtemplatename'] or $vbulletin->config['Misc']['debug'])
{
// Be verbose
$adcomment = 'id="' . $adid . '" what="' . htmlspecialchars($what) . '" clientid="' . htmlspecialchars($clientid)
. '" target="' . htmlspecialchars($target) . '" source="' . htmlspecialchars($source)
. '" withtext="' . htmlspecialchars($withtext) . '"';
}
else
{
$adcomment = $adid;
}
if ($vbulletin->options['panpath'] == '')
{
// Path to phpAdsNew is empty - disable ads
return "<!-- ad {$adcomment} / -->";
}
elseif (strtolower($panpath['scheme']) == 'http')
{
// get banner from phpAdsNew via xml-rpc
/*
// ATTN:
// In phpAdsNew 2.0.6 (and maybe earlier versions) is a tiny bug which prevents xml-rpc from working cleanly.
//
// Patch:
// --- phpAdsNew/misc/samples/xmlrpc/php/lib-xmlrpc.inc.php.orig Tue Aug 16 10:51:26 2005
// +++ phpAdsNew/misc/samples/xmlrpc/php/lib-xmlrpc.inc.php Thu Oct 27 17:12:26 2005
// @@ -76,6 +76,7 @@
// global $xmlrpcStruct;
//
// global $xmlrpcTypes;
// + global $xmlrpc_valid_parents;
// global $xmlEntities;
// global $xmlrpcerr;
// global $xmlrpcstr;
//
// See https://sourceforge.net/tracker/?func=detail&atid=111386&aid=1339623&group_id=11386 for details.
*/
global $xmlrpcbanner, $phpAds_remoteInfo;
require_once(DIR . '/includes/lib-xmlrpc-class.inc.php'); // see misc/samples/xmlrpc/php/ directory of your phpAdsNew installation
if (!$xmlrpcbanner)
{
$xmlrpcbanner = new phpAds_XmlRpc($panpath['host'], $panpath['path'], (intval($panpath['port']) > 0 ? $panpath['port'] : 80));
}
$ad = $xmlrpcbanner->view_raw($what, $clientid, $target, $source, $withtext);
return "<!-- BEGIN ad {$adcomment} -->{$ad['html']}<!-- END ad {$adid} -->";
}
else
{
// get banner via direct invocation of phpAdsNew
// this is basically taken from the invocationcode generated by phpAdsNew - it does its own checks to prevent multiple inclusion
global $phpAds_context;
if (@require($vbulletin->options['panpath'] . (strstr($vbulletin->options['panpath'] , '/phpadsnew.inc.php') ? '' : '/phpadsnew.inc.php' )))
{
if (!isset($phpAds_context))
{
$phpAds_context = array();
}
$ad = view_raw($what, $clientid, $target, $source, $withtext, $phpAds_context);
if ($vbulletin->options['panbandupes'])
{
// Remember bannerid to prevent showing banner multiple times on same page
$phpAds_context[] = array('!=' => 'bannerid:'.$ad['bannerid']);
}
OA_setTimeZone('TIME/ZONE');
return "<!-- BEGIN ad {$adcomment} -->{$ad['html']}<!-- END ad {$adid} -->";
}
}
}
}
You MUST then go into the line:
OA_setTimeZone('TIME/ZONE');
and replace it with the local zone for your server...
OR
if you just want to insert the line yourself find:
$phpAds_context[] = array('!=' => 'bannerid:'.$ad['bannerid']);
}
and place
OA_setTimeZone('TIME/ZONE');
before the next line:
return "<!-- BEGIN ad {$adcomment} -->{$ad['html']}<!-- END ad {$adid} -->";
}
and that's it...
or at least that has fixed the issue for me.
Now I must say that I am not sure of what effect this might have on the openX server if it is not in the timezone that the main boards are - this could conceivable cause problems associated with skew of the statistics or other database date and time records within openX.
If I notice anything like this I will report here.
Cheers,
Will
speedway
06-23-2009, 07:17 AM
Fantastic Will, will try this now, have had to stay on 2.4.3 due to the ad tag bug.
Cheers
Bruce
Dennis B
06-23-2009, 04:41 PM
I have localmode calls working well (very fast page loads)Are you using LWillmann's solution or something else? I have quite a few ads running with javascript and it's eating up my servers' resources...
stardotstar
06-24-2009, 03:37 AM
It's this Add-on with a modification (one only) to the plugin that delivers the ad.
Dennis B
06-24-2009, 12:49 PM
Thanks for the answer. Is the modification related to the ability to use local calls or not? I really wanted to get rid of the javascript...
stardotstar
06-26-2009, 07:48 AM
This mod invokes the ads via local mode or xml-rpc calls by defining a template tag <ad />.
The javascript invocation method is not implemented using the <ad /> tag to callout phpAdsNew [openX].
If I understand you correctly, you are using javascript invocation calls generated by the zone defined in phpAdsNew [openX]?
This method is slow and very inefficient compared to local mode therefore I tried this mod in order to improve performance but immediately ran into the problem of it no longer being supported for vB3.8.x or openX (as such).
Having a server with vB3.8.3 and openX 2.8 on the same localhost I thought I'd give this mod a go and see if it works. It does, but with the caveat that as soon as you invoke an ad using the <ad /> tag all timestamps on the board are reverted to UTC (whatever the server config or userCP setting) but the board time remains correct and displays correctly (timezone and all) at the bottom of the pages.
The reason for this is that when making local mode calls to openX 2.8 the timezone is not correctly handled - as reported in this bug (https://developer.openx.org/jira/browse/OX-3620).
Several workarounds are suggested and I found that ultimately defining the openX timezone prior to making the callout (with the localhost local timezone - nothing to do with a user's preference setting offset) fixed the problemo.
So that, in a nutshell, is it.
I have not experimented with xml-rpc but since this mod provides it as an alternative call I suspect it works as expected.
You can therefore do away with javascript invocation by implementing this mod with the single plugin modification I posted above.
HTH
Cheers,
\\'
I suppose that this mod could be relaunched as OpenX Banner Ads Integration and stated as compatible with vB 3.8 and OpenX2.8 - much more testing would have to be done though and the local system timezone would have to be implemented as opposed to hardwiring it in the plugin.
dholt
07-01-2009, 04:32 PM
vb 3.8.3
openx 2.8 -
1. I did what stardotstar said Above
2. I set up website and campaign and uploaded banner and
Linked them together
3. Set up zone = zone name Header
Added this too the header Template were I wanted the banner <ad what="Header" />
when I hit save I get a blank page and it won't save the code.
Then I tried to use the java tag invocation code and it saved but nothing displayed.
I need just a little more help getting this to work. Thanks
dholt
07-01-2009, 08:49 PM
Ok fixed as it works good now
chang to the full path in Plugins & Products-Plugin Manager-Product : phpAdsNew Integration-init_startup and edit
find phpadsnew.inc.php
and ad the full path
'http://www.mysite.org/openx/phpadsnew.inc.php'
the foolbar thingy didn't work so I added the java tag invocation code
which you can find under inventory/zones/ invocation code
drop down menu selct java
and it showed up fine I am so jumping with joy right now woot woot. :D
Now I'm off to forumhome template hopefully I'm on a roll
dholt
07-01-2009, 09:29 PM
I have a new problem on forumhome as the banner dispalys under the navbar on the left.
what I need is it to display on the left be side the forums.
what can I do too re size the forums to give me a left column on forum home so it displays left of the forums.
Dennis B
07-02-2009, 12:47 AM
star,
Thanks a million for this, should work perfectly. The only question I have left is if the modification you suggested will take the actual zone file in the server and read it or just implement a standard. I'm asking this because of daylight savings time adjustments that tend to move around quite a bit from year to year.
Thanks again,
stardotstar
07-05-2009, 08:32 AM
Dennis - you need to specify the actual TZ in this work around. Like - Australia/Sydney - so daylight saving would only be invoked if openX is able to auto detect daylight saving time - I know many systems do but not sure of openX. So no, it does not read the server zone file - but that should be easy enough to do by using the php TZ variable.
dholt - I would look into the template/style forums - I'm not much more than a hack at layout and css stuff... I use USC (Ultimate Side Columns) for my side banners, otherwise you can adjust the widths in the template controls in ACP.
baerwurz
10-07-2009, 12:34 PM
I use vbadvanced on every threadpage on the right sidebar. I will setup a module in the right sidebar which shows a large Rectangle Ad.
I have about 17.000 Threads in the most of them i want to show the same banner. But in around 100 Threads i want to show 100 different Banners.
Say for the Nokia E71 Thread, i want to show a Nokia E71 banner which links into the right place on our shop.
In the Iphone 3 GS Thread i want to show a banner with Iphone 3 Gs which links in the Iphone Section in our shop etc...
Is this possible with this mod?
LWillmann
10-07-2009, 06:35 PM
I use vbadvanced on every threadpage on the right sidebar. I will setup a module in the right sidebar which shows a large Rectangle Ad.
I have about 17.000 Threads in the most of them i want to show the same banner. But in around 100 Threads i want to show 100 different Banners.
Say for the Nokia E71 Thread, i want to show a Nokia E71 banner which links into the right place on our shop.
In the Iphone 3 GS Thread i want to show a banner with Iphone 3 Gs which links in the Iphone Section in our shop etc...
Is this possible with this mod?
People had issues with the newer versions of vB and this version of the mod. I got it to work, and detailed how I did it in earlier posts. However, the later versions of OpenX have gotten slower and slower and really bogged my server down, so I have gone away from their package completely.
Thinking back, if you new the banner ID that you wanted to refer to, or created a group showing a bunch of iPhone banners, then you could call banners for that group when in the iPhone section of your site directly. The same goes for the Nokia. But you'd have to do it by either referring to that particular banner, or that group and randomly selecting a banner from the group. But what you're asking can be done.
stardotstar
10-28-2009, 01:11 AM
I have done some simple placement of the banner invocation in the templates using the places where the existing ad hooks are for vB itself - and inserted some simple conditionals that delivery a particular zone if a forum is a particular ID...
I should mention that if you can use the localmode invocation and the openX is on the localhost it is much much faster than if you do a javascript call, but LWillmann is right there is a considerable load to sustain if your site is delivering massive page refreshes.
I keep an eye on this thread becasue I am trying to get the flash banners to work since I completely rely on this hack to deliver my commercial content on my site and in the absence of a better alternative that I can readily transition to I am needing it to be as good as possible.
Anne Lise
12-29-2009, 11:03 AM
Can this please be changed to be compatibel with the 4.0-version?
stardotstar
12-31-2009, 12:18 AM
I am sure it can be - but who would do that I am not sure. I am not on 4 and have not yet even begun to get my head around ensuring that my mods and hacks will transition. :ugh:
BTW I have the flash components working by building in a script call that defines the flashplayer - this is documented in one of my other threads here - and is a solution contributed by another member here who found it on OpenX forums.
Happy New Year all.
W
stardotstar
12-31-2009, 12:20 AM
I use vbadvanced on every threadpage on the right sidebar. I will setup a module in the right sidebar which shows a large Rectangle Ad.
I have about 17.000 Threads in the most of them i want to show the same banner. But in around 100 Threads i want to show 100 different Banners.
Say for the Nokia E71 Thread, i want to show a Nokia E71 banner which links into the right place on our shop.
In the Iphone 3 GS Thread i want to show a banner with Iphone 3 Gs which links in the Iphone Section in our shop etc...
Is this possible with this mod?
I don't know how you would do this but in essence it is simple - use some script that determines which browser interface the user is using (or get them to put their interface/phone type in a custom userfield) and then do a test in the template and use it to call a specific "Zone" from OpenX as per the handset they are using... I do the same thing for setting particular ads to particular forums based on group or custom user profile fields.
stardotstar
01-07-2010, 12:44 AM
The flash display issue that was identified from an OpenX thread by TenPercenter is this
1. Open your headerinclude template.
2. Add this line to the top. (correct it for your site's openx path)
<script type='text/javascript' src='/ads/www/delivery/fl.js'></script>
This has solved flash banner delivery for me.
bertwrld
02-19-2010, 10:08 AM
Anyone have this working with vb4 yet by any chance.
I will pay for this to be converted or a completely new mod written, if someone with the proven experience would be able to get openx and the options working with vb4.
thanks
TheMic
08-06-2010, 12:53 PM
an update for VB4?!? pleeeeeaseeeeee help!
bada_bing
08-06-2010, 04:33 PM
an update for VB4?!? pleeeeeaseeeeee help!
YES PLEASE
bertwrld
08-13-2010, 07:18 AM
Still willing to pay for this mod to be ported over to work with vb4, or a new mod created.
bada_bing
09-10-2010, 02:41 PM
Any updates to 4.0 version ?
Dennis B
09-10-2010, 06:25 PM
I've been using OpenX with vB4 without any problems, calling the ads directly with javascript.
bada_bing
09-13-2010, 03:53 PM
I've been using OpenX with vB4 without any problems, calling the ads directly with javascript.
Can you provide more details
Dennis B
09-14-2010, 02:32 PM
Sure. :)
Please remember that calling several ads using this method might load your server significantly.
All you have to do is go into your OpenX control panel, choose 'Direct Selection' from the left menu, next select javascript invocation from the options and adjust the script according to your needs.
All my banners have unique identifiers so it's pretty easy to target them with a simple '?what=' condition in the script.
The final script version is copied to where ever you want the banner to show, usually placing it inside one of the ad templates is a good idea. :)
kpmedia
04-25-2012, 07:45 AM
the local server timezone
Does anybody have a list of names that work?
I can't find the proper names for cities on other continents; specifically North American cities.
EDIT: America/Chicago, America/Detroit are two. :)
##
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.