Register for your free account! | Forgot your password?

You last visited: Today at 06:06

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[FRAGE]

Discussion on [FRAGE] within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2008
Posts: 280
Received Thanks: 104
[FRAGE]

Ist es möglich in der rangliste die Spiel zeit des Chars abzurufen ?
IKomanderI is offline  
Old 02/15/2010, 08:17   #2
 
hen!'s Avatar
 
elite*gold: 125
Join Date: Apr 2008
Posts: 1,217
Received Thanks: 1,304
Ja ist es. Hab nur grade den Spaltennamen nicht parat. Heißt glaub ich "playtime" musst beim SELECT halt noch playtime hinzufügen und übers PHP die playtime ausgeben.

fetch_object: $variable->playtime
fetch_array: $var['playtime']

Ein wenig PHP-Kenntnisse solltest du haben oder deine Rangliste hier als Code posten.
hen! is offline  
Thanks
1 User
Old 02/15/2010, 08:32   #3
 
elite*gold: 0
Join Date: Dec 2008
Posts: 280
Received Thanks: 104
Hier ist die Rangliste.:
IKomanderI is offline  
Old 02/15/2010, 10:56   #4
 
hen!'s Avatar
 
elite*gold: 125
Join Date: Apr 2008
Posts: 1,217
Received Thanks: 1,304
Code:
<?php
echo "<center><table border=\"0\">
<tr>
<td width=\"40\"><b><center>Rang</center></b></td>
<td width=\"200\"><b><center>Name</center></b></td>
[COLOR="Red"]<td width=\"100\"><b><center>Spielzeit (Min)</center></b></td>[/COLOR]
<td width=\"60\"><b><center>Level</center></b></td>
<td width=\"150\"><b><center>Reich</center></b></td>
</tr>";
include 'dbsettings.php';
$db = "player";
mysql_connect($dbhost, $dbuser, $dbpw) OR
die("ERROR: Connection failed. ".mysql_error());
mysql_select_db($db) OR
die("ERROR: DB allready open. ".mysql_error());
$sql = "SELECT * FROM player WHERE name NOT LIKE '[GM]%' AND name NOT LIKE '[GA]%' AND name NOT LIKE '[SA]%' ORDER BY level desc, exp desc";
$i = "0" ;
$ergebnis = mysql_query($sql);
while($row = mysql_fetch_object($ergebnis))
{
$i = $i + 1 ;
echo "
<tr>
<th width=\"40\"><font color=#000>$i</font></th>
<th width=\"200\"><font color=#000><a name=\"$row->name\"> $row->name[COLOR="Red"]</a>[/COLOR]</font></th>
[COLOR="Red"]<th width=\"100\"><font color=#000>$row->[COLOR="Lime"]playtime[/COLOR]</font></th>[/COLOR]
<th width=\"200\"><font color=#000>$row->level</font></th>";
$sql2 = "SELECT * from player_index where id like $row->account_id";
$ergebnis2 = mysql_query($sql2);
$row2 = mysql_fetch_object($ergebnis2);
if($row2->empire == 1)
{
echo "<th width=\"200\"><img src=\"./images/shinsoo.jpg\"></th></tr>";
}
elseif($row2->empire == 2)
{
echo "<th width=\"200\"><img src=\"./images/chunjo.jpg\"></th></tr>";
}
else
{
echo "<th width=\"200\"><img src=\"./images/jinno.jpg\"></th></tr>";
}
}
echo "</table></center>";
echo "<br>";
?>
Habe dir die Zeilen ergänzt. Da ich nicht zu Hause bin und keine DB hier habe kann ichs nur vermuten. Im Notfall noch mal in die DB gucken unter player->player und dort die spalte suchen. Habe die Stelle grün markiert, die du mit dem Spaltennamen ersetzen musst.
hen! is offline  
Thanks
1 User
Old 02/16/2010, 12:08   #5
 
elite*gold: 0
Join Date: Dec 2008
Posts: 280
Received Thanks: 104
THX Ich versuche es mal..
IKomanderI is offline  
Reply




All times are GMT +1. The time now is 06:07.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.