[Mood Manager] - Disable Mood In Postbit
How do I convert this template code:
Code:
<if condition="!empty($post[mood])AND !in_array($GLOBALS[forumid], array(18,24))">
so that it works in this Plugin PHP Code:
Code:
global $vbulletin, $onceonly;
if ($this->registry->options['moodmanageronoff'] == 0)
{
$this->post['mood'] = NULL;
}
else if ($vbulletin->options['moodmanagerpostbit'])
{
if (!isset($onceonly))
{
$find = "";
if (strpos($this->templatename, "legacy") === false)
{
$find = '<div>
$vbphrase[posts]: $post[posts]
</div>';
}
else
{
$find = '<div>
$vbphrase[posts]: $post[posts]
</div>';
}
$addafter = '
".(!empty($post[mood]) ? ("
<div>
<span style=\\"vertical-align: middle;\\">$vbphrase[my_mood]:</span> <img style=\\"vertical-align: middle;\\" src=\\"images/mood/$post[mood].gif\\" border=\\"0\\" />
</div>
") : (""))."';
$vbulletin->templatecache[$this->templatename] = str_replace($find, $find . $addafter, $vbulletin->templatecache[$this->templatename]);
$onceonly = true;
}
}