Ok Basically... I Made this Plugin to Read outta MYSQL data to post on the main site forums.php
$database = mysql_connect ('localhost','ihpk_xx' ,'xxxx');
mysql_select_db ('ihpk_ihpk', $database );
$SelectString = "SELECT * FROM pklog ORDER by id DESC";
$pkliste_result = mysql_query($SelectString);
$pkliste = mysql_fetch_array ( $pkliste_result);
$groupidfetch_result = mysql_query(sprintf("SELECT * FROM user WHERE username = '%s'", $pkliste['killer']));
$groupidfetch = mysql_fetch_array ( $groupidfetch_result );
$UserGroupID = $groupidfetch['usergroupid'];
$tagfetch_result = mysql_query("SELECT * FROM usergroup WHERE usergroupid = ".$UserGroupID);
$tagfetch = mysql_fetch_array( $tagfetch_result);
$killer = $tagfetch['opentag']. $pkliste['killer'] . "</b></font>";
$lastpk="<a href=pklog.php><center><font color=red><b><u>Our Last Victim</b></u></center></font></a><br>".$pkliste['o_name']. " a Level ".$pkliste['o_level']." ". $pkliste['o_typ'] ." was slain by <a href=pklog.php?viewname=".$pkliste['killer'].">".$killer."</a> on <a href=pklog.php?realm=" . $pkliste['realm'] . ">".$pkliste['realm']. "</a> at <a href=pklog.php?sort=time>". $pkliste['zeit'] . "</a>";
Now if my memory serves me right..
This is the Template / Plugin i've made for my clan's TopList
-
*/
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'Toplist');
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
require_once(DIR . '/includes/functions_misc.php');
require_once(DIR . '/includes/class_postbit.php');
include(DIR . '/includes/config.php');
// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################
// build navbar
$navbits = array('' => $vbphrase['Toplist']);
$templatename = 'Toplist';
// Connecting to MYSQL Database
$database = mysql_connect ( $config['MasterServer']['servername'] ,$config['MasterServer']['username'] ,$config['MasterServer']['password']);
mysql_select_db ( $config['Database']['dbname'], $database );
function GetTotalPKs($forumname) {
$pkliste_result = mysql_query("SELECT * FROM pklog WHERE killer='$forumname'");
$i=0;
while ( $pkliste = mysql_fetch_array ( $pkliste_result) )
$i=$i + 1;
return $i;
}
function GetTotalScore($forumname) {
$pkliste_result = mysql_query("SELECT * FROM pklog WHERE killer='$forumname'");
$i=0;
while ( $pkliste = mysql_fetch_array ( $pkliste_result) )
$i = $i + $pkliste[o_level] * 6;
return $i;
}
$SelectString = 'SELECT SUM(o_level) AS Summe, SUM(Points) AS points, killer FROM pklog GROUP BY killer ORDER BY Summe DESC';
$SelectString ='SELECT SUM( o_level ) AS Summe, SUM( Points ) AS Points,
MAX( o_level ) AS high, zeit AS time1, killer FROM pklog GROUP BY killer ORDER BY Summe DESC';
$pklog_result = mysql_query($SelectString);
// Building Table
$toplist = '<table class="tborder" border="0" width="100%" align="center">
<tr align="center">
<td class="thead">#</td>
<td class="thead">Name</td>
<td class="thead">Score</td>
<td class="thead">PK Points</td>
<td class="thead">Total PKs</td>
<td class="thead">Average PK Level</td>
<td class="thead">Highest PK</td>
<td class="thead">Latest PK</td>
</tr>';
while ( $pkliste = mysql_fetch_array ( $pklog_result ) ) {
if($pkliste['killer'][0]!='*') {
$i++;
$score = GetTotalScore($pkliste['killer']);
$kills = GetTotalPKs($pkliste['killer']);
$average = round(($score/6)/$kills,2);
$points = $pkliste[Points];
$killer = GetMemberTagByName($pkliste['killer']) . $pkliste['killer'] ."</font>";
$high = $pkliste[high];
// $timeago = TimeAgo(strtotime($pkliste['time1']));
$timeago = $pkliste['time1'];
$toplist = $toplist . '<tr>
<td align="center" class="alt1" NOWRAP>'.$i.'</td>
<td align="center" class="alt1" NOWRAP><a href=pklog.php?viewname='.$pkliste['killer'].'>'.$killer.'</a></td>
<td align="center" class="alt1" NOWRAP>'.$score.'</td>
<td align="center" class="alt1" NOWRAP>'.$points.'</td>
<td align="center" class="alt1" NOWRAP>'.$kills.'</td>
<td align="center" class="alt1" NOWRAP>'.$average.' </td>
<td align="center" class="alt1" NOWRAP>'.$high.' </td>
<td align="center" class="alt1" NOWRAP>'.$timeago.' </td>
</tr>';
}
}
$toplist = $toplist. "</table>";
if ($templatename != '')
{
$navbits[''] = 'Toplist';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template($templatename) . '");');
}
?>
What i wanna do is in the Postbit templates or posts
I'd Like a Box Like this to show up.
If anyone has any pointers let me know please.