Thread: [PI] mySQL

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 [PI] mySQL 
    Registered Member
    Join Date
    Jun 2012
    Posts
    78
    Thanks given
    0
    Thanks received
    4
    Rep Power
    12
    Followed this guide:
    http://www.rune-server.org/runescape...a-website.html

    Problem, no ones showing up on highscores.









    server side:
    *except this*






    Logout in Client.jaba
    Code:
    public void logout() {
    		synchronized (this) {
    			if(System.currentTimeMillis() - logoutDelay > 10000) {
    				outStream.createFrame(109);
    				properLogout = true;
    				if(playerRights == 0 || playerRights == 4 || playerRights == 5){
    				SQL.createConnection();
    				SQL.saveHighScores(this);
    				SQL.destroyConnection();
    				}
    			} else {
    				sendMessage("Please wait 10 seconds to be logged out, since you were in combat.");
    			}
    		}
    	}
    Reply With Quote  
     

  2. #2  
    Registered Member
    Dogreen's Avatar
    Join Date
    Jan 2014
    Posts
    600
    Thanks given
    55
    Thanks received
    142
    Rep Power
    105
    The database and server sided is working fine, as you can see it saves servers' accounts on the database. It's something on your Highscores.php file
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jun 2012
    Posts
    78
    Thanks given
    0
    Thanks received
    4
    Rep Power
    12
    Quote Originally Posted by Amazing View Post
    The database and server sided is working fine, as you can see it saves servers' accounts on the database. It's something on your Highscores.php file
    [SPOIL]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <?php
    include("mysql.php");
    include("functions.php");
    ?>
    <head>
    <link rel="icon" type="image/vnd.microsoft.icon" href="https://www.runescape.com/favicon.ico">
    <title>RuneTrocity HighScores</title>
    <style type="text/css">/*\*/@import url(RS_Styles.css);/**/</style>
    <script type="text/javascript" src="http://www.jagex.com/js/jquery/jquery_1_3_2.js"></script>
    </head>
    <body id="navcommunity" class="bodyBackground">
    <div id="scroll">
    <div id="head"><div id="headBg">
    <div class="navigation">
    <div class="location">
    <b>Location: </b> <a href="FORUMSLINK">Forums</a> &gt;
    Hiscores
    </div>

    </div>
    </div></div>
    <div id="content">
    <div id="article">
    <div class="sectionHeader">
    <div class="left">
    <div class="right">
    <div class="plaque">
    RuneTrocity HighScores
    </div>
    </div>
    </div>
    </div>
    <div class="section">
    <!--[if lt IE 6]>
    <style type="text/css">
    #skillsList_back {
    width: 173px;
    }
    #skillsList ul li a:hover {
    height: 19px;
    }
    #skillsList ul li a {
    height: 19px;
    }
    #playerList_back {
    width: 381px;
    }
    .table_back tr {
    color: #f9deb3;
    }
    .table_back th {
    color: white;
    }
    .table_back {
    text-align: center;
    }
    #PlayerSkill_back {
    width: 363px;
    }
    #mini_player, #skill_player {
    width: 353px;
    }
    #scores_head {
    padding-top: 5px;
    }
    #compare_header {
    padding-top: 6px;
    }
    </style>
    <![endif]-->
    <div class="brown_background">
    <div id="hiscores_background" class="inner_brown_background">
    <div id="skillsList_back" class="brown_box">
    <div class="subsectionHeader">Skills</div>
    <div id="skillsList">
    <ul>
    <li style="background-color:#4c350a">
    <a href="http://LOCALHOST/highscores/highscores.php" target="_self"" class=" Overall ico">
    Overall
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=1" target="_self"" class=" Attack ico">

    Attack
    </a>
    </li>
    <li>

    <a href="http://LOCALHOST/highscores/skills.php?type=2" target="_self"" class=" Defence ico">

    Defence
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=3" target="_self"" class=" Strength ico">

    Strength
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=4" target="_self"" class=" Hitpoints ico">

    Hitpoints
    </a>
    </li>

    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=5" target="_self"" class=" Ranged ico">

    Ranged
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=6" target="_self"" class=" Prayer ico">

    Prayer
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=7" target="_self"" class=" Magic ico">

    Magic
    </a>

    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=8" target="_self"" class=" Cooking ico">

    Cooking
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=9" target="_self"" class=" Woodcutting ico">

    Woodcutting
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=10" target="_self"" class=" Fletching ico">

    Fletching

    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=11" target="_self"" class=" Fishing ico">

    Fishing
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=12" target="_self"" class=" Firemaking ico">

    Firemaking
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=13" target="_self"" class=" Crafting ico">

    Crafting
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=14" target="_self"" class=" Smithing ico">

    Smithing
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=15" target="_self"" class=" Mining ico">

    Mining
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=16" target="_self"" class=" Herblore ico">

    Herblore
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=17" target="_self"" class=" Agility ico">

    Agility
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=18" target="_self"" class=" Thieving ico">

    Thieving
    </a>
    </li>
    <li>

    <a href="http://LOCALHOST/highscores/skills.php?type=19" target="_self"" class=" Slayer ico">

    Slayer
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=20" target="_self"" class=" Farming ico">

    Farming
    </a>
    </li>
    <li>
    <a href="http://LOCALHOST/highscores/skills.php?type=21" target="_self"" class=" Runecraft ico">

    Runecrafting
    </a>
    </li>
    </ul>
    </div>
    <div class="subsectionHeader"></div>
    </div>
    <div id="modeSelect_back" class="brown_box">
    <div class="buttons">
    <a id="button-left" href="www.google.com/test">
    <span class="lev1a"></span>
    Skills
    </a>
    <a id="button-right" href="www.google.com/test">
    <span class="lev1"></span>
    </a>
    </div>
    </div>
    <div id="playerList_back" class="brown_box">

    <div id="scores_head" class="subsectionHeader" style="padding: 0px;">
    <img style="margin-top: 3px;" class="miniimg_list" id="image_caption" src="http://www.runescape.com/img/hiscores/skill_icon_overall1.gif">
    Overall
    Hiscores
    </div>
    <?
    if(!$_GET['playerName']) {
    if(!$_GET['name']) {
    if($_GET['type'] != "0" && $_GET['type'] != "" && $_GET['type'] != "PK") {

    showPlayers($_GET['type']);
    } else if($_GET['type'] == "PK") {
    PkRating();
    } else {
    OverallHiscore();
    }
    } else {
    showPlayer($_GET['name']);
    }
    } else {
    showSig($_GET['playerName']);
    }

    ?>
    </div>
    <div id="search_back" class="brown_box">
    <div class="subsectionHeader search_title">Search by Name</div>
    <div class="search_small">
    <input class="textinput text" maxlength="12" type="text" name="character" id="character">
    <input class="buttonmedium" name="search" type="submit" value="Search" onclick="if(document.getElementById('character').v alue) { location.href = '<?=$website?>/<?=$pers?>?name='+document.getElementById('charact er').value; } else { alert('Please write a name'); }">

    </div>
    <div class="subsectionHeader search_title">RuneTrocity Site</div>
    <div class="search_large" id="friends_search">
    <div class="friendsContent">
    To go to the<br>
    RuneTrocity<br>
    website<br>
    <form action="www.runetrocity.com" method="" class="no_margin">
    <input id="search_friends" type="submit" class="buttonmedium" value="Click Here">
    </form>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    <div id="footer"><div class="contain">
    <div class="footerdesc">
    <br />
    </div>

    </body>
    </html>
    [/SPOIL]
    Reply With Quote  
     

  4. #4  
    Banned
    Join Date
    Feb 2012
    Posts
    584
    Thanks given
    0
    Thanks received
    13
    Rep Power
    0
    its not reading the files and placing then on the screen
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jun 2012
    Posts
    78
    Thanks given
    0
    Thanks received
    4
    Rep Power
    12
    Quote Originally Posted by Flavorless Fab View Post
    its not reading the files and placing then on the screen
    mind helping me out :O?
    Reply With Quote  
     

  6. #6  
    Registered Member
    Dogreen's Avatar
    Join Date
    Jan 2014
    Posts
    600
    Thanks given
    55
    Thanks received
    142
    Rep Power
    105
    Sorry I said it wrong, I meant Mysql.php or Functions.php, that's both files which grabs all players from the database, Highscore.php just shows it and w/e.

    Post here your Mysql.php and Functions.php
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Jun 2012
    Posts
    78
    Thanks given
    0
    Thanks received
    4
    Rep Power
    12
    Spoiler for mysql:
    <?php
    // MYSQL
    mysql_connect('localhost', 'root', 'MYPASS');
    mysql_select_db('highscores');

    // CONFIG
    $ppls_page = "20";
    $sig_support = false;
    $maxhiscorelevel = 99;
    $sig_image = "";
    $top_hiscore = 1000001;
    $minlvltohiscore = 10;
    $website = "http://LOCALHOST/highscores";
    $webtwo = "http://LOCALHOST/personal";
    $images = "";
    $file = "highscores.php";
    $file2 = "skills.php";
    $pers = "personal.php";

    // ARRAY REMEMBER ALWAYS START WITH MALL LETTER
    $webbers = array("N/a");
    $admins = array("N/a");
    $mods = array("N/a");
    $high_mods = array("N/a");
    $donators = array("N/a");
    $banned = array("null", "", " ");

    // ICONS
    $webbers_icon = "http://img264.imageshack.us/img264/3287/moddws8.gif";
    $admins_icon = "http://i7.tinypic.com/8foy68l.gif";
    $mods_icon = "http://img264.imageshack.us/img264/3287/moddws8.gif";
    $high_mods_icon = "http://img264.imageshack.us/img264/3287/moddws8.gif";
    $donators_icon = "http://img243.imageshack.us/img243/5434/donnf7.gif";

    // BBCODE
    $webbers_code = '<img src="http://i46.tinypic.com/357omjp.gif" border="0" />';
    $admins_code = '<img src="http://i34.tinypic.com/1zeccg9.jpg" border="0" />';
    $mods_code = '<img src="http://i26.tinypic.com/29597ic.jpg" border="0" />';
    $high_mods_code = '<img src="http://i34.tinypic.com/1zeccg9.jpg" border="0" />';
    $donators_code = '<img src="http://i47.tinypic.com/2643zpc.jpg" border="0" />';



    Spoiler for Functions:
    <?php

    include("mysql.php");

    function getLevelForXP($xp) {
    $lvl =1;
    if(!$xp || $xp==0) $xp = 1;

    while($xp > $output){
    $points = $points + floor($lvl + 300 * pow(2, ($lvl / 7)));
    $output = floor($points / 4);
    if($lvl > 99){
    return 99;
    break;
    } else if($xp > 13034430){
    return 99;
    break;
    } else if($xp < 83){
    return 1;
    break;
    } else if($output >= $xp){
    return $lvl;
    break;
    }
    $lvl++;
    }
    }
    function findType($type) {
    if($type == "" && $type != "PK") {
    return "Hitpoints";
    } else if($type == "0") {
    return "Hitpoints";
    } else if($type == "1") {
    return "Attack";
    } else if($type == "2") {
    return "Defence";
    } else if($type == "3") {
    return "Strength";
    } else if($type == "4") {
    return "Hitpoints";
    } else if($type == "5") {
    return "Range";
    } else if($type == "6") {
    return "Prayer";
    } else if($type == "7") {
    return "Magic";
    } else if($type == "8") {
    return "Cooking";
    } else if($type == "9") {
    return "Woodcutting";
    } else if($type == "10") {
    return "Fletching";
    } else if($type == "11") {
    return "Fishing";
    } else if($type == "12") {
    return "Firemaking";
    } else if($type == "13") {
    return "Crafting";
    } else if($type == "14") {
    return "Smithing";
    } else if($type == "15") {
    return "Mining";
    } else if($type == "16") {
    return "Herblore";
    } else if($type == "17") {
    return "Agility";
    } else if($type == "18") {
    return "Thieving";
    } else if($type == "19") {
    return "Slayer";
    } else if($type == "20") {
    return "Farming";
    } else if($type == "21") {
    return "Runecraft";
    } else if($type == "PK") {
    return "PK Rating";
    }

    }

    function fixName($name) {
    return strtolower($name);
    }

    function dots($num) {
    if($num) {
    $num = number_format($num);
    } else {
    $num = "0";
    }
    return $num;
    }
    function findRank($playerName,$skill) {
    include "mysql.php";
    $playerName = fixName($playerName);
    if(!$top_hiscore) { $top_hiscore = "101"; }
    if($skill != "0") {
    $i=1;
    $xptype = findType($skill)."xp";
    $query = mysql_query("SELECT * FROM skills ORDER BY $xptype DESC") or die(mysql_error());

    while($row = mysql_fetch_array($query)){
    if (!in_array(fixName($row["playerName"]), $banned)) {
    if(fixName($row["playerName"]) == $playerName) {
    if($i > $top_hiscore) {
    return "Not Ranked";
    } else {
    return $i;
    }
    }
    $i++;
    }
    }
    } else {
    $i=1;
    $query = mysql_query ("SELECT * FROM skillsoverall ORDER BY lvl DESC") or die(mysql_error());
    while($row = mysql_fetch_array($query)){
    if (!in_array(fixName($row["playerName"]), $banned)) {
    if(fixName($row["playerName"]) == $playerName) {
    if($i > $top_hiscore) {
    return "Not Ranked";
    } else {
    return $i;
    }
    }
    $i++;
    }
    }
    }
    }

    function BBCode($playerName) {
    include "mysql.php";
    if (in_array(fixName($playerName), $webbers)) {
    return $webbers_code.ucwords($playerName);
    } else if (in_array(fixName($playerName), $admins)) {
    return $admins_code.'<font color="#f7fe11">'.ucwords($playerName).'</font>';;
    } else if (in_array(fixName($playerName), $high_mods)) {
    return $high_mods_code.ucwords($playerName);
    } else if (in_array(fixName($playerName), $mods)) {
    return $mods_code.ucwords($playerName);
    } else if (in_array(fixName($playerName), $donators)) {
    return $donators_code.'<font color="red">'.ucwords($playerName).'</font>';
    } else {
    return ucwords($playerName);
    }
    }

    function showSig($playerName) {
    include "mysql.php";
    if($sig_support == "true") {
    $query = mysql_query("SELECT * FROM skills WHERE playerName = '".$playerName."' LIMIT 1") or die(mysql_error());
    $row = mysql_fetch_array($query);
    if(isset($playerName) && isset($row["playerName"]) && !in_array(fixName($row["playerName"]), $banned)) {
    echo "Use this image link to show your signature<br />";
    echo "<input type='text' size='100' value='".$website."/image.php?playerName=".$playerName."' class='button'><br /><br />";
    echo "<b>Demo:</b><br />";
    echo "<img src='".$website."/image.php?playerName=".$playerName."'>";
    } else {
    echo "The user dosent exist";
    }
    } else {
    echo "Signatures isent supported.";
    }
    }
    function Pkrating() {
    include "mysql.php";
    if(!$top_hiscore) { $top_hiscore = "101"; }
    echo '
    <table class="table_back">
    <tbody>
    <thead>
    <tr class="table_header">
    <th class="rankHead">Rank</th>
    <th class="nameHead">Name</th>

    <th class="scoreHead">Score</th>
    </tr>
    </thead>
    ';
    $count = mysql_result(mysql_query("SELECT COUNT(*) FROM skills"),0) or die(mysql_error());

    $from = (isset($_GET["from"]) && is_numeric($_GET["from"]) && $_GET["from"] < $count) ? $_GET["from"] : 0;
    $query = mysql_query ("SELECT * FROM skills ORDER BY Rating DESC limit $from, $ppls_page") or die(mysql_error());

    $i = $from;
    while($row = mysql_fetch_array($query)){
    $i++;
    if($i < $top_hiscore) {
    if($i & 1) {
    echo '<tr class="row row1">
    <td class="rankCol">'.$i.'</td>
    <td class="alL"><a href="'.$website.'/'.$pers.'?name='.$row["playerName"].'" target="_self">'.BBCode($row["playerName"]).'</a></td>
    <td class="alL">'.dots($row["Rating"]).'</td>
    </tr>
    ';
    } else {
    echo '<tr class="row row2">
    <td class="rankCol">'.$i.'</td>
    <td class="alL"><a href="'.$website.'/'.$pers.'?name='.$row["playerName"].'" target="_self">'.BBCode($row["playerName"]).'</a></td>
    <td class="alL">'.dots($row["Rating"]).'</td>
    </tr>
    ';
    }
    }
    }
    echo '</table>
    ';
    if($count >= $ppls_page) {
    echo '<table border="0" width="100%">
    <tr>
    <td align="center">
    ';
    if ($from > 0) {
    $back= $from - $ppls_page;
    echo '<a href="'.$website.'/'.$file.'?type=0&from='.$back.'"><b>Back</b></a> ';
    }
    $page = 1;

    for ($start = 0; $count > $start; $start = $start + $ppls_page) {
    if($from != $page * $ppls_page - $ppls_page) {
    if($start < $top_hiscore) {
    echo '<a href="'.$website.'/'.$file.'?type=0&from='.$start.'"><b>'.$page.'</b></a> ';
    }
    } else {
    echo $page.' ';
    }
    $page++;
    }

    if ($from < $count - $ppls_page || $from < $top_hiscore) {
    $next = $from + $ppls_page;
    if($next < $top_hiscore) {
    echo ' <a href="'.$website.'/'.$file.'?type=0&from='.$next.'"><b>Next</b></a>';
    }
    }
    echo "</td>
    </tr>
    </table>";
    }
    }
    function Roguerating() {
    include "mysql.php";
    if(!$top_hiscore) { $top_hiscore = "101"; }
    echo '
    <table class="table_back">
    <tbody>
    <thead>
    <tr class="table_header">
    <th class="rankHead">Rank</th>
    <th class="nameHead">Name</th>

    <th class="scoreHead">Score</th>
    </tr>
    </thead>
    ';
    $count = mysql_result(mysql_query("SELECT COUNT(*) FROM skills"),0) or die(mysql_error());

    $from = (isset($_GET["from"]) && is_numeric($_GET["from"]) && $_GET["from"] < $count) ? $_GET["from"] : 0;
    $query = mysql_query ("SELECT * FROM skills ORDER BY Score DESC limit $from, $ppls_page") or die(mysql_error());

    $i = $from;
    while($row = mysql_fetch_array($query)){
    $i++;
    if($i < $top_hiscore) {
    if($i & 1) {
    echo '<tr class="row row1">
    <td class="rankCol">'.$i.'</td>
    <td class="alL"><a href="'.$website.'/'.$pers.'?name='.$row["playerName"].'" target="_self">'.BBCode($row["playerName"]).'</a></td>
    <td class="alL">'.dots($row["Score"]).'</td>
    </tr>
    ';
    } else {
    echo '<tr class="row row2">
    <td class="rankCol">'.$i.'</td>
    <td class="alL"><a href="'.$website.'/'.$pers.'?name='.$row["playerName"].'" target="_self">'.BBCode($row["playerName"]).'</a></td>
    <td class="alL">'.dots($row["Score"]).'</td>
    </tr>
    ';
    }
    }
    }
    echo '</table>
    ';
    if($count >= $ppls_page) {
    echo '<table border="0" width="100%">
    <tr>
    <td align="center">
    ';
    if ($from > 0) {
    $back= $from - $ppls_page;
    echo '<a href="'.$website.'/'.$file.'?type=0&from='.$back.'"><b>Back</b></a> ';
    }
    $page = 1;

    for ($start = 0; $count > $start; $start = $start + $ppls_page) {
    if($from != $page * $ppls_page - $ppls_page) {
    if($start < $top_hiscore) {
    echo '<a href="'.$website.'/'.$file.'?type=0&from='.$start.'"><b>'.$page.'</b></a> ';
    }
    } else {
    echo $page.' ';
    }
    $page++;
    }

    if ($from < $count - $ppls_page || $from < $top_hiscore) {
    $next = $from + $ppls_page;
    if($next < $top_hiscore) {
    echo ' <a href="'.$website.'/'.$file.'?type=0&from='.$next.'"><b>Next</b></a>';
    }
    }
    echo "</td>
    </tr>
    </table>";
    }
    }
    function OverallHiscore() {
    include "mysql.php";
    if(!$top_hiscore) { $top_hiscore = "101"; }
    echo '<table border="0" width="100%">
    <table class="table_back">
    <tbody>
    <thead>
    <tr class="table_header">
    <th class="rankHead">Rank</th>
    <th class="nameHead">Name</th>
    <th class="levelHead">Level</th>
    <th class="xpHead">XP</th>
    </tr>

    </thead>
    ';
    $count = mysql_result(mysql_query("SELECT COUNT(*) FROM skillsoverall"),0) or die(mysql_error());

    $from = (isset($_GET["from"]) && is_numeric($_GET["from"]) && $_GET["from"] < $count) ? $_GET["from"] : 0;

    $query = mysql_query ("SELECT * FROM skillsoverall ORDER BY lvl DESC limit $from, $ppls_page") or die(mysql_error());

    $i = $from;
    while($row = mysql_fetch_array($query)){
    $i++;
    if($i < $top_hiscore) {
    if($i & 1) {
    echo '<tr class="row row1">
    <td class="rankCol">'.$i.'</td>
    <td class="alL"><a href="'.$website.'/'.$pers.'?name='.$row["playerName"].'" target="_self">'.BBCode($row["playerName"]).'</a></td>
    <td class="alL">'.dots($row["lvl"]).'</td>
    <td class="alL">'.dots($row["xp"]).'</td>
    </tr>
    ';
    } else {
    echo '<tr class="row row2">
    <td class="rankCol">'.$i.'</td>
    <td class="alL"><a href="'.$website.'/'.$pers.'?name='.$row["playerName"].'" target="_self">'.BBCode($row["playerName"]).'</a></td>
    <td class="alL">'.dots($row["lvl"]).'</td>
    <td class="alL">'.dots($row["xp"]).'</td>
    </tr>
    ';


    }
    }
    }
    echo '</tbody>
    </table>
    ';
    if($count >= $ppls_page) {
    echo '<table border="0" width="100%">
    <tr>
    <td align="center">
    ';
    if ($from > 0) {
    $back= $from - $ppls_page;
    echo '<a href="'.$website.'/'.$file.'?type=0&from='.$back.'"><b>Back</b></a> ';
    }
    $page = 1;

    for ($start = 0; $count > $start; $start = $start + $ppls_page) {
    if($from != $page * $ppls_page - $ppls_page) {
    if($start < $top_hiscore) {
    echo '<a href="'.$website.'/'.$file.'?type=0&from='.$start.'"><b>'.$page.'</b></a> ';
    }
    } else {
    echo $page.' ';
    }
    $page++;
    }

    if ($from < $count - $ppls_page || $from < $top_hiscore) {
    $next = $from + $ppls_page;
    if($next < $top_hiscore) {
    echo ' <a href="'.$website.'/'.$file.'?type=0&from='.$next.'"><b>Next</b></a>';
    }
    }
    echo "</td>
    </tr>
    </table>";
    }
    }
    function showPlayers($type) {
    include "mysql.php";
    if(!$top_hiscore) { $top_hiscore = "101"; }
    echo '<div id="playerList_back" class="brown_box">

    <div id="scores_head" class="subsectionHeader" style="padding: 0px;">
    <img src="'.$website.'/assets/skill_icon_'.strtolower(findType($type)).'1.gif">' .ucwords(findType($type)).'

    HighScores
    </div>
    <table class="table_back">
    <tbody>
    <thead>
    <tr class="table_header">
    <th class="rankHead">Rank</th>
    <th class="nameHead">Name</th>
    <th class="levelHead">Level</th>
    <th class="xpHead">XP</th>
    </tr>
    </thead>';

    $xptype = findType($type)."xp";
    $count = mysql_result(mysql_query("SELECT COUNT(*) FROM skills"),0) or die(mysql_error());
    $from = (isset($_GET["from"]) && is_numeric($_GET["from"]) && $_GET["from"] < $count) ? $_GET["from"] : 0;
    $query = mysql_query ("SELECT * FROM skills ORDER BY $xptype DESC limit $from, $ppls_page") or die(mysql_error());
    $i = $from;
    while($row = mysql_fetch_array($query)){
    $i++;
    if($i < $top_hiscore && !in_array($row["playerName"], $banned) && !in_array(ucwords($row["playerName"]), $banned)) {
    if($i & 1) {
    echo '<tr class="row row1">
    <td class="rankCol">'.$i.'</td>
    <td class="alL"><a href="'.$website.'/'.$pers.'?name='.$row["playerName"].'" target="_self">'.BBCode($row["playerName"]).'</a></td>
    <td class="alL">'.getLevelForXP($row[$xptype]).'</td>
    <td class="alL">'.dots($row[$xptype]).'</td>
    </tr>';
    } else {
    echo '<tr class="row row2">
    <td class="rankCol">'.$i.'</td>
    <td class="alL"><a href="'.$website.'/'.$pers.'?name='.$row["playerName"].'" target="_self">'.BBCode($row["playerName"]).'</a></td>
    <td class="alL">'.getLevelForXP($row[$xptype]).'</td>
    <td class="alL">'.dots($row[$xptype]).'</td>
    </tr>';
    }
    }

    }
    echo '</tbody></table>
    ';
    if($count >= $ppls_page) {
    echo '<table border="0" width="100%">
    <tr>
    <td align="center">
    ';
    if ($from > 0) {
    $back= $from - $ppls_page;
    echo '<a href="'.$website.'/'.$file.'?type='.$_GET["type"].'&from='.$back.'"><b>Back</b></a> ';
    }
    $page = 1;
    for ($start = 0; $count > $start; $start = $start + $ppls_page) {
    if($from != $page * $ppls_page - $ppls_page) {
    if($start < $top_hiscore) {
    echo '<a href="'.$website.'/'.$file.'?type='.$_GET["type"].'&from='.$start.'"><b>'.$page.'</b></a> ';
    }
    } else {
    echo $page." ";
    }
    $page++;
    }

    if ($from < $count - $ppls_page || $from < $top_hiscore) {
    $next = $from + $ppls_page;
    if($next < $top_hiscore) {
    echo ' <a href="'.$website.'/'.$file.'?type='.$_GET["type"].'&from='.$next.'"><b>Next</b></a>';
    }
    }
    echo "</td>
    </tr>
    </table>";
    }
    }
    function showPlayer($name) {
    include "mysql.php";
    $query = mysql_query("SELECT * FROM skills WHERE playerName LIKE '".fixName($name)."' LIMIT 1") or die(mysql_error());

    $row = mysql_fetch_array($query);
    $overall["lvl"] = getLevelForXP($row["Attackxp"]) + getLevelForXP($row["Defencexp"]) + getLevelForXP($row["Strengthxp"]) + getLevelForXP($row["Hitpointsxp"]) + getLevelForXP($row["Rangexp"]) + getLevelForXP($row["Prayerxp"]) + getLevelForXP($row["Magicxp"]) + getLevelForXP($row["Cookingxp"]) + getLevelForXP($row["Woodcuttingxp"]) + getLevelForXP($row["Fletchingxp"]) + getLevelForXP($row["Fishingxp"]) + getLevelForXP($row["Firemakingxp"]) + getLevelForXP($row["Craftingxp"]) + getLevelForXP($row["Smithingxp"]) + getLevelForXP($row["Miningxp"]) + getLevelForXP($row["Herblorexp"]) + getLevelForXP($row["Agilityxp"]) + getLevelForXP($row["Thievingxp"]) + getLevelForXP($row["Slayerxp"]) + getLevelForXP($row["Farmingxp"]) + getLevelForXP($row["Runecraftxp"]);
    $overall["xp"] = $row["Attackxp"] + $row["Defencexp"] + $row["Strengthxp"] + $row["Hitpointsxp"] + $row["Rangexp"] + $row["Prayerxp"] + $row["Magicxp"] + $row["Cookingxp"] + $row["Woodcuttingxp"] + $row["Fletchingxp"] + $row["Fishingxp"] + $row["Firemakingxp"] + $row["Craftingxp"] + $row["Smithingxp"] + $row["Miningxp"] + $row["Herblorexp"] + $row["Agilityxp"] + $row["Thievingxp"] + $row["Slayerxp"] + $row["Farmingxp"] + $row["Runecraftxp"];
    echo '


    <div class="brown_background">
    <div id="hiscores_background" class="inner_brown_background">
    <div class="center_container">
    <div id="player_header" class="brown_box">
    <div id="player_sub" class="subsectionHeader">
    Personal scores for <div class="player_name"><a href="'.$website.'/'.$pers.'?name='.$row["playerName"].'" target="_self">'.BBCode($row["playerName"]).'</a></td></div>
    </div>
    </div>
    <div id="PlayerSkill_back" class="brown_box">
    <div id="scores_head" class="subsectionHeader" style="padding: 0px">
    Skills
    </div>
    <table class="table_back" style="margin-bottom:5px" id="mini_player">
    <tbody>
    <thead>
    <tr class="table_header">

    <th class="imageHead_P"></th>
    <th class="skillsHead_P">Skills</th>
    <th class="rankHead_P">Rank</th>
    <th class="levelHead_P">Level</th>
    <th class="xpHead_P">XP</th>
    </tr>
    </thead>

    <tr class="row rowp1">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_overall1.gif">
    </td>

    <td class="alL">
    <a href="'.$website.'/'.$file.'" target="_self">

    Overall
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"0").'</td>
    <td class="alL">'.dots($overall["lvl"]).'</td>
    <td class="alL">'.dots($overall["xp"]).'</td>
    </tr>
    <tr class="row rowp2">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_attack1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=1" target="_self">

    Attack
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"1").'</td>
    <td class="alL">'.getLevelForXP($row["Attackxp"]).'</td>
    <td class="alL">'.dots($row["Attackxp"]).'</td>
    </tr>
    <tr class="row rowp3">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_defence1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=2" target="_self">

    Defence
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"2").'</td>
    <td class="alL">'.getLevelForXP($row["Defencexp"]).'</td>
    <td class="alL">'.dots($row["Defencexp"]).'</td>
    </tr>
    <tr class="row rowp4">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_strength1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=3" target="_self">

    Strength
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"3").'</td>
    <td class="alL">'.getLevelForXP($row["Strengthxp"]).'</td>
    <td class="alL">'.dots($row["Strengthxp"]).'</td>
    </tr>
    <tr class="row rowp5">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_hitpoints1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=4" target="_self">

    Hitpoints
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"4").'</td>
    <td class="alL">'.getLevelForXP($row["Hitpointsxp"]).'</td>
    <td class="alL">'.dots($row["Hitpointsxp"]).'</td>
    </tr>
    <tr class="row rowp6">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_range1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=5" target="_self">

    Ranged
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"5").'</td>
    <td class="alL">'.getLevelForXP($row["Rangexp"]).'</td>
    <td class="alL">'.dots($row["Rangexp"]).'</td>
    </tr>
    <tr class="row rowp7">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_prayer1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=6" target="_self">

    Prayer
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"6").'</td>
    <td class="alL">'.getLevelForXP($row["Prayerxp"]).'</td>
    <td class="alL">'.dots($row["Prayerxp"]).'</td>
    </tr>
    <tr class="row rowp8">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_magic1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=7" target="_self">

    Magic
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"7").'</td>
    <td class="alL">'.getLevelForXP($row["Magicxp"]).'</td>
    <td class="alL">'.dots($row["Magicxp"]).'</td>
    </tr>
    <tr class="row rowp9">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_cooking1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=8" target="_self">

    Cooking
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"8").'</td>
    <td class="alL">'.getLevelForXP($row["Cookingxp"]).'</td>
    <td class="alL">'.dots($row["Cookingxp"]).'</td>
    </tr>
    <tr class="row rowp10">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_woodcutting1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=9" target="_self">

    Woodcutting
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"9").'</td>
    <td class="alL">'.getLevelForXP($row["Woodcuttingxp"]).'</td>
    <td class="alL">'.dots($row["Woodcuttingxp"]).'</td>
    </tr>
    <tr class="row rowp11">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_fletching1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=10" target="_self">

    Fletching
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"10").'</td>
    <td class="alL">'.getLevelForXP($row["Fletchingxp"]).'</td>
    <td class="alL">'.dots($row["Fletchingxp"]).'</td>
    </tr>
    <tr class="row rowp12">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_fishing1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=11" target="_self">

    Fishing
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"11").'</td>
    <td class="alL">'.getLevelForXP($row["Fishingxp"]).'</td>
    <td class="alL">'.dots($row["Fishingxp"]).'</td>
    </tr>
    <tr class="row rowp13">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_firemaking1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=12" target="_self">

    Firemaking
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"12").'</td>
    <td class="alL">'.getLevelForXP($row["Firemakingxp"]).'</td>
    <td class="alL">'.dots($row["Firemakingxp"]).'</td>
    </tr>
    <tr class="row rowp14">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_crafting1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=13" target="_self">

    Crafting
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"13").'</td>
    <td class="alL">'.getLevelForXP($row["Craftingxp"]).'</td>
    <td class="alL">'.dots($row["Craftingxp"]).'</td>
    </tr>
    <tr class="row rowp15">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_smithing1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=14" target="_self">

    Smithing
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"14").'</td>
    <td class="alL">'.getLevelForXP($row["Smithingxp"]).'</td>
    <td class="alL">'.dots($row["Smithingxp"]).'</td>
    </tr>
    <tr class="row rowp16">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_mining1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=15" target="_self">

    Mining
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"15").'</td>
    <td class="alL">'.getLevelForXP($row["Miningxp"]).'</td>
    <td class="alL">'.dots($row["Miningxp"]).'</td>
    </tr>
    <tr class="row rowp17">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_herblore1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=16" target="_self">

    Herblore
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"16").'</td>
    <td class="alL">'.getLevelForXP($row["Herblorexp"]).'</td>
    <td class="alL">'.dots($row["Herblorexp"]).'</td>
    </tr>
    <tr class="row rowp18">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_agility1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=17" target="_self">

    Agility
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"17").'</td>
    <td class="alL">'.getLevelForXP($row["Agilityxp"]).'</td>
    <td class="alL">'.dots($row["Agilityxp"]).'</td>
    </tr>
    <tr class="row rowp19">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_thieving1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=18" target="_self">

    Thieving
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"18").'</td>
    <td class="alL">'.getLevelForXP($row["Thievingxp"]).'</td>
    <td class="alL">'.dots($row["Thievingxp"]).'</td>
    </tr>
    <tr class="row rowp20">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_slayer1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=19" target="_self">

    Slayer
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"19").'</td>
    <td class="alL">'.getLevelForXP($row["Slayerxp"]).'</td>
    <td class="alL">'.dots($row["Slayerxp"]).'</td>
    </tr>
    <tr class="row rowp21">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_farming1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=20" target="_self">

    Farming
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"20").'</td>
    <td class="alL">'.getLevelForXP($row["Farmingxp"]).'</td>
    <td class="alL">'.dots($row["Farmingxp"]).'</td>
    </tr>
    <tr class="row rowp22">
    <td align="center">
    <img src="'.$website.'/assets/skill_icon_runecraft1.gif">
    </td>
    <td class="alL">
    <a href="'.$website.'/'.$file2.'?type=21" target="_self">

    Runecrafting
    </a>
    </td>
    <td class="alL">'.findRank($_GET["name"],"21").'</td>
    <td class="alL">'.getLevelForXP($row["Runecraftxp"]).'</td>
    <td class="alL">'.dots($row["Runecraftxp"]).'</td>
    </tr>
    </table>
    </div>
    ';
    }
    ?>
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Jun 2012
    Posts
    78
    Thanks given
    0
    Thanks received
    4
    Rep Power
    12
    Quote Originally Posted by Amazing View Post
    Sorry I said it wrong, I meant Mysql.php or Functions.php, that's both files which grabs all players from the database, Highscore.php just shows it and w/e.

    Post here your Mysql.php and Functions.php
    Forgot to quote so it would notify you.
    Reply With Quote  
     

  9. #9  
    Banned
    Join Date
    Nov 2013
    Age
    28
    Posts
    433
    Thanks given
    465
    Thanks received
    69
    Rep Power
    0
    That is a terrible highscores system.

    Code:
    public void logout() {
    		synchronized (this) {
    			if(System.currentTimeMillis() - logoutDelay > 10000) {
    				outStream.createFrame(109);
    				properLogout = true;
    				if(playerRights == 0 || playerRights == 4 || playerRights == 5){
    				SQL.createConnection();
    				SQL.saveHighScores(this);
    				SQL.destroyConnection();
    				}
    			} else {
    				sendMessage("Please wait 10 seconds to be logged out, since you were in combat.");
    			}
    		}
    	}
    There's your problem.
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Jun 2012
    Posts
    78
    Thanks given
    0
    Thanks received
    4
    Rep Power
    12
    Quote Originally Posted by Ags View Post
    That is a terrible highscores system.

    Code:
    public void logout() {
    		synchronized (this) {
    			if(System.currentTimeMillis() - logoutDelay > 10000) {
    				outStream.createFrame(109);
    				properLogout = true;
    				if(playerRights == 0 || playerRights == 4 || playerRights == 5){
    				SQL.createConnection();
    				SQL.saveHighScores(this);
    				SQL.destroyConnection();
    				}
    			} else {
    				sendMessage("Please wait 10 seconds to be logged out, since you were in combat.");
    			}
    		}
    	}
    There's your problem.
    nope. thats just saying, mods, admins, and owners wont show in highscores..
    i have a few player accounts from players.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. PI mysql help
    By jmckeag in forum Help
    Replies: 3
    Last Post: 03-12-2011, 05:37 AM
  2. [PI] MYSQL Connect Failure
    By ashitrin in forum Help
    Replies: 3
    Last Post: 01-26-2011, 07:58 PM
  3. [Pi]mysql requests[pi]
    By flame_blade00 in forum Help
    Replies: 5
    Last Post: 01-07-2011, 06:41 AM
  4. [PI] Mysql
    By iMac in forum Snippets
    Replies: 9
    Last Post: 12-31-2010, 12:45 AM
  5. [PI] MySql confusion.
    By The Situationist in forum Help
    Replies: 3
    Last Post: 09-17-2010, 06:35 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •