Пример #1
0
<?php

#   Copyright by Manuel
#   Support www.ilch.de
defined('main') or die('no direct access');
if (empty($_GET['sum'])) {
    $heute = date('Y-m-d');
    $ges_visits = db_result(db_query("SELECT SUM(count) FROM prefix_counter"), 0);
    $ges_heute = @db_result(db_query("SELECT count FROM prefix_counter WHERE date = '" . $heute . "'"), 0);
    $ges_gestern = @db_result(db_query('SELECT count FROM prefix_counter WHERE date < "' . $heute . '" ORDER BY date DESC LIMIT 1'), 0);
    echo $lang['whole'] . ': ' . $ges_visits . '<br />';
    echo $lang['today'] . ': ' . $ges_heute . '<br />';
    echo $lang['yesterday'] . ': ' . $ges_gestern . '<br />';
    echo 'Online: ' . ges_online() . '<br />';
    echo '<a class="box" href="index.php?statistik"><b>... ' . $lang['more'] . '</b></a>';
} else {
    $title = $allgAr['title'] . ' :: Statistik';
    $hmenu = 'Statistik';
    $design = new design($title, $hmenu, 0);
    $design->header();
    $anzahlShownTage = 7;
    echo '<br /><table width=90%" align="center" class="border" cellpadding="0" cellspacing="1" border="0"><tr><td>';
    echo '<table width="100%" border="0" cellpadding="5" cellspacing="0">';
    echo '<tr class="Chead"><td colspan="3" align="center"><b>Site Statistik</b></td></tr>';
    $max_in = 0;
    $ges = 0;
    $dat = array();
    $max_width = 200;
    $maxErg = db_query('SELECT MAX(count) FROM `prefix_counter`');
    $max_in = db_result($maxErg, 0);
    $erg = db_query("SELECT count, DATE_FORMAT(date,'%a der %d. %b') as datum FROM `prefix_counter` ORDER BY date DESC LIMIT " . $anzahlShownTage);
Пример #2
0
$tpl->out(0);
$category_array = array();
$forum_array = array();
$q = "SELECT\r\n  a.id, a.cid, a.name, a.besch,\r\n  a.topics, a.posts, b.name as topic,\r\n  c.id as pid, c.tid, b.rep, c.erst, c.time,\r\n  a.cid, k.name as cname\r\nFROM prefix_forums a\r\n  LEFT JOIN prefix_forumcats k ON k.id = a.cid\r\n  LEFT JOIN prefix_posts c ON a.last_post_id = c.id\r\n  LEFT JOIN prefix_topics b ON c.tid = b.id\r\n\t\r\n  LEFT JOIN prefix_groupusers vg ON vg.uid = " . $_SESSION['authid'] . " AND vg.gid = a.view\r\n  LEFT JOIN prefix_groupusers rg ON rg.uid = " . $_SESSION['authid'] . " AND rg.gid = a.reply\r\n  LEFT JOIN prefix_groupusers sg ON sg.uid = " . $_SESSION['authid'] . " AND sg.gid = a.start\r\n\t\r\nWHERE ((" . $_SESSION['authright'] . " <= a.view AND a.view < 1) \r\n   OR (" . $_SESSION['authright'] . " <= a.reply AND a.reply < 1)\r\n   OR (" . $_SESSION['authright'] . " <= a.start AND a.start < 1)\r\n\t OR vg.fid IS NOT NULL\r\n\t OR rg.fid IS NOT NULL\r\n\t OR sg.fid IS NOT NULL\r\n\t OR -9 = " . $_SESSION['authright'] . ")\r\n\t AND k.cid = 0\r\nORDER BY k.pos, a.pos";
$erg1 = db_query($q);
$xcid = 0;
while ($r = db_fetch_assoc($erg1)) {
    $r['topicl'] = $r['topic'];
    $r['topic'] = html_enc_substr($r['topic'], 0, 23);
    $r['ORD'] = forum_get_ordner($r['time'], $r['id']);
    $r['mods'] = getmods($r['id']);
    $r['datum'] = date('d.m.y - H:i', $r['time']);
    $r['page'] = ceil(($r['rep'] + 1) / $allgAr['Fpanz']);
    $tpl->set_ar($r);
    if ($r['cid'] != $xcid) {
        $tpl->out(1);
        //Unterkategorien
        $sql = db_query("SELECT DISTINCT a.name as cname, a.id as cid FROM `prefix_forumcats` a LEFT JOIN `prefix_forums` b ON a.id = b.cid WHERE a.cid = {$r['cid']} AND a.id = b.cid ORDER BY a.pos, a.name");
        while ($ucat = db_fetch_assoc($sql)) {
            $tpl->set_ar_out($ucat, 2);
        }
        //Unterkategorien - Ende
        $xcid = $r['cid'];
    }
    $tpl->set_ar_out($r, 3);
}
# statistic #
$ges_online_user = ges_online();
$stats_array = array('privmsgpopup' => check_for_pm_popup(), 'topics' => db_result(db_query("SELECT COUNT(ID) FROM `prefix_topics`"), 0), 'posts' => db_result(db_query("SELECT COUNT(ID) FROM `prefix_posts`"), 0), 'users' => db_result(db_query("SELECT COUNT(ID) FROM `prefix_user`"), 0), 'istsind' => $ges_online_user > 1 ? 'sind' : 'ist', 'gesonline' => $ges_online_user, 'gastonline' => ges_gast_online(), 'useronline' => ges_user_online(), 'userliste' => user_online_liste());
$tpl->set_ar_out($stats_array, 4);
$design->footer();