Anexxion
04-14-2008, 10:03 PM
What I am making is a CS:Source player ranking page for my CS server.
preview: http://psiclocybin.clanservers.com/
its only two columns, i want to add two more, but thats easy, here is how i approached it.
what I do not get is why it isnt displaying xx2.php in the desired columns..
heres the tut i used: http://css-iceworld.com/howtos/sitestats.php
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>«PSiLOCYBiN GAMiNG RANK»</title>
<style type="text/css">
body {
background-color:#000000
}
<!--
.style6 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; font-weight: bold; color: #999999; }
-->
table {vertical-align:middle}
</style>
</head>
<body>
<table width="900" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><span class="style6">Player</span></div></td>
<td><span class="style6">K/D</span></div></td>
</tr>
<? include("xx2.php"); ?>
<tr>
<td><span class="style6">test</span></div></td>
<td><span class="style6">test</span></div></td>
</tr>
<? include("xx1.php"); ?>
</table>
</body>
</html>
xx1.php
<?php
//How many rows of results would you like? (ex. if you're looking for the Top10, enter //10 here.
$limitresults=200;
//How many characters long would you like each string (players name), before its //replaced with "...".
$trunication=40;
//Location of your mani_ranks.txt file. It can be a URL or a direct link to the file (i.e. //http://server.com/mani_ranks.txt or data/mani_ranks.txt
$manirankslocation="ftp://xxxx:xxxx@208.167.247.221/css/208.167.247.221:27015/cstrike/cfg/mani_admin_plugin/data/mani_ranks.txt";
//These are color codes used to alternate background colors between results.
$bgcolor1="333333";
$bgcolor2="e91f7a";
//DO NOT CHANGE (opens the mani_ranks.txt file)
$handle = fopen($manirankslocation, "r");
//DO NOT CHANGE
function trunicate ($string, $max = 50, $rep = '') {
$leave = $max - strlen ($rep);
return substr_replace($string, $rep, $leave);
}
$row = 0;
//DO NOT CHANGE
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
$row_color = ($row % 2) ? $bgcolor2 : $bgcolor1;
if($row < $limitresults){
if(strlen($data[64]) > $trunication){
//Change the HTML Code between the ""'s to what you need it to be
echo "<tr><b><td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . trunicate($data[64], $trunication,'...') . "</font></b></td>";
echo "<td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . $data[7] . ":" . $data[5] . "</font></b></td></b></tr>";
}else{
echo "<tr><td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . $data[64] . "</font></b></td>";
echo "<td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . $data[7] . ":" . $data[5] . "</font></b></td></b></tr>";
}
}
$row++;
}
fclose($handle);
?>
xx2.php
<?php
//How many rows of results would you like? (ex. if you're looking for the Top10, enter //10 here.
$limitresults=200;
//How many characters long would you like each string (players name), before its //replaced with "...".
$trunication=40;
//Location of your mani_ranks.txt file. It can be a URL or a direct link to the file (i.e. //http://server.com/mani_ranks.txt or data/mani_ranks.txt
$manirankslocation="ftp://xxxx:xxxx@208.167.247.221/css/208.167.247.221:27015/cstrike/cfg/mani_admin_plugin/data/mani_ranks.txt";
//These are color codes used to alternate background colors between results.
$bgcolor1="333333";
$bgcolor2="e91f7a";
//DO NOT CHANGE (opens the mani_ranks.txt file)
$handle = fopen($manirankslocation, "r");
//DO NOT CHANGE
function trunicate ($string, $max = 50, $rep = '') {
$leave = $max - strlen ($rep);
return substr_replace($string, $rep, $leave);
}
$row = 0;
//DO NOT CHANGE
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
$row_color = ($row % 2) ? $bgcolor2 : $bgcolor1;
if($row < $limitresults){
if(strlen($data[64]) > $trunication){
//Change the HTML Code between the ""'s to what you need it to be
echo "<tr><b><td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . trunicate($data[64], $trunication,'...') . "</font></b></td>";
echo "<td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . $data[7] . ":" . $data[5] . "</font></b></td></b></tr>";
}else{
echo "<tr><td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . $data[64] . "</font></b></td>";
echo "<td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . $data[7] . ":" . $data[5] . "</font></b></td></b></tr>";
}
}
$row++;
}
fclose($handle);
?>
preview: http://psiclocybin.clanservers.com/
its only two columns, i want to add two more, but thats easy, here is how i approached it.
what I do not get is why it isnt displaying xx2.php in the desired columns..
heres the tut i used: http://css-iceworld.com/howtos/sitestats.php
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>«PSiLOCYBiN GAMiNG RANK»</title>
<style type="text/css">
body {
background-color:#000000
}
<!--
.style6 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; font-weight: bold; color: #999999; }
-->
table {vertical-align:middle}
</style>
</head>
<body>
<table width="900" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><span class="style6">Player</span></div></td>
<td><span class="style6">K/D</span></div></td>
</tr>
<? include("xx2.php"); ?>
<tr>
<td><span class="style6">test</span></div></td>
<td><span class="style6">test</span></div></td>
</tr>
<? include("xx1.php"); ?>
</table>
</body>
</html>
xx1.php
<?php
//How many rows of results would you like? (ex. if you're looking for the Top10, enter //10 here.
$limitresults=200;
//How many characters long would you like each string (players name), before its //replaced with "...".
$trunication=40;
//Location of your mani_ranks.txt file. It can be a URL or a direct link to the file (i.e. //http://server.com/mani_ranks.txt or data/mani_ranks.txt
$manirankslocation="ftp://xxxx:xxxx@208.167.247.221/css/208.167.247.221:27015/cstrike/cfg/mani_admin_plugin/data/mani_ranks.txt";
//These are color codes used to alternate background colors between results.
$bgcolor1="333333";
$bgcolor2="e91f7a";
//DO NOT CHANGE (opens the mani_ranks.txt file)
$handle = fopen($manirankslocation, "r");
//DO NOT CHANGE
function trunicate ($string, $max = 50, $rep = '') {
$leave = $max - strlen ($rep);
return substr_replace($string, $rep, $leave);
}
$row = 0;
//DO NOT CHANGE
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
$row_color = ($row % 2) ? $bgcolor2 : $bgcolor1;
if($row < $limitresults){
if(strlen($data[64]) > $trunication){
//Change the HTML Code between the ""'s to what you need it to be
echo "<tr><b><td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . trunicate($data[64], $trunication,'...') . "</font></b></td>";
echo "<td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . $data[7] . ":" . $data[5] . "</font></b></td></b></tr>";
}else{
echo "<tr><td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . $data[64] . "</font></b></td>";
echo "<td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . $data[7] . ":" . $data[5] . "</font></b></td></b></tr>";
}
}
$row++;
}
fclose($handle);
?>
xx2.php
<?php
//How many rows of results would you like? (ex. if you're looking for the Top10, enter //10 here.
$limitresults=200;
//How many characters long would you like each string (players name), before its //replaced with "...".
$trunication=40;
//Location of your mani_ranks.txt file. It can be a URL or a direct link to the file (i.e. //http://server.com/mani_ranks.txt or data/mani_ranks.txt
$manirankslocation="ftp://xxxx:xxxx@208.167.247.221/css/208.167.247.221:27015/cstrike/cfg/mani_admin_plugin/data/mani_ranks.txt";
//These are color codes used to alternate background colors between results.
$bgcolor1="333333";
$bgcolor2="e91f7a";
//DO NOT CHANGE (opens the mani_ranks.txt file)
$handle = fopen($manirankslocation, "r");
//DO NOT CHANGE
function trunicate ($string, $max = 50, $rep = '') {
$leave = $max - strlen ($rep);
return substr_replace($string, $rep, $leave);
}
$row = 0;
//DO NOT CHANGE
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
$row_color = ($row % 2) ? $bgcolor2 : $bgcolor1;
if($row < $limitresults){
if(strlen($data[64]) > $trunication){
//Change the HTML Code between the ""'s to what you need it to be
echo "<tr><b><td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . trunicate($data[64], $trunication,'...') . "</font></b></td>";
echo "<td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . $data[7] . ":" . $data[5] . "</font></b></td></b></tr>";
}else{
echo "<tr><td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . $data[64] . "</font></b></td>";
echo "<td bgcolor='$row_color'><b><font face=Verdana, Arial, Helvetica, sans-serif font size=-6>" . $data[7] . ":" . $data[5] . "</font></b></td></b></tr>";
}
}
$row++;
}
fclose($handle);
?>