Instructions to have a Steam Powered profile shown when reading messages in Xenforo 1.1b4.
.spdark-wrap {
position: relative;
width: 112px;
height: 100px;
background-color: #F0E0D2;
border: 1px solid #E4BFA5;
border-radius: 4px 4px 4px 4px;
padding: 2px;
overflow: hidden;
margin-top: 4px;
margin-bottom: 4px;
margin-left: -4px;
}
.steamprofile {
position: relative;
width: 112px;
height: 100px;
background: #3A3A3A url(background.png);
overflow: hidden;
}
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', 'profileSteamView'), $output);
}
}
static public function profileReplace($matches){
return $matches[1].Dark_Steam_Helper_SteamUserField::steamIdToCommunityId(urldecode($matches[2])).$matches[3];
}
static public function profileSteamView($matches){
return "<div class=\"spdark-wrap\"><div class=\"steamprofile\" title=\"".Dark_Steam_Helper_SteamUserField::steamIdToCommunityId(urldecode($matches[2]))."\"></div></div>";
}
}
do you make your own addon fot this
can you wrap all of the changes up into a single post/document?
case 'plague_bar_hook'; // Add content above all noticies / top of message posts
{
$mergedParams = array_merge($template->getParams(), $hookParams);
$myTemplate = $template->create('plague_message_bar', $mergedParams);
$rendered = $myTemplate->render();
$contents = $rendered . $contents;
break;
} //end case
<xen:foreach loop="$userFieldsInfo" key="$fieldId" value="$fieldInfo">
<xen:if is="{$fieldInfo.viewable_message}">
<xen:if hascontent="true">
<xen:contentcheck>{xen:helper userFieldValue, $fieldInfo, $message, {$message.customFields.{$fieldId}}}</xen:contentcheck>
</xen:if>
</xen:if>
</xen:foreach>
Any ideas why?The field 'custom_field_Steam' was not recognised.
Hi guys,
I have the Steam ID custom field required, but when people put in a legit ID it says:
Any ideas why?
I am using 1.1b4
Weird. I got this working without issues.
Do you have your Steam ID field required during registration like I do?
Instructions to have a Steam Powered profile shown when reading messages in Xenforo 1.1b4.
Requirements:
- Get http://code.google.com/p/steamprofile/
- Set up Steam Identity Service (like it is show on the thread)
Steps:
- Install steamprofile on your htdocs root
- The directory steamprofile/cache needs to be writable (chmod 777 or chown www-data:www-data or whatever) (Use FACL if your system supports it!)
- The template PAGE_CONTAINER just before </head> add:
HTML:<script type="text/javascript" src="/steamprofile/steamprofile.js"></script>
- Then all you have to go to the Users >> Custom Fields select Steam and go in General Options. You have to make sure that the content is Visible in User Info in Messages. This makes sure that the content gets correctly carried over to the default template.
- Change the content of file library/Dark/Steam/EventListener/TemplatePostRender.php to the following code:
PHP: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', 'profileSteamView'), $output); } } static public function profileReplace($matches){ return $matches[1].Dark_Steam_Helper_SteamUserField::steamIdToCommunityId(urldecode($matches[2])).$matches[3]; } static public function profileSteamView($matches){ return "<div class=\"steamprofile\" title=\"".Dark_Steam_Helper_SteamUserField::steamIdToCommunityId(urldecode($matches[2]))."\"></div>"; } }
- Replace the .steamprofile CSS tag in file steamprofile/theme/default/style.css with:
HTML:.steamprofile { position: relative; width: 109px; height: 48px; background: #3A3A3A url(background.png); overflow: hidden; margin: 4px; }
And there you have it! With Xenforo 1.1b4 works like a charm and you don't need to do much, other then to work on the PACE_CONTAINER template. And I believe that we can work around that as well, but I don't have the time tonight. You can see the end result here: http://www.eqnomadi.org/forum/threads/nuova-casa.4073/ Garani is either online or off-line.
<a href="http://steamcommunity.com/profiles/{$value}">{$value}</a>
We use essential cookies to make this site work, and optional cookies to enhance your experience.