- Timestamp:
- Jan 24, 2007, 1:09:02 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/language/en_UK.iso-8859-1/admin.lang.php
r1745 r1749 167 167 $lang['Site manager'] = 'Site manager'; 168 168 $lang['Status'] = 'Status'; 169 $lang['Statistics'] = 'Statistics'; 169 170 $lang['Storage category'] = 'Storage category'; 170 171 $lang['Submit'] = 'Submit'; -
trunk/language/fr_FR.iso-8859-1/admin.lang.php
r1745 r1749 167 167 $lang['Site manager'] = 'Gestionnaire des sites'; 168 168 $lang['Status'] = 'Statut'; 169 $lang['Statistics'] = 'Statistiques'; 169 170 $lang['Storage category'] = 'Catégorie de stockage'; 170 171 $lang['Submit'] = 'Valider'; -
trunk/plugins/admin_advices/main.inc.php
r1724 r1749 30 30 // +-----------------------------------------------------------------------+ 31 31 32 add_event_handler('loc_begin_page_tail', 'set_admin_advice' );33 32 add_event_handler('loc_end_page_header', 'set_admin_advice_add_css' ); 34 33 … … 36 35 function set_admin_advice_add_css() 37 36 { 38 global $template; 39 $template->assign_block_vars( 40 'head_element', 41 array( 42 'CONTENT' => '<link rel="stylesheet" type="text/css" ' 43 . 'href="plugins/admin_advices/default-layout.css" />', 44 ) 45 ); 37 global $template, $page; 38 if ( isset($page['body_id']) and $page['body_id']=='theAdminPage' 39 and $page['page'] == 'intro' 40 ) 41 {// This Plugin works only on the Admin page 42 $template->assign_block_vars( 43 'head_element', 44 array( 45 'CONTENT' => '<link rel="stylesheet" type="text/css" ' 46 . 'href="'.PHPWG_PLUGINS_PATH.'admin_advices/default-layout.css" />', 47 ) 48 ); 49 add_event_handler('loc_begin_page_tail', 'set_admin_advice' ); 50 } 46 51 } 47 52 … … 51 56 global $page, $user, $template, $conf; 52 57 53 54 // This Plugin works only on the Admin page 55 if ( isset($page['body_id']) and $page['body_id']=='theAdminPage' 56 and $page['page'] == 'intro' 57 ) 58 // Setup Advice Language (Maybe there is already a variable) 59 $advlang = ( isset($user['language']) ) ? 60 $user['language'] : $conf['default_language']; // en_UK.iso-8859-1 61 $my_path = dirname(__FILE__).'/'; 62 $adv = array(); 63 if ( !@file_exists($my_path."$advlang/lang.adv.php") ) 58 64 { 59 // Setup Advice Language (Maybe there is already a variable) 60 $advlang = ( isset($user['language']) ) ? 61 $user['language'] : $conf['default_language']; // en_UK.iso-8859-1 62 63 $adv = array(); 64 if ( !@file_exists(PHPWG_ROOT_PATH 65 . "plugins/admin_advices/$advlang/lang.adv.php") ) 66 { 67 $advlang = 'en_UK.iso-8859-1'; 68 } 65 $advlang = 'en_UK.iso-8859-1'; 66 } 69 67 // Include language advices 70 @include_once( PHPWG_ROOT_PATH 71 . "plugins/admin_advices/$advlang/lang.adv.php" ); 68 @include_once( $my_path."$advlang/lang.adv.php" ); 72 69 73 70 // If there is an advice 74 if ( $cond ) 75 { 76 $template->set_filenames(array( 77 'admin_advice' => 78 PHPWG_ROOT_PATH.'/plugins/admin_advices/admin_advices.tpl') 79 ); 71 if ( $cond ) 72 { 73 $template->set_filenames(array( 74 'admin_advice' => $my_path.'admin_advices.tpl') 75 ); 80 76 81 77 // Random Thumbnail 78 $query = ' 79 SELECT * 80 FROM '.IMAGES_TABLE.' 81 ORDER BY RAND(NOW()) 82 LIMIT 0, 1 83 ;'; 84 $result = pwg_query($query); 85 $row = mysql_fetch_assoc($result); 86 if ( is_array($row) ) 87 { 88 $url_modify = get_root_url().'admin.php?page=picture_modify' 89 .'&image_id='.$row['id']; 90 $url_check = get_themeconf('icon_dir').'/'; 91 $url_uncheck = $url_check . 'uncheck'; 92 $url_check .= 'check'; 93 $picture_id = $row['id']; 82 94 $query = ' 83 SELECT *84 FROM '.IMAGES_TABLE.'85 ORDER BY RAND(NOW())86 LIMIT 0, 187 ;';88 $result = pwg_query($query);89 $row = mysql_fetch_assoc($result);90 if ( is_array($row) )91 {92 $url_modify = get_root_url().'admin.php?page=picture_modify'93 .'&image_id='.$row['id'];94 $url_check = get_themeconf('icon_dir').'/';95 $url_uncheck = $url_check . 'uncheck';96 $url_check .= 'check';97 $picture_id = $row['id'];98 $query = '99 95 SELECT * FROM '.IMAGE_TAG_TABLE.' 100 96 WHERE image_id = ' . $picture_id .' 101 97 ;'; 102 $tag_count = mysql_num_rows(mysql_query($query)); 98 $tag_count = mysql_num_rows(mysql_query($query)); 99 $template->assign_block_vars( 100 'thumbnail', 101 array( 102 'IMAGE' => get_thumbnail_url($row), 103 'IMAGE_ALT' => $row['file'], 104 'IMAGE_TITLE' => $row['name'], 105 'METADATA' => (empty($row['date_metadata_update'])) ? 106 $url_uncheck : $url_check, 107 'NAME' => (empty($row['name'])) ? 108 $url_uncheck : $url_check, 109 'COMMENT' => (empty($row['comment'])) ? 110 $url_uncheck : $url_check, 111 'AUTHOR' => (empty($row['author'])) ? 112 $url_uncheck : $url_check, 113 'CREATE_DATE' => (empty($row['date_creation'])) ? 114 $url_uncheck : $url_check, 115 'TAGS' => ($tag_count == 0) ? 116 $url_uncheck : $url_check, 117 'NUM_TAGS' => (string) $tag_count, 118 'U_MODIFY' => $url_modify, 119 ) 120 ); 121 } 122 $advice_text = array_shift($adv); 123 $template->assign_vars( 124 array( 125 'ADVICE_ABOUT' => '$conf[' . "'$confk'] ", 126 'ADVICE_TEXT' => $advice_text, 127 ) 128 ); 129 foreach ($adv as $advice) 130 { 103 131 $template->assign_block_vars( 104 'thumbnail', 105 array( 106 'IMAGE' => get_thumbnail_url($row), 107 'IMAGE_ALT' => $row['file'], 108 'IMAGE_TITLE' => $row['name'], 109 'METADATA' => (empty($row['date_metadata_update'])) ? 110 $url_uncheck : $url_check, 111 'NAME' => (empty($row['name'])) ? 112 $url_uncheck : $url_check, 113 'COMMENT' => (empty($row['comment'])) ? 114 $url_uncheck : $url_check, 115 'AUTHOR' => (empty($row['author'])) ? 116 $url_uncheck : $url_check, 117 'CREATE_DATE' => (empty($row['date_creation'])) ? 118 $url_uncheck : $url_check, 119 'TAGS' => ($tag_count == 0) ? 120 $url_uncheck : $url_check, 121 'NUM_TAGS' => (string) $tag_count, 122 'U_MODIFY' => $url_modify, 123 ) 124 ); 125 } 126 $advice_text = array_shift($adv); 127 $template->assign_vars( 128 array( 129 'ADVICE_ABOUT' => '$conf[' . "'$confk'] ", 130 'ADVICE_TEXT' => $advice_text, 131 ) 132 ); 133 foreach ($adv as $advice) 134 { 135 $template->assign_block_vars( 136 'More', 137 array( 138 'ADVICE' => $advice 139 ) 140 ); 141 } 142 $template->parse('admin_advice'); 132 'More', 133 array( 134 'ADVICE' => $advice 135 ) 136 ); 143 137 } 138 $template->parse('admin_advice'); 144 139 } 145 140 }
Note: See TracChangeset
for help on using the changeset viewer.