-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgallery.php
158 lines (152 loc) · 7.42 KB
/
gallery.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
<?php
//========================//
if(INCLUDED !== TRUE)
{
echo "No Direct File Linking Allowed!";
exit;
}
// ==================== //
/*
*/
if (isset ($_GET['page']))
$page=$_GET['page'];
else
$page=1;
$limitstart = (($page*$Module_Config['pagelimit'])-$Module_Config['pagelimit']);
if (isset ($_GET['gal']))
{
if ( $_GET['gal'] == 'deleted' )
if ($user['account_level'] >= 3 )
{
$lastpicid = (int)$DB->selectCell("SELECT `id` FROM `mw_gallery` WHERE `cat`='".$_GET['gal']."' ORDER BY `id` DESC LIMIT 1;");
$pictures = $DB->select("SELECT * FROM `mw_gallery` WHERE `cat`='".$_GET['gal']."' ORDER BY `id` ASC LIMIT ".$limitstart.",".$Module_Config['pagelimit'].";");
$totalimages = (int)$DB->selectCell("select count(id) from `mw_gallery` where `cat`='".$_GET['gal']."';");
}
else
{
echo'
<center>
'.$module_lang['notowneredit'].'<br/>
<a href="?module='. MODULE_NAME .'">'.$module_lang[$galleries].' </a>
</center>
';
exit;
}
else
{
$lastpicid = (int)$DB->selectCell("SELECT `id` FROM `mw_gallery` WHERE `cat`='".$_GET['gal']."' ORDER BY `id` DESC LIMIT 1;");
$pictures = $DB->select("SELECT * FROM `mw_gallery` WHERE `cat`='".$_GET['gal']."' ORDER BY `id` ASC LIMIT ".$limitstart.",".$Module_Config['pagelimit'].";");
$totalimages = (int)$DB->selectCell("select count(id) from `mw_gallery` where `cat`='".$_GET['gal']."';");
}
}
else
{
$lastpicid = (int)$DB->selectCell("SELECT `id` FROM `mw_gallery` ORDER BY `id` DESC LIMIT 1;");
if ($user['account_level'] >= 3)
$pictures = $DB->select("SELECT * FROM `mw_gallery` ORDER BY `id` ASC LIMIT ".$limitstart.",".$Module_Config['pagelimit'].";");
else
$pictures = $DB->select("SELECT * FROM `mw_gallery` WHERE `cat`!='deleted' ORDER BY `id` ASC LIMIT ".$limitstart.",".$Module_Config['pagelimit'].";");
$totalimages = (int)$DB->selectCell("select count(id) from `mw_gallery`;");
}
if ($totalimages >> 0)
{
foreach($pictures as $picture)
{
echo '
<center>
<table style="margin: 7px;" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td><img src="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/frame/lt.png" class="png" style="width: 12px; height: 9px;" border="0" height="0" width="0"></td>
<td background="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/frame/_t.gif"><img src="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/frame/_.gif" height="0" width="0"></td>
<td><img src="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/frame/rt.png" class="png" style="width: 12px; height: 9px;" border="0" height="0" width="0"></td>
</tr>
<tr>
<td background="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/frame/_l.gif"><img src="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/frame/_.gif" height="0" width="0"></td>
<td>';
if ($picture['cat'] == 'deleted')
{
echo '<a href="images/'. $picture['oldcat'] .'s/'. $picture['img'] .'" target="_blank"><img src="modules/'. MODULE_NAME .'/show_picture.php?filename='. $picture['img'] .'&gallery='. $picture['oldcat'] .'&width=282" width="282" alt="" style="border: 1px solid #333333"/>';
}
Else
{
echo '<a href="images/'. $picture['cat'] .'s/'. $picture['img'] .'" target="_blank"><img src="modules/'. MODULE_NAME .'/show_picture.php?filename='. $picture['img'] .'&gallery='. $picture['cat'] .'&width=282" width="282" alt="" style="border: 1px solid #333333"/>';
}
echo '
</td>
<td background="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/frame/_r.gif"><img src="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/frame/_.gif" height="0" width="0"></td>
<td width="25" />
<td width="200">
<br /> '.$module_lang['comment'].': '.$picture['comment'].'
<br /> '.$module_lang['author'].": ".$picture['autor'].'
<br /> '.$module_lang['date'].": ".$picture['date'].'
';
if ($picture['cat'] == 'deleted')
echo'
<br/>
<b>'.$module_lang['deleted'].' '.$module_lang[$picture['oldcat']].'<b>
';
if ($picture['autor'] == $user['username'] or $user['account_level'] >= 3 )
echo'
<br/>
<form method="post" action="index.php?module='. MODULE_NAME .'&sub=edit&pic='.$picture['id'].'" enctype="multipart/form-data">
<input type="submit" value="'.$module_lang['edit'].'" name="edit">
</form>
';
if ($picture['autor'] == $user['username'] or $user['account_level'] >= 3 )
if ($picture['cat'] != 'deleted' )
echo'
<form method="post" action="index.php?module='. MODULE_NAME .'&sub=delete&pic='.$picture['id'].'" enctype="multipart/form-data">
<input type="submit" value="'.$module_lang['delete'].'" name="deletpic">
</form>
';
echo'
</td>
</tr>
<tr>
<td><img src="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/frame/lb.png" class="png" style="width: 12px; height: 12px;" border="0" height="12" width="12"></td>
<td background="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/frame/_b.gif"><img src="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/frame/_.gif" height="1" width="9"></td>
<td><img src="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/frame/rb.png" class="png" style="width: 12px; height: 12px;" border="0" height="12" width="12"></td>
</tr>';
}
unset($pictures);
echo '</tr></tbody></table>';
echo '<table><tbody><tr>';
if ((int)$page >> 1)
{
$prevpg = $page-1;
if (isset ($_GET['gal']))
echo '<td><a href="?module='. MODULE_NAME .'&sub=gallery&gal='. $_GET['gal'] .'&page='. $prevpg .'"><img src="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/arrow-left.gif">'. $module_lang['back'] .'</a></td>';
else
echo '<td><a href="?module='. MODULE_NAME .'&sub=gallery&page='. $prevpg .'"><img src="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/arrow-left.gif">'. $module_lang['back'] .'</a></td>';
}
else
echo '<td><img src="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/arrow-left-grey.gif">'. $module_lang['back'] .'</td>';
echo '<td width="200">
<center><b> Page : '.$page.' </b></center>
</td>';
$lastpicsshown = (int)($picture['id']);
if ($lastpicsshown != $lastpicid)
{
$nextpg = $page+1;
if (isset ($_GET['gal']))
echo '<td><a href="?module='. MODULE_NAME .'&sub=gallery&gal='. $_GET['gal'] .'&page='. $nextpg .'">'. $module_lang['next'] .'<img src="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/arrow-right.gif"></a></td>';
else
echo '<td><a href="?module='. MODULE_NAME .'&sub=gallery&page='. $nextpg .'">'. $module_lang['next'] .'<img src="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/arrow-right.gif"></a></td>';
}
else
echo '<td>'. $module_lang['next'] .'<img src="modules/'. MODULE_NAME .'/templates/'.$moduletheme.'/arrow-right-grey.gif"></td>';
echo '</tr></tbody></table></center>';
unset($picture);
}
else
{
echo '<center>'.$module_lang['noimages'].'<br/>
<a href=?module='. MODULE_NAME .'&sub=add_image">'.$module_lang['befirst'].'</a></center>
';
}
/*
echo ' <center><br /><br /><a href="?module='. MODULE_NAME .'"><br />'.add_pictureletter('G').'';
echo '<br />o back to the gallery start page</a></center>';
*/
?>