Changeset 14688
- Timestamp:
- May 2, 2012, 10:24:28 PM (13 years ago)
- Location:
- trunk/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/history.php
r12922 r14688 119 119 } 120 120 121 if (!empty($_POST['ip'])) 122 { 123 $search['fields']['ip'] = str_replace( 124 '*', 125 '%', 126 pwg_db_real_escape_string($_POST['ip']) 127 ); 128 } 129 121 130 $search['fields']['display_thumbnail'] = $_POST['display_thumbnail']; 122 131 // Display choise are also save to one cookie … … 130 139 $cookie_val = null; 131 140 } 132 141 133 142 pwg_set_cookie_var('display_thumbnail', $cookie_val, strtotime('+1 month') ); 134 143 … … 227 236 $category_ids = array(); 228 237 $image_ids = array(); 229 $ tag_ids = array();238 $has_tags = false; 230 239 231 240 foreach ($data as $row) … … 245 254 if (isset($row['tag_ids'])) 246 255 { 247 foreach (explode(',', $row['tag_ids']) as $tag_id) 248 { 249 array_push($tag_ids, $tag_id); 250 } 251 } 252 253 array_push( 254 $history_lines, 255 $row 256 ); 256 $has_tags = true; 257 } 258 259 $history_lines[] = $row; 257 260 } 258 261 … … 339 342 } 340 343 341 if (count($tag_ids) > 0) 342 { 343 $tag_ids = array_unique($tag_ids); 344 344 if ($has_tags > 0) 345 { 345 346 $query = ' 346 347 SELECT 347 348 id, 348 349 name 349 FROM '.TAGS_TABLE.' 350 WHERE id IN ('.implode(', ', $tag_ids).') 351 ;'; 352 $name_of_tag = array(); 353 354 $result = pwg_query($query); 355 while ($row = pwg_db_fetch_assoc($result)) 356 { 357 $name_of_tag[ $row['id'] ] = $row['name']; 358 } 350 FROM '.TAGS_TABLE; 351 $name_of_tag = simple_hash_from_query($query, 'id', 'name'); 359 352 } 360 353 … … 431 424 $tags_string = preg_replace( 432 425 '/(\d+)/e', 433 ' $name_of_tag["$1"]',426 'isset($name_of_tag["$1"]) ? $name_of_tag["$1"] : "$1"', 434 427 str_replace( 435 428 ',', … … 631 624 $form['image_id'] = @$page['search']['fields']['image_id']; 632 625 $form['filename'] = @$page['search']['fields']['filename']; 626 $form['ip'] = @$page['search']['fields']['ip']; 633 627 634 628 $form['display_thumbnail'] = @$page['search']['fields']['display_thumbnail']; … … 656 650 'IMAGE_ID' => @$form['image_id'], 657 651 'FILENAME' => @$form['filename'], 652 'IP' => @$form['ip'], 658 653 659 654 'month_list' => $month_list, -
trunk/admin/include/functions_history.inc.php
r12922 r14688 138 138 } 139 139 } 140 141 if (isset($search['fields']['ip'])) 142 { 143 $clauses[] = 'IP LIKE "'.$search['fields']['ip'].'"'; 144 } 140 145 141 146 $clauses = prepend_append_array_items($clauses, '(', ')'); -
trunk/admin/themes/default/template/history.tpl
r7995 r14688 69 69 <label> 70 70 {'File name'|@translate} 71 <input name="filename" value="{$FILENAME}" type="text">71 <input name="filename" value="{$FILENAME}" type="text" size="12"> 72 72 </label> 73 74 <label> 75 {'IP'|@translate} 76 <input name="ip" value="{$IP}" type="text" size="12"> 77 </label> 73 78 74 79 <label>
Note: See TracChangeset
for help on using the changeset viewer.