php session_start define NTOP title Главная require_once system connec

  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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<?php
session_start();
define('NTOP', 1);
$title = 'Главная';
require_once ('system/connect.php');
require_once ('system/core.php');
require_once ('system/function.php');
require_once ('system/head.php');
require_once ('system/panel.php');
require_once ('system/news.php');
if($_COOKIE['version'] == 'wap'){
echo "<div class='tip'>";
echo "<center>";
echo "Топ100";
echo "</center>";
echo "</div>";
$all = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0'"));
if($all != 0){
$total=intval(($all-1)/$page_top)+1;
$page=abs(intval($_GET['page']));
if(empty($page) OR $page < 0){
$page = 1;
}
if($page > $total){
$page = $total;
}
$past=intval($all/$page_top);
$start=$page*$page_top-$page_top;
$top = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0' ORDER BY `hosts` DESC LIMIT ".$start.",".$page_top."");
while($row = mysql_fetch_array($top)){
$start++;
if($_SESSION['id'] == $row['id']){
$div_1 = "</div><div class='main'><b>";
}else{
$div_1 = "</div><a href='http://".$set['home']."/stats/".$row['id']."'><div class='main1'>";
}
echo $div_1.$start.".";
echo "<b>".$row['url']."</b>";
echo "";
echo " ".$row['hosts'].":".$row['hits']." ";
echo "</br>";
if(mb_strlen($row['about']) > 250){
$text = substr($row['about'],0,250);
echo " ".$text."...</br>";
}else{
echo " ".$row['about']."<br/></b>";
echo "<small>";
echo "<font color='#4F4F4F'>";
echo "В топ:".$row['in']."";
echo " | Из топа:".$row['out']." ";
echo "</font>";
echo "</small>";
echo "</br>";
}
echo "</div></a>";
}
navigation($all,$page_top,$page,'/',$total);
}else{
echo "<div class='main'>";
echo "Сайтов участвующих в Топ-100 не обнаружено!";
echo "</div>";
}
echo "<a href='http://".$set['home']."/modules/category'>";
echo "<div class='mav'>";
echo "Категории";
echo "</div>";
echo "</a>";
echo "<a href='http://".$set['home']."/modules/search'>";
echo "<div class='mav'>";
echo "Поиск Сайта";
echo "</div>";
echo "</a>";
echo "<a href='http://".$set['home']."/modules/ban'>";
echo "<div class='mav'>";
echo "Бан Лист";
echo "</div>";
echo "</a>";
echo "<a href='http://".$set['home']."/modules/news.php'>";
echo "<div class='mav'>";
echo "Новости";
echo "</div>";
echo "</a>";
echo "<a href='http://".$set['home']."/modules/users.php'>";
echo "<div class='mav'>";
echo "Пользователи";
echo "</div>";
echo "</a>";
unset($_SESSION['id']);
}
if($_COOKIE['version'] == 'web'){
echo "<table class='stata'>";
echo "<tr>";
echo "<th class='left0 top0'>";
echo "#";
echo "</th>";
echo "<th class='top0'>";
echo "Сайты из категории Top-100";
echo "</th>";
echo "<th class='top0'>";
echo "Хосты";
echo "</th>";
echo "<th class='top0'>";
echo "Хиты";
echo "</th>";
echo "<th class='top0'>";
echo "В топ";
echo "</th>";
echo "<th class='top0'>";
echo "Из";
echo "</th>";
echo "<th class='right0 top0'>";
echo "Инфо";
echo "</th>";
echo "</tr>";
$all = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0' AND `category` != '4'"));
if($all != 0){
$total = intval(($all-1)/20)+1;
$page = abs(intval($_GET['page']));
if($id or $id >= 1){
$result = mysql_query("SELECT `hosts` FROM `".$prefix."sait` WHERE `id` = '".$id."' AND `status` = '1' AND `ban` = '0' AND `hosts` > '0' AND `category` != '4' LIMIT 1;");
$row = mysql_fetch_array($result);
$host_today = $row['hosts'];
$topt = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `category` != '4' AND `hosts`>= '".$host_today."' ORDER BY `hosts` DESC;"));
$page = ceil($topt/20);
}
if(empty($page) OR $page <= 0){
$page = 1;
}
if($page > $total){
$page = $total;
}
$past=intval($all/20);
$start=$page*20-20;
$top = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0' AND `category` != '4' ORDER BY `hosts` DESC LIMIT ".$start.",20");
while($row = mysql_fetch_array($top)){
$start++;
echo "<tr class='tr2'>";
echo "<td class='num bold left0'>";
echo " ".$start." ";
echo "</td>";
if($row['id'] == $id){
echo "<td class='site'>";
echo "<a href='/out.php?id=".$row['id']."'>";
echo "<font color='red'>";
echo " ".$row['url']." ";
echo "</font>";
echo "</a>";
}else{
echo "<td class='site'>";
echo "<a href='/out.php?id=".$row['id']."'>";
echo " ".$row['url']." ";
echo "</a>";
}
echo "<br>";
echo "<small>";
echo " ".$row['about']." ";
echo "</small>";
echo "</td>";
echo "<td>";
echo " ".stats($row['hosts'])." ";
echo "</td>";
echo "<td>";
echo " ".stats($row['hits'])." ";
echo "</td>";
echo "<td>";
echo " ".$row['in']." ";
echo "</td>";
echo "<td>";
echo " ".$row['out']." ";
echo "</td>";
if($row['mem'] == 0){
echo "<td class='more right0'>";
echo "<a href='http://".$set['home']."/stats/".$row['id']."'>";
echo "<img src='/style/icons/stat.gif'>";
echo "</a>";
echo "</td>";
echo "</tr>";
}else{
echo "<td class='more right0'>";
echo "</td>";
echo "</tr>";
}
}
echo "</table>";
navigation($all,20,$page,'index.php?',$total);
}else{
echo "<div class='stat'>";
echo "Сайтов в топе пока нет!";
echo "</div>";
}
}
require_once ('modules/foot.php');
?>