Changeset 28707 for trunk/search.php
- Timestamp:
- Jun 16, 2014, 3:53:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/search.php
r28587 r28707 84 84 } 85 85 86 if ($_POST['search_author']) 87 { 86 if (isset($_POST['authors']) and is_array($_POST['authors']) and count($_POST['authors']) > 0) 87 { 88 $authors = array(); 89 90 foreach ($_POST['authors'] as $author) 91 { 92 $authors[] = strip_tags($author); 93 } 94 88 95 $search['fields']['author'] = array( 89 'words' => preg_split( 90 '/\s+/', 91 strip_tags($_POST['search_author']) 92 ), 96 'words' => $authors, 93 97 'mode' => 'OR', 94 98 ); … … 210 214 ); 211 215 } 216 217 // authors 218 $query = ' 219 SELECT 220 author, 221 COUNT(*) AS counter 222 FROM '.IMAGES_TABLE.' AS i 223 JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON ic.image_id = i.id 224 '.get_sql_condition_FandF( 225 array( 226 'forbidden_categories' => 'category_id', 227 'visible_categories' => 'category_id', 228 'visible_images' => 'ic.image_id' 229 ), 230 ' WHERE ' 231 ).' 232 AND author IS NOT NULL 233 GROUP BY author 234 ORDER BY author 235 ;'; 236 $authors = query2array($query); 237 238 $template->assign('AUTHORS', $authors); 212 239 213 240 //------------------------------------------------------------- categories form
Note: See TracChangeset
for help on using the changeset viewer.