MyBB Community Forums

Full Version: str_replace Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Im having a problem with str_replace, just doesnt seem to be working , and i cant see where im going wrong. Eh, as far as i can see its correct, maybe someone cant spot something im missing.

Im using "index_start" hook.

function test_run()
{
	global $db,$mybb,$templates,$usergroup,$groupscache;
	
	$statpvt = $mybb->user['usergroup'];
	$xstatpvt = explode(",",$mybb->settings['test_2']);

	if (in_array($statpvt,$xstatpvt))
	   {
     	$templates->cache['index_boardstats'] = str_replace('{$whosonline}', '<td class="tcat" style="text-align:{$mybb->settings[\'test_4\']};"><strong>{$mybb->settings[\'test_3\']}</strong></td>',$templates->cache['index_boardstats']);
		
	   }
}


EDIT: You can close this , i solved the problem lol , im just blind thats all Big Grin