-
Notifications
You must be signed in to change notification settings - Fork 2
/
pview_pics_menu.php
125 lines (61 loc) · 2.34 KB
/
pview_pics_menu.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
<?php
/*
+---------------------------------------------------------------+
| e107 website system
| http://e107.org
|
| PView Gallery by R.F. Carter
+---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
// Include plugin language file, check first for site's preferred language
if (file_exists(e_PLUGIN . "pviewgallery/languages/" . e_LANGUAGE . ".php")){
include_once(e_PLUGIN."pviewgallery/languages/".e_LANGUAGE.".php");
} else {
include_once(e_PLUGIN . "pviewgallery/languages/German.php");
}
require_once(e_PLUGIN."pviewgallery/pview.class.php");
$PView = new PView;
$menu_SQL =& new db;
$imgArray = array();
$menuPics = array();
$menuPics = explode(",",$PView -> getPView_config("menu_pics"));
if (!$menuPics[1]){
$menuPics[1] = $menuPics[0]+1;
}
if ($PView -> getPView_config("menu_display") == "latest"){
$pv_header = LAN_MENU_1;
$menu_SQL -> db_Select("pview_image", "*", "ORDER BY uploadDate DESC", "nowhere");
while($findImage = $menu_SQL -> db_Fetch() ) {
if($PView -> getPermission("image",$findImage['imageId'],"View") && $imageCount < intval($menuPics[1])) {
// check gallery restriction
$albumData = $PView -> getAlbumData($findImage['albumId']);
if ($PView -> getPView_config("menu_allGal") OR !$albumData['galleryId']) {
array_push($imgArray,$findImage);
$imageCount++;
}
}
}
}
if ($PView -> getPView_config("menu_display") == "random"){
$pv_header = LAN_MENU_2;
$menu_SQL -> db_Select("pview_image", "*", "ORDER BY RAND()", "nowhere");
while($findImage = $menu_SQL -> db_Fetch() ) {
if($PView -> getPermission("image",$findImage['imageId'],"View") && $imageCount < intval($menuPics[1]) && !in_array($findImage['imageId'],$checkArray)) {
// Prüfen ob Gallery Einschränkung und Ergebnis
$albumData = $PView -> getAlbumData($findImage['albumId']);
if ($PView -> getPView_config("menu_allGal") OR !$albumData['galleryId']) {
array_push($imgArray,$findImage);
array_push($checkArray, $findImage['imageId']);
$imageCount++;
}
}
}
}
if (!$imageCount) {
$ns->tablerender($pv_header, LAN_MENU_4,'pview');
} else {
$ns->tablerender($pv_header, $PView -> getScroller($imgArray),'pview');
}
?>