-
Notifications
You must be signed in to change notification settings - Fork 0
/
cat.php
72 lines (66 loc) · 1.47 KB
/
cat.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
<?php
$templatelist="cat_cat,cat_video,cat_videoo,";
include "globals.php";
$perpage=20;
$query=$DB->query("select * from cat where id=\"".checkval($arbb->input['id'])."\"");
while($cat=$DB->fetch_array($query))
{
$titleetc=$cat['title'];
$page=($arbb->input['page'])?$arbb->input['page']:1;
$query=$DB->query("select id from movies where cat_id=$cat[id]");
$num=$DB->num_rows($query);
$start=($perpage*$page)-$perpage;
$limit="limit $start,$perpage";
$query=$DB->query("select * from movies where cat_id=$cat[id] order by id desc $limit");
while($m=$DB->fetch_array($query))
{
$i++;
$sub_v.=$TP->GetTemp("cat_video");
$sub_v2.=$TP->GetTemp("cat_videoo");
if($i==4)
{
$sub_v.="</tr><tr>".$sub_v2."</tr><tr><td colspan=4 class=\"tfoot\"> </td></tr><tr>";
$sub_v2="";
$i=0;
}
}
if($i < 4)
{
for($iii=$i;$iii<4;$iii++)
{
$sub_v.="<td class=\"tfoot\"> </td>";
}
}
$sub_v.="</tr><tr>".$sub_v2;
if($i < 4)
{
for($iii=$i;$iii<4;$iii++)
{
$sub_v.="<td class=\"alt2\"> </td>";
}
}
$pages = ceil($num / $perpage);
if($pages > 1)
{
$pagesp="";
for($i=0;$i<$pages;$i++)
{
$ii=$i+1;
if($page==$ii)
{
$pagesp.="<td class=\"tfoot\">$ii</td>";
}
else
{
$pagesp.="<td class=\"alt1\"><a href=\"cat-$cat[id]-$ii.html\">$ii</a></td>";
}
}
$pages_t='<br><br><table class="tborder" cellpadding="3" cellspacing="1" border="0" align="center">'
."<tr><td>ÇÎÊÑ ÕÝÍÉ ááÇäÊÞÇá</td>$pagesp</tr></table>";
}
$webcontent.=$pages_t;
$TP->webtemp("cat_cat");
$webcontent.=$pages_t;
}
print_page();
?>