MyBB Community Forums

Full Version: Eval Code in Showthread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I made a new template and would like to have it show up someplace in the postbit. So I put the following code in showthread.php:
	eval("\$mystuff = \"".$templates->get("mystuff")."\";");

And in postbit, I put $mystuff somewhere in the template.

When I visit the showthread.php page, the mystuff template does not show up. What am I doing wrong? Thanks!
in inc/functions_post.php inside the function makepostbit, add
global $mystuff;
Thanks for the reply, but that didn't seem to work.

Here is my postbit template:
<tr>
<td class="$altbg" width="155" valign="top" nowrap="nowrap" align="center"><a name="pid$post[pid]"></a>
<strong><span class="largetext">$post[profilelink]</span></strong><br />
<span class="smalltext">
$post[usertitle]<br />
$post[userstars]
$post[groupimage]<br />
$post[useravatar]<br />
$lang->postbit_posts $post[postnum]<br />
$lang->postbit_group $usergroup[title]<br />
$lang->postbit_joined $post[userregdate]<br />
$lang->postbit_status $post[onlinestatus]$post[replink]<br />
</span>
</td>
<td class="$altbg" width="100%" valign="top">
<table width="100%">
<tr><td class="trow">$post[posturl]$post[icon]<span class="smalltext"><strong> $post[subject]</strong></span>
<p>$post[message]</p>
$post[attachments]
[b]$mystuff[/b]
$post[signature]
<div style="text-align: right; vertical-align: bottom;">
$post[editedmsg]
$post[iplogged]
</div>
</td></tr>
</table>
</td>
</tr>
<tr>
<td class="$altbg" height="18" nowrap="nowrap" align="center"><span class="smalltext">$post[postdate] $post[posttime]</span></td>
<td class="$altbg" width="100%" valign="middle" height="18">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr valign="bottom">
		<td align="left" ><span class="smalltext">$post[button_email]$post[button_pm]$post[button_www]$post[button_find]</span></td>
		<td align="right" nowrap="nowrap"><span class="smalltext">$post[button_edit]$post[button_quickdelete]$post[button_quote]$post[button_report]</span></td>
	</tr>
	</table>
</td>
</tr>
$seperator
Here is the ending of showthread.php:
	}
	return $posts;
}

eval("\$mystuff = \"".$templates->get("mystuff")."\";");
?>

Here is part of my function_post.php:
function makepostbit($post, $pmprevann=0)
{
	[b]global $mystuff;[/b]	
	global $db, $altbg, $theme, $settings, $mybb, $mybbuser, $postcounter, $titlescache, $page, $templates;
	global $forumpermissions, $attachcache, $lang, $ismod, $inlinecookie, $inlinecount, $groupscache, $fid;
	global $plugins;

And I also created a template called "mystuff". What am I doing wrong? Thanks!


Bump:
Is there anyone who can let me know what I am doing wrong? I really appreciate it, thanks!
<bump>
Can anyone help me out? Thanks!