[Release]Players Online and Banned players [PHP]

Results 1 to 8 of 8
  1. #1
    Account Upgraded | Title Enabled! MjClarke1 is offline
    MemberRank
    Jun 2006 Join Date
    London, OntarioLocation
    644Posts

    [Release]Players Online and Banned players [PHP]

    First, credits to Me(Matthew1) and Drakia from osRose.

    Config.php for all
    Code:
    <?php
    $dbhost = "localhost"; // Change this to your database server
    $dbname = "roseon"; // Change this to your database name
    $dbuser = "roseon"; // Change this to your database username
    $dbpswd = "roseon"; // Change this to your database password
    ?>


    Online Players

    Code:
    <?php
    include("config.php");
    // Connect to the database
    $db = mysql_connect($dbhost, $dbuser, $dbpswd) or die("Could not connect to server database");
    mysql_select_db($dbname, $db);
    // Select all the banned users and display them
    $result = mysql_query("SELECT * FROM accounts WHERE online = '1'", $db) or die(mysql_error());  
    
    while($row = mysql_fetch_array( $result )) {
        echo "<strong>".$row['lastchar']."<BR></strong>";
    }
    mysql_close($db);
    ?>


    Banned Players

    Code:
    <?php
    include("config.php");
    // Connect to the database
    $db = mysql_connect($dbhost, $dbuser, $dbpswd) or die("Could not connect to server database");
    mysql_select_db($dbname, $db);
    // Select all the banned users and display them
    $result = mysql_query("SELECT * FROM accounts WHERE accesslevel = '0'", $db) or die(mysql_error());  
    
    while($row = mysql_fetch_array( $result )) {
        echo "<strong>".$row['username']."<BR></strong>";
    }
    mysql_close($db);
    ?>


  2. #2
    Valued Member deejdd is offline
    MemberRank
    Apr 2006 Join Date
    Inside the SystemLocation
    108Posts

    Re: [Release]Players Online and Banned players [PHP]

    Whaha nice script thanks ;) goodjob

  3. #3
    Account Upgraded | Title Enabled! rune 1100 is offline
    MemberRank
    Feb 2006 Join Date
    Wales--- soon to be NewZELANDLocation
    298Posts

    Re: [Release]Players Online and Banned players [PHP]

    wheres the config.php then?

  4. #4
    Valued Member deejdd is offline
    MemberRank
    Apr 2006 Join Date
    Inside the SystemLocation
    108Posts

    Re: [Release]Players Online and Banned players [PHP]

    read the post....

    <?php
    $dbhost = "localhost"; // Change this to your database server
    $dbname = "roseon"; // Change this to your database name
    $dbuser = "roseon"; // Change this to your database username
    $dbpswd = "roseon"; // Change this to your database password
    ?>

  5. #5
    Member heavensite is offline
    MemberRank
    Mar 2007 Join Date
    60Posts

    Re: [Release]Players Online and Banned players [PHP]

    where to place those files?/ im using Rose CP 1.6 By DyePrey
    and where to place those files?

  6. #6
    Jerkin the Gherkin Junkee is offline
    MemberRank
    Apr 2005 Join Date
    IllinoisLocation
    298Posts

    Re: [Release]Players Online and Banned players [PHP]

    if you are using another CMS i would imagine that most config.php's have all the needed db entries, so you would just put the other 2 .php files in your CMS directory and edit the index.php file to include spots for the banned players and online players.. atleast that's what i would do.

  7. #7
    Member heavensite is offline
    MemberRank
    Mar 2007 Join Date
    60Posts

    Re: [Release]Players Online and Banned players [PHP]

    but i tried that when i check the CMS it errored.

  8. #8
    OsiRose DEV XxXshidoXxX is offline
    MemberRank
    Sep 2006 Join Date
    eeeLocation
    212Posts

    Re: [Release]Players Online and Banned players [PHP]

    I have test , it work , thanks for your work =D



Advertisement