Okay should of done that lol.
This is the PHP (stat_widget.php):
Code:
<head>
<style>
#BigBox {
color: #fff;
padding: 4px 4px;
text-decoration: none;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
</style>
</head>
<?php
//SteamID
$steamid=$post['field5'];
//GET GAMEME INFORMATION
define("CLIENT_API_URL", "http://protf2.gameme.com/api");
//GRAB STATS
$tfpxml = new SimpleXMLElement(file_get_contents(CLIENT_API_URL."/playerinfo/tf/".$steamid));
if (count($tfpxml->playerinfo[0]->player) > 0) {
$tfplayerdata = array();
$tfplayerdata['name'] = $tfpxml->playerinfo[0]->player[0]->name;
$tfplayerdata['cc'] = $tfpxml->playerinfo[0]->player[0]->cc;
$tfplayerdata['clanname'] = $tfpxml->playerinfo[0]->player[0]->clanname;
$tfplayerdata['id'] = $tfpxml->playerinfo[0]->player[0]->id;
$tfplayerdata['time'] = $tfpxml->playerinfo[0]->player[0]->time;
$tfplayerdata['rank'] = $tfpxml->playerinfo[0]->player[0]->rank;
$tfplayerdata['skill'] = $tfpxml->playerinfo[0]->player[0]->skill;
$tfplayerdata['kills'] = $tfpxml->playerinfo[0]->player[0]->kills;
$tfplayerdata['deaths'] = $tfpxml->playerinfo[0]->player[0]->deaths;
$tfdays= intval($playerdata['time']/60/60/24);
$tfhours= intval(($playerdata['time']/60/60)-($days*24));
$tfminutes= intval(($playerdata['time']/60)-($hours*60)-($days*24*60));
$tfseconds= intval(($playerdata['time'])-($hours*60*60)-($days*24*60*60)-($minutes*60));
}
//ECHO THE INFO
IF ($tfplayerdata['id']<>'') {
echo '<table style="float:right; valign:middle; width:170px;">';
echo '<tr></tr>';
echo '<tr><td valign="middle" rowspan="2">';
echo '<table style="z-index:2; padding:0px; width:50px; position:relative; left:+0px; background: black url(http://zurb.com/images/alert-overlay.png) repeat-x; " id="BigBox">';
echo '<tr><td valign="middle" align="center" style="padding: 3px 0px 3px 0px;"><a href="http://protf2.gameme.com/playerinfo/'.$tfplayerdata['id'].'"><img name="TF2 Stats" src="http://forum.specialattack.net/images/icons/tf2.png"/></a></td></tr>';
echo '</table>';
echo '</td></tr>';
echo '<tr><td valign="middle">';
echo '<table height="41" style="position:relative; left:-40px; background: gray url(http://zurb.com/images/alert-overlay.png) repeat-x;" id="BigBox">';
echo '<tr><td style="text-shadow:1px 1px 1px rgba(0,0,0,0.75);padding: 0px 10px 0px 25px;"><b>Rank: </b>'.$tfplayerdata['rank'].'<br><b>Points: </b>'.$tfplayerdata['skill'].'</td></tr>';
echo '</table>';
echo '</td></tr>';
echo '</table>';
}
?>
This is a snip from the template where I modded it (postbit_legacy)
Code:
{vb:raw template_hook.postbit_messagearea_start}
<vb:if condition="$post['title'] OR $show['messageicon']">
<vb:if condition="$post['field5']">{vb:raw statswidget}</vb:if>
<h2 class="title icon">
<vb:if condition="$show['messageicon']"><img src="{vb:raw post.iconpath}" alt="{vb:raw post.icontitle}" /> </vb:if>{vb:raw post.title}
</h2>
</vb:if>
And then this is the plugin: (hook location: global_start)
Code:
ob_start();
require_once('/home/protf2/public_html/stat_widget.php');
$statswidget = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('postbit_legacy',array('statswidget' => $statswidget));
I used this to create the plugin
http://www.vbulletin.com/forum/showt...P-or-HTML-File