MyBB Community Forums

Full Version: [help needed]MyCode with PHP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!
I know I posted this on the MyCode request thread, but I thought a thread by itself would get me more help, since actual support would read it. Sorry if this is against the rules.

I would like to know if it's possible to make a MyCode that displays what a PHP function returns.
I managed to add a PHP function to the code (in global.php) that returns a string.
But what I would like is that a certain code displays it.
For example, if this function existed:
function foobar($text) {return "This is some text:" . $text; }
then I would like to have some code like this:
[foobar_text]123456[/foobar_text]

Shows:

This is some text: 123456

EDIT: by the way, the returned value by the function has HTML tags in it, which should be dealt with apropriately (ie. <b>Hi</b> should appear as Hi).

Can this be done? Thanks!
I am no good with PHP, so i cant help. Just want to state that that request thread isn't official, just made by a member who wants to help, so it's ok.

And I'm also interested with this, might be useful anytime soon for me. Smile