did u add the online user php to the modules folder?
here put this in modules folder;
onlineplayers.php - FileFront.com
Printable View
did u add the online user php to the modules folder?
here put this in modules folder;
onlineplayers.php - FileFront.com
when i put that in my modules folder i getQuote:
Warning: include(config.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\website\modules\onlineplayers.php on line 2
Warning: include() [function.include]: Failed opening 'config.php' for inclusion (include_path='.;C:\php5\pear') in C:\wamp\www\website\modules\onlineplayers.php on line 2
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\website\modules\onlineplayers.php on line 4
Could not connect to server database
yeah u didnt have the config for it;
put this in your modules folder, make sure u edit it to ur database
config.php - FileFront.com
that dont work for me gives me blank page...the online players that is
should work, works just fine for me; Is anybody actually online?
ok it all works grate now thanks for all your help
Np
need anything more just ask
here i edited mine a bit looks better :P and gives admins + banned + onlines maybe works..
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><center>Online:<br>'.$row[lastchar].'</strong>';
}
$result = mysql_query("SELECT * FROM accounts WHERE accesslevel = '0'", $db) or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
echo '<strong><center>------<br>Banned:<br>'.$row[username].'<BR>------</strong>';
}
$result = mysql_query("SELECT * FROM accounts WHERE accesslevel = '300'", $db) or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
echo '<strong><center>------<br>Admins:<br>'.$row[username].'<BR>------</strong>';
}
?>
doesnt rly work... all it does for me is spilt admins.. looks like this..
http://img91.imageshack.us/img91/4854/lolfk8.th.png
ill see if i can get it to work for me..
been editing it.. but still not done..
edit: done, works;
The only prob is, it lists the admins as there last char they were on, doesnt say when they are on or not but it does say who they are, it will list banned users at the bottom.. and the users part will show users when they are online.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 Admins and lists the char they were last on
// I cant seem to make it toggle when they are on or off so... it always will say they are on just listing them.
$result = mysql_query("SELECT * FROM accounts WHERE accesslevel = '300'", $db) or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
echo "<strong>Admins:".$row['lastchar']."<BR></strong>";
}
$result = mysql_query("SELECT * FROM accounts WHERE online = '1'", $db) or die(mysql_error());
echo "<strong><br><br>Users:</strong><br>";
while($row = mysql_fetch_array( $result )) {
echo "<strong>".$row['lastchar']."<BR></strong>";
}
// Select all the Banned and lists the char
// will also list them.
$result = mysql_query("SELECT * FROM accounts WHERE accesslevel = '0'", $db) or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
echo "<strong><br><br>Banned:".$row['lastchar']."<BR></strong>";
}
mysql_close($db);
?>
so it shows like this;
Admins: (last char name)
(next admin name)
Users: (name of a user online)
(another user in game)
Banned: (Name of banned player)
(if another banned one it will go down here)
and thats how it lists it.
v(^o^)v
here would be a cool idea try adding the item mall matt released to this CMS
actually i have been attempting that for the past half hour to hour i think im getting close =P
thats sick man! Hope you get it.it would be really neat to see
im going to sleep rite now, then i have school, then about an hour after i get home from school i have to do maintenance on my server, then after all that i will resume working on it =P
maybe u can do something like
add this
with this?PHP Code:$result = mysql_query("SELECT * FROM accounts WHERE accesslevel = '300'", $db) or die(mysql_error());
together lol im not that php advanced tho lolPHP Code:("SELECT * FROM accounts WHERE online = '1'", $db)