Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #21  
Old 09-20-2008, 02:22 AM
Vackrick Vackrick is offline
 
Join Date: Apr 2008
Location: Taiwan
Posts: 359
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Google Ads Manager Give error i try yesterday...
Reply With Quote
  #22  
Old 12-24-2008, 09:51 PM
mexicanpizza mexicanpizza is offline
 
Join Date: Oct 2007
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by slo_chewie View Post
This has been working on my forum using local php invocation code.

I do get 3 mysql errors every hour that I haven't been able to figure out though. The mysql errror always gets reported as unregistered user so I think it may be spider related. The mysql error hasn't been causing any problems though. Just annoying getting the email about it.

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 add $phpAds_raw[html] to your template where you want the banner ad to appear
Wanted to followup on this to help others trying to do the same thing.

My goal was to have OpenX capture the vbulletin $forumid into the "source" parameter, so that I could serve different ads to different forums based on the delivery options in openX. This turned out to be pretty simple.

1. Configure your "local mode" invocation code via OpenX. Put $forumid in the source box so it will show you where in the php openX expects the forumid. The automated generated bannercode should look something like the following. You MUST remove the single quotes from around $forumid ( change '$forumid' to $forumid ).

Code:
<?php
  //<!--/* OpenX Local Mode Tag v2.6.3 */-->

  // The MAX_PATH below should point to the base of your OpenX installation
  define('MAX_PATH', '/home/mysite.com/openx');
  if (@include_once(MAX_PATH . '/www/delivery/alocal.php')) {
    if (!isset($phpAds_context)) {
      $phpAds_context = array();
    }
    // function view_local($what, $zoneid=0, $campaignid=0, $bannerid=0, $target='', $source='', $withtext='', $context='', $charset='')
    $phpAds_raw = view_local('', 2, 0, 0, '', $forumid, '0', $phpAds_context, '');
  }
  echo $phpAds_raw['html'];
?>
2. Create a plugin in vBulletin ACP --> Plugins/Products --> Add New Plugin.
  • hook location: global_start
  • title: whatever
  • execution order: 5 or whatever

Into the "Plugin PHP Code:", paste the invocation code, but without the php delimiters:

Code:
define('MAX_PATH', '/home/mysite.com/openx');
  if (@include_once(MAX_PATH . '/www/delivery/alocal.php')) {
    if (!isset($phpAds_context)) {
      $phpAds_context = array();
    }
    // function view_local($what, $zoneid=0, $campaignid=0, $bannerid=0, $target='', $source='', $withtext='', $context='', $charset='')
    $phpAds_raw = view_local('', 2, 0, 0, '', $forumid, '0', $phpAds_context, '');
  }
  echo $phpAds_raw['html'];
3. Put the variable $phpAds_raw[html] wherever you want this set of ad's to appear. It was important to remove the single quotes from around html for this to work. For example, my ad_navbar_below template now looks like this:

Code:
<center><div>

$phpAds_raw[html]
		
</div></center>
		
<br />
Hopefully this helps others trying to do the same thing. I am not a programmer and this could be dramatically wrong/improper, but it seems to be working great for me on vB 3.7.4 and with OpenX 2.6.3.

I welcome comments.
Reply With Quote
  #23  
Old 02-19-2010, 06:13 AM
TalkVirginia's Avatar
TalkVirginia TalkVirginia is offline
 
Join Date: Oct 2008
Location: Virginia
Posts: 545
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok I'm confused.. using the instructions in the link below, how would I render an output array to say the ad_global_header2 template? Can someone enlighten me on this?

https://vborg.vbsupport.ru/showthread.php?t=228078
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 06:15 PM.


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.04987 seconds
  • Memory Usage 2,185KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)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