jeg har et PHP script som lagger vildt..
her er scriptet..
<!-- Made by Katten, Modified by 4220niller -->
<style>
A.link2 {
color : #004294;
visibility : visible;
font-weight : bold;
font-family: Verdana, Arial, Times New Roman;
text-decoration : none;
font-size: 9pt;
}
A.link2:hover {
text-decoration : underline;
font-weight : bold;
color : #0063DC;
visibility : visible;
}
A.link {
color : #004294;
visibility : visible;
font-weight : bold;
font-family: Verdana, Arial, Times New Roman;
text-decoration : none;
font-size: 8pt;
}
A.link:hover {
text-decoration : underline;
font-weight : bold;
color : #0063DC;
visibility : visible;
}
A.link3 {
color : #004294;
visibility : visible;
font-weight : bold;
font-family: Verdana, Arial, Times New Roman;
text-decoration : none;
font-size: 7pt;
}
A.link3:hover {
text-decoration : underline;
font-weight : bold;
color : #0063DC;
visibility : visible;
}
.i
{
background-color: #F1E0C6;
}
.alt
{
background-color: #D4C0A1;
}
.whites {
color: #EFEFEF;
background-color: #505050;
visibility: visible;
font-weight: bold;
font-size: 9pt;
height: 22px;
font-family: Verdana, Arial, Times New Roman;
}
.hw {
visibility: visible;
height: 24px;
}
.whites2 {
color: #FFFFFF;
background-color: #505050;
font-family: Verdana, Arial, Times New Roman;
visibility: visible;
font-weight: bold;
height: 18px;
width: 70px;
font-size: 7pt;
}
font.fonti {
font-family: Verdana, Arial, Times New Roman;
visibility: visible;
margin-left: 5px;
}
</style>
<?php
include("config.php");
$showskill = "";
if(isset($_GET['skill'])) {
$showskill = $_GET['skill'];
}
if($showskill == "") $showskill = "level";
$searched = "";
switch($showskill)
{
case "level":
$searched = "level=\\"";
break;
case "magic":
$searched = "maglevel=\\"";
break;
case "fist":
$searched = "<skill skillid=\\"0\\" level=\\"";
break;
case "club":
$searched = "<skill skillid=\\"1\\" level=\\"";
break;
case "sword":
$searched = "<skill skillid=\\"2\\" level=\\"";
break;
case "axe":
$searched = "<skill skillid=\\"3\\" level=\\"";
break;
case "distance":
$searched = "<skill skillid=\\"4\\" level=\\"";
break;
case "shield":
$searched = "<skill skillid=\\"5\\" level=\\"";
break;
case "fishing":
$searched = "<skill skillid=\\"6\\" level=\\"";
break;
}
$players = $folderplayer;
$page = $_GET["page"];
$next_page = $page+1;
if(isset($page)){
$load_1 = $page * $players_shown;
$load_2 = $page * $players_shown+$players_shown;
} else {
if ($page >= 1){
$load_1 = $players_shown*$page;
$load_2 = $load_1*2;
}else{
$load_1 = 0;
$load_2 = $players_shown;
}
}
if ($page >= 1){
$i = $players_shown*$page;
$i2_number = 0;
}else{
$i = 0;
$i2_number = 0;
}
$x = array();
$dir = dir($players);
while($plik = $dir->read())
{
if(eregi("\\.xml$",$plik))
{
$file = file($players."/".$plik);
$plik = explode(".",$plik);
}
for($i2 = $i2_number; $file["$i2"]; $i2++)
{
if(strstr($file[$i2], "access=\\"5\\"")) break;
if(strstr($file[$i2], "access=\\"4\\"")) break;
if(strstr($file[$i2], "access=\\"3\\"")) break;
if(strstr($file[$i2], "access=\\"2\\"")) break;
if(strstr($file[$i2], "access=\\"1\\"")) break;
$result = strstr($file[$i2], $searched);
if($result)
{
$resultarray = explode("\\"",$result);
if($showskill == "level" || $showskill == "magic")
{
$exp = strstr($file[$i2], "exp=");
$temp = explode('"', $exp);
$exp = $temp[1];
if($x[$i] = $resultarray[1]."---".$plik[0])
break;
}
else if ($showskill == "fist" || $showskill == "club" || $showskill == "sword" || $showskill == "axe" || $showskill == "distance" || $showskill == "shield" || $showskill == "fish")
{
if($x[$i] = $resultarray[3]."---".$plik[0])
break;
}
}
}
$i++;
}
if($showskill == "level" || $showskill == "magic" || $showskill == "club" || $showskill == "sword"
|| $showskill == "axe" || $showskill == "distance" || $showskill == "shield")
{
if(isset($showskill)){
$skill = "&skill=$showskill";
} else {
$skill = "";
}
echo "<table align='center' width='700'><tr><td align='center'>";
echo "<table align='right'><tr><td class='whites2' align='center'>Chose a skill</td></tr><tr bgcolor='F1E0C6'><td>";
if ($showskill != "level" || !isset($showskill)){
echo "<a href='?show=high&skill=level' class='link' target='_self'>Level</a><br/>";
}
if ($showskill != "magic"){
echo "<a href='?show=high&skill=magic' class='link' target='_self'>Magic</a><br/>";
}
if ($showskill != "shield"){
echo "<a href='?show=high&skill=shield' class='link' target='_self'>Shielding</a><br/>";
}
if ($showskill != "distance"){
echo "<a href='?show=high&skill=distance' class='link' target='_self'>Distance</a><br/>";
}
if ($showskill != "sword"){
echo "<a href='?show=high&skill=sword' class='link' target='_self'>Sword</a><br/>";
}
if ($showskill != "club"){
echo "<a href='?show=high&skill=club' class='link' target='_self'>Club</a><br/>";
}
if ($showskill != "axe"){
echo "<a href='?show=high&skill=axe' class='link' target='_self'>Axe</a><br/>";
}
if ($showskill != "fist"){
echo "<a href='?show=high&skill=fist' class='link' target='_self'>Fist</a><br/>";
}
if ($showskill != "fishing"){
echo "<a href='?show=high&skill=fishing' class='link' target='_self'>Fishing</a><br/>";
}
$rank1 = $players_shown*$page+1+$players_shown;
$rank2 = $rank1 + $players_shown-1;
$rank = $rank1."-".$rank2;
//echo "<a href='?page=$next_page$skill' class='link'>Next page </a>";
if($page >= 1){
$pre_page = $next_page-2;
$rankp1 = $rank - $players_shown - $players_shown;
$rankp2 = $rankp1 + $players_shown-1;
$rankp = $rankp1."-".$rankp2;
//echo "<br /><a href='?page=$pre_page$skill' class='link'> Previus page</a>";
}
echo "</table>";
?>
<body background="paper_body.jpg">
<?
echo "<table width='470'>";
if ($page >= 1){
echo "<tr>
<td align='right'>";
echo "
<a href='?page=$pre_page$skill' class='link3'>Rank ".$rankp."</a>
<font color='#603000' style='font-family: Verdana, Arial, Times New Roman;'>|</font>
<a href='?page=$next_page$skill' class='link3'>Rank ".$rank."</a></td>
</tr>";
}else{
echo "<tr>
<td align='right'>";
echo "
<a href='?page=$next_page$skill' class='link3'>Rank ".$rank."</a></td>
</tr>";
}
echo "</table>";
echo "<table cellspacing='1' align='left'>";
//echo "</table><table cellspacing='1' align='left'>";
echo '<tr>
<td class="whites"><font class="fonti">Rank</font></td>
<td class="whites"><font class="fonti">Name</font></td>
<td class="whites"><font class="fonti">Level</font></td>';
if ($showskill == "level" || !isset($showskill)){
echo "<td class=\\"whites\\"><font class=\\"fonti\\">Points</font></td>";
}
echo "</tr>";
$i2 = 1;
SORT($x, 1);
$alt_row = 1;
if ($page > 0){
$shown = $players_shown*$page;
while($i >= $load_1 && $i2 <= $load_2)
{
$result = explode("---", "$x[$i]");
$result[1] = ucwords($result[1]);
if ($alt_row == 0)
{
$alt = ' class="i"';
$alt_row = 1;
}
else
{
$alt = ' class="alt"';
$alt_row = 0;
}
if($result[0] != "" && $result[1] != "") {
if ($i2 > $shown){
echo "<tr".$alt.">
<td width=55 class='hw'><font class='fonti' style='font-size: 12px; color: #603000; margin-left: 5px;'>$i2</font></td>
<td width=300 class='hw'><a href='character.php?char=$result[1]' class='link2' style=' margin-left: 5px;'>$result[1]</a></td>
<td width=80 class='hw'><font class='fonti' style='font-size: 12px; color: #603000; margin-left: 5px;'>$result[0]</font></td>";
if ($showskill == "level" || !isset($showskill)){
echo "<td width='100' class='hw'><font class='fonti' style='font-size: 12px; color: #603000; margin-left: 5px;'>".$exp."</font></td>";
}
}
echo "</tr>";
$i2++;
}
$i--;
}
}else{
while($i >= $load_1 && $i2 <= $load_2)
{
$result = explode("---", "$x[$i]");
$result[1] = ucwords($result[1]);
if ($alt_row == 0)
{
$alt = ' class="i"';
$alt_row = 1;
}
else
{
$alt = ' class="alt"';
$alt_row = 0;
}
if($result[0] != "" && $result[1] != "") {
echo "<tr".$alt.">
<td width=55 class='hw'><font class='fonti' style='font-size: 12px; color: #603000; margin-left: 5px;'>$i2</font></td>
<td width=300 class='hw'><a href='character.php?char=$result[1]' class='link2' style=' margin-left: 5px;'>$result[1]</a></td>
<td width=80 class='hw'><font class='fonti' style='font-size: 12px; color: #603000; margin-left: 5px;'>$result[0]</font></td>";
if ($showskill == "level" || !isset($showskill)){
echo "<td width='100' class='hw'><font class='fonti' style='font-size: 12px; color: #603000; margin-left: 5px;'>".$exp."</font></td>";
}
echo "</tr>";
$i2++;
}
$i--;
}
}
echo "</table></td></tr></table>";
}
?>
<title>Highscores!</title>
</center></font>