vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   RC2 Accessing $output (https://vborg.vbsupport.ru/showthread.php?t=230252)

MyChemicalSelf 12-15-2009 02:33 PM

RC2 Accessing $output
 
Hey guys, in Beta 5 and lower i could call $output from global_complete and edit data etc, but for soem reason (After upgrading to rc2) this is no longer possible. Can anyone shed some light on this?

Lynne 12-15-2009 03:04 PM

Perhaps post your code. I am using global_complete to add addition css to my pages though the use of str_replace to the $output and it is working just fine for me in RC2.

MyChemicalSelf 12-15-2009 03:09 PM

Thanks Lynne i have this is in global_complete, oddly this was working in beta 5 and has stopped since the upgrade.
PHP Code:

$gperm convert_bits_to_array($vbulletin->userinfo['permissions']['gcbos_permissions'], $vbulletin->bf_ugp_gcbos_permissions);

if (
$gperm['can_view'])
{
    global 
$output;
    
$gcbos_head '<script src="clientscript/gcbos.js"></script></head>';

    if (!
preg_match('/forumbits.css/'$output)) //Is forumbits.css being required allready
        
$gcbos_head '<link rel="stylesheet" type="text/css" href="forumbits.css" />' $gcbos_head;  

    
$output str_replace('</head>'$gcbos_head$output);
    
$output str_replace('<!-- {SHOUTBOX} -->'vB_Template::create('GCBOS')->render(), $output);



Lynne 12-15-2009 03:51 PM

You've got a couple str_replace going on in there... have you tried to narrow it down to which one is the problem? I would start by only having the last one 'on' and seeing if that works and then going backwards to see where the problem is. But, I can tell you that str_replace IS working for $output at that hook location for me.

MyChemicalSelf 12-15-2009 03:55 PM

Quote:

Originally Posted by Lynne (Post 1931179)
You've got a couple str_replace going on in there... have you tried to narrow it down to which one is the problem? I would start by only having the last one 'on' and seeing if that works and then going backwards to see where the problem is. But, I can tell you that str_replace IS working for $output at that hook location for me.

How odd, and im sure its not the replaces' due the fact i cant even exit($output) and i cant seem to see it in get_defined_vars() anyway thanks for your help going to try a fresh install and hope that fixes it :)


All times are GMT. The time now is 10:11 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.00998 seconds
  • Memory Usage 1,725KB
  • 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
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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