Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
phpAdsNew Banner Ads integration (advertisements, classified ads, Adsense, etc.) Details »»
phpAdsNew Banner Ads integration (advertisements, classified ads, Adsense, etc.)
Version: 1.0.4, by The M.I.P. The M.I.P. is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.5.x Rating:
Released: 11-05-2005 Last Update: 10-11-2006 Installs: 571
Uses Plugins
 
No support by the author.

OpenAds / phpAdsNew Integration 1.0.4 for vBulletin 3.[56].x
2006-06-08 by mip

Integrates the OpenAds / phpAdsNew ads system by introducing a new template tag <ad ... />.
You can even deliver your Adsense stuff via phpAdsNew using HTML banners.

The features of phpAdsNew combined with the power of vBulletin's templating system gives you the possibility to place ads for specific user groups, forums, and keywords.

PREREQUISITES:
This plugin requires a working installation (local or remote) of a recent version ofOpenAds / phpAdsNew (free software released under the GPL).
When using OpenAds, replace phpAdsNew in this documentation with OpenAds (phpAdsNew is just the predecessor of OpenAds).

INSTALLATION:
When having a previous version of this product installed, see section UPGRADE instead.

Install product "phpadsnew-1.0.4.xml".
Set phpAdsNew path in Server Settings and Optimization Options to point to either your local phpAdsNew installation or a remote server (using XML-RPC).
It is strongly recommended to set $phpAds_config['compatibility_mode'] = true; in phpAdsNew config file, to prevent problems when phpAdsNew uses a database different from the one used by your vBulletin board.

When using XML-RPC, make sure to have lib-xmlrpc-class.inc.php and lib-xmlrpc.inc.php copied from phpAdsNew misc/samples/xmlrpc/php/ to your forum's includes/ directory (not necessary when using a local phpAdsNew installation).

Read the NOTES section below.

Click INSTALL in this thread to mark product as "installed" and receive notifications when a new version comes out.

UPGRADE:
  • 1.0.3 --> 1.0.4
    1. Import product as usual, with "Allow Overwrite" set to Yes.
  • 1.0.2 --> 1.0.3
    Upgrading is recommended, as this is a bugfix release.
    1. Import product as usual, with "Allow Overwrite" set to Yes.
    2. Recompile any templates where you experienced problems with the <ad .../> tag (notably those where this tag is used repeatedly on a line).
  • 1.0.1 --> 1.0.2
    1. Import product as usual, with "Allow Overwrite" set to Yes.
    2. Set $phpAds_config['compatibility_mode'] = true; in phpAdsNew config file.
  • 1.0 --> 1.0.1
    There's basically no need to upgrade, as the changes don't affect a working installation, but I recommend to do so, to ease possible upgrades in the future.
    1. Import product as usual, with "Allow Overwrite" set to Yes.
    2. Alter the path to phpAdsNew in vBulletin Server Settings and Optimization Options to point to your phpAdsNew installation.
      As opposed to version 1.0 of this product, a local path is not relative to the DOCUMENT_ROOT.

USAGE:
Use the newly introduced <ad ... /> tag in your templates.
The syntax is similar to phpAdsNew's view_raw() function call - the tag understands what, clientid, target, source, and withtext as arguments.

Please make yourself familiar with phpAdsNew prior to using this product. You can't expect this product to work, if you didn't check if your phpAdsNew is delivering your banners cleanly.

Examples:
  • Get banner using keywords:
    <ad what="foo|bar" />
  • Get banner for guest usergroup (in this case, "ug1" must be set as a keyword in phpADsNew, see 2nd screenshot):
    <ad what="ug$bbuserinfo['usergroupid']" />
    (same technique can be applied to deliver forum-specific ads)
  • Similar invocation using template conditionals:
    <if condition="$bbuserinfo['usergroupid']==1"><ad what="" /></if>

NOTES:
  1. Always use the latest stable version of phpAdsNew.
    Old versions had bugs and some even had severe security issues - I'll give no support for installations with an outdated phpAdsNew.
    At the time of writing, latest version is 2.0.8.
  2. Templates which make use of the ad-tag might need to get recompiled after product change.
  3. Recommendations for heavy-duty servers: Move the plugin code to files; try to avoid using xml-rpc or cache xml-rpc requests (e.g. with memcache).
  4. Have an eye on current phpAdsNew security issues
  5. This product comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.
  6. Support is provided at will.
    Don't expect help if you haven't read instructions or phpAdsNew manual, if you're using non-standard vBulletin software or if your problem descriptions are useless.

PS:
This plugin is donationware - it helps you to make some money, so please be fair and honor my work with an adequate pecuniary donation.
Donate via Paypal

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #562  
Old 02-04-2009, 10:19 PM
funinthesun funinthesun is offline
 
Join Date: Oct 2005
Posts: 460
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #563  
Old 05-20-2009, 10:37 AM
stardotstar stardotstar is offline
 
Join Date: May 2008
Location: SYD, AU
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #564  
Old 05-20-2009, 11:06 AM
stardotstar stardotstar is offline
 
Join Date: May 2008
Location: SYD, AU
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:

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?>
Reply With Quote
  #565  
Old 05-22-2009, 10:03 AM
stardotstar stardotstar is offline
 
Join Date: May 2008
Location: SYD, AU
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #566  
Old 05-22-2009, 11:28 PM
jw00dy's Avatar
jw00dy jw00dy is offline
 
Join Date: Dec 2004
Location: Utah
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am interested for sure.
Reply With Quote
  #567  
Old 05-27-2009, 05:16 PM
bertwrld bertwrld is offline
 
Join Date: Nov 2006
Location: Outside of Detroit
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I get a shifted time as well, a fix would be great.
Reply With Quote
  #568  
Old 05-28-2009, 09:31 AM
stardotstar stardotstar is offline
 
Join Date: May 2008
Location: SYD, AU
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #569  
Old 05-31-2009, 03:35 PM
bertwrld bertwrld is offline
 
Join Date: Nov 2006
Location: Outside of Detroit
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Curious as to any luck with this as of yet?
Reply With Quote
  #570  
Old 06-01-2009, 01:58 AM
stardotstar stardotstar is offline
 
Join Date: May 2008
Location: SYD, AU
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not yet, following various leads; I'll be sure to keep you updated of progress.
Reply With Quote
  #571  
Old 06-02-2009, 07:47 PM
bertwrld bertwrld is offline
 
Join Date: Nov 2006
Location: Outside of Detroit
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Right on, thanks.

The java delivery def uses a lot of resources.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:16 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
  • Page Generation 0.05706 seconds
  • Memory Usage 2,324KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete