This repository has been archived by the owner on Jun 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtopten.php
134 lines (93 loc) · 2.72 KB
/
topten.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?
require_once ("header.php");
?>
<form action="make.php" method="POST">
<br>
<font face="sans-serif" size="2">
<i>ncane</i> is a Zulu word meaning "small", and that's what we're doing here: saving you space.
<br><br>
<b>STATISTICS:</b>
<br><br>
TOP TEN
<table><tr><td><font size="2">
<ol>
<?php
DBConnect();
$toptensql = "SELECT ncane_id, ncane_url, ncane_hit FROM ncane_tbl where ncane_exp = 0 ORDER BY ncane_hit DESC LIMIT 0, 10";
$result = mysql_query($toptensql) or die('Query failed: ' . mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$ncane_url = $row['ncane_url'];
$ncane_id = "http://ncane.com/" . $row['ncane_id'];
$ncane_hit = $row['ncane_hit'];
if ($row['ncane_hit'] < 2)
{
$hit_text = " hit";
}
else
{
$hit_text = " hits";
}
echo "\t<li><a href=\"" . $ncane_id . "\" target=\"_blank\">" . $ncane_id .
"</a> - " . number_format($ncane_hit, 0, '.', ',') . $hit_text . "</li>\n";
}
//DBCloseConnection();
?>
</ol>
</table>
<br><br>
ELEVEN TO TWENTY-FIVE
<table><tr><td><font size="2">
<ol start="11">
<?php
DBConnect();
$toptensql = "SELECT ncane_id, ncane_url, ncane_hit FROM ncane_tbl where ncane_exp = 0 ORDER BY ncane_hit DESC LIMIT 10, 15";
$result = mysql_query($toptensql) or die('Query failed: ' . mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$ncane_url = $row['ncane_url'];
$ncane_id = "http://ncane.com/" . $row['ncane_id'];
$ncane_hit = $row['ncane_hit'];
if ($row['ncane_hit'] < 2)
{
$hit_text = " hit";
}
else
{
$hit_text = " hits";
}
echo "\t<li><a href=\"" . $ncane_id . "\" target=\"_blank\">" . $ncane_id .
"</a> - " . number_format($ncane_hit, 0, '.', ',') . $hit_text . "</li>\n";
}
//DBCloseConnection();
?>
</ol>
</table>
<br><br>
TOP TEN CONTRIBUTORS
<table><tr><td><font size="2">
<ol>
<?php
DBConnect();
$toptensql = "SELECT ncane_ip, count(ncane_ip) as ncane_counter FROM ncane_vw where ncane_exp = 0 and ncane_ip <> '127.255.255.255' GROUP BY ncane_ip ORDER BY count(ncane_ip) DESC LIMIT 0, 10";
$result = mysql_query($toptensql) or die('Query failed: ' . mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$ncane_ip = $row['ncane_ip'];
$ncane_hit = $row['ncane_counter'];
if ($row['ncane_counter'] < 2)
{
$hit_text = " URL";
}
else
{
$hit_text = " URLs";
}
echo "\t<li>" . number_format($ncane_hit, 0, '.', ',') . $hit_text . "</li>\n";
}
//DBCloseConnection();
?>
</ol>
<? echo URLCounter(); ?>
</font></td></tr></table>
<? require_once ("footer.php"); ?>