- Joined
- Jun 27, 2009
- Messages
- 1,645
- Reaction score
- 287
Ok, i started to learn PHP and MySQL i created a little script for people that don't have the Registered Count on the the Header Here we go
First open inc/class.core.php
find
Under it add
Save it and Done with that
Now Open header.php
find
Under it add this
Also for got Open header.php again
find
Under it add
Now open lang/en.php
find
under it add
Then after that all done Create and File called registered.php and place this in it
Then your Done!!!
Screenie:
UPDATED
For the Registered to show on index page open index.php
fine
beside it add
Make sure you have the <br />
First open inc/class.core.php
find
PHP:
public static function UsersOnline()
{
$online = mysql_fetch_array(mysql_query("SELECT * FROM server_status"));
return intval($online['users_online']);
}
Under it add
PHP:
public static function UsersRegistered()
{
$register = mysql_query("SELECT * FROM users");
return intval ($users = mysql_num_rows($register));
}
Save it and Done with that
Now Open header.php
find
PHP:
<div class="OnlineCount"><?php echo $core->UsersOnline(); ?> <?php echo $lang['users_online']; ?></div>
Under it add this
PHP:
<div class="RegisterCount"><?php echo $core->UsersRegistered(); ?> <?php echo $lang['registered']; ?></div>
Also for got Open header.php again
find
PHP:
function RefreshUserCount()
{
var html = $.ajax({
url: "online.php",
async: false
}).responseText;
$('.OnlineCount').fadeOut(200, function () {
$('.OnlineCount').css("display", "none")
$('.OnlineCount').html(html + ' <?php echo $lang['users_online']; ?>')
$('.OnlineCount').fadeIn(200)
});
setTimeout("RefreshUserCount()",120000);
}
Under it add
PHP:
function UsersRegistered()
{
var html = $.ajax({
url: "registered.php",
async: false
}).responseText;
$('.RegisterCount').fadeOut(200, function () {
$('.RegisterCount').css("display", "none")
$('.RegisterCount').html(html + ' <?php echo $lang['users_online']; ?>')
$('.RegisterCount').fadeIn(200)
});
setTimeout("UsersRegistered()",120000);
}
Now open lang/en.php
find
PHP:
'users_online' => 'Users Online'
under it add
PHP:
'registered' => 'Users Registered'
Then after that all done Create and File called registered.php and place this in it
PHP:
<?php
define('USERNAME_REQUIRED', FALSE);
define('ACCOUNT_REQUIRED', FALSE);
include('global.php');
echo $core->UsersRegistered();
?>
Then your Done!!!
Screenie:
UPDATED
For the Registered to show on index page open index.php
fine
PHP:
<?php echo $core->UsersOnline(); ?> <?php echo $lang['users_online']; ?>
beside it add
PHP:
<br /> <?php echo $core->UsersRegistered(); ?> <?php echo $lang['registered']; ?>
Make sure you have the <br />
Last edited:
.
