Simple Machines Community Forum

General Community => Scripting Help => Topic started by: shins on April 14, 2012, 11:33:53 PM

Title: Customised Proifile Summary
Post by: shins on April 14, 2012, 11:33:53 PM
I am after  a customised profile summary since i am running a minecraft server and wish to show stats on each player for example like the below image

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.ozziecraft.net%2Fimages%2Fprofile.png&hash=0246692c6a893dd287e8af2d1c7baa88add5d248)

All the information is pulled from the database and populated into these fields I have the code for doing so in IPB and Xenofro but not for Simple Machines. I am not sure what file in SMF i need to edit or if its more complicated than adding a chunk of code into a tpl file like most forums use.

Any help would be appreciated

Code for the IPB May help you with the idea

<if test="$f->parsed != ''">
<span class='row_title'>{$f->raw_data['pf_title']}</span>
<div class='row_data'>
<if test="genericIsArray:|:is_array($f->parsed)">
{parse expression="implode( '<br />', $f->parsed )"}
<else />
        <if test="mclastseen:|:$f->raw_data['pf_key'] == 'mclastseen'">
{parse date="$f->parsed" format="long" relative="false"}
<else />
<if test="mcgametime:|:$f->raw_data['pf_key'] == 'mcgametime'">
                                        <php>
                                        $time = (int) $f->parsed;
$seconds = $time%60;
$mins = floor($time/60)%60;
$hours = floor($time/60/60)%24;
$days = floor($time/60/60/24);
$playtime = "";
if($days>0){
$playtime .= $days . " Days";
}
if($hours >0){
if($playtime != '')
$playtime .= ", ";
$playtime .= $hours . " Hours";
}
if($mins >0){
if($playtime != '')
$playtime .= ", ";
$playtime .= $mins . " Minutes";
}
if($seconds>0){
if($playtime != '')
$playtime .= ", ";
$playtime .= $seconds . " Seconds";
}
                                        </php>
{$playtime}
<else />
<if test="mcxp:|:$f->raw_data['pf_key'] == 'mcxp'">
{$f->parsed} XP
<else />
<if test="mclifeticks:|:$f->raw_data['pf_key'] == 'mclifeticks'">
<php>
$ticks = (int) $f->parsed;
$daysold = sprintf("%.1f", $ticks / 24000);
</php>
{$daysold} Days Old
<else />
        {$f->parsed}
</if>
</if>
</if>
</if>
</if>
</div>