-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrandom_pic.php
89 lines (80 loc) · 2.31 KB
/
random_pic.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
<?
/*
+--------------------------------------------------------------------------
| MkPortal
| ========================================
| by Meo aka Luponero <Amedeo de longis>
|
| (c) 2004 mkportal.it
| http://www.mkportal.it
| Email: [email protected]
|
+---------------------------------------------------------------------------
|
| > MKPortal
| > Written By Amedeo de longis
| > Date started: 9.2.2004
|
+--------------------------------------------------------------------------
*/
$content = "";
$query = $DB->query("SELECT id FROM mkp_gallery");
$count = $DB->get_num_rows ($query);
$start = rand(0, ($count -1));
$query = $DB->query("SELECT id, titolo, file FROM mkp_gallery where validate = '1' LIMIT $start, 1");
$foto = $DB->fetch_row($query);
$id = $foto['id'];
$titolo = $foto['titolo'];
$file = $foto['file'];
$thumb = "t_$file";
if (!file_exists("$this->sitepath/mkportal/modules/gallery/album/$thumb")) {
$thumb_mes = $this->ResizeImage(120,"$this->sitepath/mkportal/modules/gallery/album/$file");
$content = "
<tr>
<td align=\"center\"><a href=\"$this->siteurl/index.php?ind=gallery&op=foto_show&ida=$id\"><img src=\"$this->siteurl/mkportal/modules/gallery/album/$file\" border=\"0\" width=\"$thumb_mes[0]\" height=\"$thumb_mes[1]\" alt=\"{$this->lang['gallery_zoom']}\" /></a>
</td>
</tr>
<tr>
<td class=\"tdblock\" align=\"center\">$titolo<br />
</td>
</tr>
";
} else {
$content = "
<tr>
<td align=\"center\"><a href=\"$this->siteurl/index.php?ind=gallery&op=foto_show&ida=$id\"><img src=\"$this->siteurl/mkportal/modules/gallery/album/$thumb\" border=\"0\" alt=\"{$this->lang['gallery_zoom']}\" /></a>
</td>
</tr>
<tr>
<td class=\"tdblock\" align=\"center\">$titolo<br />
</td>
</tr>
";
}
if(!$id) {
$content = "
<tr>
<td class=\"tdblock\" align=\"center\">
{$this->lang['no_galleryim']}
</td>
</tr>
";
}
if(!$mkportals->member['g_access_cp'] && !$this->member['g_access_gallery']) {
$content = "
<tr>
<td class=\"tdblock\" align=\"center\">
{$this->lang['gallery_noallow']}
</td>
</tr>
";
}
unset($query);
unset($count);
unset($start);
unset($foto);
unset($id);
unset($titolo);
unset($file);
unset($thumb);
?>