Register for your free account! | Forgot your password?

You last visited: Today at 22:14

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

Advertisement



[Web]Ranklist SQL Cache PHP

Discussion on [Web]Ranklist SQL Cache PHP within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
TraxWall's Avatar
 
elite*gold: 0
Join Date: Oct 2010
Posts: 178
Received Thanks: 86
Cool [Web]Ranklist SQL Cache PHP

Hey.

I created a test rankings, which stores it in a file.
This is a test that has not been resolved to number them: S

But who knows who also make'd be happy

source:


PHP Code:
<?php
echo "<table border=\"0\" width=\"230\">
    <tr>
    <td width=\"150\"><b>Name</b></td>
    <td width=\"30\"><b>Level</b></td>
    </tr>"
;

?>
<?php
$file 
'rankingsreload_cache.txt';

$rankingsreload86400// 24 hours

if (file_exists($file) &&

    
filemtime($file) > (time() - $rankingsreload)) {

    
$rankingsrecords unserialize(file_get_contents($file));

} else {

    
$link mysql_connect('ip','user','password')

        or die (
mysql_error());

    
mysql_select_db('player')

        or die (
mysql_error());

    
/* form SQL query */

    
$query "SELECT id,name,level,exp,account_id FROM player WHERE name NOT LIKE '[%]%' ORDER BY level desc, exp desc, name asc limit 10";

    
$result mysql_query($query)

        or die (
mysql_error());

    while (
$rankingsrecord mysql_fetch_array($result) ) {

        
$rankingsrecords [] = $rankingsrecord;

    }

    
$OUTPUT serialize($rankingsrecords);

    
$fp fopen($file,"w");

    
fputs($fp$OUTPUT);

    
fclose($fp);

// end else

// Query results are in $rankingsrecords array

foreach ($rankingsrecords as $id=>$row) {

    if (
$row['name'] == $_REQUEST['name']) {
?>
<?php
        
// name selected - print bold
        
print '<B>'.$row['name'].'  '.$row['level'].'</B><br>';

    } else {

        
// other name - print regular
?>

  <tr>
    <th width="187"><?php print $row['name'];?></th>
    <th width="30"><?php print $row['level'];?></th>
</tr>


<?php
}
}
?>
I hope it was helpful
TraxWall is offline  
Old 05/11/2013, 13:01   #2
 
Stαgє6's Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 2,019
Received Thanks: 1,471
Hmm.. this file rankingsreload_cache.txt is missing..
Stαgє6 is offline  
Old 05/11/2013, 13:02   #3
 
-TÜRK-'s Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 328
Received Thanks: 434
I think, there we have lot of hp script with sql cache ranklist...

You can do this job with ob_get_contents also.
-TÜRK- is offline  
Old 05/11/2013, 13:06   #4
 
TraxWall's Avatar
 
elite*gold: 0
Join Date: Oct 2010
Posts: 178
Received Thanks: 86
Quote:
Originally Posted by TheSonny View Post
Hmm.. this file rankingsreload_cache.txt is missing..
You do not need it and I'll run it by itself is made up: D
TraxWall is offline  
Reply


Similar Threads Similar Threads
[Suche]Ranklist Script.
08/13/2012 - Metin2 Private Server - 2 Replies
HEY, I'm looking for a ranklist script that has the same following options with their organization: # Name Empire Experience Level upload it here for me plz :) thank u
METIN2 RanKlist!!!HELP
07/01/2010 - Metin2 Private Server - 0 Replies
ANYBODY WHO KNOWS HOW CAN I MAKE RANKLIST AT MY SITE????? I MAKE REGISTER SITE WITH XAAMP BUT I DON'T KNOW ABOUT RANKLIST... ???? TY :)
[how to]add photo from de char to the ranklist and photo on itemshop
04/25/2010 - Metin2 PServer Guides & Strategies - 5 Replies
for the epvp comunety staff remove my links without say anything and for have no respetc for the people speack only english i have remove all my stuff by epvp
RANKLIST COOL?
11/10/2009 - Metin2 Private Server - 3 Replies
where download this script ranlist? from this website exist exelent ranklist whit banlist flag empire name exp Guild wars
cache.csv
08/06/2008 - Dekaron - 2 Replies
Hey, That could be also my problem. (My Problem!) That comes if I 2Moons closes. How can I repair that? http://img384.imageshack.us/img384/9379/unbenannt rm8.png



All times are GMT +1. The time now is 22:14.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.