1 |
<?php |
2 |
|
3 |
###################################################################### |
4 |
# PHP-NUKE: Web Portal System |
5 |
# =========================== |
6 |
# |
7 |
# Copyright (c) 2000 by Francisco Burzi (fburzi@ncc.org.ve) |
8 |
# http://www.ncc.org.ve/php-nuke.php |
9 |
# |
10 |
# This modules is to produce statistics about access at your site |
11 |
# |
12 |
# This program is free software. You can redistribute it and/or modify |
13 |
# it under the terms of the GNU General Public License as published by |
14 |
# the Free Software Foundation; either version 2 of the License. |
15 |
###################################################################### |
16 |
|
17 |
if (!isset($mainfile)) { include("mainfile.php"); } |
18 |
include("header.php"); |
19 |
include("config.php"); |
20 |
|
21 |
$dkn = mysql_query("select type, var, count from counter order by type desc"); |
22 |
if (!$dkn) { echo mysql_errno(). ": ".mysql_error(). "<br>"; exit(); } |
23 |
while(list($type, $var, $count) = mysql_fetch_row($dkn)) { |
24 |
if(($type == "total") && ($var == "hits")) { |
25 |
$total = $count; |
26 |
} elseif($type == "browser") { |
27 |
if($var == "Netscape") { |
28 |
$netscape[] = $count; |
29 |
$netscape[] = substr(100 * $count / $total, 0, 5); |
30 |
} elseif($var == "MSIE") { |
31 |
$msie[] = $count; |
32 |
$msie[] = substr(100 * $count / $total, 0, 5); |
33 |
} elseif($var == "Konqueror") { |
34 |
$konqueror[] = $count; |
35 |
$konqueror[] = substr(100 * $count / $total, 0, 5); |
36 |
} elseif($var == "Opera") { |
37 |
$opera[] = $count; |
38 |
$opera[] = substr(100 * $count / $total, 0, 5); |
39 |
} elseif($var == "Lynx") { |
40 |
$lynx[] = $count; |
41 |
$lynx[] = substr(100 * $count / $total, 0, 5); |
42 |
} elseif($var == "WebTV") { |
43 |
$webtv[] = $count; |
44 |
$webtv[] = substr(100 * $count / $total, 0, 5); |
45 |
} elseif($var == "Bot") { |
46 |
$bot[] = $count; |
47 |
$bot[] = substr(100 * $count / $total, 0, 5); |
48 |
} elseif(($type == "browser") && ($var == "Other")) { |
49 |
$b_other[] = $count; |
50 |
$b_other[] = substr(100 * $count / $total, 0, 5); |
51 |
} |
52 |
} elseif($type == "os") { |
53 |
if($var == "Windows") { |
54 |
$windows[] = $count; |
55 |
$windows[] = substr(100 * $count / $total, 0, 5); |
56 |
} elseif($var == "Mac") { |
57 |
$mac[] = $count; |
58 |
$mac[] = substr(100 * $count / $total, 0, 5); |
59 |
} elseif($var == "Linux") { |
60 |
$linux[] = $count; |
61 |
$linux[] = substr(100 * $count / $total, 0, 5); |
62 |
} elseif($var == "FreeBSD") { |
63 |
$freebsd[] = $count; |
64 |
$freebsd[] = substr(100 * $count / $total, 0, 5); |
65 |
} elseif($var == "SunOS") { |
66 |
$sunos[] = $count; |
67 |
$sunos[] = substr(100 * $count / $total, 0, 5); |
68 |
} elseif($var == "IRIX") { |
69 |
$irix[] = $count; |
70 |
$irix[] = substr(100 * $count / $total, 0, 5); |
71 |
} elseif($var == "BeOS") { |
72 |
$beos[] = $count; |
73 |
$beos[] = substr(100 * $count / $total, 0, 5); |
74 |
} elseif($var == "OS/2") { |
75 |
$os2[] = $count; |
76 |
$os2[] = substr(100 * $count / $total, 0, 5); |
77 |
} elseif($var == "AIX") { |
78 |
$aix[] = $count; |
79 |
$aix[] = substr(100 * $count / $total, 0, 5); |
80 |
} elseif(($type == "os") && ($var == "Other")) { |
81 |
$os_other[] = $count; |
82 |
$os_other[] = substr(100 * $count / $total, 0, 5); |
83 |
} |
84 |
} |
85 |
} |
86 |
|
87 |
echo "<center><font face=Arial,Helvetica size=3>".translate("We received")." <b>$total</b> ".translate("visitors from")." $startdate<br><br>"; |
88 |
|
89 |
echo "<TABLE CELLSPACING=0 CELLPADDING=2 BORDER=0 BGCOLOR=000000><TR><TD COLSPAN=2>"; |
90 |
echo "<TABLE CELLSPACING=0 CELLPADDING=3 BORDER=0 BGCOLOR=FFFFFF>"; |
91 |
echo "<font color=White face=Arial,Helvetica><center><b>".translate("Browsers")."</b></center></font>"; |
92 |
echo "<tr><td><img src=images/stats/explorer.gif border=0><font face=Arial,Helvetica size=2> MSIE: </td><td><img src=\"images/leftbar.gif\" height=16 width=4 Alt=\"Internet Explorer\"><img src=\"images/mainbar.gif\" Alt=\"Internet Explorer\" height=16 width=", $msie[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"Internet Explorer\"> $msie[1] % ($msie[0])</td></tr>\n"; |
93 |
echo "<tr><td><img src=images/stats/netscape.gif border=0><font face=Arial,Helvetica size=2> Netscape: </td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"Netscape\"><img src=\"images/mainbar.gif\" Alt=\"Netscape\" height=16 width=", $netscape[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"Netscape\"> $netscape[1] % ($netscape[0])</td></tr>\n"; |
94 |
echo "<tr><td><img src=images/stats/opera.gif border=0><font face=Arial,Helvetica size=2> Opera: </td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"Opera\"><img src=\"images/mainbar.gif\" Alt=\"Opera\" height=16 width=", $opera[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"Opera\"> $opera[1] % ($opera[0])</td></tr>\n"; |
95 |
echo "<tr><td><img src=images/stats/webtv.gif border=0><font face=Arial,Helvetica size=2> WebTV: </td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"WebTV\"><img src=\"images/mainbar.gif\" Alt=\"WebTV\" height=16 width=", $webtv[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"WebTV\"> $webtv[1] % ($webtv[0])</td></tr>\n"; |
96 |
echo "<tr><td><img src=images/stats/konqueror.gif border=0><font face=Arial,Helvetica size=2> Konqueror: </td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"Konqueror\"><img src=\"images/mainbar.gif\" Alt=\"Konqueror (KDE)\" height=16 width=", $konqueror[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"Konqueror\"> $konqueror[1] % ($konqueror[0])</td></tr>\n"; |
97 |
echo "<tr><td><img src=images/stats/lynx.gif border=0><font face=Arial,Helvetica size=2> Lynx: </td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"Lynx\"><img src=\"images/mainbar.gif\" Alt=\"Lynx\" height=16 width=", $lynx[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"Lynx\"> $lynx[1] % ($lynx[0])</td></tr>\n"; |
98 |
echo "<tr><td><img src=images/stats/altavista.gif border=0><font face=Arial,Helvetica size=2> Buscadores: </td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"Robots - Spiders - Buscadores\"><img src=\"images/mainbar.gif\" Alt=\"Robots - Spiders - Buscadores\" height=16 width=", $bot[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"Robots - Spiders - Buscadores\"> $bot[1] % ($bot[0])</td></tr>\n"; |
99 |
echo "<tr><td><img src=images/stats/question.gif border=0><font face=Arial,Helvetica size=2> ".translate("Unknown").": </td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"Otros - Desconocidos\"><img src=\"images/mainbar.gif\" Alt=\"Otros - Desconocidos\" height=16 width=", $b_other[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"Otros - Desconocidos\"> $b_other[1] % ($b_other[0])"; |
100 |
echo "</FONT>"; |
101 |
echo "</TD></TR></TABLE>"; |
102 |
echo "</TD></TR></TABLE>"; |
103 |
echo "<br><br><center>"; |
104 |
echo "<TABLE CELLSPACING=0 CELLPADDING=2 BORDER=0 BGCOLOR=000000><TR><TD COLSPAN=2>"; |
105 |
echo "<TABLE CELLSPACING=0 CELLPADDING=3 BORDER=0 BGCOLOR=FFFFFF>"; |
106 |
echo "<font color=White face=Arial,Helvetica><center><b>".translate("Operating Systems")."</b></center></font>"; |
107 |
echo "<tr><td><img src=images/stats/windows.gif border=0><font face=Arial,Helvetica size=2> Windows:</td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"Windows\"><img src=\"images/mainbar.gif\" Alt=\"Windows\" height=16 width=", $windows[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"Windows\"> $windows[1] % ($windows[0])</td></tr>\n"; |
108 |
echo "<tr><td><img src=images/stats/linux.gif border=0><font face=Arial,Helvetica size=2> Linux:</td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"Linux\"><img src=\"images/mainbar.gif\" Alt=\"Linux\" height=16 width=", $linux[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"Linux\"> $linux[1] % ($linux[0])</td></tr>\n"; |
109 |
echo "<tr><td><img src=images/stats/mac.gif border=0><font face=Arial,Helvetica size=2> Mac/PPC:</td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"Mac/PPC\"><img src=\"images/mainbar.gif\" Alt=\"Mac - PPC\" height=16 width=", $mac[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"Mac/PPC\"> $mac[1] % ($mac[0])</td></tr>\n"; |
110 |
echo "<tr><td><img src=images/stats/bsd.gif border=0><font face=Arial,Helvetica size=2> FreeBSD:</td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"FreeBSD\"><img src=\"images/mainbar.gif\" Alt=\"FreeBSD\" height=16 width=", $freebsd[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"FreeBSD\"> $freebsd[1] % ($freebsd[0])</td></tr>\n"; |
111 |
echo "<tr><td><img src=images/stats/sun.gif border=0><font face=Arial,Helvetica size=2> SunOS:</td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"SunOS\"><img src=\"images/mainbar.gif\" Alt=\"SunOS\" height=16 width=", $sunos[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"SunOS\"> $sunos[1] % ($sunos[0])</td></tr>\n"; |
112 |
echo "<tr><td><img src=images/stats/irix.gif border=0><font face=Arial,Helvetica size=2> IRIX:</td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"SGI Irix\"><img src=\"images/mainbar.gif\" Alt=\"SGI Irix\" height=16 width=", $irix[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"SGI Irix\"> $irix[1] % ($irix[0])</td></tr>\n"; |
113 |
echo "<tr><td><img src=images/stats/be.gif border=0><font face=Arial,Helvetica size=2> BeOS:</td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"BeOS\"><img src=\"images/mainbar.gif\" Alt=\"BeOS\" height=16 width=", $beos[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"BeOS\"> $beos[1] % ($beos[0])</td></tr>\n"; |
114 |
echo "<tr><td><img src=images/stats/os2.gif border=0><font face=Arial,Helvetica size=2> OS/2:</td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"OS/2\"><img src=\"images/mainbar.gif\" Alt=\"OS/2\" height=16 width=", $os2[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"OS/2\"> $os2[1] % ($os2[0])</td></tr>\n"; |
115 |
echo "<tr><td><img src=images/stats/aix.gif border=0><font face=Arial,Helvetica size=2> AIX:</td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"AIX\"><img src=\"images/mainbar.gif\" Alt=\"AIX\" height=16 width=", $aix[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"AIX\"> $aix[1] % ($aix[0])</td></tr>\n"; |
116 |
echo "<tr><td><img src=images/stats/question.gif border=0><font face=Arial,Helvetica size=2> ".translate("Unknown").":</td><td><img src=\"images/leftbar.gif\" height=16 width=3 Alt=\"Otros - Desconocidos\"><img src=\"images/mainbar.gif\" ALt=\"Otros - Desconocidos\" height=16 width=", $os_other[1] * 2, "><img src=\"images/rightbar.gif\" height=16 width=3 Alt=\"Otros - Desconocidos\"> $os_other[1] % ($os_other[0])"; |
117 |
echo "</FONT>"; |
118 |
echo "</TD></TR></TABLE>"; |
119 |
echo "</TD></TR></TABLE>"; |
120 |
echo "<br><br><center>"; |
121 |
|
122 |
$result = mysql_query("select * from users"); |
123 |
$unum = mysql_num_rows($result); |
124 |
$result = mysql_query("select * from authors"); |
125 |
$anum = mysql_num_rows($result); |
126 |
$result = mysql_query("select * from stories"); |
127 |
$snum = mysql_num_rows($result); |
128 |
$result = mysql_query("select * from comments"); |
129 |
$cnum = mysql_num_rows($result); |
130 |
$result = mysql_query("select * from sections"); |
131 |
$secnum = mysql_num_rows($result); |
132 |
$result = mysql_query("select * from seccont"); |
133 |
$secanum = mysql_num_rows($result); |
134 |
$result = mysql_query("select * from queue"); |
135 |
$subnum = mysql_num_rows($result); |
136 |
$result = mysql_query("select * from topics"); |
137 |
$tnum = mysql_num_rows($result); |
138 |
$result = mysql_query("select * from links_links"); |
139 |
$links = mysql_num_rows($result); |
140 |
$result = mysql_query("select * from links_categories"); |
141 |
$cat1 = mysql_num_rows($result); |
142 |
$result = mysql_query("select * from links_subcategories"); |
143 |
$cat2 = mysql_num_rows($result); |
144 |
$cat = $cat1+$cat2; |
145 |
|
146 |
echo "<TABLE CELLSPACING=0 CELLPADDING=2 BORDER=0 BGCOLOR=000000><TR><TD COLSPAN=2>"; |
147 |
echo "<TABLE CELLSPACING=0 CELLPADDING=3 BORDER=0 BGCOLOR=FFFFFF>"; |
148 |
echo "<font color=White face=Arial,Helvetica><center><b>".translate("Miscelaneous Stats")."</b></center></font>"; |
149 |
echo "<tr><td><img src=images/stats/users.gif border=0><font face=Arial,Helvetica size=3> ".translate("Registered Users: ")."</td><td><font face=Arial,Helvetica size=3><b>$unum</b></td></tr>\n"; |
150 |
echo "<tr><td><img src=images/stats/authors.gif border=0><font face=Arial,Helvetica size=3> ".translate("Active Authors: ")."</td><td><font face=Arial,Helvetica size=3><b>$anum</b></td></tr>\n"; |
151 |
echo "<tr><td><img src=images/stats/news.gif border=0><font face=Arial,Helvetica size=3> ".translate("Stories Published: ")."</td><td><font face=Arial,Helvetica size=3><b>$snum</b></td></tr>\n"; |
152 |
echo "<tr><td><img src=images/stats/topics.gif border=0><font face=Arial,Helvetica size=3> ".translate("Active Topics: ")."</td><td><font face=Arial,Helvetica size=3><b>$tnum</b></td></tr>\n"; |
153 |
echo "<tr><td><img src=images/stats/comments.gif border=0><font face=Arial,Helvetica size=3> ".translate("Comments Posted: ")."</td><td><font face=Arial,Helvetica size=3><b>$cnum</b></td></tr>\n"; |
154 |
echo "<tr><td><img src=images/stats/sections.gif border=0><font face=Arial,Helvetica size=3> ".translate("Special Sections: ")."</td><td><font face=Arial,Helvetica size=3><b>$secnum</b></td></tr>\n"; |
155 |
echo "<tr><td><img src=images/stats/articles.gif border=0><font face=Arial,Helvetica size=3> ".translate("Articles in Sections: ")."</td><td><font face=Arial,Helvetica size=3><b>$secanum</b></td></tr>\n"; |
156 |
|
157 |
echo "<tr><td><img src=images/stats/topics.gif border=0><font face=Arial,Helvetica size=3> ".translate("Links in Web Links: ")."</td><td><font face=Arial,Helvetica size=3><b>$links</b></td></tr>\n"; |
158 |
echo "<tr><td><img src=images/stats/sections.gif border=0><font face=Arial,Helvetica size=3> ".translate("Categories in Web Links: ")."</td><td><font face=Arial,Helvetica size=3><b>$cat</b></td></tr>\n"; |
159 |
|
160 |
echo "<tr><td><img src=images/stats/waiting.gif border=0><font face=Arial,Helvetica size=3> ".translate("News Waiting to be Published: ")."</td><td><font face=Arial,Helvetica size=3><b>$subnum</b></td></tr>\n"; |
161 |
echo "</FONT>"; |
162 |
echo "</TD></TR></TABLE>"; |
163 |
echo "</TD></TR></TABLE>"; |
164 |
|
165 |
echo "<br><br><br></center>"; |
166 |
include("footer.php"); |
167 |
|
168 |
?> |