class Dark_Steam_EventListener_TemplatePostRender
{
static public function listen($templateName, &$output, &$containerData, XenForo_Template_Abstract $template){
if($templateName == 'member_view'){
$output = preg_replace_callback('#(<a href="http://steamcommunity.com/profiles/)([^"]+)(">.*?</a>)#', array('Dark_Steam_EventListener_TemplatePostRender', 'profileReplace'), $output);
}
if($templateName == 'thread_view'){
$output = preg_replace_callback('#(<a href="http://steamcommunity.com/profiles/)([^"]+)(">.*?</a>)#', array('Dark_Steam_EventListener_TemplatePostRender', 'profileReplace'), $output);
}
}
static public function profileReplace($matches){
return $matches[1].Dark_Steam_Helper_SteamUserField::steamIdToCommunityId(urldecode($matches[2])).$matches[3];
}
}