-
Notifications
You must be signed in to change notification settings - Fork 2
/
pview_search.php
179 lines (77 loc) · 2.91 KB
/
pview_search.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
<?php
/*
+---------------------------------------------------------------+
| e107 website system
| http://e107.org
|
| PView Gallery by R.F. Carter
+---------------------------------------------------------------+
*/
// Include pview.class for permission request
require_once(e_PLUGIN."pviewgallery/pview.class.php");
$PView = new PView;
$imgArray = array();
$sql->db_Select("pview_image", "*", "", "nowhere");
while ($image = $sql -> db_Fetch()) {
// PERMISSION!!!
if ($PView->getPermission("image",$image['imageId'],"View")) {
array_push ($imgArray, $image['imageId']);
}
}
$advanced_where = "";
$return_fields = "imageId, name, description, uploaderUserId, uploadDate";
$search_fields = array("name", "description");
$weights = array("1.2", "1.0");
$no_results = LAN_198;
$where = "imageId IN (".implode(",",$imgArray).") and";
//$where = "";
$order = array('uploadDate' => DESC);
$table = "pview_image";
$ps = $sch->parsesearch($table, $return_fields, $search_fields, $weights, 'search_pview', $no_results, $where, $order);
$text .= $ps['text'];
$results = $ps['results'];
function search_pview($row) {
global $pref;
global $con;
$PView = new PView;
if ($PView -> getPView_config("img_Link_search_extJS")) {
$script = $PView -> getPView_config("img_Link_extJS");
} else {
$script = "noscript";
}
// 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");
}
$user = get_user_data($row["uploaderUserId"]);
$datestamp = $con->convert_date($row['uploadDate'], "short");
switch ($script) {
case "noscript":
// image will open in pviewgallery
$res['link'] = e_PLUGIN."pviewgallery/pviewgallery.php?image=".$row["imageId"];
break;
case "lightbox":
// image will open in lightbox group
$res['link'] = $PView -> getResizePath($row["imageId"]). "' rel='lightbox";
break;
case "shadowbox":
// image will open in shadowbox group
$res['link'] = $PView -> getResizePath($row["imageId"]). "' rel='shadowbox";
break;
case "highslide":
// image will open in highslide group
$res['link'] = $PView -> getResizePath($row["imageId"]). "' class='highslide' onclick='return hs.expand(this)'";
break;
}
$res['pre_title'] = "";
$res['title'] = $row["name"];
$res['summary'] = $row["description"];
$res['detail'] = LAN_IMAGE_13." <a href='user.php?id.".$row['uploaderUserId']."'>".$user['user_name']."</a>, ".LAN_IMAGE_14." ".$datestamp;
return $res;
}
?>