[Release]Players Online and Banned players [PHP]

Joined
Jun 11, 2006
Messages
518
Reaction score
0
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);
?>
 
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
?>
 
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.
 
Back