Statistik 2.0 - Druckversion +- MyBB.de Forum (https://www.mybb.de/forum) +-- Forum: Anpassungen (https://www.mybb.de/forum/forum-47.html) +--- Forum: Plugin-Diskussionen (https://www.mybb.de/forum/forum-38.html) +--- Thema: Statistik 2.0 (/thread-1586.html) |
RE: Statistik 2.0 - cooper1988 - 30.03.2006 <?php /** * MyBB 1.0 * Copyright © 2005 MyBulletinBoard Group, All Rights Reserved * * Website: http://www.mybboard.com * License: http://www.mybboard.com/eula.html * * $Id: stats.php 897 2005-11-13 20:08:05Z dennis $ */ define("KILL_GLOBALS", 1); $templatelist = "stats,stats_thread"; require "./global.php"; require "./inc/functions_post.php"; // Load global language phrases $lang->load("stats"); addnav($lang->nav_stats); $stats = $cache->read("stats"); if($stats['numthreads'] < 1 || $stats['numposts'] < 1) { error($lang->not_enough_info_stats); } $plugins->run_hooks("stats_start"); $repliesperthread = mynumberformat(round((($stats['numposts'] - $stats['numthreads']) / $stats['numthreads']), 2)); $postspermember = mynumberformat(round(($stats['numposts'] / $stats['numusers']), 2)); // Get number of days since board start (might need improvement) $query = $db->query("SELECT regdate FROM ".TABLE_PREFIX."users ORDER BY regdate LIMIT 1"); $result = $db->fetch_array($query); $days = (time() - $result['regdate']) / 86400; // Get "per day" things $postsperday = mynumberformat(round(($stats['numposts'] / $days), 2)); $threadsperday = mynumberformat(round(($stats['numthreads'] / $days), 2)); $membersperday = mynumberformat(round(($stats['numusers'] / $days), 2)); // Get forum permissions $unviewableforums = getunviewableforums(); if($unviewableforums) { $fidnot = " AND fid NOT IN ($unviewableforums)"; } // Most replied-to threads $query = $db->query("SELECT tid, subject, replies FROM ".TABLE_PREFIX."threads WHERE 1=1 $fidnot ORDER BY replies DESC LIMIT 0, ".$mybb->settings[statslimit]); while($thread = $db->fetch_array($query)) { $thread['subject'] = htmlspecialchars_uni(stripslashes(dobadwords($thread['subject']))); $numberbit = mynumberformat($thread['replies']); $numbertype = $lang->replies; eval("\$mostreplies .= \"".$templates->get("stats_thread")."\";"); } // Most viewed threads $query = $db->query("SELECT tid, subject, views FROM ".TABLE_PREFIX."threads WHERE 1=1 $fidnot ORDER BY views DESC LIMIT 0, ".$mybb->settings[statslimit]); while($thread = $db->fetch_array($query)) { $thread['subject'] = htmlspecialchars_uni(stripslashes(dobadwords($thread['subject']))); $numberbit = mynumberformat($thread['views']); $numbertype = $lang->views; eval("\$mostviews .= \"".$templates->get("stats_thread")."\";"); } // Top forum $query = $db->query("SELECT fid, name, threads, posts FROM ".TABLE_PREFIX."forums WHERE 1=1 $fidnot AND type='f' ORDER BY posts DESC LIMIT 1"); $forum = $db->fetch_array($query); if(!$forum['posts']) { $topforum = $lang->none; $topforumposts = $lang->no; $topforumthreads = $lang->no; } else { $forum['name'] = htmlspecialchars_uni(stripslashes($forum['name'])); $topforum = "<a href=\"forumdisplay.php?fid=$forum[fid]\">$forum[name]</a>"; $topforumposts = $forum['posts']; $topforumthreads = $forum['threads']; } // Today's top poster $timesearch = time() - 86400; $query = $db->query("SELECT u.uid, u.username, COUNT(*) AS poststoday FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid) WHERE p.dateline > $timesearch GROUP BY p.uid ORDER BY poststoday DESC LIMIT 1"); $user = $db->fetch_array($query); if(!$user['poststoday']) { $topposter = $lang->nobody; $topposterposts = $lang->no_posts; } else { if(!$user['uid']) { $topposter = $lang->guest; } else { $topposter = "<a href=\"member.php?action=profile&uid=$user[uid]\">$user[username]</a>"; } //Eldest Member $rt = $db->query("SELECT uid, username, birthday FROM ".TABLE_PREFIX."users ORDER BY birthday DESC LIMIT 0,1"); while($nt = $db->fetch_array($rt)){ $usr = $nt['username']; $aged = "<a href=\"member.php?action=profile&uid=$nt[uid]\">$usr</a>"; $agedd = $nt['birthday']; } //youngest Member $rt = $db->query("SELECT uid, username, birthday FROM ".TABLE_PREFIX."users WHERE birthday != '' ORDER BY birthday ASC LIMIT 0,1"); while($nt = $db->fetch_array($rt)){ $usr = $nt['username']; $youngest = "<a href=\"member.php?action=profile&uid=$nt[uid]\">$usr</a>"; $youngestd = $nt['birthday']; } //First Member $rt = $db->query("SELECT uid, username, regdate FROM ".TABLE_PREFIX."users ORDER BY regdate ASC LIMIT 0,2"); while($nt = $db->fetch_array($rt)){ $usr = $nt['username']; $ftreg = "<a href=\"member.php?action=profile&uid=$nt[uid]\">$usr</a>"; $ftregd= $nt['regdate']; } //last visit $rt = $db->query("SELECT uid, username, lastvisit FROM ".TABLE_PREFIX."users ORDER BY lastvisit DESC LIMIT 0,2"); while($nt = $db->fetch_array($rt)){ $usr = $nt['username']; $lastvisitor = "<a href=\"member.php?action=profile&uid=$nt[uid]\">$usr</a>"; $lastvisitord= $nt['lastvisit']; } //total males $rt = $db->query("SELECT count( * ) AS fid FROM ".TABLE_PREFIX."userfields WHERE fid3 = 'Male'"); while($nt = $db->fetch_array($rt)){ $tm = $nt['fid']; $tmale = "$tm"; } //total Undisclosed $rt = $db->query("SELECT count( * ) AS fid FROM ".TABLE_PREFIX."userfields WHERE fid3 = 'Undisclosed'"); while($nt = $db->fetch_array($rt)){ $tu = $nt['fid']; $tundi = "$tu"; } //total Females $rt = $db->query("SELECT count( * ) AS fid FROM ".TABLE_PREFIX."userfields WHERE fid3 = 'Female'"); while($nt = $db->fetch_array($rt)){ $tf = $nt['fid']; $tfem = "$tf"; } //top poster $rt = $db->query("SELECT uid, username, postnum FROM ".TABLE_PREFIX."users ORDER BY postnum DESC LIMIT 0,1"); while($nt = $db->fetch_array($rt)){ $usr = $nt['username']; $tpost = "<a href=\"member.php?action=profile&uid=$nt[uid]\">$usr</a>"; $tpost2 = $nt['postnum']; } // What percent of members have posted? $query = $db->query("SELECT COUNT(*) FROM ".TABLE_PREFIX."users WHERE postnum > 0"); $posters = $db->result($query, 0); $havepostedpercent = round((($posters / $stats['numusers']) * 100), 2) . "%"; $lang->todays_top_poster = sprintf($lang->todays_top_poster, $topposter, mynumberformat($topposterposts)); $lang->popular_forum = sprintf($lang->popular_forum, $topforum, mynumberformat($topforumposts), mynumberformat($topforumthreads)); $stats['numposts'] = mynumberformat($stats['numposts']); $stats['numthreads'] = mynumberformat($stats['numthreads']); $stats['numusers'] = mynumberformat($stats['numusers']); eval("\$stats = \"".$templates->get("stats")."\";"); $plugins->run_hooks("stats_end"); outputpage($stats); ?> RE: Statistik 2.0 - Michael - 31.03.2006 Ist das die originale stats.php, die du hochgeladen hast? RE: Statistik 2.0 - cooper1988 - 31.03.2006 ja is die originale stats.php RE: Statistik 2.0 - Michael - 31.03.2006 Nein ist sie nicht, du hast eine falsche (modifizierte) Datei übertragen. RE: Statistik 2.0 - cooper1988 - 31.03.2006 ne hab ich net das is die originale so wie ichs gesaugt habe poste ma die originale RE: Statistik 2.0 - cooper1988 - 31.03.2006 gut hab es schon kann ma das auch irgendwie auch auf die startseite bringen so das es ganz unten zu sehn ist RE: Statistik 2.0 - Michael - 31.03.2006 Dazu musst du das entsprechende Template durch den gewünschten Code ergänzen und den PHP-Code in die index.php einfügen, bevor das entsprechende Template geladen wird. RE: Statistik 2.0 - cooper1988 - 01.04.2006 wenn du mir noch sagst wie das geht bin ich zufrieden mit dir(euch) RE: Statistik 2.0 - Garlant - 01.04.2006 Hallo Cooper1988, Unten ist etwas weit gefächert(unter der useronlineanzeige, unter dem headder,...). Wo genau willst du das denn einbauen? Dann können wir dir auch sagen was du suchen kannst RE: Statistik 2.0 - cooper1988 - 01.04.2006 schau ma in mein forum unten steht schon ein bsp Forenstatistik dort hätte ichs gern hin gegen das alte system Forenstatistik soll nun das neue dort sein siehe bild [Bild: http://img97.imageshack.us/img97/3113/test9cd.th.jpg] |