PDA

View Full Version : Need help adding usergroup permissions to pho forum block with ob_start


Scalemotorcars
04-29-2014, 05:41 PM
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.

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

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 1398810181 at 1398810181 ---------------

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.