Changeset 2245 for trunk/admin
- Timestamp:
- Mar 3, 2008, 1:50:54 PM (17 years ago)
- Location:
- trunk/admin
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/history.php
r2201 r2245 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 7PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | file : $Id$ … … 108 108 $search['fields']['image_id'] = intval($_POST['image_id']); 109 109 } 110 110 111 111 if (!empty($_POST['filename'])) 112 112 { … … 124 124 // TODO manage inconsistency of having $_POST['image_id'] and 125 125 // $_POST['filename'] simultaneously 126 126 127 127 // echo '<pre>'; print_r($search); echo '</pre>'; 128 128 129 129 if (!empty($search)) 130 130 { … … 140 140 141 141 $search_id = mysql_insert_id(); 142 142 143 143 redirect( 144 144 PHPWG_ROOT_PATH.'admin.php?page=history&search_id='.$search_id … … 160 160 history_tabsheet(); 161 161 162 $base_url = PHPWG_ROOT_PATH.'admin.php?page=history'; 163 164 $template->assign_vars( 162 $template->assign( 165 163 array( 166 164 'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=history', 167 168 'F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=history' 169 ) 170 ); 171 172 $template->assign_vars( 173 array( 174 'TODAY_DAY' => date('d', time()), 175 'TODAY_MONTH' => date('m', time()), 176 'TODAY_YEAR' => date('Y', time()), 165 'F_ACTION' => get_root_url().'admin.php?page=history' 177 166 ) 178 167 ); … … 213 202 214 203 $search_id = mysql_insert_id(); 215 204 216 205 redirect( 217 206 PHPWG_ROOT_PATH.'admin.php?page=history&search_id='.$search_id … … 287 276 288 277 $name_of_category = array(); 289 278 290 279 foreach ($uppercats_of as $category_id => $uppercats) 291 280 { … … 360 349 } 361 350 } 362 351 363 352 $i = 0; 364 353 $first_line = $page['start'] + 1; … … 375 364 // #images.representative_filesize and add 'representative' in the 376 365 // choices of #history.image_type. 377 366 378 367 if (isset($line['image_type'])) 379 368 { … … 402 391 $summary['guests_IP'][ $line['IP'] ] = 0; 403 392 } 404 393 405 394 $summary['guests_IP'][ $line['IP'] ]++; 406 395 } 407 396 408 397 $i++; 409 398 410 399 if ($i < $first_line or $i > $last_line) 411 400 { … … 498 487 } 499 488 } 500 501 $template->a ssign_block_vars(502 ' detail',489 490 $template->append( 491 'search_results', 503 492 array( 504 493 'DATE' => $line['date'], … … 515 504 : '', 516 505 'TAGS' => $tags_string, 517 'T_CLASS' => ($i % 2) ? 'row1' : 'row2',518 506 ) 519 507 ); … … 529 517 unset($username_of[ $conf['guest_id'] ]); 530 518 } 531 519 532 520 $summary['nb_members'] = count($username_of); 533 521 … … 536 524 { 537 525 $member_string = $user_name.' <a href="'; 538 $member_string.= PHPWG_ROOT_PATH.'admin.php?page=history';526 $member_string.= get_root_url().'admin.php?page=history'; 539 527 $member_string.= '&search_id='.$page['search_id']; 540 528 $member_string.= '&user_id='.$user_id; … … 543 531 $member_strings[] = $member_string; 544 532 } 545 546 $template->assign _block_vars(547 's ummary',533 534 $template->assign( 535 'search_summary', 548 536 array( 549 537 'NB_LINES' => l10n_dec( … … 578 566 { 579 567 $navbar = create_navigation_bar( 580 PHPWG_ROOT_PATH.'admin.php'.get_query_string_diff(array('start')),568 get_root_url().'admin.php'.get_query_string_diff(array('start')), 581 569 $page['nb_lines'], 582 570 $page['start'], … … 584 572 ); 585 573 586 $template->assign_block_vars( 587 'navigation', 588 array( 589 'NAVBAR' => $navbar 590 ) 591 ); 574 $template->assign('NAV_BAR', $navbar); 592 575 } 593 576 … … 603 586 { 604 587 $tokens = explode('-', $page['search']['fields']['date-after']); 605 588 606 589 $form['start_year'] = (int)$tokens[0]; 607 590 $form['start_month'] = (int)$tokens[1]; … … 647 630 } 648 631 649 // start date 650 get_day_list('start_day', @$form['start_day']); 651 get_month_list('start_month', @$form['start_month']); 652 // end date 653 get_day_list('end_day', @$form['end_day']); 654 get_month_list('end_month', @$form['end_month']); 655 656 $template->assign_vars( 632 633 $month_list = $lang['month']; 634 $month_list[0]='------------'; 635 ksort($month_list); 636 637 $template->assign( 657 638 array( 658 'START_YEAR' => @$form['start_year'],659 'END_YEAR' => @$form['end_year'],660 639 'IMAGE_ID' => @$form['image_id'], 661 640 'FILENAME' => @$form['filename'], 641 642 'month_list' => $month_list, 643 644 'START_DAY_SELECTED' => @$form['start_day'], 645 'START_MONTH_SELECTED' => @$form['start_month'], 646 'START_YEAR' => @$form['start_year'], 647 648 'END_DAY_SELECTED' => @$form['end_day'], 649 'END_MONTH_SELECTED' => @$form['end_month'], 650 'END_YEAR' => @$form['end_year'], 662 651 ) 663 652 ); 664 653 665 foreach ($types as $option) 666 { 667 $selected = ''; 668 669 if (in_array($option, $form['types'])) 670 { 671 $selected = 'selected="selected"'; 672 } 673 674 $template->assign_block_vars( 675 'types_option', 654 $template->assign( 676 655 array( 677 'VALUE' => $option, 678 'CONTENT' => l10n($option), 679 'SELECTED' => $selected, 680 ) 681 ); 682 } 683 684 $template->assign_block_vars( 685 'user_option', 686 array( 687 'VALUE'=> -1, 688 'CONTENT' => '------------', 689 'SELECTED' => '' 656 'type_option_values' => $types, 657 'type_option_selected' => $form['types'] 690 658 ) 691 659 ); 660 692 661 693 662 $query = ' … … 698 667 ORDER BY username ASC 699 668 ;'; 700 $result = pwg_query($query); 701 702 while ($row = mysql_fetch_array($result)) 703 { 704 $selected = ''; 705 706 if (isset($form['user']) 707 and $row['id'] == $form['user']) 708 { 709 $selected = 'selected="selected"'; 710 } 711 712 $template->assign_block_vars( 713 'user_option', 714 array( 715 'VALUE' => $row['id'], 716 'CONTENT' => $row['username'], 717 'SELECTED' => $selected, 718 ) 719 ); 720 } 721 722 foreach ($display_thumbnails as $display_thumbnail) 723 { 724 $selected = ''; 725 726 if ($display_thumbnail === $form['display_thumbnail']) 727 { 728 $selected = 'selected="selected"'; 729 } 730 731 $template->assign_block_vars( 732 'display_thumbnail', 733 array( 734 'VALUE' => $display_thumbnail, 735 'CONTENT' => l10n($display_thumbnail), 736 'SELECTED' => $selected, 737 ) 738 ); 739 } 669 $template->assign( 670 array( 671 'user_options' => simple_hash_from_query($query, 'id','username'), 672 'user_options_selected' => array(@$form['user']) 673 ) 674 ); 675 676 $template->assign( 677 array( 678 'display_thumbnail_values' => $display_thumbnails, 679 'display_thumbnail_selected' => array($form['display_thumbnail']), 680 ) 681 ); 740 682 741 683 // +-----------------------------------------------------------------------+ -
trunk/admin/include/functions_plugins.inc.php
r2243 r2245 137 137 * @param bool (true for retrieve new extensions) 138 138 */ 139 function check_server_plugins($newext=false) 140 { 141 global $fs_plugins; 142 139 function check_server_plugins(& $fs_plugins, $newext=false) 140 { 143 141 foreach($fs_plugins as $plugin_id => $fs_plugin) 144 142 { … … 151 149 } 152 150 } 153 151 154 152 $url = PEM_URL . '/uptodate.php?version=' . rawurlencode(PHPWG_VERSION) . '&extensions=' . implode(',', $plugins_to_check); 155 153 $url .= $newext ? '&newext=Plugin' : ''; … … 171 169 function extract_plugin_files($action, $source, $dest) 172 170 { 173 global $archive;174 171 if ($archive = tempnam( PHPWG_PLUGINS_PATH, 'zip')) 175 172 { … … 193 190 $root = dirname($main_filepath); // main.inc.php path in archive 194 191 if ($action == 'upgrade') 195 { 192 { 196 193 $extract_path = PHPWG_PLUGINS_PATH.$dest; 197 194 } 198 195 else 199 196 { 200 $extract_path = PHPWG_PLUGINS_PATH 197 $extract_path = PHPWG_PLUGINS_PATH 201 198 . ($root == '.' ? 'extension_' . $dest : basename($root)); 202 199 } … … 223 220 } 224 221 else $status = 'temp_path_error'; 225 222 226 223 @unlink($archive); 227 224 return $status; -
trunk/admin/plugins_new.php
r2243 r2245 53 53 array_push($page['infos'], l10n('plugins_install_ok'), l10n('plugins_install_need_activate')); 54 54 break; 55 55 56 56 case 'temp_path_error': 57 array_push($page['errors'], l10n('plugins_temp_path_error')); 57 array_push($page['errors'], l10n('plugins_temp_path_error')); 58 58 break; 59 59 60 60 case 'dl_archive_error': 61 array_push($page['errors'], l10n('plugins_dl_archive_error')); 61 array_push($page['errors'], l10n('plugins_dl_archive_error')); 62 62 break; 63 63 64 64 case 'archive_error': 65 array_push($page['errors'], l10n('plugins_archive_error')); 65 array_push($page['errors'], l10n('plugins_archive_error')); 66 66 break; 67 67 68 68 default: 69 array_push($page['errors'], sprintf(l10n('plugins_extract_error'), $_GET['installstatus']), l10n('plugins_check_chmod')); 69 array_push($page['errors'], sprintf(l10n('plugins_extract_error'), $_GET['installstatus']), l10n('plugins_check_chmod')); 70 70 } 71 71 } … … 74 74 //----------------------------------------------------------------sort options 75 75 $order = isset($_GET['order']) ? $_GET['order'] : 'date'; 76 77 $template->assign('order', 76 77 $template->assign('order', 78 78 array(htmlentities($my_base_url.'&order=date') => l10n('Post date'), 79 79 htmlentities($my_base_url.'&order=name') => l10n('Name'), 80 80 htmlentities($my_base_url.'&order=author') => l10n('Author'))); 81 81 82 82 $template->assign('selected', htmlentities($my_base_url.'&order=').$order); 83 83 … … 86 86 // | start template output | 87 87 // +-----------------------------------------------------------------------+ 88 $plugins_infos = check_server_plugins( true);88 $plugins_infos = check_server_plugins($fs_plugins, true); 89 89 if ($plugins_infos !== false) 90 90 { 91 91 if ($order == 'date') krsort($plugins_infos); 92 92 else uasort($plugins_infos, 'extension_'.$order.'_compare'); 93 93 94 94 foreach($plugins_infos as $plugin) 95 95 { 96 96 $ext_desc = nl2br(htmlspecialchars(strip_tags( 97 97 utf8_encode($plugin['ext_description'])))); 98 98 99 99 $ver_desc = sprintf(l10n('plugins_description'), 100 100 $plugin['version'], … … 102 102 nl2br(htmlspecialchars(strip_tags( 103 103 utf8_encode($plugin['description']))))); 104 104 105 105 $url_auto_install = htmlentities($my_base_url) 106 106 . '&extension=' . $plugin['id_extension'] … … 108 108 . '%2Frevision-' . $plugin['id_revision'] . '%2F' 109 109 . str_replace(' ', '%20',$plugin['url']); 110 110 111 111 $url_download = PEM_URL .'/upload/extension-'.$plugin['id_extension'] 112 112 . '/revision-' . $plugin['id_revision'] 113 113 . '/' . $plugin['url']; 114 114 115 115 $template->append('plugins', 116 116 array('EXT_NAME' => $plugin['ext_name'], -
trunk/admin/plugins_update.php
r2244 r2245 59 59 60 60 case 'temp_path_error': 61 array_push($page['errors'], l10n('plugins_temp_path_error')); 61 array_push($page['errors'], l10n('plugins_temp_path_error')); 62 62 break; 63 63 64 64 case 'dl_archive_error': 65 array_push($page['errors'], l10n('plugins_dl_archive_error')); 65 array_push($page['errors'], l10n('plugins_dl_archive_error')); 66 66 break; 67 67 68 68 case 'archive_error': 69 array_push($page['errors'], l10n('plugins_archive_error')); 69 array_push($page['errors'], l10n('plugins_archive_error')); 70 70 break; 71 71 … … 73 73 array_push($page['errors'], 74 74 sprintf(l10n('plugins_extract_error'), 75 $_GET['upgradestatus'])); 75 $_GET['upgradestatus'])); 76 76 } 77 77 } … … 81 81 // | start template output | 82 82 // +-----------------------------------------------------------------------+ 83 $plugins_infos = check_server_plugins( );83 $plugins_infos = check_server_plugins($fs_plugins); 84 84 85 85 if ($plugins_infos !== false) … … 91 91 { 92 92 $plugin_info = $plugins_infos[$fs_plugin['extension']]; 93 93 94 94 $ext_desc = nl2br(htmlspecialchars(strip_tags( 95 95 utf8_encode($plugin_info['ext_description'])))); 96 96 97 97 $ver_desc = sprintf(l10n('plugins_description'), 98 98 $plugin_info['version'], … … 100 100 nl2br(htmlspecialchars(strip_tags( 101 101 utf8_encode($plugin_info['description']))))); 102 102 103 103 if ($plugin_info['version'] == $fs_plugin['version']) 104 104 { … … 117 117 . '&plugin=' . $plugin_id 118 118 . ( 119 (isset($db_plugins_by_id[$plugin_id]) 120 and $db_plugins_by_id[$plugin_id]['state'] == 'active') ? 119 (isset($db_plugins_by_id[$plugin_id]) 120 and $db_plugins_by_id[$plugin_id]['state'] == 'active') ? 121 121 '&action=deactivate' : '' 122 122 ) … … 124 124 . '%2Frevision-' . $plugin_info['id_revision'] 125 125 . '%2F' . $plugin_info['url']; 126 126 127 127 $url_download = PEM_URL.'/upload/extension-'. $fs_plugin['extension'] 128 128 . '/revision-' . $plugin_info['id_revision'] 129 129 . '/' . $plugin_info['url']; 130 130 131 131 $template->append('plugins_not_uptodate', 132 132 array('EXT_NAME' => $fs_plugin['name'], … … 141 141 } 142 142 } 143 else 143 else 144 144 { 145 145 // Can't check plugin -
trunk/admin/stats.php
r2187 r2245 389 389 history_tabsheet(); 390 390 391 $base_url = PHPWG_ROOT_PATH.'admin.php?page=history';392 393 $template->assign _vars(391 $base_url = get_root_url().'admin.php?page=history'; 392 393 $template->assign( 394 394 array( 395 395 'L_STAT_TITLE' => implode($conf['level_separator'], $title_parts), 396 396 'PERIOD_LABEL' => $period_label, 397 'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=history',398 'F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=history',397 'U_HELP' => get_root_url().'popuphelp.php?page=history', 398 'F_ACTION' => $base_url, 399 399 ) 400 400 ); … … 469 469 { 470 470 $url = 471 PHPWG_ROOT_PATH.'admin.php'471 get_root_url().'admin.php' 472 472 .'?page=stats' 473 473 .'&year='.$page['year'] … … 483 483 { 484 484 $url = 485 PHPWG_ROOT_PATH.'admin.php'485 get_root_url().'admin.php' 486 486 .'?page=stats' 487 487 .'&year='.$page['year'] … … 495 495 // at least the year is defined 496 496 $url = 497 PHPWG_ROOT_PATH.'admin.php'497 get_root_url().'admin.php' 498 498 .'?page=stats' 499 499 .'&year='.$i … … 508 508 } 509 509 510 $template->a ssign_block_vars(511 'statrow ',510 $template->append( 511 'statrows', 512 512 array( 513 513 'VALUE' => $value,
Note: See TracChangeset
for help on using the changeset viewer.