-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
43 lines (36 loc) · 1.35 KB
/
index.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
<?php
define ('CATALOGDEEP', true);
include_once('init/core.php');
$smarty->template_dir = 'templates';
##############################
$sql = mysql_query("SELECT * FROM `cat_category` ORDER BY `position`");
if(mysql_num_rows($sql) > 0)
{
$i = 0;
while($row = mysql_fetch_assoc($sql))
{
$result[$i] = $row;
$result[$i]['name'] = htmlspecialchars($row['name']);
$result[$i]['about'] = htmlspecialchars($row['about']);
if($system['whitecat'] == 0)
{
$user_act = mysql_result(mysql_query("SELECT count(*) from (SELECT DISTINCT `id_site` FROM `cat_stats` WHERE `category` = '".$row['id']."' AND `date` = '".$date."' AND `in` > 0)x"),0);
$user_all = mysql_result(mysql_query("SELECT COUNT(`category`) FROM `cat_users` WHERE `category` = '".$row['id']."' AND `status` != 'ban'"),0);
}
else
{
$user_act = mysql_result(mysql_query("SELECT count(*) FROM `cat_users` WHERE `category` = '".$row['id']."' AND `status` = 'on' "),0);
$user_all = mysql_result(mysql_query("SELECT count(`category`) FROM `cat_users` WHERE `category` = '".$row['id']."' AND `status` != 'ban' "),0);
}
$result[$i]['user_act'] = $user_act;
$result[$i]['user_all'] = $user_all;
$i++;
}
}
$smarty->assign('result', $result);
$smarty->display('index.tpl');
/*
echo $count_sql."<br/>";
echo round(microtime(true) - $time_start, 5)."<br/>";
echo $sql_time_result;*/
?>