-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathe_list.php
More file actions
223 lines (95 loc) · 4.11 KB
/
e_list.php
File metadata and controls
223 lines (95 loc) · 4.11 KB
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
<?php
/*
+---------------------------------------------------------------+
| e107 website system
| http://e107.org
|
| PView Gallery by R.F. Carter
| ronald.fuchs@hhweb.de
+---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
// Make sure the plugin is installed
if (!$sql->db_Select("plugin", "*",
"plugin_path = 'pviewgallery' AND plugin_installflag = '1'"))
{
// Plugin not installed
return;
}
// Some globals we will need
global $pref;
$list_SQL =& new db;
// Include any required plugin files
require_once(e_PLUGIN."pviewgallery/pview.class.php");
$PView = new PView;
if ($PView -> getPView_config("img_Link_search_extJS")) {
$script = $PView -> getPView_config("img_Link_extJS");
} else {
$script = "noscript";
}
// Get some standard values from the global $arr
$LIST_CAPTION = $PView -> getPView_config("pview_name");
$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
$bullet = $this->getBullet($arr[6], $mode);
if ($mode == "new_page" || $mode == "new_menu" ) {
// We only want to get data that is more recent than the users last visit
$qry = "uploadDate>".$this->getlvisit();
} else {
$qry = "imageId>0";
}
// The DB query to get the data, it is likely that the query will be more complex
// than this simple example.
// for example, the "WHERE 1" is only there as we do not know if $qry is populated
// but could be replaced by some SQL to ensure the user is allowed to view the data
$qry = "select * from #".pview_image."
where $qry
order by uploadDate desc limit 0,".$arr[7]."
";
if (!$list_SQL->db_Select_gen($qry)) {
// No data - ideally, text is obtained from a language file
$LIST_DATA = LAN_IMAGE_50;
} else {
// Got data, process each row
while ($row = $list_SQL->db_Fetch()) {
//Check permission
if ($PView -> getPermission("image",$row['imageId'],"View")) {
// Get some data to be used later
$rowheading = $this->parse_heading($row['name'], $mode);
$user = get_user_data($row['uploaderUserId']);
$image = $PView -> getImageData($row['imageId']);
switch ($script) {
case "noscript":
// image will open in pviewgallery
$pv_Heading = "<a href='".e_PLUGIN."pviewgallery/pviewgallery.php?image=".$row["imageId"];
break;
case "lightbox":
// image will open in lightbox group
$pv_Heading = "<a href='".$PView -> getResizePath($row["imageId"]). "' rel='lightbox";
break;
case "shadowbox":
// image will open in shadowbox group
$pv_Heading = "<a href='".$PView -> getResizePath($row["imageId"]). "' rel='shadowbox";
break;
case "highslide":
// image will open in highslide group
$pv_Heading = "<a href='".$PView -> getResizePath($row["imageId"]). "' class='highslide' onclick='return hs.expand(this)'";
break;
}
// Populate fields to be added to the List New array
$ICON = $bullet;
$HEADING = $pv_Heading;
$HEADING .= "' title='".$row['description']."'>";
$HEADING .= $rowheading."</a>";
$AUTHOR = "<a href='".e_BASE."user.php?id.";
$AUTHOR .= $row['uploaderUserId']."' title='".$row['uploaderUserId']."'>";
$AUTHOR .= $user["user_name"]."</a>";
$DATE = ($arr[5] ? ($row['uploadDate'] > 0 ? $this->getListDate($row['uploadDate'], $mode) : "") : "");
$CATEGORY = "<a href='".e_PLUGIN."pviewgallery/pviewgallery.php?album=".$row['albumId']."'>".$PView -> getAlbumName($row['albumId'])."</a>";
$CATEGORY .= " [ ".LIST_FORUM_3." ".$image['views']." ]";
$INFO = "";
// Finally, populate the List New data array
$LIST_DATA[$mode][] = array($ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO);
}
}
}
?>