/
album.php
163 lines (101 loc) · 4.94 KB
/
album.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
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
<title>Album,<?=$tde?></title>
<meta name="keywords" content="Album , <?=$key?> " />
<meta name="description" content="Album , <?=$mota?>" />
<script type="text/javascript" src="slide/js/prototype.js"></script>
<script type="text/javascript" src="slide/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="slide/js/lightbox.js"></script>
<link rel="stylesheet" href="slide/css/lightbox.css" type="text/css" media="screen" />
<?php if($_GET['viewSub']=='') {?>
<?php
$sqlstr=mysql_query("SELECT * FROM ".menu_anh." WHERE status='true'
AND parent='".$_GET['viewParent']."' ORDER BY stt ASC");
if(mysql_num_rows($sqlstr)>0) { $b = 0; ?>
<table width="99%" border="0" align="center" cellpadding="2" cellspacing="2" id="bochinh">
<tr >
<?php while($row=mysql_fetch_array($sqlstr)) { $b +=1;
?>
<td align="center" valign="top" width="25%" >
<table width="100%" border="0" align="center" cellspacing="2" cellpadding="2" >
<tr align="center" valign="middle" >
<td height="110">
<table border="0" cellspacing="3" cellpadding="3" width="5" >
<tr>
<td id="bosanpham" width="2%"><a href="album_<?=$_GET['viewParent']?>_<?=$row['id']?><?=$vip?>" id="tieude"><img src="images/anh/thumbs/<?=$row['picture']?>" border="0" alt="<?=$row['title']?>" title="<?=$row['title']?>" /></a></td>
</tr>
</table>
</td>
</tr>
<tr >
<td height="20" align="center" valign="top" >
<a href="album_<?=$row['id']?><?=$vip?>" id="tieude"><?=$row['category']?></a> </td>
</table>
</td>
<?php if($b%4==0) echo "</tr>";?>
<?php } ?>
</table>
<?php } ?>
<?php } ?>
<?php if($b=='') {?>
<table width="99%" border="0" align="center" cellpadding="2" cellspacing="2" id="bochinh" >
<tr id="asanpham">
<td colspan="4" ><span id="sanpham">
<?php
$sqlstr=mysql_query("SELECT * FROM ".menu_anh." WHERE status='true'
AND id='".intval($_GET['viewParent'])."' ");
if(mysql_num_rows($sqlstr)>0) { $k = 0;
while($row=mysql_fetch_array($sqlstr)) { $k +=1;
?>
<a href="album_<?=$row['id']?><?=$vip?>" id="tieude"><?=$row['category']?></a> <?php } } ?>
<?php
$sqlstr=mysql_query("SELECT * FROM ".menu_anh." WHERE status='true'
AND id='".$_GET['viewSub']."' ");
if(mysql_num_rows($sqlstr)>0) { $k = 0;
while($row=mysql_fetch_array($sqlstr)) { $k +=1;
?>
> <a href="album_<?=$row['parent']?>_<?=$row['id']?><?=$vip?>" id="tieude"> <?=$row['category']?> > </a>
<?php $tda =$row['category']?>
<?php } } ?>
</span>
</td>
</tr>
<tr >
<?php
$p=60;
if($_GET['viewParent']!='') $sqlstr = "SELECT * FROM ".anh." WHERE status='true' AND category = '".intval($_GET['viewParent'])."' ";
if($_GET['viewSub']!='') $sqlstr = "SELECT * FROM ".anh." WHERE status='true' AND subCategory = '".intval($_GET['viewSub'])."' ";
$page=mysql_query($sqlstr);
$n_record=mysql_num_rows($page);
num_page();
$link="album_".$_GET['viewParent']."_".$_GET['viewSub']."";
$view=$_GET['view']?intval($_GET['view']):1;
$s=($view-1)*$p;
$sqlstr .=" ORDER BY stt ASC limit $s,$p";
$sqlstr=mysql_query($sqlstr);
?>
<?php
if(mysql_num_rows($sqlstr)>0) { $i=0;
while($row=mysql_fetch_array($sqlstr)) { $i+=1;
?>
<td align="center" valign="top" width="25%" >
<table width="100%" border="0" align="center" cellspacing="2" cellpadding="2" >
<tr align="center" valign="top" >
<td height="100" valign="middle" >
<table border="0" cellspacing="3" cellpadding="3" width="5" >
<tr>
<td id="bosanpham" width="2%"><a href="images/anh/goc/<?=$row['picture2']?>" rel="lightbox[roadtrip]"><img src="images/anh/thumbs/<?=$row['picture']?>" border="0" alt="<?=$tda?> , <?=$row['title']?>" title="<?=$tda?> , <?=$row['title']?>" /></a></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<?php if($i%4==0) echo "</tr>";?>
<?php } }
else {
echo "<td style='color:#FF0000' >Xin lỗi chưa có ảnh nào</td> </tr> ";
}
?>
</tr>
<tr ><td colspan="4" align="right" ><?php view_page_view2($link)?></td> </tr>
</table>
<?php } ?>