vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Trying to figure out correct syntax (https://vborg.vbsupport.ru/showthread.php?t=172362)

RetroDreams 03-07-2008 02:05 PM

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?

Opserty 03-07-2008 02:11 PM

PHP Code:

$GLOBALS[phpAds_raw4][html


RetroDreams 03-07-2008 02:13 PM

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.

Opserty 03-07-2008 03:46 PM

Oh whoops you could try:
PHP Code:

{$GLOBALS[phpAds_raw4][html]}
// Note the braces surrounding it 


Dismounted 03-08-2008 03:21 AM

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).

Blackhat 06-09-2008 11:00 PM

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

Opserty 06-10-2008 06:53 AM

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.


All times are GMT. The time now is 02: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.01109 seconds
  • Memory Usage 1,732KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete