vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Need help adding usergroup permissions to pho forum block with ob_start (https://vborg.vbsupport.ru/showthread.php?t=310900)

Scalemotorcars 04-29-2014 05:41 PM

Need help adding usergroup permissions to pho forum block with ob_start
 
Im working on a php sidebar block and need a little help with it.

I want to change the php block from one to another using the IF Usergroup condition but Im having problems with the code.

This works but I cant figure how to change the $my_output to ob_start.

PHP Code:

if(is_member_of(vB::$vbulletin->userinfo,24)){
$my_output='<center><b>STANDARD HTML HERE</b></center>';
}else{
$my_output='THIS IS WHERE THE I WANT PHP NOT HTML';
}
return
$my_output

The below code is what Im using and it works fine in a standard php block without a usergroup condition.
PHP Code:

ob_start(); 
require_once(
$_SERVER['DOCUMENT_ROOT'] . "/phpbay/ebay.php");
phpBayAPI("(keyword*)""5""888""excluded*"""true);
$output=ob_get_contents(); 
ob_end_clean(); 

Any help would be great. Thanks.. :up:

kh99 04-29-2014 06:47 PM

I think what you want is this:
PHP Code:

if(is_member_of(vB::$vbulletin->userinfo,24)){ 
$my_output='<center><b>STANDARD HTML HERE</b></center>'
}else{ 
ob_start();  
require_once(
$_SERVER['DOCUMENT_ROOT'] . "/phpbay/ebay.php"); 
phpBayAPI("(keyword*)""5""888""excluded*"""true); 
$my_output=ob_get_contents();  
ob_end_clean();  

return
$my_output


Scalemotorcars 04-29-2014 06:59 PM

Worked perfect. Thanks kh99

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

What about the above code in a specific forum ID?

Im using the SIdebar Anywhere hack and would like to show forum blocks on specific forums. I dont need an array.


All times are GMT. The time now is 05:24 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.01171 seconds
  • Memory Usage 1,717KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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