forked from coppermine-gallery/cpg1.6.x
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch.php
165 lines (138 loc) · 7.29 KB
/
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
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
159
160
161
162
163
164
165
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2016 Coppermine Dev Team
v1.0 originally written by Gregory Demar
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3
as published by the Free Software Foundation.
********************************************
Coppermine version: 1.6.01
$HeadURL$
**********************************************/
define('IN_COPPERMINE', true);
define('SEARCH_PHP', true);
require('include/init.inc.php');
if (!USER_ID && $CONFIG['allow_unlogged_access'] == 0) {
$redirect = 'login.php';
header("Location: $redirect");
exit();
}
$icon_array['search'] = cpg_fetch_icon('search', 2);
pageheader($lang_search_php['title']);
$text = '';
$text .= <<<EOT
<form method="get" action="thumbnails.php" name="searchcpg" id="cpgform3">
EOT;
$text .= starttable('100%', $icon_array['search'] . $lang_search_php['title'], 1, '', true);
$ip = GALLERY_ADMIN_MODE ? '
<tr>
<td>
<input type="checkbox" name="pic_raw_ip" class="checkbox" id="pic_raw_ip" /><label for="pic_raw_ip" class="clickable_option">'.$lang_search_php['ip_address'].'</label>
</td>
</tr>' :
'<tr>
<td> </td>
<td> </td>
</tr>';
$customs = '';
if ($cpg_udb->can_join_tables) {
$owner_name = <<<EOT
<tr>
<td><input type="checkbox" name="owner_name" id="owner_name" class="checkbox" /><label for="owner_name" class="clickable_option">{$lang_common['owner_name']}</label></td>
<td> </td>
</tr>
EOT;
} else {
$owner_name = '';
}
foreach (range(1, 4) as $i) {
$value = $CONFIG["user_field{$i}_name"];
if (!$value) {
continue;
}
$customs .= <<<EOT
<tr>
<td>
<input type="checkbox" name="user$i" id="user$i" class="checkbox" /><label for="user$i" class="clickable_option">$value</label>
</td>
</tr>
EOT;
}
$text .= <<<EOT
<tr>
<td class="tableb" align="center">
<input type="text" style="width: 80%" name="search" maxlength="255" value="" class="textinput" />
<button type="submit" class="button" name="submit" id="submit" value="{$lang_search_php['submit_search']}">{$icon_array['search']}{$lang_search_php['submit_search']}</button>
<input type="hidden" name="album" value="search" />
</td>
</tr>
<tr>
<td class="tableb">
<table align="center" width="60%">
<tr>
<td class="tableh2">{$lang_search_php['imgfields']}:</td>
<td align="center" class="tableh2">{$lang_search_php['age']}:</td>
</tr>
<tr>
<td><input type="checkbox" name="title" id="title" class="checkbox" checked="checked" /><label for="title" class="clickable_option">{$lang_common['title']}</label></td>
<td align="right">{$lang_search_php['newer_than']} <input type="text" name="newer_than" size="3" maxlength="4" class="textinput" /> {$lang_search_php['days']}</td>
</tr>
<tr>
<td><input type="checkbox" name="caption" id="caption" class="checkbox" checked="checked" /><label for="caption" class="clickable_option">{$lang_common['caption']}</label></td>
<td align="right">{$lang_search_php['older_than']} <input type="text" name="older_than" size="3" maxlength="4" class="textinput" /> {$lang_search_php['days']}</td>
</tr>
<tr>
<td><input type="checkbox" name="keywords" id="keywords" class="checkbox" checked="checked" /><label for="keywords" class="clickable_option">{$lang_common['keywords']}</label></td>
<td> </td>
</tr>
<tr>
<td><input type="checkbox" name="filename" id="filename" class="checkbox" /><label for="filename" class="clickable_option">{$lang_common['filename']}</label></td>
<td align="right">
<select name="type" class="listbox">
<option value="AND" selected="selected">{$lang_search_php['all_words']}</option>
<option value="OR">{$lang_search_php['any_words']}</option>
<option value="regex">{$lang_search_php['regex']}</option>
</select>
</td>
</tr>
$owner_name
$customs
$ip
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="tableh2">{$lang_search_php['albcatfields']}:</td>
<td class="tableh2"> </td>
</tr>
<tr>
<td><input type="checkbox" name="album_title" id="album_title" class="checkbox" /><label for="album_title" class="clickable_option">{$lang_search_php['album_title']}</label></td>
<td> </td>
</tr>
<tr>
<td><input type="checkbox" name="category_title" id="category_title" class="checkbox" /><label for="category_title" class="clickable_option">{$lang_search_php['category_title']}</label></td>
<td> </td>
</tr>
</table>
</td>
</tr>
EOT;
$text .= endtable(true);
$text .= '</form>';
$text = CPGPluginAPI::filter('search_form', $text);
echo $text;
if ($CONFIG['clickable_keyword_search'] != 0) {
include('include/keyword.inc.php');
}
echo <<<EOT
<script language="javascript" type="text/javascript">
<!--
document.searchcpg.search.focus();
-->
</script>
EOT;
pagefooter();
//EOF