MyBB Community Forums

Full Version: small question about the blocks
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

I'm trying to add some blocks to my portal page.
So, I create a new template in portal templates called portal_chat and containing the HTML code I want to display.
In the portal template, I've added {$chat} where I want to display it, but nothing appears.

Have I to add something to make it working?

Thanks by advance.
No, I can't find in the way to register new blocks.
Previously, I've added the html code in the template, but now I want to do it as a real block.
You need to eval it.

In portal.php

Find
eval("\$portal = \"".$templates->get("portal")."\";");
Above it add
eval("\$chat = \"".$templates->get("portal_chat")."\";");
zaher1988 Wrote:You need to eval it.
Thanks...
That was the conclusion I finally had, but I'm quite surprizing. I think I'll add a suggestion to the idea part: having an auto-eval of the included parts.
Crazycat Wrote:
zaher1988 Wrote:You need to eval it.
Thanks...
That was the conclusion I finally had, but I'm quite surprizing. I think I'll add a suggestion to the idea part: having an auto-eval of the included parts.
I don't think it is feasible or even efficient.
preg_replace_callback() based on a logical pattern ($portal_(\d{2,})) might work...