Example #1
3
function runtime_init()
{
    global $conf;
    $runtime = cache_get('runtime');
    // 实时运行的数据,初始化!
    if ($runtime === NULL || !isset($runtime['users']) || !isset($runtime['onlines'])) {
        $runtime = array();
        $runtime['users'] = user_count();
        $runtime['posts'] = post_count();
        $runtime['threads'] = thread_count();
        $runtime['posts'] -= $runtime['threads'];
        // 减去首帖
        $runtime['todayusers'] = 0;
        $runtime['todayposts'] = 0;
        $runtime['todaythreads'] = 0;
        $runtime['onlines'] = max(1, online_count());
        // runtime_append
        $arr = kv_get('runtime_append');
        is_array($arr) and $runtime += $arr;
        cache_set('runtime', $runtime, TRUE);
    }
    return $runtime;
}
Example #2
0
function online_gc()
{
    global $time, $conf;
    $expiry = $time - $conf['online_hold_time'];
    $n = db_exec("DELETE FROM `bbs_online` WHERE last_date<'{$expiry}'");
    // 重新统计在线数, MyISAM count 快,InnoDB 慢。
    runtime_set('onlines', max(1, online_count()));
    // 清理缓存
    online_list_cache_delete();
}
Example #3
0
<?php

session_start();
include_once 'config.php';
// loads config variables
include_once 'functions.php';
$servers = server_status();
$users = online_count();
opentable('<font color="yellow">Evangelis RO</font><br><font size="1" color="gray">- 500x500x100x -<br>High Rates Premium</font>');
echo '
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td align="center"><b>Login</b></td>
				<td align="center"><b>Char</b></td>
				<td align="center"><b>Map</b></td>
			</tr>
			<tr>
	';
if ($servers & 1) {
    echo '
			 <td><img src="online.png"></td>
		';
} else {
    echo '
			<td><img src="offline.png"></td>
		';
}
if ($servers & 2) {
    echo '
			 <td><img src="online.png"></td>
		';
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

To contact any of the authors about special permissions send
an e-mail to cerescp@gmail.com
*/
session_start();
include_once 'config.php';
// loads config variables
include_once 'query.php';
// imports queries
include_once 'functions.php';
$servers = server_status();
$quantos = moneyformat(online_count());
//Dynamic Info Check [ABOUT_RATES|RATES_AGIT]
if ($CONFIG_dynamic_info || $CONFIG_agit_check) {
    if ($CONFIG_agit_check) {
        $query = sprintf(RATES_AGIT, $CONFIG_dynamic_name);
    } else {
        $query = sprintf(ABOUT_RATES, $CONFIG_dynamic_name);
    }
    $result = execute_query($query, 'server_status.php');
    $line = $result->fetch_row();
    $rate_base = moneyformat($line[0] / 100);
    $rate_job = moneyformat($line[1] / 100);
    $rate_drop = moneyformat($line[2] / 100);
    if (isset($line[3])) {
        if ($line[3] == 1) {
            $agit_status = "<font color=\"green\">" . $lang['AGIT_ON'] . "</font>";