Server Status CMS problems

Results 1 to 7 of 7
  1. #1
    Account Upgraded | Title Enabled! PepsiNotCoke is offline
    MemberRank
    Dec 2009 Join Date
    255Posts

    Server Status CMS problems

    I am currently using GoldenShit CMS by samus, and am having a few problems with the server status. It keeps track of accounts, characters and online and such fine. My problem is the online/offline notice. Whether my server is offline or online, it always says offline. here is the status script:
    PHP Code:
    <div id="stactics">
            <div id="staticstext">
            <table align="center" width="90%" cellpadding="0" cellspacing="3" border="0" style="font-family: 'Calibri', Verdana, sans-serif; font-size: 12px; text-shadow: #ffffff 0px 1px 1px; font-size: 16px; margin-bottom: 15px">
                    <tr>
                        <td align="left">
                            Online:
                        </td>
                        <td align="right">
                            <?php
                            $checkaccs 
    mysql_query("SELECT * FROM accounts");
                            
    $checkchars mysql_query("SELECT * FROM characters");
                            
    $checkbanned mysql_query("SELECT * FROM accounts where banned = 1");
                            
    $accounts mysql_num_rows($checkaccs);
                            
    $characters mysql_num_rows($checkchars);
                            
    $banned mysql_num_rows($checkbanned);
                            include(
    'ConfigShit/init.php');
                            
    $database->query("SELECT * FROM gold_logs ORDER BY time DESC LIMIT 1");
                            if (
    $result $database->fetch_next()) {
                                
    date_default_timezone_set('America/New_York');
                                if ((
    time() - strtotime($result['time']) > 60 3)) {//Check every 3 minutes
                                    
    $doagain true;
                                    
    $database->query("SELECT count(*) as onlinecount FROM accounts WHERE loggedin = 2");
                                    
    $row $database->fetch_next();
                                    
    $loggedin = (string) $row['onlinecount'];
                                } else {
                                    
    $doagain false;
                                    
    $loggedin = (string) $result['onlineplayers'];
                                }
                            } else {
                                
    $doagain true;
                                
    $database->query("SELECT count(*) as onlinecount FROM accounts WHERE loggedin = 2");
                                
    $row $database->fetch_next();
                                
    $loggedin = (string) $row['onlinecount'];
                            }
                            echo 
    $loggedin;
                            
    ?>
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            Status:
                        </td>
                        <td align="right">
                            <?php
                            
    if ($doagain) {
                                
    $fp = @fsockopen(SERVER_IPLOGIN_PORT$errno$errstr1);
                            } else {
                                
    $fp $result['online'];
                            }
                            if (!
    $fp) {
                                
    $isonline 0;
                                
    $t "<font color='#c80000'><u>Offline</u></font>";
                            }else{
                                
    $isonline 1;
                                
    $t "<font color='#1ec800'><u>Online</u></font>";
                            }
                            echo 
    $t;
                            if (
    $doagain) {
                                
    $database->query("INSERT INTO gold_logs (time, onlineplayers, online) VALUES ('".date('Y-m-d H:i:s'time())."', ".$loggedin.", ".$isonline.")");
                                @
    fclose($fp);
                            }
                            
    ?>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"><img src="./images/sprtr.png"></td>
                    </tr>
                    <tr>
                        <td align="left">
                            Exp rate:
                        </td>
                        <td align="right">
                            <?php echo $e_rate?>
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            Meso rate:
                        </td>
                        <td align="right">
                            <?php echo $m_rate?>
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            Drop rate:
                        </td>
                        <td align="right">
                            <?php echo $d_rate?>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"><img src="./images/sprtr.png"></td>
                    </tr>
                    <tr>
                        <td align="left">
                            Version:
                        </td>
                        <td align="right">
                            <?php echo $version?>
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            Accounts:
                        </td>
                        <td align="right">
                            <?php echo $accounts?>
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            Characters:
                        </td>
                        <td align="right">
                            <?php echo $characters?>
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            Banned:
                        </td>
                        <td align="right">
                            <?php echo $banned?>
                        </td>
                    </tr>
                </table>
                
            </div>
            <div id="footer">
                    Copyright © <?php echo $servername;?> || Coded & Designed by Samus
                </div>
        </div>

    Now if it matters, here is my Config:
    PHP Code:
    <?php
    $servername 
    "GoldenShit CMS";
    $host['hostname'] = 'localhost';    // Host name (127.0.0.1/localhost or IP)
    $host['user'] = 'root';         // DB Username
    $host['password'] = ''// DB Password
    $host['database'] = 'mapleblade';     // DB Name
    $e_rate '5x';                     // Exp Rate
    $m_rate '1x';                     // Meso Rate
    $d_rate '1x';                     // Drop Rate
    $version '0.83';                     // Version
    $serverip "";             // Replace with your WAN IP if public
    $loginport "8484";                 // LoginPort [DEFAULT: 8484]
    $forumlink "http://forums.net";                // Forum link here.
    $rewardnx 1000;                    // Amount of NX for voting.

    //Download links//
    $client_link1 ""//Direct Download link here
    $client_link2 ""//I prefer mediafire.
    $setup_link1 "http://download3.nexon.net/maplestory/fullversion/MSSetupv83.exe"//from nexon itself. Atm it's v83
    $setup_link2 "http://tohbey.de/mssetupv83.exe"//Just in case..

    //Social Media
    $facebooklink "http://facebook.com";
    $twitterlink "http://www.Twitter.com";
    $youtubelink "http://www.YouTube.com";

    // Opens connection to mysql server [DO NOT TOUCH THIS]
    mysql_connect($host['hostname'],$host['user'],$host['password']) OR die("Can't connect to server");
    mysql_select_db($host['database']) OR die("Cannot select DB");

    if(
    basename($_SERVER["PHP_SELF"]) == "config.php"){
        die(
    "Error! Shit just happened");
    }

    function 
    sql_injectionproof($sCode) {
        if (
    function_exists("mysql_real_escape_string")) {
            
    $sCode mysql_real_escape_string($sCode);
        } else {
            
    $sCode addslashes($sCode);
        }
        return 
    $sCode;
    }

    ?>

    Oh, I suppose it might be important to say that I get no errors anywhere. Also, if you need another file, dont be afraid to ask. and my ip isnt normally blank, i just took that out for security reasons. (its usually my wan ip) Thanks for you help, PepsiNotCoke
    Last edited by PepsiNotCoke; 11-08-11 at 07:21 PM.


  2. #2
    RaGEZONER habib10 is offline
    MemberRank
    Nov 2009 Join Date
    AnywereLocation
    778Posts

    Re: Server Status CMS problems

    try this and post errors?

    PHP Code:
    <div id="stactics"> 
            <div id="staticstext"> 
            <table align="center" width="90%" cellpadding="0" cellspacing="3" border="0" style="font-family: 'Calibri', Verdana, sans-serif; font-size: 12px; text-shadow: #ffffff 0px 1px 1px; font-size: 16px; margin-bottom: 15px"> 
                    <tr> 
                        <td align="left"> 
                            Online: 
                        </td> 
                        <td align="right"> 
                            <?php 
                            $checkaccs 
    mysql_query("SELECT * FROM accounts"); 
                            
    $checkchars mysql_query("SELECT * FROM characters"); 
                            
    $checkbanned mysql_query("SELECT * FROM accounts where banned = 1"); 
                            
    $accounts mysql_num_rows($checkaccs); 
                            
    $characters mysql_num_rows($checkchars); 
                            
    $banned mysql_num_rows($checkbanned); 
                            include(
    'ConfigShit/init.php'); 
                            
    $database->query("SELECT * FROM gold_logs ORDER BY time DESC LIMIT 1"); 
                            if (
    $result $database->fetch_next()) { 
                                
    date_default_timezone_set('America/New_York'); 
                                if ((
    time() - strtotime($result['time']) > 60 3)) {//Check every 3 minutes 
                                    
    $doagain true
                                    
    $database->query("SELECT count(*) as onlinecount FROM accounts WHERE loggedin = 2"); 
                                    
    $row $database->fetch_next(); 
                                    
    $loggedin = (string) $row['onlinecount']; 
                                } else { 
                                    
    $doagain false
                                    
    $loggedin = (string) $result['onlineplayers']; 
                                } 
                            } else { 
                                
    $doagain true
                                
    $database->query("SELECT count(*) as onlinecount FROM accounts WHERE loggedin = 2"); 
                                
    $row $database->fetch_next(); 
                                
    $loggedin = (string) $row['onlinecount']; 
                            } 
                            echo 
    $loggedin
                            
    ?> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td align="left"> 
                            Status: 
                        </td> 
                        <td align="right"> 
                            <?php 
                            $fp 
    = @fsockopen($serverip$loginport$errno$errstr1);
          if (!
    $fp
        { echo 
    $offline; } else { echo $online; }
            @
    fclose($fp);
                            if (
    $doagain) { 
                                
    $database->query("INSERT INTO gold_logs (time, onlineplayers, online) VALUES ('".date('Y-m-d H:i:s'time())."', ".$loggedin.", ".$isonline.")"); 
                                @
    fclose($fp); 
                            } 
                            
    ?> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td colspan="2"><img src="./images/sprtr.png"></td> 
                    </tr> 
                    <tr> 
                        <td align="left"> 
                            Exp rate: 
                        </td> 
                        <td align="right"> 
                            <?php echo $e_rate?> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td align="left"> 
                            Meso rate: 
                        </td> 
                        <td align="right"> 
                            <?php echo $m_rate?> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td align="left"> 
                            Drop rate: 
                        </td> 
                        <td align="right"> 
                            <?php echo $d_rate?> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td colspan="2"><img src="./images/sprtr.png"></td> 
                    </tr> 
                    <tr> 
                        <td align="left"> 
                            Version: 
                        </td> 
                        <td align="right"> 
                            <?php echo $version?> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td align="left"> 
                            Accounts: 
                        </td> 
                        <td align="right"> 
                            <?php echo $accounts?> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td align="left"> 
                            Characters: 
                        </td> 
                        <td align="right"> 
                            <?php echo $characters?> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td align="left"> 
                            Banned: 
                        </td> 
                        <td align="right"> 
                            <?php echo $banned?> 
                        </td> 
                    </tr> 
                </table> 
                 
            </div> 
            <div id="footer"> 
                    Copyright © <?php echo $servername;?> || Coded & Designed by Samus 
                </div> 
        </div>

  3. #3
    Account Upgraded | Title Enabled! PepsiNotCoke is offline
    MemberRank
    Dec 2009 Join Date
    255Posts

    Re: Server Status CMS problems

    Code:
    Fatal error: Failed to execute MySQL Query - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
    Query: INSERT INTO gold_logs (time, onlineplayers, online) VALUES ('2011-08-11 13:35:16', 1, ) in C:\wamp\www\ConfigShit\core_class.php on line 37

  4. #4
    RaGEZONER habib10 is offline
    MemberRank
    Nov 2009 Join Date
    AnywereLocation
    778Posts

    Re: Server Status CMS problems

    look on those lines post them here

  5. #5
    Account Upgraded | Title Enabled! PepsiNotCoke is offline
    MemberRank
    Dec 2009 Join Date
    255Posts

    Re: Server Status CMS problems

    the core_class is just the error script but here anyway:
    PHP Code:
    trigger_error('Failed to execute MySQL Query - '.mysql_error().'<br />Query: '.$sql_queryE_USER_ERROR); 
    and Im not sure what i am supposed to post for the line one. It does not say which file, and it doesnt make sense in the status file

  6. #6
    RaGEZONER habib10 is offline
    MemberRank
    Nov 2009 Join Date
    AnywereLocation
    778Posts

    Re: Server Status CMS problems

    hmm still looking for solution

  7. #7
    Account Upgraded | Title Enabled! PepsiNotCoke is offline
    MemberRank
    Dec 2009 Join Date
    255Posts

    Re: Server Status CMS problems

    I had actually tried what you did, and got the same problem. its quite bizarre.



Advertisement