PDA

View Full Version : How to add PHP code into Forum blocks manager?


postcd
04-08-2014, 04:51 PM
Hello,

i read: http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/vbulletin-4-quick-tips-and-customizations/380752-creating-an-html-or-php-block

and in AdminCP, Forums & Moderators, Forum Block Manager, My block

i select PHP code

Then im trying to add some

if (function(bla, bla) { echo something } else{ something }

but it dont show anything on forum sidebar. The code is tested and works on normal php page, but there dont, anyone please can link to an example or write example with ifs that works in this blocks manager?

When adding:

$a = "ddd";
return $a;

It shows ddd which is good.

How to add ifs and elses intot that text field?

Zachery
04-08-2014, 06:15 PM
Would probably need to see the actual code you're trying to use, and you'd have to tell us how its failing, and how you expected it to work.

postcd
04-09-2014, 02:00 PM
i had badly structured code. i apologize. Had to be like:

if (strpos($_SERVER['HTTP_USER_AGENT'],'zzzz') == false) {
$html = '
html code here
';
return $html;
}
now works