can you give me a ranking page

Status
Not open for further replies.
im tired because it`s error if i will get it to cms

i need only a stand alone ranking page with the blank background
 
ok fine,

first make a rankings.php and write this

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<?php 
require ('functions/config.php');
require ('functions/functions.php');

$rs = mysql_connect($dbhost, $dbuser, $dbpasswd) or die('Could not establish database connection.');
mysql_select_db($dbname,$rs) or die(mysql_error()); 

?>
<center><h3> Top 50 Players</h3></center>
<?PHP
$sql = "SELECT
                c.level as level,
                c.char_name as char_name,
                c.zuly as zuly,
                c.classid as classid
                FROM
                characters as c
              LEFT JOIN
                accounts as a
              ON
                (c.account_name = a.username)
              WHERE
                a.accesslevel < 150
              ORDER BY
                c.level
              DESC
              LIMIT 0,50
              ";
$result = @mysql_query($sql) or die(mysql_error());


echo "<table border='0'>";
echo "<tr><th width=1>Level </th> <th width=40%>Character</th> <th width=30%>Zuly</th> <th width=15%>Job</th> </tr>";

while($row = mysql_fetch_array( $result )) {
    echo "<tr><td bgcolor=''>"; 
    echo $row['level'];
    echo "</td><td bgcolor=''>"; 
    echo $row['char_name'];
    echo "</td><td bgcolor=''>"; 
    echo $row['zuly'];
echo "</td><td bgcolor=''>";
    include ('functions/class.php');
    echo "</td></tr>"; 
} 
                echo "</table>";                
    ?>

2nd make a folder then name it functions
3rd make a class.php in functions folder then write this code


Code:
<?php
// Credits to -=sIN and sevy for teh script 
if ($row['classid']=="0")
echo "Visitor";
if ($row['classid']=="111")
echo "Soldier";
if ($row['classid']=="121")
echo "Knight";
if ($row['classid']=="122")
echo "Champion";
if ($row['classid']=="211")
echo "Muse";
if ($row['classid']=="221")
echo "Mage";
if ($row['classid']=="222")
echo "Cleric";
if($row['classid']=="311")
echo "Hawker";
if($row['classid']=="321")
echo "Raider";
if($row['classid']=="322")
echo "Scout";
if($row['classid']=="411")
echo "Dealer";
if($row['classid']=="421")
echo "Bourgeois";
if($row['classid']=="422")
echo "Artisan";
?>

4th Make Config.php in functions folder and write these code

Code:
<?php

/* Database Configuration */

$dbhost = 'localhost'; // Database host
$dbname = '[B]replace this with your database name[/B]'; // Database name
$dbuser = '[B]replace this with your [/B][B] Database User (default: root)[/B]'; // Database user
$dbpasswd = '[B]replace this with your [/B][B] Database User (default: root)[/B]'; // Database pass

5th Make functions.php in functions folder and write these code
(i know its not a part of ranking, but write these for the error. you may try to not add this and erase the require ('functions/functions.php'); in rankings.php)


Code:
<?PHP
function LoginStatus($s_ip) {
    $result = @fsockopen($s_ip, '29000', $ERRNO, $ERRSTR, .02);
    if(!$result) { return FALSE; } 
    else { return TRUE; }
}
function WorldStatus($s_ip) {
    $result = @fsockopen($s_ip, '29200', $ERRNO, $ERRSTR, .02);
    if(!$result) { return FALSE; } 
    else { return TRUE; }
}
function CharStatus($s_ip) {
    $result = @fsockopen($s_ip, '29100', $ERRNO, $ERRSTR, .02);
    if(!$result) { return FALSE; } 
    else { return TRUE; }
}    
function onlineTotal() {
$check = mysql_query("SELECT online FROM accounts WHERE online = '1'");
$total = mysql_num_rows($check);
echo $total;
}

function accTotal() {
$check = mysql_query("SELECT id FROM accounts");
$total = mysql_num_rows($check);
echo $total;
}
function charTotal() {
$check = mysql_query("SELECT id FROM characters");
$total = mysql_num_rows($check);
echo $total;
}
function gmTotal() {
$check = mysql_query("SELECT accesslevel FROM accounts WHERE accesslevel = '300'");
$total = mysql_num_rows($check);
echo $total;
}

function clanTotal() {
$check = mysql_query("SELECT id FROM list_clan");
$total = mysql_num_rows($check);
echo $total;
}    
function totalMale() {
$result = mysql_query("SELECT sex FROM characters WHERE sex = '0'");
$rows = mysql_num_rows($result);
echo $rows ;
}

function totalVisitors() {
$result = mysql_query("SELECT sex FROM characters WHERE classid = '0'");
$rows = mysql_num_rows($result);
echo $rows ;
}

function totalMuse() {
$result = mysql_query("SELECT sex FROM characters WHERE classid = '211'");
$rows = mysql_num_rows($result);
echo $rows ;
}

function totalMage() {
$result = mysql_query("SELECT sex FROM characters WHERE classid = '222'");
$rows = mysql_num_rows($result);
echo $rows ;
}

function totalCleric() {
$result = mysql_query("SELECT sex FROM characters WHERE classid = '221'");
$rows = mysql_num_rows($result);
echo $rows ;
}

function totalVisitor() {
$result = mysql_query("SELECT sex FROM characters WHERE classid = '0'");
$rows = mysql_num_rows($result);
echo $rows ;
}

function totalSoldier() {
$result = mysql_query("SELECT sex FROM characters WHERE classid = '111'");
$rows = mysql_num_rows($result);
echo $rows ;
}

function totalHawker() {
$result = mysql_query("SELECT sex FROM characters WHERE classid = '311'");
$rows = mysql_num_rows($result);
echo $rows ;
}

function totalDealer() {
$result = mysql_query("SELECT sex FROM characters WHERE classid = '411'");
$rows = mysql_num_rows($result);
echo $rows ;
}

function totalKnight() {
$result = mysql_query("SELECT sex FROM characters WHERE classid = '121'");
$rows = mysql_num_rows($result);
echo $rows ;
}

function totalChampion() {
$result = mysql_query("SELECT sex FROM characters WHERE classid = '122'");
$rows = mysql_num_rows($result);
echo $rows ;
}

function totalRaider() {
$result = mysql_query("SELECT sex FROM characters WHERE classid = '321'");
$rows = mysql_num_rows($result);
echo $rows ;
}

function totalScout() {
$result = mysql_query("SELECT sex FROM characters WHERE classid = '322'");
$rows = mysql_num_rows($result);
echo $rows ;
}

function totalArtisan() {
$result = mysql_query("SELECT sex FROM characters WHERE classid = '422'");
$rows = mysql_num_rows($result);
echo $rows ;
}

function totalBourgeois() {
$result = mysql_query("SELECT sex FROM characters WHERE classid = '421'");
$rows = mysql_num_rows($result);
echo $rows ;
}

function totalFemale() {
$result = mysql_query("SELECT sex FROM characters WHERE sex = '1'");
$rows = mysql_num_rows($result);
echo $rows ;
}



$interval     = time()+120;


error_reporting(0); //without this you will se an error if the server is down.


if($_COOKIE["checked"] != "true")
{
$log = fsockopen($host, $log_port, $errno, $errstr, 1);
$char = fsockopen($host, $char_port, $errno, $errstr, 1);
$world = fsockopen($host, $world_port, $errno, $errstr, 1);

if(!$log){ $log_status = $offline; setcookie("log_status", "offline", $interval); } else { $log_status = $online; }
if(!$char){ $char_status = $offline; setcookie("char_status", "offline", $interval); } else { $char_status = $online; }
if(!$world){ $world_status = $offline; setcookie("world_status", "offline", $interval); } else { $world_status = $online; }

setcookie("checked", "true", $interval);
}
else
if($_COOKIE["checked"] == "true")
{
if($_COOKIE["log_status"] == "offline"){ $log_status = $offline; } else { $log_status = $online; }
if($_COOKIE["char_status"] == "offline"){ $char_status = $offline; } else { $char_status = $online; }
if($_COOKIE["world_status"] == "offline"){ $world_status = $offline; } else { $world_status = $online; }
}


these codes is on Dynasty CMS,
 
hehehe c`uz i made a registration but it`s always error

im trying to get to the dynasty cms but it`s error hehehe

i don`t know what should i do????
 
it`s finish hehehe hayyzzzz^^

can you closed this tread and some of the tread that i post the i nedd simple registration the i need user panell and this thankz
 
Status
Not open for further replies.
Back