3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the Revised BSD License.
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 Revised BSD License for more details.
11 Copyright 2004-2009 iDB Support - http://idb.berlios.de/
12 Copyright 2004-2009 Game Maker 2k - http://gamemaker2k.org/
14 $FileInfo: stats.php - Last Update: 7/21/2009 SVN 276 - Author: cooldude2k $
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="stats.php"||$File3Name=="/stats.php") {
20 if($_GET['act']=="view"||$_GET['act']=="stats") {
21 $ntquery = query("SELECT COUNT(*) FROM `".$Settings['sqltable']."topics`", array(null));
22 $ntresult = mysql_query($ntquery);
23 $numtopics = mysql_result($ntresult,0);
24 @mysql_free_result($ntresult);
25 $npquery = query("SELECT COUNT(*) FROM `".$Settings['sqltable']."posts`", array(null));
26 $npresult = mysql_query($npquery);
27 $numposts = mysql_result($npresult,0);
28 @mysql_free_result($npresult);
29 $nmquery = query("SELECT SQL_CALC_FOUND_ROWS * FROM `".$Settings['sqltable']."members` WHERE `id`>=0 AND `HiddenMember`='no' ORDER BY `Joined` DESC LIMIT 1", array(-1));
30 $rnmquery = query("SELECT FOUND_ROWS();", array(null));
31 $nmresult = mysql_query($nmquery);
32 $rnmresult = mysql_query($rnmquery);
33 //$nummembers = mysql_num_rows($nmresult);
34 $nummembers = mysql_result($rnmresult,0);
35 @mysql_free_result($rnmresult);
36 $NewestMem = array(null);
37 $NewestMem['ID']=mysql_result($nmresult,0,"id");
38 $NewestMem['Name']=mysql_result($nmresult,0,"Name");
39 if($NewestMem['ID']<=0) { $NewestMem['ID'] = "0"; $NewestMem['Name'] = "Anonymous"; }
41 <div class="StatsBorder">
42 <?php if($ThemeSet['TableStyle']=="div") { ?>
43 <div class="TableStatsRow1">
44 <span style="text-align: left;">
45 <?php echo $ThemeSet['TitleIcon']; ?><a id="bstats" href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=stats",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>#bstats">Board Statistics</a></span></div>
47 <table class="TableStats1">
48 <?php if($ThemeSet['TableStyle']=="table") { ?>
49 <tr class="TableStatsRow1">
50 <td class="TableStatsColumn1" colspan="2"><span style="text-align: left;">
51 <?php echo $ThemeSet['TitleIcon']; ?><a id="bstats" href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=stats",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>#bstats">Board Statistics</a></span>
54 <tr id="Stats1" class="TableStatsRow2">
55 <td class="TableStatsColumn2" colspan="2" style="width: 100%; font-weight: bold;">Board Stats</td>
57 <tr class="TableStatsRow3" id="Stats2">
58 <td style="width: 4%;" class="TableStatsColumn3"><div class="statsicon">
59 <?php echo $ThemeSet['StatsIcon']; ?></div></td>
60 <td style="width: 96%;" class="TableStatsColumn3"><div class="statsinfo">
61 Our members have made a total of <?php echo $numposts; ?> posts<br />
62 We have a total of <?php echo $numtopics; ?> topics made<br />
63 We have <?php echo $nummembers; ?> registered members<br />
64 Our newest member is <a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$NewestMem['ID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>"><?php echo $NewestMem['Name']; ?></a>
67 <tr id="Stats3" class="TableStatsRow4">
68 <td class="TableStatsColumn4" colspan="2"> </td>
71 <div class="DivStats"> </div>