Salut,
Cred ca stiti cu toti versiunea veche a scriptului player info (player.php) care va ofera cateva informatii despre caracterul respectiv. Ei bine, m-am gandit sa il imbunatatesc, uitati ce a iesit:
Poza
Instalare:
1. Intrati in fisierul ranking.php(cel in care aveti scriptul clasamentului) cautati
2. Creati un fisier numit player.php in care bagati acest script
3. Creati un fisier numit config.php in care adaugati
Cred ca stiti cu toti versiunea veche a scriptului player info (player.php) care va ofera cateva informatii despre caracterul respectiv. Ei bine, m-am gandit sa il imbunatatesc, uitati ce a iesit:
Poza
Instalare:
1. Intrati in fisierul ranking.php(cel in care aveti scriptul clasamentului) cautati
- Cod:
<td>".$getPlayers->name."</td>
sau
<td>" . $array["name"] . "</td>
- Cod:
<td><a href="index.php?s=player&char=".$getPlayers->name."">".$getPlayers->name."</td>
sau
<td><a href="index.php?s=player&char=" . $array["name"] . "">" . $array["name"] . "</td>
2. Creati un fisier numit player.php in care bagati acest script
- Cod:
<?php
session_start();
$char = $_GET['char'];
include 'config.php';
$db = "player";
mysql_connect($dbhost, $dbuser, $dbpw) OR
die("EROARE: Nu ma pot conecta la Baza de Data. ".mysql_error());
mysql_select_db($db) OR
die("EROARE: Aceasta baza de date ruleaza deja. ".mysql_error());
$sql = "SELECT * FROM player WHERE name LIKE '$char'";
$ergebnis = mysql_query($sql);
$row = mysql_fetch_object($ergebnis);
$nivel = $row->level;
$skillgroup = $row->skill_group;
$clasa = $row->job;
$timp_online = $row->playtime;
$atashi = $row->last_play;
$puncte_rang = $row->alignment;
$experienta = $row->exp;
$hp = $row->hp;
$mp = $row->mp;
$levelstep = $row->level_step;
$name = $row->name;
$nivel_cal = $row->horse_level;
$part_main = $row->part_main;
$yang = $row->gold;
$putere = $row->st;
$viata = $row->ht;
$dexteritate = $row->dx;
$mana = $row->iq;
# Copyright by Atashi. All rights reserved.
echo "
<p align="center">Informaþii despre caracterul <u>". $name."</u></p>
<table width='240'>
<tr>
<td class="topLine" width="50%"> • Nume caracter :</td><td class="tdunkel"> <font color="yellow" title="VIT: ". $viata ." | INT: ". $mana ." | STR: ". $putere ." | DEX: ". $dexteritate ."">". $name."</font></td>
</tr>
<tr>
<td class="tdunkel" width="50%"> • Nivel caracter :</td><td class="topLine"> ". $nivel."
</td>
</tr>
<tr>
<td class="topLine" width="50%"> • Viatã / Mana :</td><td class="tdunkel"> <font color="orange" title="Vitalitatea actualã a caracterului ". $name ."">". $hp."</font> / <font color="skyblue" title="Mana actualã a caracterului ". $name ."">". $mp ."</font>
";
echo "</td>
</tr>
<tr>
<td class="tdunkel" width="50%"> • Rang :</td><td class="topLine" title="". $puncte_rang ." puncte.">
";
#Modificarea acestui script poate duce la deteriorarea sa.
#Rang script avansat.
if($puncte_rang > "15000" or $puncte_rang == "20000")
{
echo "<font color="skyblue">Cavaleresc.</font>";
}
elseif($puncte_rang > "8000" or $puncte_rang == "14999")
{
echo "<font color="0090FF">Nobil.</font>";
}
elseif($puncte_rang > "3000" or $puncte_rang == "7999")
{
echo "<font color="5C6EFF">Bun.</font>";
}
elseif($puncte_rang > "1000" or $puncte_rang == "2999")
{
echo "<font color="9B9BFF">Prietenos.</font>";
}
elseif($puncte_rang > "0" or $puncte_rang == "999")
{
echo "<font color="CCCCC">Neutru.</font>";
}
elseif($puncte_rang > "-999" or $puncte_rang == "-1")
{
echo "<font color="CF7500">Agresiv.</font>";
}
elseif($puncte_rang > "-5999" or $puncte_rang == "-1000")
{
echo "<font color="EB5300">Fãtãrnicie.</font>";
}
elseif($puncte_rang > "-16999" or $puncte_rang == "-6000")
{
echo "<font color="E30000">Rãutãcios.</font>";
}
elseif($puncte_rang > "-22000" or $puncte_rang == "-17000")
{
echo "<font color="FF0000">Crud.</font>";
}
echo "</td>
</tr>
<tr>
<td class="topLine" width="50%"> • Timp online :</td><td class="tdunkel"> ". $timp_online ." minute.</td>
</tr>
<tr>
<td class="tdunkel" width="50%"> • Ultima datã online :</td><td class="topLine"> ". $atashi ."</td>
</tr>
<tr>
<td class="topLine" width="50%"> • Experienþã acumulatã :</td><td class="tdunkel"> ". $experienta ."</td>
</tr>
<tr>
<td class="tdunkel" width="50%"> • Progres nivel :</td><td class="topLine"> <font color="orange">",$levelstep,"</font>/<font color="red">4</font> sfere.</td>
</tr>
<tr>
<td class="topLine" width="50%"> • Yang deþinut :</td><td class="tdunkel"> ". $yang ."</td>
</tr>
<tr>
<td class="tdunkel" width="50%"> • Nivel cal :</td><td class="topLine"> ",$nivel_cal,"</td>
</tr>
<tr>
<td class="topLine" width="50%"> • Sex :<td class="tdunkel">
";
if($clasa == "0" or $clasa == "2" or $clasa == "5" or $clasa == "7" and $clasa != "0")
{
echo "<img src="img/m.png" width="14" height="14" alt="m" title="Sex masculin."/> Masculin.";
}
else
{
echo "<img src="img/f.gif" width="13" height="13" alt="f" title="Sex feminin."/> Feminin.";
}
echo "</td>
</tr>
<tr>
<td class="tdunkel" width="50%"> • Rasã & Invãtãturã :</td><td class="topLine"> ";
if($clasa == "0" or $clasa == "4")
{
if($skillgroup == "1" and $skillgroup !="0")
{
echo "Rãzboinic corp. ";
}
elseif($skillgroup == "2" and $skillgroup !="0")
{
echo "Rãzboinic mental. ";
}
elseif($skillgroup == "0")
{
echo "<font color="red">Fãrã magie.</font>";
}
}
elseif($clasa == "1" or $clasa == "5")
{
if($skillgroup == "1" and $skillgroup !="0")
{
echo "Ninja lame. ";
}
elseif($skillgroup == "2" and $skillgroup !="0")
{
echo "Ninja arcas. ";
}
elseif($skillgroup == "0")
{
echo "<font color="red">Fãrã magie.</font>";
}
}
elseif($clasa == "2" or $clasa == "6")
{
if($skillgroup == "1" and $skillgroup !="0")
{
echo "Sura arme magice.";
}
elseif($skillgroup == "2" and $skillgroup !="0")
{
echo "Sura magie neagrã.";
}
elseif($skillgroup == "0")
{
echo "<font color="red">Fãrã magie.</font>";
}
}
elseif($clasa == "3" or $clasa == "7")
{
if($skillgroup == "1" and $skillgroup !="0")
{
echo "Saman dragon. ";
}
elseif($skillgroup == "2" and $skillgroup !="0")
{
echo "Saman regenerare.";
}
elseif($skillgroup == "0")
{
echo "<font color="red">Fãrã magie.</font>";
}
}
else
{
echo "";
}
echo "</td>
</tr>
</table>
</td></tr>
</table>
";
?>
3. Creati un fisier numit config.php in care adaugati
- Cod:
<?php
$dbhost = 'IP .100';
$dbuser = 'root';
$dbpw = 'Parola ta';
$serverip = 'IP-ul tau';
?>