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

Reply
 
Thread Tools Display Modes
  #1  
Old 03-07-2008, 02:05 PM
RetroDreams RetroDreams is offline
 
Join Date: Nov 2002
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Trying to figure out correct syntax

I've got an old phpAds setup that has always worked well so I've stuck with it throughtout phpAds progression to OpenAds and now to OpenX. Anyhow, I've never tried to put an ad into the postbit but I'd now like to do so for guests -- and for more information I use the legacy postbit.

Generally, I just throw $phpAds_raw[html] where I want the ad to show up and move on. However, I threw it into the postbit_legacy template and it just comes up blank. In using the search engine, I've found that you need to use $GLOBALS[] when using postbit_legacy, however, I cannot seem to figure out the correct syntax to get the ad to appear.

$GLOBALS[phpAds_raw] returns "Array" but it needs to have that [html] on the end in order to serve the ad. Is there a way to double bracket? Does anyone have any insight on this?
Reply With Quote
  #2  
Old 03-07-2008, 02:11 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$GLOBALS[phpAds_raw4][html
Reply With Quote
  #3  
Old 03-07-2008, 02:13 PM
RetroDreams RetroDreams is offline
 
Join Date: Nov 2002
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tried it... it just returns Array[html]

--------------- Added [DATE]1204910490[/DATE] at [TIME]1204910490[/TIME] ---------------

Disregard... I've figured it out.

I created a new plugin at postbit_display_complete and entered global $phpAds_raw4; into it. Doing so allowed me to use my standard $phpAds_raw4[html] verbage in the template.
Reply With Quote
  #4  
Old 03-07-2008, 03:46 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh whoops you could try:
PHP Code:
{$GLOBALS[phpAds_raw4][html]}
// Note the braces surrounding it 
Reply With Quote
  #5  
Old 03-08-2008, 03:21 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In templates, you can only use one level of addressing arrays. To get around it, you need to use braces (which Opserty has posted as a fix).
Reply With Quote
  #6  
Old 06-09-2008, 11:00 PM
Blackhat's Avatar
Blackhat Blackhat is offline
 
Join Date: Mar 2005
Posts: 323
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I cant get this to work. Im using this in a plugin

PHP Code:
// The MAX_PATH below should point to the base of your OpenX installation
  
define('MAX_PATH''/*****/*****/*****/html/ads');
  if (@include_once(
MAX_PATH '/www/delivery/alocal.php')) {
    if (!isset(
$phpAds_context)) {
      
$phpAds_context = array();
    }
    
$phpAds_raw view_local(''1200'''''0'$phpAds_context);

  } 
and try to call it as posted above, but it only prints the [html] part as text
Reply With Quote
  #7  
Old 06-10-2008, 06:53 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It could be do with the script, you should test the output separately as well.

Try:
PHP Code:
// The MAX_PATH below should point to the base of your OpenX installation 
  
define('MAX_PATH''/*****/*****/*****/html/ads'); 
  if (@include_once(
MAX_PATH '/www/delivery/alocal.php')) 
  { 
    if (!isset(
$phpAds_context)) 
    { 
        
$phpAds_context = array(); 
    } 
    
$phpAds_raw view_local(''1200'''''0'$phpAds_context); 
    
$phpAdsHTML =& $phpAds_raw['html'];
  } 
And use [minicode]$GLOBALS[phpAdsHTML][/minicode] in your template. If that doesn't work, try doing a var_dump() of the phpAds variable and seeing what output there is.
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 12:43 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.06116 seconds
  • Memory Usage 2,227KB
  • 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_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete