MyBB Community Forums

Full Version: How do you use the theme style?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Are you making a plugin Tom ? Paste your plugin's code here. I'll edit it for you.
It's only a tiny page ATM Toungue

I basically need to echo some HTML to make a table in the style of the theme the user is using Smile
You can make it as a template and then evaluate it in the plugin function.
I want to try and do it without templates, but I guess I could use them.

How do you define and fill and call a template?
Download this plugin: http://yaldaram.com/showthread.php?tid=137 And see how I call templates Toungue
Could you just paste it Smile

At college and your site is blocked Toungue
OK, Make a template with this code;

	require MYBB_ROOT."/inc/adminfunctions_templates.php";
	$template = array(
		"title"		=> "TEMPLATE_NAME",
		"template"	=> 'TEMPLATE_CODE',
		"sid"		=> -1
	);
	$db->insert_query("templates", $template);

Now use this following code to evaluate this template;
eval("\$VARIABLE = \"".$templates->get("TEMPLATE_NAME")."\";");

And finally, use this variable: $VARIABLE and place it in the template where you want the template code to show.
Can I just create a template and call it? I dont really understand eval :;
No, you've to evaluate it for displaying whats inside it.
So what is $variable?
Pages: 1 2 3 4