![]() |
[FIXED]Programmer help required to update an old but good plugin
Hi all,
I am new at building product/plugins for vB - I spent much time with phpBB cutting my teeth on the mods for the 2.x series. I am getting my head around calling php from external programmes and in this case I am using a product from vB.org that integrates phpAdsNew - now openx. The problem I have found there is that it is only supported up to vB3.5 and after playing with it I got it working just fine on 3.8.2 with one major flaw. I needed to use what openx calls local mode invocation since the ad server and vB are on the same physical machine - using javascript is very slow when there are a few ads on the page. This apparently is a simple call to openx server in php called view.raw with the necessary variables set. Having got the product working and the necessary calls into the templates - it uses a new tag <ad /> I got my dearly needed speed increase (further improved by implementing memchached). But suddenly I notice that the post timestamps are skewed into the past (about 10 or 11 hours - the same as taking off the GMT offset - on my board +10). I checked the server = ok, I sent emails = OK, I checked an unmodded board = ok and therefore started to troubleshoot. I found that in my templates/styles if I removed any reference to the invocation of the phpAdsNew integration the time would revert to normal offset. Therefore the time is not being altered only displayed incorrectly - and only within certain frames - for example the time is incorrect (- 10 hours) in personal message received times and all posts within threads and indexes etc BUT not at the very bottom of the board where the board time is displayed eg: Code:
All times are GMT +10. The time now is 1:09pm. Note that the server is set to Localtime (+10) and the time is correct, the time is also correctly set within openx and I am investigating there what may be happening when the call is made. Interestingly the use of javascript to pull the ad into the board (although slow) does not cause this time skew - only the "local mode" call. Here is what I think is happening. When a page is generated the header has a call to another template which contains the "invocation code" for the ad. In the past I have used Javascript here. so: Code:
<td align="$stylevar[left]" id="header_right_cell"> ad_header_logo is now simple: Code:
<ad what="zone:1" /> Code:
<!--/* OpenX Javascript Tag v2.8.0 */--> ad_tag_callback in template_compile execution order 5 Code:
if (!function_exists('_tag_callback')) view_ad function in init_startup also at 5 Code:
if (!function_exists('view_ad')) The important part in this as far as I can see is the local mode not xmlrpc Code:
else You can see this phenomenon for you self without needing to log in at my board. http://www.archeli.com.au/forums It is also interesting to note that this does not effect the display of the time when "detailed" is used - I guess because that function doesn't care if the time is "zoned" as such since it is a "difference" not a literal stamp. I have just tried to change the time to "Normal" and edited the time format to "h:i A e" which shows the time zone - and what do you know - UTC Is what is being delivered back to the pages as they render: Code:
18-05-2009 06:07 AM UTC Code:
18-05-2009 04:07 PM Australia/ACT The time of the post from the postbit is $post[posttime] and somehow that is getting transformed back to UTC... Any help would be appreciated, I am starting to get somewhere as a developer of this kind of code and will continue to ponder and submerge myself in the workings of vB and the products/openx. Cheers Will |
I am hot on the trail of this problem but still need help from a competent php programmer.
The problem lies with a bug in openx https://developer.openx.org/jira/browse/OX-3620 This means that calls out to local mode will result in the board's zone setting (or that of the user's session) being set to UTC. I am trying to work out how to implement a simple save and reset before and after the plugin call respectively but so far with no success. Any suggestions or help/coaching would be appreciated. Will Something like Code:
$script_tz1 = date_default_timezone_get(); http://www.vbulletin.com/forum/showt...99#post1738499 Can't wait to get this sorted - it should mean we can do an update to phpadsnew integration for openx2.8 and vB3.8.2 Will |
I notice when I do a scan of my php info the date section shows correct timezone but not a set value...
Code:
date |
Good luck with this. I'd love to help but my skills are far less than your's.
I'm going to be using OpenX Ad sever with VBulletin 3.8 with VBSEO installed. I'll keep an eye on this thread and if my developers come up with a solution, I'll post it here. |
Please do; I am doing my best to wrangle in the kind of help required to troubleshoot this.
|
I have not solved this yet but managed to most terribly mangle my board in the process of hacking it out :oops: I was able to fix it but it was a close one!
--------------- Added [DATE]1244188915[/DATE] at [TIME]1244188915[/TIME] --------------- OK, I have a dev board running without any modifications - clean 3.8.2 install; nothing in database except a single test post. Installed mod and turned it on; as soon as the ad is invoked using local mode = zap! time zone switches from the +10 I had selected in the UCP to UTC. Very curious. I am going to troubleshoot this from the dev board after nearly breaking my main ship last night trying to find a solution. Will I may as well blog in this thread while I flounder around looking for a solution :) Will --------------- Added [DATE]1244189068[/DATE] at [TIME]1244189068[/TIME] --------------- I have my default time zone defined in php.ini so that is not it: Code:
date |
In an effort to keep this effort going I have grabbed a screen shot of two renderings of the same index.
This is a vanilla vB 3.8.2 with only the openX integration applied. The window on the left is a template with the <ad.../> tags invoked. The window on the left shows the same index with a clean style. http://www.sourcepoint.com.au/outlinks/TimeZoneProb.jpg Notice that the time is correct in both cases as stated by the board time at the bottom of the main page - this is the native time zone for the board since even though I am logged in my user timezone is the same as the server. Guests would see exactly the same in each case. The Posts and Most Users Online dates (and PMs etc) all show back at UTC with the view_ad function called - but not the date at the bottom and importantly only for display - not effecting in any way the accuracy of the clock for database purposes (thankfully) I think therefore that I need to find out how to protect whatever value/variable is being used to calculate the times that are being written out after the view_ad function call. The way I tried to do this is to save a value, then reset it before exiting the plugin but either it didn't work or it was the wrong variable etc etc etc. I know I am blogging this but I would still appreciate any insight or assistance from a more skillful hand if one is available to look at the problem. The board in question can be accessed and is my dev board. Will |
Fixed.
I have reported the fix for php5, openX 2.8, vB3.8.3 in the mod thread: https://vborg.vbsupport.ru/showthrea...89#post1829889 Almost absurdly simple. |
All times are GMT. The time now is 07:14 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|