- Timestamp:
- Feb 21, 2007, 12:40:02 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/action.php
r1817 r1844 128 128 129 129 if ($_GET['part'] == 'h') { 130 $is_high = true; 131 pwg_log($_GET['id'], $is_high); 130 pwg_log($_GET['id'], 'high'); 131 } 132 else if ($_GET['part'] == 'e') 133 { 134 pwg_log($_GET['id'], 'other'); 132 135 } 133 136 -
trunk/admin/history.php
r1821 r1844 59 59 } 60 60 61 $types = array('none', 'picture', 'high', 'other'); 62 61 63 // +-----------------------------------------------------------------------+ 62 64 // | Check Access and exit when user status is not ok | … … 95 97 } 96 98 97 $search['fields']['pictures'] = $_POST['pictures']; 98 $search['fields']['high'] = $_POST['high']; 99 $search['fields']['types'] = $_POST['types']; 99 100 100 101 // echo '<pre>'; print_r($search); echo '</pre>'; … … 185 186 } 186 187 187 if (isset($page['search']['fields'][' pictures']))188 { 189 $ clause = null;188 if (isset($page['search']['fields']['types'])) 189 { 190 $local_clauses = array(); 190 191 191 if ($page['search']['fields']['pictures'] == 'no') 192 foreach ($types as $type) { 193 if (in_array($type, $page['search']['fields']['types'])) { 194 $clause = 'image_type '; 195 if ($type == 'none') 196 { 197 $clause.= 'IS NULL'; 198 } 199 else 200 { 201 $clause.= "= '".$type."'"; 202 } 203 204 array_push($local_clauses, $clause); 205 } 206 } 207 208 if (count($local_clauses) > 0) 192 209 { 193 $clause = 'image_id IS NULL'; 194 } 195 196 if ($page['search']['fields']['pictures'] == 'only') 197 { 198 $clause = 'image_id IS NOT NULL'; 199 } 200 201 if (isset($clause)) 202 { 203 array_push($clauses, $clause); 204 } 205 } 206 207 if (isset($page['search']['fields']['high'])) 208 { 209 $clause = null; 210 211 if ($page['search']['fields']['high'] == 'no') 212 { 213 $clause = "is_high IS NULL or is_high = 'false'"; 214 } 215 216 if ($page['search']['fields']['high'] == 'only') 217 { 218 $clause = "is_high = 'true'"; 219 } 220 221 if (isset($clause)) 222 { 223 array_push($clauses, $clause); 210 array_push( 211 $clauses, 212 implode(' OR ', $local_clauses) 213 ); 224 214 } 225 215 } … … 237 227 FROM '.HISTORY_TABLE.' 238 228 WHERE '.$where_separator.' 239 '; 240 229 ;'; 230 231 // echo '<pre>'.$query.'</pre>'; 232 241 233 list($page['nb_lines']) = mysql_fetch_row(pwg_query($query)); 242 234 … … 251 243 tag_ids, 252 244 image_id, 253 i s_high245 image_type 254 246 FROM '.HISTORY_TABLE.' 255 247 WHERE '.$where_separator.' … … 345 337 : 'deleted '.$line['image_id']) 346 338 : $line['image_id'], 339 'TYPE' => $line['image_type'], 347 340 'SECTION' => $line['section'], 348 341 'CATEGORY' => isset($line['category_id']) … … 355 348 ) 356 349 ); 357 358 if (isset($line['image_id']))359 {360 if ($line['is_high'] == 'true')361 {362 $template->assign_block_vars('detail.high', array());363 }364 else365 {366 $template->assign_block_vars('detail.no_high', array());367 }368 }369 350 } 370 351 } … … 426 407 } 427 408 428 $form['pictures'] = $page['search']['fields']['pictures']; 429 $form['high'] = $page['search']['fields']['high']; 409 $form['types'] = $page['search']['fields']['types']; 430 410 } 431 411 else … … 436 416 $form['start_month'] = $form['end_month'] = date('n'); 437 417 $form['start_day'] = $form['end_day'] = date('j'); 438 $form['pictures'] = 'yes'; 439 $form['high'] = 'yes'; 418 $form['types'] = $types; 440 419 } 441 420 … … 454 433 ); 455 434 456 foreach (array('pictures', 'high') as $block) 457 { 458 foreach (array('yes', 'no', 'only') as $item) 459 { 460 $selected = ''; 461 462 if ($item == $form[$block]) 463 { 464 $selected = 'selected="selected"'; 465 } 466 467 $template->assign_block_vars( 468 $block.'_option', 469 array( 470 'VALUE' => $item, 471 'CONTENT' => l10n($item), 472 'SELECTED' => $selected, 473 ) 474 ); 475 } 435 foreach ($types as $option) 436 { 437 $selected = ''; 438 439 if (in_array($option, $form['types'])) 440 { 441 $selected = 'selected="selected"'; 442 } 443 444 $template->assign_block_vars( 445 'types_option', 446 array( 447 'VALUE' => $option, 448 'CONTENT' => l10n($option), 449 'SELECTED' => $selected, 450 ) 451 ); 476 452 } 477 453 -
trunk/include/functions.inc.php
r1817 r1844 411 411 } 412 412 413 function pwg_log($image_id = null, $i s_high = false)413 function pwg_log($image_id = null, $image_type = null) 414 414 { 415 415 global $conf, $user, $page; … … 469 469 category_id, 470 470 image_id, 471 i s_high,471 image_type, 472 472 tag_ids 473 473 ) … … 485 485 '.(isset($page['category']) ? $page['category'] : 'NULL').', 486 486 '.(isset($image_id) ? $image_id : 'NULL').', 487 '.(isset($image_id) ? "'". boolean_to_string($is_high)."'" : 'NULL').',487 '.(isset($image_id) ? "'".$image_type."'" : 'NULL').', 488 488 '.(isset($tags_string) ? "'".$tags_string."'" : 'NULL').' 489 489 ) -
trunk/install/phpwebgallery_structure.sql
r1817 r1844 127 127 `image_id` mediumint(8) default NULL, 128 128 `summarized` enum('true','false') default 'false', 129 `i s_high` enum('true','false') default NULL,129 `image_type` enum('picture','high','other') default NULL, 130 130 PRIMARY KEY (`id`), 131 131 KEY `history_i1` (`summarized`) -
trunk/picture.php
r1837 r1844 813 813 } 814 814 //------------------------------------------------------------ log informations 815 pwg_log($picture['current']['id'] );815 pwg_log($picture['current']['id'], 'picture'); 816 816 817 817 include(PHPWG_ROOT_PATH.'include/page_header.php'); -
trunk/template/yoga/admin/history.tpl
r1827 r1844 50 50 </ul> 51 51 52 <ul>53 <li><label></label></li>54 <li></li>55 </ul>56 57 52 <label> 58 {lang:Pictures} 59 <select name="pictures"> 60 <!-- BEGIN pictures_option --> 61 <option 62 value="{pictures_option.VALUE}" 63 {pictures_option.SELECTED} 64 > 65 {pictures_option.CONTENT} 53 {lang:Element type} 54 <select name="types[]" multiple="multiple" size="4"> 55 <!-- BEGIN types_option --> 56 <option value="{types_option.VALUE}" {types_option.SELECTED}> 57 {types_option.CONTENT} 66 58 </option> 67 <!-- END pictures_option --> 68 </select> 69 </label> 70 71 <label> 72 {lang:High quality} 73 <select name="high"> 74 <!-- BEGIN high_option --> 75 <option 76 value="{high_option.VALUE}" 77 {high_option.SELECTED} 78 > 79 {high_option.CONTENT} 80 </option> 81 <!-- END high_option --> 59 <!-- END types_option --> 82 60 </select> 83 61 </label> … … 102 80 <th>{lang:IP}</th> 103 81 <th>{lang:image}</th> 104 <th>{lang: high quality}</th>82 <th>{lang:Element type}</th> 105 83 <th>{lang:section}</th> 106 84 <th>{lang:category}</th> … … 114 92 <td>{detail.IP}</td> 115 93 <td>{detail.IMAGE}</td> 116 <td> 117 <!-- BEGIN high --> 118 <img src="{themeconf:icon_dir}/check.png" alt="{lang:yes}"> 119 <!-- END high --> 120 <!-- BEGIN no_high --> 121 <img src="{themeconf:icon_dir}/uncheck.png" alt="{lang:no}"> 122 <!-- END no_high --> 123 </td> 94 <td>{detail.TYPE}</td> 124 95 <td>{detail.SECTION}</td> 125 96 <td>{detail.CATEGORY}</td>
Note: See TracChangeset
for help on using the changeset viewer.