Changeset 393
- Timestamp:
- Mar 20, 2004, 1:52:37 AM (20 years ago)
- Location:
- trunk
- Files:
-
- 15 added
- 21 deleted
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/about.php
r369 r393 37 37 38 38 $template->set_filenames(array('about'=>'about.tpl')); 39 initialize_template();40 41 39 $template->assign_vars(array( 42 40 'PAGE_TITLE' => $title, 43 41 'L_ABOUT' => $lang['about_message'], 44 42 'L_RETURN' => $lang['about_return'], 45 'U_RETURN' => add_session_id( './category.php?'.$_SERVER['QUERY_STRING'])43 'U_RETURN' => add_session_id(PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING']) 46 44 ) 47 45 ); -
trunk/admin.php
r375 r393 28 28 //----------------------------------------------------------- include 29 29 define('PHPWG_ROOT_PATH','./'); 30 define('IN_ADMIN', true); 30 31 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 31 include_once( './admin/include/isadmin.inc.php' ); 32 //----------------------------------------------------- template initialization 33 $vtp = new VTemplate; 34 $handle = $vtp->Open( './template/'.$user['template'].'/admin.vtp' ); 35 // language 36 $tpl = array( 'title_default','charset','install_warning' ); 37 templatize_array( $tpl, 'lang', $handle ); 38 $vtp->setGlobalVar( $handle, 'style', './template/'.$user['template'].'/'.$user['template'].'-admin.css'); 39 //-------------------------------------------------- install.php still exists ? 40 if ( is_file( './install.php' ) ) 41 { 42 $vtp->addSession( $handle, 'install_warning' ); 43 $vtp->closeSession( $handle, 'install_warning' ); 44 } 32 include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); 33 45 34 //--------------------------------------- validating page and creation of title 46 35 $page_valide = false; … … 53 42 case 'user_modify': 54 43 $title = $lang['title_modify']; $page_valide = true; break; 55 case 'user_ perm':56 if ( !is_numeric( $_GET['user_id'] ) ) $_GET['user_id'] = -1;44 case 'user_search': 45 /* if ( !is_numeric( $_GET['user_id'] ) ) $_GET['user_id'] = -1; 57 46 $query = 'SELECT status,username'; 58 47 $query.= ' FROM '.USERS_TABLE; … … 72 61 { 73 62 $page_valide = false; 74 } 75 break; 63 }*/ 64 $title = $lang['title_user_perm']; 65 //.' '.$_POST['username']; 66 $page_valide = true; break; 76 67 case 'group_list' : 77 68 $title = $lang['title_groups']; $page_valide = true; break; 78 69 case 'group_perm' : 79 70 if ( !is_numeric( $_GET['group_id'] ) ) $_GET['group_id'] = -1; 80 $query = 'SELECT name'; 81 $query.= ' FROM '.PREFIX_TABLE.'groups'; 71 $query = 'SELECT name FROM '.GROUPS_TABLE; 82 72 $query.= ' WHERE id = '.$_GET['group_id']; 83 73 $query.= ';'; … … 128 118 if ( isset( $_GET['dir'] ) ) 129 119 { 130 $title.= ' '.$lang['title_thumbnails_2'].' <span style="color:#006699;">';120 $title.= ' '.$lang['title_thumbnails_2'].' <span class="titreImg">'; 131 121 // $_GET['dir'] contains : 132 122 // ./galleries/vieux_lyon ou … … 135 125 $dir = explode( "/", $_GET['dir'] ); 136 126 $title.= $dir[2]; 137 for ( $i = 3; $i < sizeof( $dir ) - 1; $i++ )127 for ( $i = 2; $i < sizeof( $dir ) - 1; $i++ ) 138 128 { 139 $title.= ' > '.$dir[$i ];129 $title.= ' > '.$dir[$i+1]; 140 130 } 141 131 $title.= "</span>"; … … 155 145 } 156 146 if ( $title == '' ) $title = $lang['title_default']; 157 $vtp->setGlobalVar( $handle, 'title', $title ); 158 //--------------------------------------------------------------------- summary 159 $link_start = './admin.php?page='; 160 // configuration 161 $vtp->addSession( $handle, 'summary' ); 162 $vtp->setVar( $handle, 'summary.indent', '' ); 163 $vtp->setVar( $handle, 'summary.link', 164 add_session_id( $link_start.'configuration' ) ); 165 $vtp->setVar( $handle, 'summary.name', $lang['menu_config'] ); 166 $vtp->closeSession( $handle, 'summary' ); 167 // users 168 $vtp->addSession( $handle, 'summary' ); 169 $vtp->setVar( $handle, 'summary.indent', '| ' ); 170 $vtp->setVar( $handle, 'summary.link', 171 add_session_id( $link_start.'user_list' ) ); 172 $vtp->setVar( $handle, 'summary.name', $lang['menu_users'] ); 173 $vtp->closeSession( $handle, 'summary' ); 174 // groups 175 $vtp->addSession( $handle, 'summary' ); 176 $vtp->setVar( $handle, 'summary.indent', '| ' ); 177 $vtp->setVar( $handle, 'summary.link', 178 add_session_id( $link_start.'group_list' ) ); 179 $vtp->setVar( $handle, 'summary.name', $lang['menu_groups'] ); 180 $vtp->closeSession( $handle, 'summary' ); 181 // categories 182 $vtp->addSession( $handle, 'summary' ); 183 $vtp->setVar( $handle, 'summary.indent', '| ' ); 184 $vtp->setVar( $handle, 'summary.link',add_session_id( $link_start.'cat_list')); 185 $vtp->setVar( $handle, 'summary.name', $lang['menu_categories'] ); 186 $vtp->closeSession( $handle, 'summary' ); 147 187 148 // waiting 188 $vtp->addSession( $handle, 'summary' ); 189 $vtp->setVar( $handle, 'summary.indent', '| ' ); 190 $vtp->setVar( $handle, 'summary.link', 191 add_session_id( $link_start.'waiting' ) ); 192 $query = 'SELECT id'; 193 $query.= ' FROM '.PREFIX_TABLE.'waiting'; 149 $query = 'SELECT id FROM '.WAITING_TABLE; 194 150 $query.= " WHERE validated='false'"; 195 151 $query.= ';'; … … 200 156 $nb_waiting = ' [ '.mysql_num_rows( $result ).' ]'; 201 157 } 202 $vtp->setVar( $handle, 'summary.name', $lang['menu_waiting'].$nb_waiting );203 $vtp->closeSession( $handle, 'summary' );204 158 // comments 205 $vtp->addSession( $handle, 'summary' ); 206 $vtp->setVar( $handle, 'summary.indent', '| ' ); 207 $vtp->setVar( $handle, 'summary.link', 208 add_session_id( $link_start.'comments' ) ); 209 $query = 'SELECT id'; 210 $query.= ' FROM '.PREFIX_TABLE.'comments'; 159 $query = 'SELECT id FROM '.COMMENTS_TABLE; 211 160 $query.= " WHERE validated='false'"; 212 161 $query.= ';'; 213 162 $result = mysql_query( $query ); 214 $nb_ waiting= '';163 $nb_comments = ''; 215 164 if ( mysql_num_rows( $result ) > 0 ) 216 165 { 217 $nb_waiting = ' [ '.mysql_num_rows( $result ).' ]'; 218 } 219 $vtp->setVar( $handle, 'summary.name', $lang['menu_comments'].$nb_waiting ); 220 $vtp->closeSession( $handle, 'summary' ); 221 // update 222 $vtp->addSession( $handle, 'summary' ); 223 $vtp->setVar( $handle, 'summary.indent', '| ' ); 224 $vtp->setVar( $handle, 'summary.link', 225 add_session_id( $link_start.'update' ) ); 226 $vtp->setVar( $handle, 'summary.name', $lang['menu_update'] ); 227 $vtp->closeSession( $handle, 'summary' ); 228 // thumbnails 229 $vtp->addSession( $handle, 'summary' ); 230 $vtp->setVar( $handle, 'summary.indent', '| ' ); 231 $vtp->setVar( $handle, 'summary.link', 232 add_session_id( $link_start.'thumbnail' ) ); 233 $vtp->setVar( $handle, 'summary.name', $lang['menu_thumbnails'] ); 234 $vtp->closeSession( $handle, 'summary' ); 235 // history 236 $vtp->addSession( $handle, 'summary' ); 237 $vtp->setVar( $handle, 'summary.indent', '| ' ); 238 $vtp->setVar( $handle, 'summary.link', 239 add_session_id( $link_start.'stats' ) ); 240 $vtp->setVar( $handle, 'summary.name', $lang['menu_history'] ); 241 $vtp->closeSession( $handle, 'summary' ); 242 // instructions 243 $vtp->addSession( $handle, 'summary' ); 244 $vtp->setVar( $handle, 'summary.indent', '| ' ); 245 $vtp->setVar( $handle, 'summary.link', 246 add_session_id( $link_start.'help' ) ); 247 $vtp->setVar( $handle, 'summary.name', $lang['menu_instructions'] ); 248 $vtp->closeSession( $handle, 'summary' ); 249 // back to thumbnails page 250 $vtp->addSession( $handle, 'summary' ); 251 $vtp->setVar( $handle, 'summary.indent', '| ' ); 252 $vtp->setVar( $handle, 'summary.link', add_session_id( './category.php' ) ); 253 $vtp->setVar( $handle, 'summary.name', $lang['menu_back'] ); 254 $vtp->closeSession( $handle, 'summary' ); 166 $nb_comments = ' [ '.mysql_num_rows( $result ).' ]'; 167 } 168 169 $link_start = PHPWG_ROOT_PATH.'admin.php?page='; 170 //----------------------------------------------------- template initialization 171 include(PHPWG_ROOT_PATH.'include/page_header.php'); 172 $template->set_filenames( array('admin'=>'admin.tpl') ); 173 174 $template->assign_vars(array( 175 'L_CONFIG'=>$lang['menu_config'], 176 'L_USERS'=>$lang['menu_users'], 177 'L_GROUPS'=>$lang['menu_groups'], 178 'L_CATEGORIES'=>$lang['menu_categories'], 179 'L_WAITING'=>$lang['menu_waiting'].$nb_waiting, 180 'L_COMMENTS'=>$lang['menu_comments'].$nb_comments, 181 'L_UPDATE'=>$lang['menu_update'], 182 'L_THUMBNAILS'=>$lang['menu_thumbnails'], 183 'L_HISTORY'=>$lang['menu_history'], 184 'L_FAQ'=>$lang['menu_instructions'], 185 'L_RETURN'=>$lang['menu_back'], 186 187 'U_CONFIG'=>add_session_id($link_start.'configuration' ), 188 'U_USERS'=>add_session_id($link_start.'user_search' ), 189 'U_GROUPS'=>add_session_id($link_start.'group_list' ), 190 'U_CATEGORIES'=>add_session_id($link_start.'cat_list' ), 191 'U_WAITING'=>add_session_id($link_start.'waiting' ), 192 'U_COMMENTS'=>add_session_id($link_start.'comments' ), 193 'U_UPDATE'=>add_session_id($link_start.'update' ), 194 'U_THUMBNAILS'=>add_session_id($link_start.'thumbnail' ), 195 'U_HISTORY'=>add_session_id($link_start.'stats' ), 196 'U_FAQ'=>add_session_id($link_start.'help' ), 197 'U_RETURN'=>add_session_id(PHPWG_ROOT_PATH.'category.php') 198 )); 199 200 //--------------------------------------------------------------------- summary 201 $link_start = PHPWG_ROOT_PATH.'admin.php?page='; 255 202 //------------------------------------------------------------- content display 256 203 if ( $page_valide ) 257 204 { 258 include ( './admin/'.$_GET['page'].'.php' ); 205 if ($_GET['page']=='comments') include ( PHPWG_ROOT_PATH.'comments.php'); 206 else include ( PHPWG_ROOT_PATH.'admin/'.$_GET['page'].'.php' ); 259 207 } 260 208 else 261 209 { 262 $vtp->setVar( 263 $handle, 'sub', 264 '<div style="text-align:center">'.$lang['default_message'].'</div>' ); 265 } 266 //----------------------------------------------------------- html code display 267 $code = $vtp->Display( $handle, 0 ); 268 echo $code; 210 $template->assign_vars(array ('ADMIN_CONTENT'=> '<div style="text-align:center">'.$lang['default_message'].'</div>') ); 211 } 212 $template->pparse('admin'); 213 include(PHPWG_ROOT_PATH.'include/page_tail.php'); 269 214 ?> -
trunk/admin/configuration.php
r383 r393 26 26 // +-----------------------------------------------------------------------+ 27 27 28 include_once( './admin/include/isadmin.inc.php' ); 28 if( !defined("PHPWG_ROOT_PATH") ) 29 { 30 die ("Hacking attempt!"); 31 } 32 33 include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); 29 34 30 35 $Caracs = array("¥" => "Y", "µ" => "u", "À" => "A", "Á" => "A", … … 45 50 "ý" => "y", "ÿ" => "y"); 46 51 //------------------------------ verification and registration of modifications 47 $conf_infos = array();48 $query = 'SELECT param';49 $query.= ' FROM '.CONFIG_TABLE;50 $query.= ';';51 $result = mysql_query( $query );52 while ( $row = mysql_fetch_array( $result ) )53 {54 array_push( $conf_infos, $row['param'] );55 }56 57 $default_user_infos =58 array( 'nb_image_line','nb_line_page','language','maxwidth',59 'maxheight','expand','show_nb_comments','short_period','long_period',60 'template' );61 52 $error = array(); 62 53 if ( isset( $_POST['submit'] ) ) 63 54 { 64 55 $int_pattern = '/^\d+$/'; 65 // empty session table if asked66 if ( $_POST['empty_session_table'] == 1 )67 {68 $query = 'DELETE FROM '.PREFIX_TABLE.'sessions';69 $query.= ' WHERE expiration < '.time().';';70 mysql_query( $query );71 }72 56 // deletion of site as asked 73 57 $site_deleted = false; 74 58 $query = 'SELECT id'; 75 $query.= ' FROM '. PREFIX_TABLE.'sites';59 $query.= ' FROM '.SITES_TABLE; 76 60 $query.= " WHERE galleries_url <> './galleries/';"; 77 61 $result = mysql_query( $query ); … … 135 119 array_push( $error, $lang['conf_err_sid_time'] ); 136 120 } 137 // max_user_listbox must be an integer between 0 and 255 included138 if ( !preg_match( $int_pattern, $_POST['max_user_listbox'] )139 or $_POST['max_user_listbox'] < 0140 or $_POST['max_user_listbox'] > 255 )141 {142 array_push( $error, $lang['conf_err_max_user_listbox'] );143 }144 121 // the number of comments per page must be an integer between 5 and 50 145 122 // included … … 186 163 } 187 164 188 if ( $_POST['maxwidth'] != ''165 /* if ( $_POST['maxwidth'] != '' 189 166 and ( !preg_match( $int_pattern, $_POST['maxwidth'] ) 190 167 or $_POST['maxwidth'] < 50 ) ) … … 197 174 { 198 175 array_push( $error, $lang['err_maxheight'] ); 199 } 176 }*/ 200 177 // updating configuraiton if no error found 201 178 if ( count( $error ) == 0 ) 202 179 { 203 foreach ( $conf_infos as $conf_info ) { 204 if ( isset( $_POST[$conf_info] ) ) 180 $result = mysql_query( "SELECT * FROM ".CONFIG_TABLE ); 181 while ( $row = mysql_fetch_array( $result ) ) 182 { 183 $config_name = $row['param']; 184 $conf[$config_name] = ( isset($_POST[$config_name]) ) ? $_POST[$config_name] : $row['value']; 185 if ( isset( $_POST[$config_name] ) ) 205 186 { 206 187 $query = 'UPDATE '.CONFIG_TABLE; 207 $query.= ' SET value = '; 208 if ( $_POST[$conf_info] == '' ) 209 { 210 $query.= 'NULL'; 211 } 212 else 213 { 214 $query.= "'".$_POST[$conf_info]."'"; 215 } 216 $query.= " WHERE param = '".$conf_info."'"; 217 $query.= ';'; 188 $query.= " SET value = '". str_replace("\'", "''", $conf[$config_name]) ; 189 $query.= "' WHERE param = '$config_name'"; 218 190 mysql_query( $query ); 219 191 } 220 192 } 221 222 $query = 'UPDATE '.USERS_TABLE; 223 $query.= ' SET'; 224 foreach ( $default_user_infos as $i => $default_user_info ) { 225 if ( $i > 0 ) $query.= ','; 226 else $query.= ' '; 227 $query.= $default_user_info; 228 $query.= ' = '; 229 if ( $_POST[$default_user_info] == '' ) 230 { 231 $query.= 'NULL'; 232 } 233 else 234 { 235 $query.= "'".$_POST[$default_user_info]."'"; 236 } 237 } 238 $query.= " WHERE username = 'guest'"; 239 $query.= ';'; 240 mysql_query( $query ); 241 } 242 //--------------------------------------------------------- data initialization 243 foreach ( $conf_infos as $conf_info ) { 244 $$conf_info = $_POST[$conf_info]; 245 } 246 foreach ( $default_user_infos as $default_user_info ) { 247 $$default_user_info = $_POST[$default_user_info]; 248 } 249 } 250 else 251 { 252 //--------------------------------------------------------- data initialization 253 $query = 'SELECT param,value'; 254 $query.= ' FROM '.CONFIG_TABLE; 255 $query.= ';'; 256 $result = mysql_query( $query ); 257 while ( $row =mysql_fetch_array( $result ) ) 258 { 259 if ( isset( $row['value'] ) ) 260 { 261 $$row['param'] = $row['value']; 262 } 263 else 264 { 265 $$row['param'] = ''; 266 } 267 } 268 269 $query = 'SELECT '.implode( ',', $default_user_infos ); 270 $query.= ' FROM '.USERS_TABLE; 271 $query.= " WHERE username = 'guest'"; 272 $query.= ';'; 273 $row = mysql_fetch_array( mysql_query( $query ) ); 274 foreach ( $default_user_infos as $info ) { 275 if ( isset( $row[$info] ) ) $$info = $row[$info]; 276 else $$info = ''; 277 } 278 } 193 } 194 } 195 196 $access = ($conf['access']=='free')?'ACCESS_FREE':'ACCESS_RESTRICTED'; 197 $log = ($conf['log']=='true')?'HISTORY_YES':'HISTORY_NO'; 198 $mail_notif = ($conf['mail_notification']=='true')?'MAIL_NOTIFICATION_YES':'MAIL_NOTIFICATION_NO'; 199 $show_comments = ($conf['show_comments']=='true')?'SHOW_COMMENTS_YES':'SHOW_COMMENTS_NO'; 200 $comments_all = ($conf['comments_forall']=='true')?'COMMENTS_ALL_YES':'COMMENTS_ALL_NO'; 201 $comments_validation = ($conf['comments_validation']=='true')?'VALIDATE_COMMENTS_YES':'VALIDATE_COMMENTS_NO'; 202 $expand = ($conf['auto_expand']=='true')?'EXPAND_TREE_YES':'EXPAND_TREE_NO'; 203 $nb_comments = ($conf['show_nb_comments']=='true')?'NB_COMMENTS_YES':'NB_COMMENTS_NO'; 204 $upload = ($conf['upload_available']=='true')?'UPLOAD_YES':'UPLOAD_NO'; 205 $cookie = ($conf['authorize_cookies']=='true')?'COOKIE_YES':'COOKIE_NO'; 206 279 207 //----------------------------------------------------- template initialization 280 $sub = $vtp->Open( 281 './template/'.$user['template'].'/admin/configuration.vtp' ); 208 $template->set_filenames( array('config'=>'admin/configuration.tpl') ); 209 210 $template->assign_vars(array( 211 'ADMIN_NAME'=>$conf['webmaster'], 212 'ADMIN_MAIL'=>$conf['mail_webmaster'], 213 'THUMBNAIL_PREFIX'=>$conf['prefix_thumbnail'], 214 'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'], 215 'LANG_SELECT'=>language_select($conf['default_lang'], 'default_lang'), 216 'NB_IMAGE_LINE'=>$conf['nb_image_line'], 217 'NB_ROW_PAGE'=>$conf['nb_line_page'], 218 'STYLE_SELECT'=>style_select($conf['default_style'], 'default_style'), 219 'SHORT_PERIOD'=>$conf['short_period'], 220 'LONG_PERIOD'=>$conf['long_period'], 221 'UPLOAD_MAXSIZE'=>$conf['upload_maxfilesize'], 222 'UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth'], 223 'UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight'], 224 'TN_UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth_thumbnail'], 225 'TN_UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight_thumbnail'], 226 'SESSION_LENGTH'=>$conf['session_time'], 227 'SESSION_ID_SIZE'=>$conf['session_id_size'], 228 229 $access=>'checked="checked"', 230 $log=>'checked="checked"', 231 $mail_notif=>'checked="checked"', 232 $show_comments=>'checked="checked"', 233 $comments_all=>'checked="checked"', 234 $comments_validation=>'checked="checked"', 235 $expand=>'checked="checked"', 236 $nb_comments=>'checked="checked"', 237 $upload=>'checked="checked"', 238 $cookie=>'checked="checked"', 239 240 'L_CONFIRM'=>$lang['conf_confirmation'], 241 'L_CONF_GENERAL'=>$lang['conf_general_title'], 242 'L_ADMIN_NAME'=>$lang['conf_general_webmaster'], 243 'L_ADMIN_NAME_INFO'=>$lang['conf_general_webmaster_info'], 244 'L_ADMIN_MAIL'=>$lang['conf_general_mail'], 245 'L_ADMIN_MAIL_INFO'=>$lang['conf_general_mail_info'], 246 'L_THUMBNAIL_PREFIX'=>$lang['conf_general_prefix'], 247 'L_THUMBNAIL_PREFIX_INFO'=>$lang['conf_general_prefix_info'], 248 'L_ACCESS'=>$lang['conf_general_access'], 249 'L_ACCESS_INFO'=>$lang['conf_general_access_info'], 250 'L_ACCESS_FREE'=>$lang['conf_general_access_1'], 251 'L_ACCESS_RESTRICTED'=>$lang['conf_general_access_2'], 252 'L_HISTORY'=>$lang['conf_general_log'], 253 'L_HISTORY_INFO'=>$lang['conf_general_log_info'], 254 'L_MAIL_NOTIFICATION'=>$lang['conf_general_mail_notification'], 255 'L_MAIL_NOTIFICATION_INFO'=>$lang['conf_general_mail_notification_info'], 256 'L_CONF_COMMENTS'=>$lang['conf_comments_title'], 257 'L_SHOW_COMMENTS'=>$lang['conf_comments_show_comments'], 258 'L_SHOW_COMMENTS_INFO'=>$lang['conf_comments_show_comments_info'], 259 'L_COMMENTS_ALL'=>$lang['conf_comments_forall'], 260 'L_COMMENTS_ALL_INFO'=>$lang['conf_comments_forall_info'], 261 'L_NB_COMMENTS_PAGE'=>$lang['conf_comments_comments_number'], 262 'L_NB_COMMENTS_PAGE_INFO'=>$lang['conf_comments_comments_number_info'], 263 'L_VALIDATE_COMMENTS'=>$lang['conf_comments_validation'], 264 'L_VALIDATE_COMMENTS_INFO'=>$lang['conf_comments_validation_info'], 265 'L_ABILITIES_SETTINGS'=>$lang['conf_default_title'], 266 'L_LANG_SELECT'=>$lang['customize_language'], 267 'L_LANG_SELECT_INFO'=>$lang['conf_default_language_info'], 268 'L_NB_IMAGE_LINE'=>$lang['customize_nb_image_per_row'], 269 'L_NB_IMAGE_LINE_INFO'=>$lang['conf_default_nb_image_per_row_info'], 270 'L_NB_ROW_PAGE'=>$lang['customize_nb_row_per_page'], 271 'L_NB_ROW_PAGE_INFO'=>$lang['conf_default_nb_row_per_page_info'], 272 'L_STYLE_SELECT'=>$lang['customize_theme'], 273 'L_STYLE_SELECT_INFO'=>$lang['conf_default_theme_info'], 274 'L_SHORT_PERIOD'=>$lang['customize_short_period'], 275 'L_SHORT_PERIOD_INFO'=>$lang['conf_default_short_period_info'], 276 'L_LONG_PERIOD'=>$lang['customize_long_period'], 277 'L_LONG_PERIOD_INFO'=>$lang['conf_default_long_period_info'], 278 'L_EXPAND_TREE'=>$lang['customize_expand'], 279 'L_EXPAND_TREE_INFO'=>$lang['conf_default_expand_info'], 280 'L_NB_COMMENTS'=>$lang['customize_show_nb_comments'], 281 'L_NB_COMMENTS_INFO'=>$lang['conf_default_show_nb_comments_info'], 282 'L_UPLOAD'=>$lang['conf_upload_available'], 283 'L_UPLOAD_INFO'=>$lang['conf_upload_available_info'], 284 'L_CONF_UPLOAD'=>$lang['conf_upload_title'], 285 'L_UPLOAD_MAXSIZE'=>$lang['conf_upload_maxfilesize'], 286 'L_UPLOAD_MAXSIZE_INFO'=>$lang['conf_upload_maxfilesize_info'], 287 'L_UPLOAD_MAXWIDTH'=>$lang['conf_upload_maxwidth'], 288 'L_UPLOAD_MAXWIDTH_INFO'=>$lang['conf_upload_maxwidth_info'], 289 'L_UPLOAD_MAXHEIGHT'=>$lang['conf_upload_maxheight'], 290 'L_UPLOAD_MAXHEIGHT_INFO'=>$lang['conf_upload_maxheight_info'], 291 'L_TN_UPLOAD_MAXWIDTH'=>$lang['conf_upload_maxwidth_thumbnail'], 292 'L_TN_UPLOAD_MAXWIDTH_INFO'=>$lang['conf_upload_maxwidth_thumbnail_info'], 293 'L_TN_UPLOAD_MAXHEIGHT'=>$lang['conf_upload_maxheight_thumbnail'], 294 'L_TN_UPLOAD_MAXHEIGHT_INFO'=>$lang['conf_upload_maxheight_thumbnail'], 295 'L_CONF_SESSION'=>$lang['conf_session_title'], 296 'L_COOKIE'=>$lang['conf_session_cookie'], 297 'L_COOKIE_INFO'=>$lang['conf_session_cookie_info'], 298 'L_SESSION_LENGTH'=>$lang['conf_session_time'], 299 'L_SESSION_LENGTH_INFO'=>$lang['conf_session_time_info'], 300 'L_SESSION_ID_SIZE'=>$lang['conf_session_size'], 301 'L_SESSION_ID_SIZE_INFO'=>$lang['conf_session_size_info'], 302 'L_YES'=>$lang['yes'], 303 'L_NO'=>$lang['no'], 304 'L_SUBMIT'=>$lang['submit'], 305 306 'F_ACTION'=>add_session_id(PHPWG_ROOT_PATH.'admin.php?page=configuration') 307 )); 282 308 283 309 $tpl = array( 'conf_confirmation','remote_site','delete', 284 310 'conf_remote_site_delete_info','submit','errors_title' ); 285 templatize_array( $tpl, 'lang', $sub ); 311 286 312 //-------------------------------------------------------------- errors display 287 313 if ( sizeof( $error ) != 0 ) 288 314 { 289 $ vtp->addSession( $sub, 'errors');315 $template->assign_block_vars('errors',array()); 290 316 for ( $i = 0; $i < sizeof( $error ); $i++ ) 291 317 { 292 $vtp->addSession( $sub, 'li' ); 293 $vtp->setVar( $sub, 'li.li', $error[$i] ); 294 $vtp->closeSession( $sub, 'li' ); 295 } 296 $vtp->closeSession( $sub, 'errors' ); 297 } 298 //-------------------------------------------------------- confirmation display 299 if ( count( $error ) == 0 and isset( $_POST['submit'] ) ) 300 { 301 $vtp->addSession( $sub, 'confirmation' ); 302 $vtp->closeSession( $sub, 'confirmation' ); 303 } 304 //----------------------------------------------------------------- form action 305 $form_action = add_session_id( './admin.php?page=configuration' ); 306 $vtp->setVar( $sub, 'form_action', $form_action ); 307 //------------------------------------------------------- general configuration 308 $vtp->addSession( $sub, 'line' ); 309 $vtp->addSession( $sub, 'title_line' ); 310 $vtp->setVar( $sub, 'title_line.title', $lang['conf_general_title'] ); 311 $vtp->closeSession( $sub, 'title_line' ); 312 $vtp->closeSession( $sub, 'line' ); 313 314 $vtp->addSession( $sub, 'line' ); 315 $vtp->addSession( $sub, 'space_line' ); 316 $vtp->closeSession( $sub, 'space_line' ); 317 $vtp->closeSession( $sub, 'line' ); 318 // webmaster name 319 $vtp->addSession( $sub, 'line' ); 320 $vtp->addSession( $sub, 'param_line' ); 321 $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_webmaster'] ); 322 $vtp->addSession( $sub, 'hidden' ); 323 $vtp->setVar( $sub, 'hidden.text', $webmaster ); 324 $vtp->setVar( $sub, 'hidden.name', 'webmaster' ); 325 $vtp->setVar( $sub, 'hidden.value', $webmaster ); 326 $vtp->closeSession( $sub, 'hidden' ); 327 $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_webmaster_info'] ); 328 $vtp->closeSession( $sub, 'param_line' ); 329 $vtp->closeSession( $sub, 'line' ); 330 // webmaster mail address 331 $vtp->addSession( $sub, 'line' ); 332 $vtp->addSession( $sub, 'param_line' ); 333 $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_mail'] ); 334 $vtp->addSession( $sub, 'text' ); 335 $vtp->setVar( $sub, 'text.name', 'mail_webmaster' ); 336 $vtp->setVar( $sub, 'text.value', $mail_webmaster ); 337 $vtp->closeSession( $sub, 'text' ); 338 $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_mail_info'] ); 339 $vtp->closeSession( $sub, 'param_line' ); 340 $vtp->closeSession( $sub, 'line' ); 341 // prefix for thumbnails 342 $vtp->addSession( $sub, 'line' ); 343 $vtp->addSession( $sub, 'param_line' ); 344 $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_prefix'] ); 345 $vtp->addSession( $sub, 'text' ); 346 $vtp->setVar( $sub, 'text.name', 'prefix_thumbnail' ); 347 $vtp->setVar( $sub, 'text.value', $prefix_thumbnail ); 348 $vtp->closeSession( $sub, 'text' ); 349 $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_prefix_info'] ); 350 $vtp->closeSession( $sub, 'param_line' ); 351 $vtp->closeSession( $sub, 'line' ); 352 // access type 353 $vtp->addSession( $sub, 'line' ); 354 $vtp->addSession( $sub, 'param_line' ); 355 $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_access'] ); 356 $vtp->addSession( $sub, 'group' ); 357 $vtp->addSession( $sub, 'radio' ); 358 $vtp->setVar( $sub, 'radio.name', 'access' ); 359 $vtp->setVar( $sub, 'radio.value', 'free' ); 360 $vtp->setVar( $sub, 'radio.option', $lang['conf_general_access_1'] ); 361 $checked = ''; 362 if ( $access == 'free' ) 363 { 364 $checked = ' checked="checked"'; 365 } 366 $vtp->setVar( $sub, 'radio.checked', $checked ); 367 $vtp->closeSession( $sub, 'radio' ); 368 $vtp->addSession( $sub, 'radio' ); 369 $vtp->setVar( $sub, 'radio.name', 'access' ); 370 $vtp->setVar( $sub, 'radio.value', 'restricted' ); 371 $vtp->setVar( $sub, 'radio.option', $lang['conf_general_access_2'] ); 372 $checked = ''; 373 if ( $access == 'restricted' ) 374 { 375 $checked = ' checked="checked"'; 376 } 377 $vtp->setVar( $sub, 'radio.checked', $checked ); 378 $vtp->closeSession( $sub, 'radio' ); 379 $vtp->closeSession( $sub, 'group' ); 380 $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_access_info'] ); 381 $vtp->closeSession( $sub, 'param_line' ); 382 $vtp->closeSession( $sub, 'line' ); 383 // maximum user number to display in the listbox of identification page 384 $vtp->addSession( $sub, 'line' ); 385 $vtp->addSession( $sub, 'param_line' ); 386 $vtp->setVar( $sub, 'param_line.name', 387 $lang['conf_general_max_user_listbox'] ); 388 $vtp->addSession( $sub, 'text' ); 389 $vtp->setVar( $sub, 'text.name', 'max_user_listbox' ); 390 $vtp->setVar( $sub, 'text.value', $max_user_listbox ); 391 $vtp->closeSession( $sub, 'text' ); 392 $vtp->setVar( $sub, 'param_line.def', 393 $lang['conf_general_max_user_listbox_info'] ); 394 $vtp->closeSession( $sub, 'param_line' ); 395 $vtp->closeSession( $sub, 'line' ); 396 // activate log 397 $vtp->addSession( $sub, 'line' ); 398 $vtp->addSession( $sub, 'param_line' ); 399 $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_log'] ); 400 $vtp->addSession( $sub, 'group' ); 401 $vtp->addSession( $sub, 'radio' ); 402 $vtp->setVar( $sub, 'radio.name', 'log' ); 403 $vtp->setVar( $sub, 'radio.value', 'true' ); 404 $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); 405 $checked = ''; 406 if ( $log == 'true' ) 407 { 408 $checked = ' checked="checked"'; 409 } 410 $vtp->setVar( $sub, 'radio.checked', $checked ); 411 $vtp->closeSession( $sub, 'radio' ); 412 $vtp->addSession( $sub, 'radio' ); 413 $vtp->setVar( $sub, 'radio.name', 'log' ); 414 $vtp->setVar( $sub, 'radio.value', 'false' ); 415 $vtp->setVar( $sub, 'radio.option', $lang['no'] ); 416 $checked = ''; 417 if ( $log == 'false' ) 418 { 419 $checked = ' checked="checked"'; 420 } 421 $vtp->setVar( $sub, 'radio.checked', $checked ); 422 $vtp->closeSession( $sub, 'radio' ); 423 $vtp->closeSession( $sub, 'group' ); 424 $vtp->setVar( $sub, 'param_line.def', 425 $lang['conf_general_log_info'] ); 426 $vtp->closeSession( $sub, 'param_line' ); 427 $vtp->closeSession( $sub, 'line' ); 428 // mail notification for admins 429 $vtp->addSession( $sub, 'line' ); 430 $vtp->addSession( $sub, 'param_line' ); 431 $vtp->setVar( $sub, 'param_line.name', 432 $lang['conf_general_mail_notification'] ); 433 $vtp->addSession( $sub, 'group' ); 434 $vtp->addSession( $sub, 'radio' ); 435 $vtp->setVar( $sub, 'radio.name', 'mail_notification' ); 436 $vtp->setVar( $sub, 'radio.value', 'true' ); 437 $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); 438 $checked = ''; 439 if ( $mail_notification == 'true' ) 440 { 441 $checked = ' checked="checked"'; 442 } 443 $vtp->setVar( $sub, 'radio.checked', $checked ); 444 $vtp->closeSession( $sub, 'radio' ); 445 $vtp->addSession( $sub, 'radio' ); 446 $vtp->setVar( $sub, 'radio.name', 'mail_notification' ); 447 $vtp->setVar( $sub, 'radio.value', 'false' ); 448 $vtp->setVar( $sub, 'radio.option', $lang['no'] ); 449 $checked = ''; 450 if ( $mail_notification == 'false' ) 451 { 452 $checked = ' checked="checked"'; 453 } 454 $vtp->setVar( $sub, 'radio.checked', $checked ); 455 $vtp->closeSession( $sub, 'radio' ); 456 $vtp->closeSession( $sub, 'group' ); 457 $vtp->setVar( $sub, 'param_line.def', 458 $lang['conf_general_mail_notification_info'] ); 459 $vtp->closeSession( $sub, 'param_line' ); 460 $vtp->closeSession( $sub, 'line' ); 461 462 $vtp->addSession( $sub, 'line' ); 463 $vtp->addSession( $sub, 'space_line' ); 464 $vtp->closeSession( $sub, 'space_line' ); 465 $vtp->closeSession( $sub, 'line' ); 466 //------------------------------------------------------ comments configuration 467 $vtp->addSession( $sub, 'line' ); 468 $vtp->addSession( $sub, 'title_line' ); 469 $vtp->setVar( $sub, 'title_line.title', $lang['conf_comments_title'] ); 470 $vtp->closeSession( $sub, 'title_line' ); 471 $vtp->closeSession( $sub, 'line' ); 472 473 $vtp->addSession( $sub, 'line' ); 474 $vtp->addSession( $sub, 'space_line' ); 475 $vtp->closeSession( $sub, 'space_line' ); 476 $vtp->closeSession( $sub, 'line' ); 477 // show comments ? 478 $vtp->addSession( $sub, 'line' ); 479 $vtp->addSession( $sub, 'param_line' ); 480 $vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_show_comments'] ); 481 $vtp->addSession( $sub, 'group' ); 482 $vtp->addSession( $sub, 'radio' ); 483 $vtp->setVar( $sub, 'radio.name', 'show_comments' ); 484 $vtp->setVar( $sub, 'radio.value', 'true' ); 485 $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); 486 $checked = ''; 487 if ( $show_comments == 'true' ) 488 { 489 $checked = ' checked="checked"'; 490 } 491 $vtp->setVar( $sub, 'radio.checked', $checked ); 492 $vtp->closeSession( $sub, 'radio' ); 493 $vtp->addSession( $sub, 'radio' ); 494 $vtp->setVar( $sub, 'radio.name', 'show_comments' ); 495 $vtp->setVar( $sub, 'radio.value', 'false' ); 496 $vtp->setVar( $sub, 'radio.option', $lang['no'] ); 497 $checked = ''; 498 if ( $show_comments == 'false' ) 499 { 500 $checked = ' checked="checked"'; 501 } 502 $vtp->setVar( $sub, 'radio.checked', $checked ); 503 $vtp->closeSession( $sub, 'radio' ); 504 $vtp->closeSession( $sub, 'group' ); 505 $vtp->setVar( $sub, 'param_line.def', 506 $lang['conf_comments_show_comments_info'] ); 507 $vtp->closeSession( $sub, 'param_line' ); 508 $vtp->closeSession( $sub, 'line' ); 509 // coments for all ? true -> guests can post messages 510 $vtp->addSession( $sub, 'line' ); 511 $vtp->addSession( $sub, 'param_line' ); 512 $vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_forall'] ); 513 $vtp->addSession( $sub, 'group' ); 514 $vtp->addSession( $sub, 'radio' ); 515 $vtp->setVar( $sub, 'radio.name', 'comments_forall' ); 516 $vtp->setVar( $sub, 'radio.value', 'true' ); 517 $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); 518 $checked = ''; 519 if ( $comments_forall == 'true' ) 520 { 521 $checked = ' checked="checked"'; 522 } 523 $vtp->setVar( $sub, 'radio.checked', $checked ); 524 $vtp->closeSession( $sub, 'radio' ); 525 $vtp->addSession( $sub, 'radio' ); 526 $vtp->setVar( $sub, 'radio.name', 'comments_forall' ); 527 $vtp->setVar( $sub, 'radio.value', 'false' ); 528 $vtp->setVar( $sub, 'radio.option', $lang['no'] ); 529 $checked = ''; 530 if ( $comments_forall == 'false' ) 531 { 532 $checked = ' checked="checked"'; 533 } 534 $vtp->setVar( $sub, 'radio.checked', $checked ); 535 $vtp->closeSession( $sub, 'radio' ); 536 $vtp->closeSession( $sub, 'group' ); 537 $vtp->setVar( $sub, 'param_line.def', 538 $lang['conf_comments_forall_info'] ); 539 $vtp->closeSession( $sub, 'param_line' ); 540 $vtp->closeSession( $sub, 'line' ); 541 // number of comments per page 542 $vtp->addSession( $sub, 'line' ); 543 $vtp->addSession( $sub, 'param_line' ); 544 $vtp->setVar( $sub, 'param_line.name', 545 $lang['conf_comments_comments_number'] ); 546 $vtp->addSession( $sub, 'text' ); 547 $vtp->setVar( $sub, 'text.name', 'nb_comment_page' ); 548 $vtp->setVar( $sub, 'text.value', $nb_comment_page ); 549 $vtp->closeSession( $sub, 'text' ); 550 $vtp->setVar( $sub, 'param_line.def', 551 $lang['conf_comments_comments_number_info'] ); 552 $vtp->closeSession( $sub, 'param_line' ); 553 $vtp->closeSession( $sub, 'line' ); 554 // coments validation 555 $vtp->addSession( $sub, 'line' ); 556 $vtp->addSession( $sub, 'param_line' ); 557 $vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_validation'] ); 558 $vtp->addSession( $sub, 'group' ); 559 $vtp->addSession( $sub, 'radio' ); 560 $vtp->setVar( $sub, 'radio.name', 'comments_validation' ); 561 $vtp->setVar( $sub, 'radio.value', 'true' ); 562 $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); 563 $checked = ''; 564 if ( $comments_validation == 'true' ) 565 { 566 $checked = ' checked="checked"'; 567 } 568 $vtp->setVar( $sub, 'radio.checked', $checked ); 569 $vtp->closeSession( $sub, 'radio' ); 570 $vtp->addSession( $sub, 'radio' ); 571 $vtp->setVar( $sub, 'radio.name', 'comments_validation' ); 572 $vtp->setVar( $sub, 'radio.value', 'false' ); 573 $vtp->setVar( $sub, 'radio.option', $lang['no'] ); 574 $checked = ''; 575 if ( $comments_validation == 'false' ) 576 { 577 $checked = ' checked="checked"'; 578 } 579 $vtp->setVar( $sub, 'radio.checked', $checked ); 580 $vtp->closeSession( $sub, 'radio' ); 581 $vtp->closeSession( $sub, 'group' ); 582 $vtp->setVar( $sub, 'param_line.def', 583 $lang['conf_comments_validation_info'] ); 584 $vtp->closeSession( $sub, 'param_line' ); 585 $vtp->closeSession( $sub, 'line' ); 586 587 $vtp->addSession( $sub, 'line' ); 588 $vtp->addSession( $sub, 'space_line' ); 589 $vtp->closeSession( $sub, 'space_line' ); 590 $vtp->closeSession( $sub, 'line' ); 591 //-------------------------------------------------- default user configuration 592 $vtp->addSession( $sub, 'line' ); 593 $vtp->addSession( $sub, 'title_line' ); 594 $vtp->setVar( $sub, 'title_line.title', $lang['conf_default_title'] ); 595 $vtp->closeSession( $sub, 'title_line' ); 596 $vtp->closeSession( $sub, 'line' ); 597 598 $vtp->addSession( $sub, 'line' ); 599 $vtp->addSession( $sub, 'space_line' ); 600 $vtp->closeSession( $sub, 'space_line' ); 601 $vtp->closeSession( $sub, 'line' ); 602 // default language 603 $vtp->addSession( $sub, 'line' ); 604 $vtp->addSession( $sub, 'param_line' ); 605 $vtp->setVar( $sub, 'param_line.name', $lang['customize_language'] ); 606 $vtp->addSession( $sub, 'select' ); 607 $vtp->setVar( $sub, 'select.name', 'language' ); 608 $option = get_languages( './language/' ); 609 for ( $i = 0; $i < sizeof( $option ); $i++ ) 610 { 611 $vtp->addSession( $sub, 'option' ); 612 $vtp->setVar( $sub, 'option.option', $option[$i] ); 613 if ( $option[$i] == $language ) 614 { 615 $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); 616 } 617 $vtp->closeSession( $sub, 'option' ); 618 } 619 $vtp->closeSession( $sub, 'select' ); 620 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_language_info'] ); 621 $vtp->closeSession( $sub, 'param_line' ); 622 $vtp->closeSession( $sub, 'line' ); 623 // number of image per row 624 $vtp->addSession( $sub, 'line' ); 625 $vtp->addSession( $sub, 'param_line' ); 626 $vtp->setVar( $sub, 'param_line.name', $lang['customize_nb_image_per_row'] ); 627 $vtp->addSession( $sub, 'select' ); 628 $vtp->setVar( $sub, 'select.name', 'nb_image_line' ); 629 for ( $i = 0; $i < sizeof( $conf['nb_image_row'] ); $i++ ) 630 { 631 $vtp->addSession( $sub, 'option' ); 632 $vtp->setVar( $sub, 'option.option', $conf['nb_image_row'][$i] ); 633 if ( $conf['nb_image_row'][$i] == $nb_image_line ) 634 { 635 $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); 636 } 637 $vtp->closeSession( $sub, 'option' ); 638 } 639 $vtp->closeSession( $sub, 'select' ); 640 $vtp->setVar( $sub, 'param_line.def', 641 $lang['conf_default_nb_image_per_row_info'] ); 642 $vtp->closeSession( $sub, 'param_line' ); 643 $vtp->closeSession( $sub, 'line' ); 644 // number of row per page 645 $vtp->addSession( $sub, 'line' ); 646 $vtp->addSession( $sub, 'param_line' ); 647 $vtp->setVar( $sub, 'param_line.name', $lang['customize_nb_row_per_page'] ); 648 $vtp->addSession( $sub, 'select' ); 649 $vtp->setVar( $sub, 'select.name', 'nb_line_page' ); 650 for ( $i = 0; $i < sizeof( $conf['nb_row_page'] ); $i++ ) 651 { 652 $vtp->addSession( $sub, 'option' ); 653 $vtp->setVar( $sub, 'option.option', $conf['nb_row_page'][$i] ); 654 if ( $conf['nb_row_page'][$i] == $nb_line_page ) 655 { 656 $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); 657 } 658 $vtp->closeSession( $sub, 'option' ); 659 } 660 $vtp->closeSession( $sub, 'select' ); 661 $vtp->setVar( $sub, 'param_line.def', 662 $lang['conf_default_nb_row_per_page_info'] ); 663 $vtp->closeSession( $sub, 'param_line' ); 664 $vtp->closeSession( $sub, 'line' ); 665 // template 666 $vtp->addSession( $sub, 'line' ); 667 $vtp->addSession( $sub, 'param_line' ); 668 $vtp->setVar( $sub, 'param_line.name', $lang['customize_theme'] ); 669 $vtp->addSession( $sub, 'select' ); 670 $vtp->setVar( $sub, 'select.name', 'template' ); 671 $option = get_dirs( './template/' ); 672 673 for ( $i = 0; $i < sizeof( $option ); $i++ ) 674 { 675 $vtp->addSession( $sub, 'option' ); 676 $vtp->setVar( $sub, 'option.option', $option[$i] ); 677 if ( $option[$i] == $template ) 678 { 679 $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); 680 } 681 $vtp->closeSession( $sub, 'option' ); 682 } 683 $vtp->closeSession( $sub, 'select' ); 684 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_theme_info'] ); 685 $vtp->closeSession( $sub, 'param_line' ); 686 $vtp->closeSession( $sub, 'line' ); 687 // short period time 688 $vtp->addSession( $sub, 'line' ); 689 $vtp->addSession( $sub, 'param_line' ); 690 $vtp->setVar( $sub, 'param_line.name', $lang['customize_short_period'] ); 691 $vtp->addSession( $sub, 'text' ); 692 $vtp->setVar( $sub, 'text.name', 'short_period' ); 693 $vtp->setVar( $sub, 'text.value', $short_period ); 694 $vtp->closeSession( $sub, 'text' ); 695 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_short_period_info']); 696 $vtp->closeSession( $sub, 'param_line' ); 697 $vtp->closeSession( $sub, 'line' ); 698 // long period time 699 $vtp->addSession( $sub, 'line' ); 700 $vtp->addSession( $sub, 'param_line' ); 701 $vtp->setVar( $sub, 'param_line.name', $lang['customize_long_period'] ); 702 $vtp->addSession( $sub, 'text' ); 703 $vtp->setVar( $sub, 'text.name', 'long_period' ); 704 $vtp->setVar( $sub, 'text.value', $long_period ); 705 $vtp->closeSession( $sub, 'text' ); 706 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_long_period_info'] ); 707 $vtp->closeSession( $sub, 'param_line' ); 708 $vtp->closeSession( $sub, 'line' ); 709 // max displayed width 710 $vtp->addSession( $sub, 'line' ); 711 $vtp->addSession( $sub, 'param_line' ); 712 $vtp->setVar( $sub, 'param_line.name', $lang['maxwidth'] ); 713 $vtp->addSession( $sub, 'text' ); 714 $vtp->setVar( $sub, 'text.name', 'maxwidth' ); 715 $vtp->setVar( $sub, 'text.value', $maxwidth ); 716 $vtp->closeSession( $sub, 'text' ); 717 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_maxwidth_info'] ); 718 $vtp->closeSession( $sub, 'param_line' ); 719 $vtp->closeSession( $sub, 'line' ); 720 // max displayed height 721 $vtp->addSession( $sub, 'line' ); 722 $vtp->addSession( $sub, 'param_line' ); 723 $vtp->setVar( $sub, 'param_line.name', $lang['maxheight'] ); 724 $vtp->addSession( $sub, 'text' ); 725 $vtp->setVar( $sub, 'text.name', 'maxheight' ); 726 $vtp->setVar( $sub, 'text.value', $maxheight ); 727 $vtp->closeSession( $sub, 'text' ); 728 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_maxheight_info'] ); 729 $vtp->closeSession( $sub, 'param_line' ); 730 $vtp->closeSession( $sub, 'line' ); 731 // expand all categories ? 732 $vtp->addSession( $sub, 'line' ); 733 $vtp->addSession( $sub, 'param_line' ); 734 $vtp->setVar( $sub, 'param_line.name', $lang['customize_expand'] ); 735 $vtp->addSession( $sub, 'group' ); 736 $vtp->addSession( $sub, 'radio' ); 737 $vtp->setVar( $sub, 'radio.name', 'expand' ); 738 739 $vtp->setVar( $sub, 'radio.value', 'true' ); 740 $checked = ''; 741 if ( $expand == 'true' ) 742 { 743 $checked = ' checked="checked"'; 744 } 745 $vtp->setVar( $sub, 'radio.checked', $checked ); 746 $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); 747 $vtp->closeSession( $sub, 'radio' ); 748 $vtp->addSession( $sub, 'radio' ); 749 $vtp->setVar( $sub, 'radio.name', 'expand' ); 750 $vtp->setVar( $sub, 'radio.value', 'false' ); 751 $checked = ''; 752 if ( $expand == 'false' ) 753 { 754 $checked = ' checked="checked"'; 755 } 756 $vtp->setVar( $sub, 'radio.checked', $checked ); 757 $vtp->setVar( $sub, 'radio.option', $lang['no'] ); 758 $vtp->closeSession( $sub, 'radio' ); 759 $vtp->closeSession( $sub, 'group' ); 760 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_expand_info'] ); 761 $vtp->closeSession( $sub, 'param_line' ); 762 $vtp->closeSession( $sub, 'line' ); 763 // show number of comments on thumbnails page 764 $vtp->addSession( $sub, 'line' ); 765 $vtp->addSession( $sub, 'param_line' ); 766 $vtp->setVar( $sub, 'param_line.name', $lang['customize_show_nb_comments'] ); 767 $vtp->addSession( $sub, 'group' ); 768 $vtp->addSession( $sub, 'radio' ); 769 $vtp->setVar( $sub, 'radio.name', 'show_nb_comments' ); 770 $vtp->setVar( $sub, 'radio.value', 'true' ); 771 $checked = ''; 772 if ( $show_nb_comments == 'true' ) 773 { 774 $checked = ' checked="checked"'; 775 } 776 $vtp->setVar( $sub, 'radio.checked', $checked ); 777 $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); 778 $vtp->closeSession( $sub, 'radio' ); 779 $vtp->addSession( $sub, 'radio' ); 780 $vtp->setVar( $sub, 'radio.name', 'show_nb_comments' ); 781 $vtp->setVar( $sub, 'radio.value', 'false' ); 782 $checked = ''; 783 if ( $show_nb_comments == 'false' ) 784 { 785 $checked = ' checked="checked"'; 786 } 787 $vtp->setVar( $sub, 'radio.checked', $checked ); 788 $vtp->setVar( $sub, 'radio.option', $lang['no'] ); 789 $vtp->closeSession( $sub, 'radio' ); 790 $vtp->closeSession( $sub, 'group' ); 791 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_show_nb_comments_info'] ); 792 $vtp->closeSession( $sub, 'param_line' ); 793 $vtp->closeSession( $sub, 'line' ); 794 795 $vtp->addSession( $sub, 'line' ); 796 $vtp->addSession( $sub, 'space_line' ); 797 $vtp->closeSession( $sub, 'space_line' ); 798 $vtp->closeSession( $sub, 'line' ); 799 //-------------------------------------------------------- upload configuration 800 $vtp->addSession( $sub, 'line' ); 801 $vtp->addSession( $sub, 'title_line' ); 802 $vtp->setVar( $sub, 'title_line.title', $lang['conf_upload_title'] ); 803 $vtp->closeSession( $sub, 'title_line' ); 804 $vtp->closeSession( $sub, 'line' ); 805 806 $vtp->addSession( $sub, 'line' ); 807 $vtp->addSession( $sub, 'space_line' ); 808 $vtp->closeSession( $sub, 'space_line' ); 809 $vtp->closeSession( $sub, 'line' ); 810 // is upload available ? 811 $vtp->addSession( $sub, 'line' ); 812 $vtp->addSession( $sub, 'param_line' ); 813 $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_available'] ); 814 $vtp->addSession( $sub, 'group' ); 815 $vtp->addSession( $sub, 'radio' ); 816 $vtp->setVar( $sub, 'radio.name', 'upload_available' ); 817 $vtp->setVar( $sub, 'radio.value', 'true' ); 818 $checked = ''; 819 if ( $upload_available == 'true' ) 820 { 821 $checked = ' checked="checked"'; 822 } 823 $vtp->setVar( $sub, 'radio.checked', $checked ); 824 $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); 825 $vtp->closeSession( $sub, 'radio' ); 826 $vtp->addSession( $sub, 'radio' ); 827 $vtp->setVar( $sub, 'radio.name', 'upload_available' ); 828 $vtp->setVar( $sub, 'radio.value', 'false' ); 829 $checked = ''; 830 if ( $upload_available == 'false' ) 831 { 832 $checked = ' checked="checked"'; 833 } 834 $vtp->setVar( $sub, 'radio.checked', $checked ); 835 $vtp->setVar( $sub, 'radio.option', $lang['no'] ); 836 $vtp->closeSession( $sub, 'radio' ); 837 $vtp->closeSession( $sub, 'group' ); 838 $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_available_info'] ); 839 $vtp->closeSession( $sub, 'param_line' ); 840 $vtp->closeSession( $sub, 'line' ); 841 // max filesize uploadable 842 $vtp->addSession( $sub, 'line' ); 843 $vtp->addSession( $sub, 'param_line' ); 844 $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxfilesize'] ); 845 $vtp->addSession( $sub, 'text' ); 846 $vtp->setVar( $sub, 'text.name', 'upload_maxfilesize' ); 847 $vtp->setVar( $sub, 'text.value', $upload_maxfilesize ); 848 $vtp->closeSession( $sub, 'text' ); 849 $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxfilesize_info'] ); 850 $vtp->closeSession( $sub, 'param_line' ); 851 $vtp->closeSession( $sub, 'line' ); 852 // maxwidth uploadable 853 $vtp->addSession( $sub, 'line' ); 854 $vtp->addSession( $sub, 'param_line' ); 855 $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxwidth'] ); 856 $vtp->addSession( $sub, 'text' ); 857 $vtp->setVar( $sub, 'text.name', 'upload_maxwidth' ); 858 $vtp->setVar( $sub, 'text.value', $upload_maxwidth ); 859 $vtp->closeSession( $sub, 'text' ); 860 $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxwidth_info'] ); 861 $vtp->closeSession( $sub, 'param_line' ); 862 $vtp->closeSession( $sub, 'line' ); 863 // maxheight uploadable 864 $vtp->addSession( $sub, 'line' ); 865 $vtp->addSession( $sub, 'param_line' ); 866 $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxheight'] ); 867 $vtp->addSession( $sub, 'text' ); 868 $vtp->setVar( $sub, 'text.name', 'upload_maxheight' ); 869 $vtp->setVar( $sub, 'text.value', $upload_maxheight ); 870 $vtp->closeSession( $sub, 'text' ); 871 $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxheight_info'] ); 872 $vtp->closeSession( $sub, 'param_line' ); 873 $vtp->closeSession( $sub, 'line' ); 874 // maxwidth for thumbnail 875 $vtp->addSession( $sub, 'line' ); 876 $vtp->addSession( $sub, 'param_line' ); 877 $vtp->setVar( $sub, 'param_line.name',$lang['conf_upload_maxwidth_thumbnail']); 878 $vtp->addSession( $sub, 'text' ); 879 $vtp->setVar( $sub, 'text.name', 'upload_maxwidth_thumbnail' ); 880 $vtp->setVar( $sub, 'text.value', $upload_maxwidth_thumbnail ); 881 $vtp->closeSession( $sub, 'text' ); 882 $vtp->setVar($sub,'param_line.def',$lang['conf_upload_maxwidth_thumbnail_info']); 883 $vtp->closeSession( $sub, 'param_line' ); 884 $vtp->closeSession( $sub, 'line' ); 885 // maxheight for thumbnail 886 $vtp->addSession( $sub, 'line' ); 887 $vtp->addSession( $sub, 'param_line' ); 888 $vtp->setVar( $sub,'param_line.name',$lang['conf_upload_maxheight_thumbnail']); 889 $vtp->addSession( $sub, 'text' ); 890 $vtp->setVar( $sub, 'text.name', 'upload_maxheight_thumbnail' ); 891 $vtp->setVar( $sub, 'text.value', $upload_maxheight_thumbnail ); 892 $vtp->closeSession( $sub, 'text' ); 893 $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxheight_thumbnail_info']); 894 $vtp->closeSession( $sub, 'param_line' ); 895 $vtp->closeSession( $sub, 'line' ); 896 897 $vtp->addSession( $sub, 'line' ); 898 $vtp->addSession( $sub, 'space_line' ); 899 $vtp->closeSession( $sub, 'space_line' ); 900 $vtp->closeSession( $sub, 'line' ); 901 //------------------------------------------------------ sessions configuration 902 $vtp->addSession( $sub, 'line' ); 903 $vtp->addSession( $sub, 'title_line' ); 904 $vtp->setVar( $sub, 'title_line.title', $lang['conf_session_title'] ); 905 $vtp->closeSession( $sub, 'title_line' ); 906 $vtp->closeSession( $sub, 'line' ); 907 908 $vtp->addSession( $sub, 'line' ); 909 $vtp->addSession( $sub, 'space_line' ); 910 $vtp->closeSession( $sub, 'space_line' ); 911 $vtp->closeSession( $sub, 'line' ); 912 // authorize cookies ? 913 $vtp->addSession( $sub, 'line' ); 914 $vtp->addSession( $sub, 'param_line' ); 915 $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_cookie'] ); 916 $vtp->addSession( $sub, 'group' ); 917 $vtp->addSession( $sub, 'radio' ); 918 $vtp->setVar( $sub, 'radio.name', 'authorize_cookies' ); 919 $vtp->setVar( $sub, 'radio.value', 'true' ); 920 $checked = ''; 921 if ( $authorize_cookies == 'true' ) 922 { 923 $checked = ' checked="checked"'; 924 } 925 $vtp->setVar( $sub, 'radio.checked', $checked ); 926 $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); 927 $vtp->closeSession( $sub, 'radio' ); 928 $vtp->addSession( $sub, 'radio' ); 929 $vtp->setVar( $sub, 'radio.name', 'authorize_cookies' ); 930 $vtp->setVar( $sub, 'radio.value', 'false' ); 931 $checked = ''; 932 if ( $authorize_cookies == 'false' ) 933 { 934 $checked = ' checked="checked"'; 935 } 936 $vtp->setVar( $sub, 'radio.checked', $checked ); 937 $vtp->setVar( $sub, 'radio.option', $lang['no'] ); 938 $vtp->closeSession( $sub, 'radio' ); 939 $vtp->closeSession( $sub, 'group' ); 940 $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_cookie_info'] ); 941 $vtp->closeSession( $sub, 'param_line' ); 942 $vtp->closeSession( $sub, 'line' ); 943 // session size 944 $vtp->addSession( $sub, 'line' ); 945 $vtp->addSession( $sub, 'param_line' ); 946 $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_size'] ); 947 $vtp->addSession( $sub, 'text' ); 948 $vtp->setVar( $sub, 'text.name', 'session_id_size' ); 949 $vtp->setVar( $sub, 'text.value', $session_id_size ); 950 $vtp->closeSession( $sub, 'text' ); 951 $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_size_info']); 952 $vtp->closeSession( $sub, 'param_line' ); 953 $vtp->closeSession( $sub, 'line' ); 954 // session length 955 $vtp->addSession( $sub, 'line' ); 956 $vtp->addSession( $sub, 'param_line' ); 957 $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_time'] ); 958 $vtp->addSession( $sub, 'text' ); 959 $vtp->setVar( $sub, 'text.name', 'session_time' ); 960 $vtp->setVar( $sub, 'text.value', $session_time ); 961 $vtp->closeSession( $sub, 'text' ); 962 $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_time_info']); 963 $vtp->closeSession( $sub, 'param_line' ); 964 $vtp->closeSession( $sub, 'line' ); 965 // session keyword 966 $vtp->addSession( $sub, 'line' ); 967 $vtp->addSession( $sub, 'param_line' ); 968 $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_key'] ); 969 $vtp->addSession( $sub, 'text' ); 970 $vtp->setVar( $sub, 'text.name', 'session_keyword' ); 971 $vtp->setVar( $sub, 'text.value', $session_keyword ); 972 $vtp->closeSession( $sub, 'text' ); 973 $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_key_info']); 974 $vtp->closeSession( $sub, 'param_line' ); 975 $vtp->closeSession( $sub, 'line' ); 976 // session deletion 977 $vtp->addSession( $sub, 'line' ); 978 $vtp->addSession( $sub, 'param_line' ); 979 $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_delete'] ); 980 $vtp->addSession( $sub, 'check' ); 981 $vtp->addSession( $sub, 'box' ); 982 $vtp->setVar( $sub, 'box.name', 'empty_session_table' ); 983 $vtp->setVar( $sub, 'box.value', '1' ); 984 $vtp->setVar( $sub, 'box.checked', ' checked="checked"' ); 985 $vtp->closeSession( $sub, 'box' ); 986 $vtp->closeSession( $sub, 'check' ); 987 $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_delete_info'] ); 988 $vtp->closeSession( $sub, 'param_line' ); 989 $vtp->closeSession( $sub, 'line' ); 990 991 $vtp->addSession( $sub, 'line' ); 992 $vtp->addSession( $sub, 'space_line' ); 993 $vtp->closeSession( $sub, 'space_line' ); 994 $vtp->closeSession( $sub, 'line' ); 318 $template->assign_block_vars('errors.error',array('ERROR'=>$error[$i])); 319 } 320 } 321 elseif ( isset( $_POST['submit'] ) ) 322 { 323 $template->assign_block_vars('confirmation' ,array()); 324 } 995 325 //------------------------------------------------ remote sites administration 996 326 $query = 'select id,galleries_url'; 997 $query.= ' from '. PREFIX_TABLE.'sites';327 $query.= ' from '.SITES_TABLE; 998 328 $query.= " where galleries_url <> './galleries/';"; 999 329 $result = mysql_query( $query ); … … 1019 349 } 1020 350 //----------------------------------------------------------- sending html code 1021 $ vtp->Parse( $handle , 'sub', $sub);351 $template->assign_var_from_handle('ADMIN_CONTENT', 'config'); 1022 352 ?> -
trunk/admin/help.php
r362 r393 25 25 // | USA. | 26 26 // +-----------------------------------------------------------------------+ 27 include_once( './admin/include/isadmin.inc.php' );27 include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); 28 28 //----------------------------------------------------- template initialization 29 $sub = $vtp->Open( './template/'.$user['template'].'/admin/help.vtp' ); 30 $tpl = array( ); 31 templatize_array( $tpl, 'lang', $sub ); 29 $template->set_filenames( array('help'=>'admin/help.tpl') ); 30 32 31 //----------------------------------------------------- help categories display 33 32 $categories = array( 'images','thumbnails','database','remote','upload', 34 33 'virtual','groups','access','infos' ); 35 34 foreach ( $categories as $category ) { 36 $ vtp->addSession( $sub, 'cat');35 $template->assign_block_vars('cat', array('NAME'=>$lang['help_'.$category.'_title'])); 37 36 if ( $category == 'images' ) 38 37 { 39 $vtp->addSession( $sub, 'illustration' ); 40 $vtp->setVar( $sub, 'illustration.pic_src', './admin/images/admin.png' ); 41 $vtp->setVar( $sub, 'illustration.pic_alt', '' ); 42 $vtp->setVar( $sub, 'illustration.caption', $lang['help_images_intro'] ); 43 $vtp->closeSession( $sub, 'illustration' ); 38 $template->assign_block_vars('cat.illustration', array( 39 'SRC_IMG'=>PHPWG_ROOT_PATH.'admin/images/admin.png', 40 'CAPTION'=>$lang['help_images_intro'] 41 )); 44 42 } 45 $vtp->setVar( $sub, 'cat.name', $lang['help_'.$category.'_title'] );46 43 foreach ( $lang['help_'.$category] as $item ) { 47 $vtp->addSession( $sub, 'item' ); 48 $vtp->setVar( $sub, 'item.content', $item ); 49 $vtp->closeSession( $sub, 'item' ); 44 $template->assign_block_vars('cat.item', array('CONTENT'=>$item)); 50 45 } 51 52 $vtp->closeSession( $sub, 'cat' );53 46 } 54 //----------------------------------------------------------- sending html code 55 $vtp->Parse( $handle , 'sub', $sub ); 47 $template->assign_var_from_handle('ADMIN_CONTENT', 'help'); 56 48 ?> -
trunk/admin/include/functions.php
r364 r393 668 668 669 669 $query = 'SELECT MAX(date_last) AS last_date'; 670 $query.= ' FROM '. PREFIX_TABLE.'categories';670 $query.= ' FROM '.CATEGORIES_TABLE; 671 671 $query.= ' WHERE id IN ('.$category['id']; 672 672 if ( count( $user_all_subcats ) > 0 ) … … 736 736 { 737 737 // 1. retrieving ids of private categories 738 $query = 'SELECT id'; 739 $query.= ' FROM '.PREFIX_TABLE.'categories'; 738 $query = 'SELECT id FROM '.CATEGORIES_TABLE; 740 739 $query.= " WHERE status = 'private'"; 741 740 $query.= ';'; … … 750 749 // 2.1. retrieving authorized categories thanks to personnal user 751 750 // authorization 752 $query = 'SELECT cat_id'; 753 $query.= ' FROM '.PREFIX_TABLE.'user_access'; 751 $query = 'SELECT cat_id FROM '.USER_ACCESS_TABLE; 754 752 $query.= ' WHERE user_id = '.$user_id; 755 753 $query.= ';'; … … 764 762 { 765 763 $query = 'SELECT ga.cat_id'; 766 $query.= ' FROM '. PREFIX_TABLE.'user_groupas ug';767 $query.= ', '. PREFIX_TABLE.'group_accessas ga';764 $query.= ' FROM '.USER_GROUP_TABLE.' as ug'; 765 $query.= ', '.GROUP_ACCESS_TABLE.' as ga'; 768 766 $query.= ' WHERE ug.group_id = ga.group_id'; 769 767 $query.= ' AND ug.user_id = '.$user_id; … … 790 788 if ( $user_status != 'admin' ) 791 789 { 792 $query = 'SELECT id'; 793 $query.= ' FROM '.PREFIX_TABLE.'categories'; 790 $query = 'SELECT id FROM '.CATEGORIES_TABLE; 794 791 $query.= " WHERE visible = 'false';"; 795 792 $result = mysql_query( $query ); … … 822 819 foreach( $user_restrictions as $user_id => $restrictions ) { 823 820 $query = 'DELETE'; 824 $query.= ' FROM '. PREFIX_TABLE.'user_category';821 $query.= ' FROM '.USER_CATEGORY_TABLE; 825 822 $query.= ' WHERE user_id = '.$user_id; 826 823 $query.= ';'; … … 828 825 } 829 826 830 $query = 'INSERT INTO '. PREFIX_TABLE.'user_category';827 $query = 'INSERT INTO '.USER_CATEGORY_TABLE; 831 828 $query.= ' (user_id,category_id,date_last,nb_sub_categories) VALUES '; 832 829 $query.= $values; … … 903 900 $query = 'SELECT id'; 904 901 $query.= ' FROM '.USERS_TABLE; 905 $query.= ', '. PREFIX_TABLE.'user_group';902 $query.= ', '.USER_GROUP_TABLE; 906 903 $query.= ' WHERE group_id = '.$group_id; 907 904 $query.= ' AND id = user_id'; … … 980 977 981 978 $query = 'SELECT uppercats'; 982 $query.= ' FROM '. PREFIX_TABLE.'categories';979 $query.= ' FROM '.CATEGORIES_TABLE; 983 980 $query.= ' WHERE id = '.$category_id; 984 981 $query.= ';'; -
trunk/admin/include/isadmin.inc.php
r364 r393 26 26 // +-----------------------------------------------------------------------+ 27 27 28 include( './admin/include/functions.php' );28 include( PHPWG_ROOT_PATH.'admin/include/functions.php' ); 29 29 30 30 $isadmin = true; -
trunk/admin/thumbnail.php
r362 r393 25 25 // | USA. | 26 26 // +-----------------------------------------------------------------------+ 27 include_once( './admin/include/isadmin.inc.php' );27 include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); 28 28 //------------------------------------------------------------------- functions 29 29 // get_subdirs returns an array containing all sub directory names, … … 212 212 } 213 213 214 // array_max returns the highest value of the given array215 function array_max( $array )216 {217 sort( $array, SORT_NUMERIC );218 return array_pop( $array );219 }220 221 // array_min returns the lowest value of the given array222 function array_min( $array )223 {224 sort( $array, SORT_NUMERIC );225 return array_shift( $array );226 }227 228 // array_avg returns the average value of the array229 function array_avg( $array )230 {231 return array_sum( $array ) / sizeof( $array );232 }233 234 214 // get_displayed_dirs builds the tree of dirs under "galleries". If a 235 215 // directory contains pictures without thumbnails, the become linked to the … … 237 217 function get_displayed_dirs( $dir, $indent ) 238 218 { 239 global $ conf,$lang,$vtp,$sub;219 global $lang; 240 220 241 221 $sub_dirs = get_subdirs( $dir ); 222 $output = ''; 223 if (!empty($sub_dirs)) 224 { 225 $output.='<ul class="menu">'; 242 226 // write of the dirs 243 227 foreach ( $sub_dirs as $sub_dir ) { 228 $output.='<li>'; 244 229 $pictures = get_images_without_thumbnail( $dir.'/'.$sub_dir ); 245 $vtp->addSession( $sub, 'dir' );246 $vtp->setVar( $sub, 'dir.indent', $indent );247 230 if ( count( $pictures ) > 0 ) 248 231 { 249 $vtp->addSession( $sub, 'linked' ); 250 $url = './admin.php?page=thumbnail&dir='.$dir."/".$sub_dir; 251 $vtp->setVar( $sub, 'linked.url', add_session_id( $url ) ); 252 $vtp->setVar( $sub, 'linked.name', $sub_dir ); 253 $vtp->setVar( $sub, 'linked.nb_pic', count( $pictures ) ); 254 $vtp->closeSession( $sub, 'linked' ); 232 $url = add_session_id(PHPWG_ROOT_PATH.'admin.php?page=thumbnail&dir='.$dir.'/'.$sub_dir); 233 $output.='<a class="adminMenu" href="'.$url.'">'.$sub_dir.'</a> [ '.count( $pictures ).' '; 234 $output.=$lang['thumbnail'].' ]'; 255 235 } 256 236 else 257 237 { 258 $vtp->addSession( $sub, 'unlinked' ); 259 $vtp->setVar( $sub, 'unlinked.name', $sub_dir ); 260 $vtp->closeSession( $sub, 'unlinked' ); 261 } 262 $vtp->closeSession( $sub, 'dir' ); 238 $output.=$sub_dir; 239 } 263 240 // recursive call 264 get_displayed_dirs( $dir.'/'.$sub_dir, 265 $indent+30 ); 266 } 267 } 241 $output.=get_displayed_dirs( $dir.'/'.$sub_dir, 242 $indent+30 ); 243 $output.='</li>'; 244 } 245 $output.='</ul>'; 246 } 247 return $output; 248 } 249 250 $errors = array(); 251 $pictures = array(); 252 $stats = array(); 253 254 if ( isset( $_GET['dir'] ) && isset( $_POST['submit'] )) 255 { 256 $pictures = get_images_without_thumbnail( $_GET['dir'] ); 257 // checking criteria 258 if ( !ereg( "^[0-9]{2,3}$", $_POST['width'] ) or $_POST['width'] < 10 ) 259 { 260 array_push( $errors, $lang['tn_err_width'].' 10' ); 261 } 262 if ( !ereg( "^[0-9]{2,3}$", $_POST['height'] ) or $_POST['height'] < 10 ) 263 { 264 array_push( $errors, $lang['tn_err_height'].' 10' ); 265 } 266 267 // picture miniaturization 268 if ( count( $errors ) == 0 ) 269 { 270 $stats = scandir( $_GET['dir'], $_POST['width'], $_POST['height'] ); 271 } 272 } 273 268 274 //----------------------------------------------------- template initialization 269 $sub = $vtp->Open( './template/'.$user['template'].'/admin/thumbnail.vtp' ); 270 $tpl = array( 271 'tn_dirs_title','tn_dirs_alone','tn_params_title','tn_params_GD', 272 'tn_params_GD_info','tn_width','tn_params_width_info','tn_height', 273 'tn_params_height_info','tn_params_create','tn_params_create_info', 274 'tn_params_format','tn_params_format_info','submit','tn_alone_title', 275 'filesize','tn_picture','tn_results_title','thumbnail', 276 'tn_results_gen_time','tn_stats','tn_stats_nb','tn_stats_total', 277 'tn_stats_max','tn_stats_min','tn_stats_mean' ); 278 templatize_array( $tpl, 'lang', $sub ); 279 $vtp->setGlobalVar( $sub, 'user_template', $user['template'] ); 275 $template->set_filenames( array('thumbnail'=>'admin/thumbnail.tpl') ); 276 277 $template->assign_vars(array( 278 'L_THUMBNAIL_TITLE'=>$lang['tn_dirs_title'], 279 'L_UNLINK'=>$lang['tn_dirs_alone'], 280 'L_RESULTS'=>$lang['tn_results_title'], 281 'L_TN_PICTURE'=>$lang['tn_picture'], 282 'L_FILESIZE'=>$lang['filesize'], 283 'L_WIDTH'=>$lang['tn_width'], 284 'L_HEIGHT'=>$lang['tn_height'], 285 'L_GENERATED'=>$lang['tn_results_gen_time'], 286 'L_THUMBNAIL'=>$lang['thumbnail'], 287 'L_PARAMS'=>$lang['tn_params_title'], 288 'L_GD'=>$lang['tn_params_GD'], 289 'L_GD_INFO'=>$lang['tn_params_GD_info'], 290 'L_WIDTH_INFO'=>$lang['tn_params_width_info'], 291 'L_HEIGHT_INFO'=>$lang['tn_params_height_info'], 292 'L_CREATE'=>$lang['tn_params_create'], 293 'L_CREATE_INFO'=>$lang['tn_params_create_info'], 294 'L_FORMAT'=>$lang['tn_params_format'], 295 'L_FORMAT_INFO'=>$lang['tn_params_format_info'], 296 'L_SUBMIT'=>$lang['submit'], 297 'L_REMAINING'=>$lang['tn_alone_title'], 298 'L_TN_STATS'=>$lang['tn_stats'], 299 'L_TN_NB_STATS'=>$lang['tn_stats_nb'], 300 'L_TN_TOTAL'=>$lang['tn_stats_total'], 301 'L_TN_MAX'=>$lang['tn_stats_max'], 302 'L_TN_MIN'=>$lang['tn_stats_min'], 303 'L_TN_AVERAGE'=>$lang['tn_stats_mean'], 304 305 'T_STYLE'=>$user['template'] 306 )); 307 280 308 //----------------------------------------------------- miniaturization results 281 if ( isset( $_GET['dir'] ) ) 282 { 309 if ( sizeof( $errors ) != 0 ) 310 { 311 $template->assign_block_vars('errors',array()); 312 for ( $i = 0; $i < sizeof( $errors ); $i++ ) 313 { 314 $template->assign_block_vars('errors.error',array('ERROR'=>$errors[$i])); 315 } 316 } 317 else if ( isset( $_GET['dir'] ) && isset( $_POST['submit'] ) && !empty($stats)) 318 { 319 $times = array(); 320 foreach ( $stats as $stat ) { 321 array_push( $times, $stat['time'] ); 322 } 323 $sum=array_sum( $times ); 324 $average = $sum/sizeof($times); 325 sort( $times, SORT_NUMERIC ); 326 $max = array_pop($times); 327 $min = array_shift( $times); 328 329 $template->assign_block_vars('results',array( 330 'TN_NB'=>count( $stats ), 331 'TN_TOTAL'=>number_format( $sum, 2, '.', ' ').' ms', 332 'TN_MAX'=>number_format( $max, 2, '.', ' ').' ms', 333 'TN_MIN'=>number_format( $min, 2, '.', ' ').' ms', 334 'TN_AVERAGE'=>number_format( $average, 2, '.', ' ').' ms' 335 )); 336 if ( !count( $pictures ) ) 337 { 338 $template->assign_block_vars('warning',array()); 339 } 340 341 foreach ( $stats as $i => $stat ) 342 { 343 $class = ($i % 2)? 'row1':'row2'; 344 $color=''; 345 if ($stat['time']==$max) $color = 'red'; 346 elseif ($stat['time']==$min) $color = '#33FF00'; 347 $template->assign_block_vars('results.picture',array( 348 'NB_IMG'=>($i+1), 349 'FILE_IMG'=>$stat['file'], 350 'FILESIZE_IMG'=>$stat['size'], 351 'WIDTH_IMG'=>$stat['width'], 352 'HEIGHT_IMG'=>$stat['height'], 353 'TN_FILE_IMG'=>$stat['tn_file'], 354 'TN_FILESIZE_IMG'=>$stat['tn_size'], 355 'TN_WIDTH_IMG'=>$stat['tn_width'], 356 'TN_HEIGHT_IMG'=>$stat['tn_height'], 357 'GEN_TIME'=>number_format( $stat['time'], 2, '.', ' ').' ms', 358 359 'T_COLOR'=>$color, 360 'T_CLASS'=>$class 361 )); 362 } 363 } 364 //-------------------------------------------------- miniaturization parameters 365 if ( isset( $_GET['dir'] ) && !sizeof( $pictures )) 366 { 367 $form_url = PHPWG_ROOT_PATH.'admin.php?page=thumbnail&dir='.$_GET['dir']; 368 $gd = !empty( $_POST['gd'] )?$_POST['gd']:2; 369 $width = !empty( $_POST['width'] )?$_POST['width']:128; 370 $height = !empty( $_POST['height'] )?$_POST['height']:96; 371 $gdlabel = 'GD'.$gd.'_CHECKED'; 372 373 $template->assign_block_vars('params',array( 374 'F_ACTION'=>add_session_id($form_url), 375 $gdlabel=>'checked="checked"', 376 'WIDTH_TN'=>$width, 377 'HEIGHT_TN'=>$height 378 )); 379 380 //---------------------------------------------------------- remaining pictures 283 381 $pictures = get_images_without_thumbnail( $_GET['dir'] ); 284 if ( count( $pictures ) == 0 ) 285 { 286 $vtp->addSession( $sub, 'warning' ); 287 $vtp->closeSession( $sub, 'warning' ); 288 } 289 elseif ( isset( $_POST['submit'] ) ) 290 { 291 // checking criteria 292 $errors = array(); 293 if ( !ereg( "^[0-9]{2,3}$", $_POST['width'] ) or $_POST['width'] < 10 ) 294 { 295 array_push( $errors, $lang['tn_err_width'].' 10' ); 296 } 297 if ( !ereg( "^[0-9]{2,3}$", $_POST['height'] ) or $_POST['height'] < 10 ) 298 { 299 array_push( $errors, $lang['tn_err_height'].' 10' ); 300 } 301 // picture miniaturization 302 if ( count( $errors ) == 0 ) 303 { 304 $vtp->addSession( $sub, 'results' ); 305 $stats = scandir( $_GET['dir'], $_POST['width'], $_POST['height'] ); 306 $times = array(); 307 foreach ( $stats as $stat ) { 308 array_push( $times, $stat['time'] ); 309 } 310 $max = array_max( $times ); 311 $min = array_min( $times ); 312 foreach ( $stats as $i => $stat ) { 313 $vtp->addSession( $sub, 'picture' ); 314 if ( $i % 2 == 1 ) 315 { 316 $vtp->setVar( $sub, 'picture.class', 'row2' ); 317 } 318 $vtp->setVar( $sub, 'picture.num', ($i+1) ); 319 $vtp->setVar( $sub, 'picture.file', $stat['file'] ); 320 $vtp->setVar( $sub, 'picture.filesize', $stat['size'] ); 321 $vtp->setVar( $sub, 'picture.width', $stat['width'] ); 322 $vtp->setVar( $sub, 'picture.height', $stat['height'] ); 323 $vtp->setVar( $sub, 'picture.thumb_file', $stat['tn_file'] ); 324 $vtp->setVar( $sub, 'picture.thumb_filesize', $stat['tn_size'] ); 325 $vtp->setVar( $sub, 'picture.thumb_width', $stat['tn_width'] ); 326 $vtp->setVar( $sub, 'picture.thumb_height', $stat['tn_height'] ); 327 $vtp->setVar( $sub, 'picture.time', 328 number_format( $stat['time'], 2, '.', ' ').' ms' ); 329 if ( $stat['time'] == $max ) 330 { 331 $vtp->setVar( $sub, 'picture.color', 'red' ); 332 } 333 else if ( $stat['time'] == $min ) 334 { 335 $vtp->setVar( $sub, 'picture.color', 'green' ); 336 } 337 $vtp->closeSession( $sub, 'picture' ); 338 } 339 // general statistics 340 $vtp->setVar( $sub, 'results.stats_nb', count( $stats ) ); 341 $vtp->setVar( $sub, 'results.stats_total', 342 number_format( array_sum( $times ), 2, '.', ' ').' ms' ); 343 $vtp->setVar( $sub, 'results.stats_max', 344 number_format( $max, 2, '.', ' ').' ms' ); 345 $vtp->setVar( $sub, 'results.stats_min', 346 number_format( $min, 2, '.', ' ').' ms' ); 347 $vtp->setVar( $sub, 'results.stats_mean', 348 number_format( array_avg( $times ), 2, '.', ' ').' ms' ); 349 $vtp->closeSession( $sub, 'results' ); 350 } 351 else 352 { 353 $vtp->addSession( $sub, 'errors' ); 354 foreach ( $errors as $error ) { 355 $vtp->addSession( $sub, 'li' ); 356 $vtp->setVar( $sub, 'li.li', $error ); 357 $vtp->closeSession( $sub, 'li' ); 358 } 359 $vtp->closeSession( $sub, 'errors' ); 360 } 361 } 362 //-------------------------------------------------- miniaturization parameters 363 if ( sizeof( $pictures ) != 0 ) 364 { 365 $vtp->addSession( $sub, 'params' ); 366 $url = './admin.php?page=thumbnail&dir='.$_GET['dir']; 367 $vtp->setVar( $sub, 'params.action', add_session_id( $url ) ); 368 // GD version selected... 369 if ( isset( $_POST['gd'] ) and $_POST['gd'] == 1 ) 370 { 371 $vtp->setVar( $sub, 'params.gd1_checked', ' checked="checked"' ); 372 } 373 else 374 { 375 $vtp->setVar( $sub, 'params.gd2_checked', ' checked="checked"' ); 376 } 377 // width values 378 if ( isset( $_POST['width'] ) ) 379 { 380 $vtp->setVar( $sub, 'params.width_value', $_POST['width'] ); 381 } 382 else 383 { 384 $vtp->setVar( $sub, 'params.width_value', '128' ); 385 } 386 // height value 387 if ( isset( $_POST['height'] ) ) 388 { 389 $vtp->setVar( $sub, 'params.height_value', $_POST['height'] ); 390 } 391 else 392 { 393 $vtp->setVar( $sub, 'params.height_value', '96' ); 394 } 395 // options for the number of picture to miniaturize : "n" 396 $options = array( 5,10,20,40 ); 397 if ( isset( $_POST['n'] ) ) $n = $_POST['n']; 398 else $n = 5; 399 foreach ( $options as $option ) { 400 $vtp->addSession( $sub, 'n_option' ); 401 $vtp->setVar( $sub, 'n_option.option', $option ); 402 if ( $option == $n ) 403 { 404 $vtp->setVar( $sub, 'n_option.selected', ' selected="selected"' ); 405 } 406 $vtp->closeSession( $sub, 'n_option' ); 407 } 408 $vtp->closeSession( $sub, 'params' ); 409 //---------------------------------------------------------- remaining pictures 410 $vtp->addSession( $sub, 'remainings' ); 411 $pictures = get_images_without_thumbnail( $_GET['dir'] ); 412 $vtp->setVar( $sub, 'remainings.total', count( $pictures ) ); 413 foreach ( $pictures as $i => $picture ) { 414 $vtp->addSession( $sub, 'remaining' ); 415 if ( $i % 2 == 1 ) 416 { 417 $vtp->setVar( $sub, 'remaining.class', 'row2' ); 418 } 419 $vtp->setVar( $sub, 'remaining.num', ($i+1) ); 420 $vtp->setVar( $sub, 'remaining.file', $picture['name'] ); 421 $vtp->setVar( $sub, 'remaining.filesize', $picture['size'] ); 422 $vtp->setVar( $sub, 'remaining.width', $picture['width'] ); 423 $vtp->setVar( $sub, 'remaining.height', $picture['height'] ); 424 $vtp->closeSession( $sub, 'remaining' ); 425 } 426 $vtp->closeSession( $sub, 'remainings' ); 427 } 382 $template->assign_block_vars('remainings',array('TOTAL_IMG'=>count( $pictures ))); 383 384 foreach ( $pictures as $i => $picture ) 385 { 386 $class = ($i % 2)? 'row1':'row2'; 387 $template->assign_block_vars('remainings.remaining',array( 388 'NB_IMG'=>($i+1), 389 'FILE_TN'=>$picture['name'], 390 'FILESIZE_IMG'=>$picture['size'], 391 'WIDTH_IMG'=>$picture['width'], 392 'HEIGHT_IMG'=>$picture['height'], 393 394 'T_CLASS'=>$class 395 )); 396 } 428 397 } 429 398 //-------------------------------------------------------------- directory list 430 399 else 431 400 { 432 $vtp->addSession( $sub, 'directory_list' ); 433 get_displayed_dirs( './galleries', 60 ); 434 $vtp->closeSession( $sub, 'directory_list' ); 435 } 436 //----------------------------------------------------------- sending html code 437 $vtp->Parse( $handle , 'sub', $sub ); 401 $categories = get_displayed_dirs( './galleries', 60 ); 402 $template->assign_block_vars('directory_list',array('CATEGORY_LIST'=>$categories)); 403 } 404 405 $template->assign_var_from_handle('ADMIN_CONTENT', 'thumbnail'); 438 406 ?> -
trunk/admin/update.php
r362 r393 26 26 // +-----------------------------------------------------------------------+ 27 27 28 include_once( './admin/include/isadmin.inc.php' );28 include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); 29 29 //------------------------------------------------------------------- functions 30 30 function insert_local_category( $id_uppercat ) … … 36 36 37 37 // 0. retrieving informations on the category to display 38 $cat_directory = './galleries';38 $cat_directory = PHPWG_ROOT_PATH.'galleries'; 39 39 if ( is_numeric( $id_uppercat ) ) 40 40 { 41 $query = 'SELECT name,uppercats,dir'; 42 $query.= ' FROM '.PREFIX_TABLE.'categories'; 41 $query = 'SELECT name,uppercats,dir FROM '.CATEGORIES_TABLE; 43 42 $query.= ' WHERE id = '.$id_uppercat; 44 43 $query.= ';'; … … 53 52 54 53 $database_dirs = array(); 55 $query = 'SELECT id,dir'; 56 $query.= ' FROM '.PREFIX_TABLE.'categories'; 54 $query = 'SELECT id,dir FROM '.CATEGORIES_TABLE; 57 55 $query.= ' WHERE id IN ('.$uppercats.')'; 58 56 $query.= ';'; … … 69 67 70 68 // 1. display the category name to update 71 $src = './template/'.$user['template'].'/admin/images/puce.gif'; 72 $output = '<img src="'.$src.'" alt=">" />'; 73 $output.= '<span style="font-weight:bold;">'.$name.'</span>'; 69 $output = '<ul class="menu">'; 70 $output.= '<li><strong>'.$name.'</strong>'; 74 71 $output.= ' [ '.$dir.' ]'; 75 $output.= '< div class="retrait">';72 $output.= '</li>'; 76 73 77 74 // 2. we search pictures of the category only if the update is for all … … 86 83 87 84 $sub_category_dirs = array(); 88 $query = 'SELECT id,dir'; 89 $query.= ' FROM '.PREFIX_TABLE.'categories'; 85 $query = 'SELECT id,dir FROM '.CATEGORIES_TABLE; 90 86 $query.= ' WHERE site_id = 1'; 91 87 if (!is_numeric($id_uppercat)) $query.= ' AND id_uppercat IS NULL'; … … 135 131 if ( count( $inserts ) > 0 ) 136 132 { 137 $query = 'INSERT INTO '. PREFIX_TABLE.'categories';133 $query = 'INSERT INTO '.CATEGORIES_TABLE; 138 134 $query.= ' (dir,name,site_id,id_uppercat,uppercats) VALUES '; 139 135 $query.= implode( ',', $inserts ); … … 141 137 mysql_query( $query ); 142 138 // updating uppercats field 143 $query = 'UPDATE '. PREFIX_TABLE.'categories';139 $query = 'UPDATE '.CATEGORIES_TABLE; 144 140 $query.= ' SET uppercats = '; 145 141 if ( $uppercats != '' ) $query.= "CONCAT('".$uppercats."',',',id)"; … … 154 150 // Recursive call on the sub-categories (not virtual ones) 155 151 $query = 'SELECT id'; 156 $query.= ' FROM '. PREFIX_TABLE.'categories';152 $query.= ' FROM '.CATEGORIES_TABLE; 157 153 $query.= ' WHERE site_id = 1'; 158 154 if (!is_numeric($id_uppercat)) $query.= ' AND id_uppercat IS NULL'; … … 168 164 if ( is_numeric( $id_uppercat ) ) 169 165 { 170 $output.= '</ div>';166 $output.= '</ul>'; 171 167 } 172 168 return $output; … … 188 184 // - don't have the associated thumbnail available anymore 189 185 $query = 'SELECT id,file,tn_ext'; 190 $query.= ' FROM '. PREFIX_TABLE.'images';186 $query.= ' FROM '.IMAGES_TABLE; 191 187 $query.= ' WHERE storage_category_id = '.$category_id; 192 188 $query.= ';'; … … 218 214 219 215 $registered_pictures = array(); 220 $query = 'SELECT file'; 221 $query.= ' FROM '.PREFIX_TABLE.'images'; 216 $query = 'SELECT file FROM '.IMAGES_TABLE; 222 217 $query.= ' WHERE storage_category_id = '.$category_id; 223 218 $query.= ';'; … … 234 229 235 230 $query = 'SELECT file,infos,validated'; 236 $query.= ' FROM '. PREFIX_TABLE.'waiting';231 $query.= ' FROM '.WAITING_TABLE; 237 232 $query.= ' WHERE storage_category_id = '.$category_id; 238 233 $query.= ';'; … … 294 289 295 290 // deleting the waiting element 296 $query = 'DELETE FROM '. PREFIX_TABLE.'waiting';291 $query = 'DELETE FROM '.WAITING_TABLE; 297 292 $query.= " WHERE file = '".$unregistered_picture."'"; 298 293 $query.= ' AND storage_category_id = '.$category_id; … … 337 332 { 338 333 // inserts all found pictures 339 $query = 'INSERT INTO '. PREFIX_TABLE.'images';334 $query = 'INSERT INTO '.IMAGES_TABLE; 340 335 $query.= ' (file,storage_category_id,date_available,tn_ext'; 341 336 $query.= ',filesize,width,height'; … … 350 345 351 346 $query = 'SELECT id'; 352 $query.= ' FROM '. PREFIX_TABLE.'images';347 $query.= ' FROM '.IMAGES_TABLE; 353 348 $query.= ' WHERE storage_category_id = '.$category_id; 354 349 $query.= ';'; … … 361 356 // recreation of the links between this storage category pictures and 362 357 // its storage category 363 $query = 'DELETE FROM '. PREFIX_TABLE.'image_category';358 $query = 'DELETE FROM '.IMAGE_CATEGORY_TABLE; 364 359 $query.= ' WHERE category_id = '.$category_id; 365 360 $query.= ' AND image_id IN ('.implode( ',', $ids ).')'; … … 367 362 mysql_query( $query ); 368 363 369 $query = 'INSERT INTO '. PREFIX_TABLE.'image_category';364 $query = 'INSERT INTO '.IMAGE_CATEGORY_TABLE; 370 365 $query.= '(category_id,image_id) VALUES '; 371 366 foreach ( $ids as $num => $image_id ) { … … 396 391 397 392 // 2. is the site already existing ? 398 $query = 'SELECT id'; 399 $query.= ' FROM '.PREFIX_TABLE.'sites'; 393 $query = 'SELECT id FROM '.SITES_TABLE; 400 394 $query.= " WHERE galleries_url = '".$url."'"; 401 395 $query.= ';'; … … 404 398 { 405 399 // we have to register this site in the database 406 $query = 'INSERT INTO '. PREFIX_TABLE.'sites';400 $query = 'INSERT INTO '.SITES_TABLE; 407 401 $query.= " (galleries_url) VALUES ('".$url."')"; 408 402 $query.= ';'; … … 438 432 { 439 433 $query = 'SELECT name,uppercats,dir'; 440 $query.= ' FROM '. PREFIX_TABLE.'categories';434 $query.= ' FROM '.CATEGORIES_TABLE; 441 435 $query.= ' WHERE id = '.$id_uppercat; 442 436 $query.= ';'; … … 468 462 // id_uppercat and site_id 469 463 $database_dirs = array(); 470 $query = 'SELECT id,dir'; 471 $query.= ' FROM '.PREFIX_TABLE.'categories'; 464 $query = 'SELECT id,dir FROM '.CATEGORIES_TABLE; 472 465 $query.= ' WHERE site_id = '.$site_id; 473 466 if (!is_numeric($id_uppercat)) $query.= ' AND id_uppercat IS NULL'; … … 509 502 if ( count( $inserts ) > 0 ) 510 503 { 511 $query = 'INSERT INTO '. PREFIX_TABLE.'categories';504 $query = 'INSERT INTO '.CATEGORIES_TABLE; 512 505 $query.= ' (dir,name,site_id,id_uppercat,uppercats) VALUES '; 513 506 $query.= implode( ',', $inserts ); … … 515 508 mysql_query( $query ); 516 509 // updating uppercats field 517 $query = 'UPDATE '. PREFIX_TABLE.'categories';510 $query = 'UPDATE '.CATEGORIES_TABLE; 518 511 $query.= ' SET uppercats = '; 519 512 if ( $uppercats != '' ) $query.= "CONCAT('".$uppercats."',',',id)"; … … 528 521 // Recursive call on the sub-categories (not virtual ones) 529 522 $query = 'SELECT id,dir'; 530 $query.= ' FROM '. PREFIX_TABLE.'categories';523 $query.= ' FROM '.CATEGORIES_TABLE; 531 524 $query.= ' WHERE site_id = '.$site_id; 532 525 if (!is_numeric($id_uppercat)) $query.= ' AND id_uppercat IS NULL'; … … 568 561 // we have to delete all the images from the database that are not in the 569 562 // directory anymore (not in the XML anymore) 570 $query = 'SELECT id,file'; 571 $query.= ' FROM '.PREFIX_TABLE.'images'; 563 $query = 'SELECT id,file FROM '.IMAGES_TABLE; 572 564 $query.= ' WHERE storage_category_id = '.$category_id; 573 565 $query.= ';'; … … 585 577 586 578 $database_pictures = array(); 587 $query = 'SELECT file'; 588 $query.= ' FROM '.PREFIX_TABLE.'images'; 579 $query = 'SELECT file FROM '.IMAGES_TABLE; 589 580 $query.= ' WHERE storage_category_id = '.$category_id; 590 581 $query.= ';'; … … 631 622 { 632 623 // inserts all found pictures 633 $query = 'INSERT INTO '. PREFIX_TABLE.'images';624 $query = 'INSERT INTO '.IMAGES_TABLE; 634 625 $query.= ' (file,storage_category_id,date_available,tn_ext'; 635 626 $query.= ',filesize,width,height)'; … … 642 633 $ids = array(); 643 634 644 $query = 'SELECT id'; 645 $query.= ' FROM '.PREFIX_TABLE.'images'; 635 $query = 'SELECT id FROM '.IMAGES_TABLE; 646 636 $query.= ' WHERE storage_category_id = '.$category_id; 647 637 $query.= ';'; … … 654 644 // recreation of the links between this storage category pictures and 655 645 // its storage category 656 $query = 'DELETE FROM '. PREFIX_TABLE.'image_category';646 $query = 'DELETE FROM '.IMAGE_CATEGORY_TABLE; 657 647 $query.= ' WHERE category_id = '.$category_id; 658 648 $query.= ' AND image_id IN ('.implode( ',', $ids ).')'; … … 660 650 mysql_query( $query ); 661 651 662 $query = 'INSERT INTO '. PREFIX_TABLE.'image_category';652 $query = 'INSERT INTO '.IMAGE_CATEGORY_TABLE; 663 653 $query.= '(category_id,image_id) VALUES '; 664 654 foreach ( $ids as $num => $image_id ) { … … 672 662 return $output; 673 663 } 664 674 665 //----------------------------------------------------- template initialization 675 $sub = $vtp->Open( './template/'.$user['template'].'/admin/update.vtp' ); 676 $tpl = array( 'update_default_title', 'update_only_cat', 'update_all', 677 'update_research_conclusion', 'update_deletion_conclusion', 678 'remote_site', 'update_part_research' ); 679 templatize_array( $tpl, 'lang', $sub ); 680 $vtp->setGlobalVar( $sub, 'user_template', $user['template'] ); 666 $template->set_filenames( array('update'=>'admin/update.tpl') ); 667 668 $template->assign_vars(array( 669 'L_UPDATE_TITLE'=>$lang['update_default_title'], 670 'L_CAT_UPDATE'=>$lang['update_only_cat'], 671 'L_ALL_UPDATE'=>$lang['update_all'], 672 'L_RESULT_UPDATE'=>$lang['update_part_research'], 673 'L_NEW_CATEGORY'=>$lang['update_research_conclusion'], 674 'L_DEL_CATEGORY'=>$lang['update_deletion_conclusion'], 675 676 'U_CAT_UPDATE'=>add_session_id( PHPWG_ROOT_PATH.'admin.php?page=update&update=cats' ), 677 'U_ALL_UPDATE'=>add_session_id( PHPWG_ROOT_PATH.'admin.php?page=update&update=all' ) 678 )); 679 680 $tpl = array('remote_site'); 681 681 //-------------------------------------------- introduction : choices of update 682 682 // Display choice if "update" var is not specified 683 683 if (!isset( $_GET['update'] )) 684 684 { 685 $vtp->addSession( $sub, 'introduction' ); 686 // only update the categories, not the pictures. 687 $url = add_session_id( './admin.php?page=update&update=cats' ); 688 $vtp->setVar( $sub, 'introduction.only_cat:url', $url ); 689 // update the entire tree folder 690 $url = add_session_id( './admin.php?page=update&update=all' ); 691 $vtp->setVar( $sub, 'introduction.all:url', $url ); 692 $vtp->closeSession( $sub, 'introduction' ); 685 $template->assign_block_vars('introduction',array()); 693 686 } 694 687 //-------------------------------------------------- local update : ./galleries … … 699 692 $count_new = 0; 700 693 $count_deleted = 0; 701 $vtp->addSession( $sub, 'local_update' );694 702 695 if ( isset( $page['cat'] ) ) 703 696 { … … 709 702 } 710 703 $end = get_moment(); 711 echo get_elapsed_time( $start, $end ).' for update <br />'; 712 $vtp->setVar( $sub, 'local_update.categories', $categories ); 713 $vtp->setVar( $sub, 'local_update.count_new', $count_new ); 714 $vtp->setVar( $sub, 'local_update.count_deleted', $count_deleted ); 715 $vtp->closeSession( $sub, 'local_update' ); 704 //echo get_elapsed_time( $start, $end ).' for update <br />'; 705 $template->assign_block_vars('update',array( 706 'CATEGORIES'=>$categories, 707 'NEW_CAT'=>$count_new, 708 'DEL_CAT'=>$count_deleted 709 )); 716 710 } 717 711 //------------------------------------------------- remote update : listing.xml … … 735 729 if ( isset( $_GET['update'] ) 736 730 or isset( $page['cat'] ) 737 or @is_file( './listing.xml' ) )731 or @is_file( './listing.xml' ) && DEBUG) 738 732 { 739 733 $start = get_moment(); … … 748 742 } 749 743 //----------------------------------------------------------- sending html code 750 $ vtp->Parse( $handle , 'sub', $sub);744 $template->assign_var_from_handle('ADMIN_CONTENT', 'update'); 751 745 ?> -
trunk/admin/user_list.php
r364 r393 25 25 // | USA. | 26 26 // +-----------------------------------------------------------------------+ 27 include_once( './admin/include/isadmin.inc.php' ); 27 include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); 28 29 30 28 31 //----------------------------------------------------- template initialization 29 32 $sub = $vtp->Open( './template/'.$user['template'].'/admin/user_list.vtp' ); -
trunk/admin/user_perm.php
r362 r393 25 25 // | USA. | 26 26 // +-----------------------------------------------------------------------+ 27 include_once( './admin/include/isadmin.inc.php' ); 27 28 if( !defined("IN_ADMIN") ) 29 { 30 die ("Hacking attempt!"); 31 } 32 33 include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); 34 35 // 36 // Username search 37 // 38 function username_search($search_match) 39 { 40 global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path; 41 global $starttime, $gen_simple_header; 42 43 $gen_simple_header = TRUE; 44 45 $username_list = ''; 46 if ( !empty($search_match) ) 47 { 48 $username_search = preg_replace('/\*/', '%', trim(strip_tags($search_match))); 49 50 $sql = "SELECT username 51 FROM " . USERS_TABLE . " 52 WHERE username LIKE '" . str_replace("\'", "''", $username_search) . "' 53 ORDER BY username"; 54 if ( !($result = $db->sql_query($sql)) ) 55 { 56 message_die(GENERAL_ERROR, 'Could not obtain search results', '', __LINE__, __FILE__, $sql); 57 } 58 59 if ( $row = $db->sql_fetchrow($result) ) 60 { 61 do 62 { 63 $username_list .= '<option value="' . $row['username'] . '">' . $row['username'] . '</option>'; 64 } 65 while ( $row = $db->sql_fetchrow($result) ); 66 } 67 else 68 { 69 $username_list .= '<option>' . $lang['No_match']. '</option>'; 70 } 71 $db->sql_freeresult($result); 72 } 73 74 $page_title = $lang['Search']; 75 include($phpbb_root_path . 'includes/page_header.'.$phpEx); 76 77 $template->set_filenames(array( 78 'search_user_body' => 'search_username.tpl') 79 ); 80 81 $template->assign_vars(array( 82 'USERNAME' => ( !empty($search_match) ) ? strip_tags($search_match) : '', 83 84 'L_CLOSE_WINDOW' => $lang['Close_window'], 85 'L_SEARCH_USERNAME' => $lang['Find_username'], 86 'L_UPDATE_USERNAME' => $lang['Select_username'], 87 'L_SELECT' => $lang['Select'], 88 'L_SEARCH' => $lang['Search'], 89 'L_SEARCH_EXPLAIN' => $lang['Search_author_explain'], 90 'L_CLOSE_WINDOW' => $lang['Close_window'], 91 92 'S_USERNAME_OPTIONS' => $username_list, 93 'S_SEARCH_ACTION' => append_sid("search.$phpEx?mode=searchuser")) 94 ); 95 96 if ( $username_list != '' ) 97 { 98 $template->assign_block_vars('switch_select_name', array()); 99 } 100 101 $template->pparse('search_user_body'); 102 103 include($phpbb_root_path . 'includes/page_tail.'.$phpEx); 104 105 return; 106 } 107 108 if (isset($HTTP_POST_VARS['username']) || isset( $_POST['submit'] )) 109 { 28 110 //----------------------------------------------------- template initialization 29 $sub = $vtp->Open( './template/'.$user['template'].'/admin/user_perm.vtp' ); 111 $template->set_filenames( array('user'=>'admin/user_perm.tpl') ); 112 30 113 $error = array(); 31 114 $tpl = array( 'permuser_authorized','permuser_forbidden','submit', 32 115 'permuser_parent_forbidden','permuser_info_message', 33 116 'adduser_info_back','permuser_only_private' ); 34 templatize_array( $tpl, 'lang', $sub );35 $vtp->setGlobalVar( $sub, 'user_template', $user['template'] );36 117 //--------------------------------------------------------------------- updates 37 118 if ( isset( $_POST['submit'] ) ) … … 68 149 } 69 150 //---------------------------------------------------------------- form display 151 70 152 $restrictions = get_user_restrictions( $_GET['user_id'], $page['user_status'], 71 153 false, false ); … … 184 266 $vtp->closeSession( $sub, 'category' ); 185 267 } 268 //----------------------------------------------------------- default code 269 else 270 { 271 $sub = $vtp->Open( '../template/'.$user['template'].'/admin/user_select_body.vtp' ); 272 $tpl = array( 'Look_up_user', 'Find_username', 'Select_username' ); 273 templatize_array( $tpl, 'lang', $sub ); 274 $vtp->addSession( $sub, 'user' ); 275 $vtp->setVarTab( $sub, array( 276 'user.S_USER_ACTION' => append_sid("./admin.php?page=user_search"), 277 'user.U_SEARCH_USER' => append_sid("./search.php")) 278 ); 279 $vtp->closeSession( $sub, 'user' ); 280 } 186 281 //----------------------------------------------------------- sending html code 187 282 $vtp->Parse( $handle , 'sub', $sub ); -
trunk/category.php
r386 r393 55 55 global $user,$template,$page; 56 56 57 $url = './category.php?cat='.$category['id'];57 $url = PHPWG_ROOT_PATH.'category.php?cat='.$category['id']; 58 58 59 59 $style = ''; … … 66 66 67 67 $name = $category['name']; 68 if ( $name == '') $name = str_replace( '_', ' ', $category['dir'] );68 if (empty($name)) $name = str_replace( '_', ' ', $category['dir'] ); 69 69 70 70 $template->assign_block_vars( … … 90 90 else 91 91 { 92 $url = './category.php';92 $url = PHPWG_ROOT_PATH.'category.php'; 93 93 if (isset($page['cat'])) 94 94 { … … 116 116 if ( $category['expanded'] ) 117 117 { 118 foreach ( $category['subcats'] as $subcat ) { 118 foreach ( $category['subcats'] as $subcat ) 119 { 119 120 $template->assign_block_vars('category.subcat', array()); 120 display_category( $subcat, $indent.str_repeat( ' ', 2 ));121 display_category( $subcat, $indent.str_repeat( ' ', 2 )); 121 122 } 122 123 } … … 244 245 'U_MOST_VISITED'=>add_session_id( PHPWG_ROOT_PATH.'category.php?cat=most_visited' ), 245 246 'U_RECENT'=>add_session_id( PHPWG_ROOT_PATH.'category.php?cat=recent' ), 246 'U_LOGOUT' => add_session_id( PHPWG_ROOT_PATH.'category.php?act=logout' ),247 'U_LOGOUT' => PHPWG_ROOT_PATH.'category.php?act=logout', 247 248 'U_ADMIN'=>add_session_id( PHPWG_ROOT_PATH.'admin.php' ), 248 249 'U_PROFILE'=>add_session_id(PHPWG_ROOT_PATH.'profile.php?'.str_replace( '&', '&', $_SERVER['QUERY_STRING'] )) … … 384 385 'U_IMG_LINK'=>add_session_id( $url_link ) 385 386 )); 386 387 387 388 if ( $conf['show_comments'] && $user['show_nb_comments'] ) 388 389 { 389 $vtp->addSession( $handle, 'nb_comments' );390 390 $query = 'SELECT COUNT(*) AS nb_comments'; 391 391 $query.= ' FROM '.COMMENTS_TABLE.' WHERE image_id = '.$row['id']; … … 393 393 $query.= ';'; 394 394 $row = mysql_fetch_array( mysql_query( $query ) ); 395 $ vtp->setVar( $handle, 'nb_comments.nb', $row['nb_comments'] );396 $vtp->closeSession( $handle, 'nb_comments');395 $template->assign_block_vars( 'thumbnails.line.thumbnail.nb_comments', 396 array('NB_COMMENTS'=>$row['nb_comments']) ); 397 397 } 398 398 } … … 447 447 $thumbnail_title = $lang['hint_category']; 448 448 449 $url_link = './category.php?cat='.$subcat_id;449 $url_link = PHPWG_ROOT_PATH.'category.php?cat='.$subcat_id; 450 450 451 451 $date = $page['plain_structure'][$subcat_id]['date_last']; … … 484 484 and $page['cat_uploadable'] ) 485 485 { 486 $url = './upload.php?cat='.$page['cat'];486 $url = PHPWG_ROOT_PATH.'upload.php?cat='.$page['cat']; 487 487 $template->assign_block_vars('upload',array('U_UPLOAD'=>add_session_id( $url ))); 488 488 } -
trunk/comments.php
r369 r393 27 27 28 28 //----------------------------------------------------------- include 29 define('PHPWG_ROOT_PATH','./'); 30 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 29 if (!defined('IN_ADMIN')) 30 { 31 define('PHPWG_ROOT_PATH','./'); 32 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 33 } 31 34 32 35 //--------------------------------------------------- number of days to display … … 37 40 $array_cat_names = array(); 38 41 $array_cat_site_id = array(); 42 43 // comment deletion 44 if ( isset( $_POST['delete'] ) ) 45 { 46 $mod_sql=''; 47 while( list($id, $row_id) = @each($_POST['comment_id']) ) 48 { 49 $mod_sql .= ( ( $mod_sql != '' ) ? ', ' : '' ) . $row_id; 50 } 51 $query = 'DELETE FROM '.COMMENTS_TABLE.' WHERE id IN ('.$mod_sql.');'; 52 mysql_query( $query ); 53 } 54 55 //--------------------------------------------------------- comments validation 56 if ( isset( $_POST['validate'] ) ) 57 { 58 $mod_sql=''; 59 while( list($id, $row_id) = @each($_POST['comment_id']) ) 60 { 61 $mod_sql .= ( ( $mod_sql != '' ) ? ', ' : '' ) . $row_id; 62 } 63 $query = 'UPDATE '.COMMENTS_TABLE; 64 $query.= " SET validated = 'true'"; 65 $query.=' WHERE id IN ('.$mod_sql.');'; 66 mysql_query( $query ); 67 } 39 68 //------------------------------------------------------- last comments display 40 69 … … 42 71 // Start output of page 43 72 // 44 $title= $lang['title_comments']; 45 include(PHPWG_ROOT_PATH.'include/page_header.php'); 73 if (!defined('IN_ADMIN')) 74 { 75 $title= $lang['title_comments']; 76 include(PHPWG_ROOT_PATH.'include/page_header.php'); 77 } 46 78 47 79 $template->set_filenames( array('comments'=>'comments.tpl') ); 48 initialize_template();49 50 80 $template->assign_vars(array( 51 'L_TITLE' => $lang['title_comments'], 52 'L_STATS' => $lang['stats_last_days'], 53 'L_RETURN' => $lang['search_return_main_page'], 81 'L_COMMENT_TITLE' => $title, 82 'L_COMMENT_STATS' => $lang['stats_last_days'], 83 'L_COMMENT_RETURN' => $lang['search_return_main_page'], 84 'L_DELETE' =>$lang['delete'], 85 'L_VALIDATE'=>$lang['submit'], 54 86 55 'U_HOME' => add_session_id( 'category.php' ) 87 'T_DEL_IMG' =>PHPWG_ROOT_PATH.'template/'.$user['template'].'/theme/delete.gif', 88 89 'U_HOME' => add_session_id( PHPWG_ROOT_PATH.'category.php' ) 56 90 ) 57 91 ); 58 92 59 93 foreach ( $conf['last_days'] as $option ) { 60 $url = './comments.php?last_days='.($option - 1); 94 $url = $PHP_SELF.'?last_days='.($option - 1); 95 if (defined('IN_ADMIN')) $url.= '&page=comments'; 61 96 $template->assign_block_vars('last_day_option', array ( 62 97 'OPTION'=>$option, … … 71 106 $maxtime = mktime( 0,0,0,$month,$day,$year ); 72 107 $query = 'SELECT DISTINCT(ic.image_id) as image_id,'; 73 $query 74 $query.= ' FROM '. PREFIX_TABLE.'commentsAS c';75 $query.= ', '.PREFIX_TABLE.'image_categoryAS ic';108 $query.= '(ic.category_id) as category_id'; 109 $query.= ' FROM '.COMMENTS_TABLE.' AS c'; 110 $query.= ', '.IMAGE_CATEGORY_TABLE.' AS ic'; 76 111 $query.= ' WHERE c.image_id = ic.image_id'; 77 112 $query.= ' AND date > '.$maxtime; 78 $query.= " AND validated = 'true'"; 79 // we must not show pictures of a forbidden category 80 if ( $user['forbidden_categories'] != '' ) 81 { 82 $query.= ' AND category_id NOT IN '; 83 $query.= '('.$user['forbidden_categories'].')'; 113 if ( $user['status'] != 'admin' ) 114 { 115 $query.= " AND validated = 'true'"; 116 // we must not show pictures of a forbidden category 117 if ( $user['forbidden_categories'] != '' ) 118 { 119 $query.= ' AND category_id NOT IN '; 120 $query.= '('.$user['forbidden_categories'].')'; 121 } 84 122 } 85 123 $query.= ' ORDER BY ic.image_id DESC'; 86 124 $query.= ';'; 87 125 $result = mysql_query( $query ); 88 126 if ( $user['status'] == 'admin' ) 127 { 128 $template->assign_block_vars('validation', array()); 129 } 89 130 while ( $row = mysql_fetch_array( $result ) ) 90 131 { … … 113 154 // name of the picture 114 155 $name = $array_cat_names[$category_id].' > '; 115 if ( $subrow['name'] != '') $name.= $subrow['name'];156 if (!empty($subrow['name'])) $name.= $subrow['name']; 116 157 else $name.= str_replace( '_', ' ', $file ); 117 158 $name.= ' [ '.$subrow['file'].' ]'; … … 121 162 $src.= $file.'.'.$subrow['tn_ext']; 122 163 // link to the full size picture 123 $url = './picture.php?cat='.$category_id;164 $url = PHPWG_ROOT_PATH.'picture.php?cat='.$category_id; 124 165 $url.= '&image_id='.$row['image_id']; 125 166 … … 131 172 132 173 // for each picture, retrieving all comments 133 $query = 'SELECT id,date,author,content'; 134 $query.= ' FROM '.COMMENTS_TABLE; 174 $query = 'SELECT * FROM '.COMMENTS_TABLE; 135 175 $query.= ' WHERE image_id = '.$row['image_id']; 136 176 $query.= ' AND date > '.$maxtime; 137 $query.= " AND validated = 'true'"; 177 if ( $user['status'] != 'admin' ) 178 { 179 $query.= " AND validated = 'true'"; 180 } 138 181 $query.= ' ORDER BY date DESC'; 139 182 $query.= ';'; … … 142 185 { 143 186 $author = $subrow['author']; 144 if ( $subrow['author'] == '') $author = $lang['guest'];187 if ( empty($subrow['author'] )) $author = $lang['guest']; 145 188 $content = nl2br( $subrow['content'] ); 146 189 … … 160 203 $content = preg_replace( $pattern, $replacement, $content ); 161 204 $template->assign_block_vars('picture.comment',array( 162 ' AUTHOR'=>$author,163 ' DATE'=>format_date( $subrow['date'], 'unix', true ),164 'CO NTENT'=>$content,205 'COMMENT_AUTHOR'=>$author, 206 'COMMENT_DATE'=>format_date( $subrow['date'], 'unix', true ), 207 'COMMENT'=>$content, 165 208 )); 209 if ( $user['status'] == 'admin' ) 210 { 211 $template->assign_block_vars('picture.comment.validation', array( 212 'ID'=> $subrow['id'], 213 'CHECKED'=>($subrow['validated']=='false')?'checked="checked"': '' 214 )); 215 } 166 216 } 167 217 } 168 218 //----------------------------------------------------------- html code display 169 $template->pparse('comments'); 170 include(PHPWG_ROOT_PATH.'include/page_tail.php'); 219 if (defined('IN_ADMIN')) 220 { 221 $template->assign_var_from_handle('ADMIN_CONTENT', 'comments'); 222 } 223 else 224 { 225 $template->assign_block_vars('title',array()); 226 $template->pparse('comments'); 227 include(PHPWG_ROOT_PATH.'include/page_tail.php'); 228 } 171 229 ?> -
trunk/identification.php
r375 r393 61 61 62 62 $template->set_filenames( array('identification'=>'identification.tpl') ); 63 initialize_template();64 63 65 64 $template->assign_vars(array( -
trunk/include/common.inc.php
r383 r393 126 126 include(PHPWG_ROOT_PATH . 'include/functions.inc.php'); 127 127 include(PHPWG_ROOT_PATH . 'include/template.php'); 128 include(PHPWG_ROOT_PATH . 'include/vtemplate.class.php');129 128 130 129 // … … 203 202 // "guest" as you can find in the database 204 203 if ( $user['is_the_guest'] ) $user['username'] = $lang['guest']; 205 include_once( './template/'.$user['template'].'/htmlfunctions.inc.php' );206 204 define('PREFIX_TABLE', $table_prefix); 207 205 ?> -
trunk/include/config.inc.php
r364 r393 55 55 $conf['max_LOV_categories'] = 50; 56 56 57 $conf['default_lang'] = 'fr_FR';58 57 $conf['default_style'] = 'default'; 59 58 60 59 ?> 60 -
trunk/include/constants.php
r375 r393 30 30 //define('DEBUG', 0); // Debugging off 31 31 32 // User level 33 define('ANONYMOUS', 2); 34 32 35 // Error codes 33 36 define('GENERAL_MESSAGE', 200); … … 41 44 define('CONFIG_TABLE', $table_prefix.'config'); 42 45 define('FAVORITES_TABLE', $table_prefix.'favorites'); 43 define('GROUP S_ACCESS_TABLE', $table_prefix.'group_access');46 define('GROUP_ACCESS_TABLE', $table_prefix.'group_access'); 44 47 define('GROUPS_TABLE', $table_prefix.'groups'); 45 48 define('HISTORY_TABLE', $table_prefix.'history'); -
trunk/include/functions_user.inc.php
r367 r393 230 230 function init_userprefs($userdata) 231 231 { 232 global $conf, $template, $lang, $lang_mapping; 233 $style = $conf['default_style']; 234 if ( !$userdata['is_the_guest'] ) 235 { 236 if ( !empty($userdata['language'])) 237 { 238 $conf['default_lang'] = $userdata['language']; 239 } 240 if ( !empty($userdata['template'])) 241 { 242 $style = $userdata['template']; 243 } 244 } 245 246 if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $conf['default_lang'] . '/common.lang.php')) ) 247 { 248 $conf['default_lang'] = 'en_EN'; 249 } 250 include_once(PHPWG_ROOT_PATH . 'language/' . $conf['default_lang'] . '/common.lang.php'); 251 252 if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $conf['default_lang'] . '/lang.lang.php')) ) 253 { 254 $conf['default_lang'] = 'en_EN'; 255 } 256 include_once(PHPWG_ROOT_PATH . 'language/' . $conf['default_lang'] . '/lang.lang.php'); 232 global $conf, $template, $lang, $lang_info; 233 include_once(PHPWG_ROOT_PATH . 'language/infos.lang.php'); 234 235 $language = (!empty($userdata['language']) && !$userdata['is_the_guest'] )?$userdata['language']:$conf['default_lang']; 236 $style = (!empty($userdata['template'])&& !$userdata['is_the_guest'] )?$userdata['template']:$conf['default_style']; 237 238 if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $language . '/common.lang.php')) ) 239 { 240 $language = 'en_EN'; 241 } 242 include_once(PHPWG_ROOT_PATH . 'language/' . $language . '/common.lang.php'); 243 257 244 258 245 if ($userdata['status'] == 'admin') 259 246 { 260 $admin_lang = $userdata['language'];261 if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $conf['default_lang'] . '/admin.lang.php')) )262 {263 $admin_lang = 'en_EN';264 }265 include_once(PHPWG_ROOT_PATH . 'language/' . $admin_lang . '/admin.lang.php'); 266 }267 247 if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $language. '/admin.lang.php')) ) 248 { 249 $language = 'en_EN'; 250 } 251 include_once(PHPWG_ROOT_PATH . 'language/' . $language . '/admin.lang.php'); 252 } 253 254 $lang_info['current_code']=$language; 268 255 $template= setup_style($style); 269 256 return; … … 281 268 function encode_ip($dotquad_ip) 282 269 { 283 284 270 $ip_sep = explode('.', $dotquad_ip); 271 return sprintf('%02x%02x%02x%02x', $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]); 285 272 } 286 273 287 274 function decode_ip($int_ip) 288 275 { 289 $hexipbang = explode('.', chunk_split($int_ip, 2, '.')); 290 return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]); 276 $hexipbang = explode('.', chunk_split($int_ip, 2, '.')); 277 return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]); 278 } 279 280 function getuserdata($user) 281 { 282 $sql = "SELECT * FROM " . USERS_TABLE; 283 $sql.= " WHERE "; 284 $sql .= ( ( is_integer($user) ) ? "id = $user" : "username = '" . str_replace("\'", "''", $user) . "'" ) . " AND id <> " . ANONYMOUS; 285 $result = mysql_query($sql); 286 return ( $row = mysql_fetch_array($result) ) ? $row : false; 291 287 } 292 288 ?> -
trunk/include/page_header.php
r371 r393 31 31 $template->set_filenames(array('header'=>'header.tpl')); 32 32 33 $css = './template/'.$user['template'].'/'.$user['template'].'.css'; 33 $charset = empty($lang_info['charset'][$lang_info['current_code']])? 34 $lang_info['default']['charset']:$lang_info['charset'][$lang_info['current_code']]; 35 $dir = empty($lang_info['direction'][$lang_info['current_code']])? 36 $lang_info['default']['direction']:$lang_info['direction'][$lang_info['current_code']]; 34 37 38 $css = PHPWG_ROOT_PATH.'template/'.$user['template'].'/'.$user['template'].'.css'; 35 39 $template->assign_vars(array( 36 'S_CONTENT_ENCODING' => $lang['charset'], 37 'T_STYLE' => $css, 38 'PAGE_TITLE' => $title 39 )); 40 'CONTENT_ENCODING' => $charset, 41 'PAGE_TITLE' => $title, 42 'LANG'=>substr($lang_info['current_code'],0,2), 43 'DIR'=>$dir, 44 45 'T_STYLE' => $css 46 )); 40 47 41 48 // refresh … … 44 51 $url = $url_link.'&slideshow='.$refresh; 45 52 $template->assign_vars(array( 46 ' S_REFRESH_TIME' => $refresh,53 'REFRESH_TIME' => $refresh, 47 54 'U_REFRESH' => add_session_id( $url ) 48 55 )); … … 65 72 66 73 $template->pparse('header'); 67 $vtp=new VTemplate;68 74 ?> -
trunk/install.php
r382 r393 153 153 include( './language/'.$language.'/install.lang.php' ); 154 154 include( './language/'.$language.'/admin.lang.php' ); 155 $mapping_lang = $language; 156 if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $language . '/lang.lang.php')) ) 157 { 158 $mapping_lang = 'en_EN'; 159 } 160 include_once(PHPWG_ROOT_PATH . 'language/' . $mapping_lang . '/lang.lang.php'); 155 include_once(PHPWG_ROOT_PATH . 'language/infos.lang.php'); 161 156 162 157 // Obtain various vars … … 172 167 $admin_pass2 = (!empty($_POST['admin_pass2'])) ? $_POST['admin_pass2'] : ''; 173 168 $admin_mail = (!empty($_POST['admin_mail'])) ? $_POST['admin_mail'] : ''; 174 175 $lang_options = $lang['lang'];176 @asort($lang_options);177 @reset($lang_options);178 169 179 170 $infos = array(); … … 282 273 $query.= " SET value = '".$admin_mail."'"; 283 274 $query.= " WHERE param = 'mail_webmaster'"; 275 $query.= ';'; 276 mysql_query( $query ); 277 278 $query = 'UPDATE '.CONFIG_TABLE; 279 $query.= " SET value = '".$language."'"; 280 $query.= " WHERE param = 'default_lang'"; 284 281 $query.= ';'; 285 282 mysql_query( $query ); … … 344 341 'F_ADMIN'=>$admin_name, 345 342 'F_ADMIN_EMAIL'=>$admin_mail, 346 'F_LANG_SELECT'=>make_jumpbox($lang_options, $language, true), 347 348 'T_CONTENT_ENCODING' => $lang['charset'], 349 'T_STYLE' => './template/'.$install_style.'/'.$install_style.'-admin.css') 350 ); 343 'F_LANG_SELECT'=>language_select($language), 344 345 'T_CONTENT_ENCODING' => $lang['default']['charset'] 346 )); 351 347 352 348 //-------------------------------------------------------- errors & infos display -
trunk/picture.php
r375 r393 48 48 { 49 49 echo '<div style="text-align:center;">'.$lang['access_forbiden'].'<br />'; 50 echo '<a href="'.add_session_id( './category.php' ).'">';50 echo '<a href="'.add_session_id( PHPWG_ROOT_PATH.'category.php' ).'">'; 51 51 echo $lang['thumbnails'].'</a></div>'; 52 52 exit(); … … 131 131 $picture[$j]['url'] = PHPWG_ROOT_PATH.'picture.php?image_id='.$row['id']; 132 132 $picture[$j]['url'].= '&cat='.$page['cat']; 133 if ( isset( $_GET['expand'] ) )134 $picture[$j]['url'].= '&expand='.$_GET['expand'];135 133 if ( $page['cat'] == 'search' ) 136 134 { … … 139 137 } 140 138 141 $url_home = './category.php?cat='.$page['cat'].'&';139 $url_home = PHPWG_ROOT_PATH.'category.php?cat='.$page['cat'].'&'; 142 140 $url_home.= 'num='.$page['num']; 143 if (isset($_GET['expand']))144 $url_home.='&expand='.$_GET['expand'];145 141 if ( $page['cat'] == 'search' ) 146 142 { … … 191 187 } 192 188 193 // 194 // Start output of page 195 // 196 197 $title = $picture['current']['name']; 198 $refresh = 0; 199 if ( isset( $_GET['slideshow'] ) && $next) 200 { 201 $refresh= $_GET['slideshow']; 202 $url_link = $picture['next']['url']; 203 } 204 205 $title_img = $picture['current']['name']; 206 $title_nb = ''; 207 if (is_numeric( $page['cat'] )) 208 { 209 $title_img = replace_space(get_cat_display_name( $page['cat_name'], " > ","font-style:italic;" )); 210 $n = $page['num'] + 1; 211 $title_nb = "Photo".' '.$n.'/'; 212 $title_nb.= $page['cat_nb_images']; 213 //$title_img.= $picture['current']['name']; 214 } 215 else if ( $page['cat'] == 'search' ) 216 { 217 $title_img = replace_search( $title_img, $_GET['search'] ); 218 } 219 220 // calculation of width and height 221 if ( empty($picture['current']['width'])) 222 { 223 $taille_image = @getimagesize( $lien_image ); 224 $original_width = $taille_image[0]; 225 $original_height = $taille_image[1]; 226 } 227 else 228 { 229 $original_width = $picture['current']['width']; 230 $original_height = $picture['current']['height']; 231 } 232 233 $picture_size = get_picture_size( $original_width, $original_height, 234 $user['maxwidth'], $user['maxheight'] ); 235 236 include(PHPWG_ROOT_PATH.'include/page_header.php'); 237 $template->set_filenames(array('picture'=>'picture.tpl')); 238 initialize_template(); 239 240 $template->assign_vars(array( 241 'CATEGORY' => $title_img, 242 'PHOTO' => $title_nb, 243 'TITLE' => $picture['current']['name'], 244 'PREV_TITLE_IMG' => $picture['prev']['name'], 245 'NEXT_TITLE_IMG' => $picture['next']['name'], 246 'PREV_IMG' => $picture['prev']['thumbnail'], 247 'NEXT_IMG' => $picture['next']['thumbnail'], 248 'SRC_IMG' => $picture['current']['src'], 249 'ALT_IMG' => $picture['current']['file'], 250 'WIDTH_IMG' => $picture_size[0], 251 'HEIGHT_IMG' => $picture_size[1], 252 'COMMENT_IMG' => $picture['current']['comment'], 253 254 'L_SLIDESHOW' => $lang['slideshow'], 255 'L_TIME' => $lang['period_seconds'], 256 'L_STOP_SLIDESHOW' => $lang['slideshow_stop'], 257 'L_PREV_IMG' =>$lang['previous_image'].' : ', 258 'L_ADMIN' =>$lang['link_info_image'], 259 'L_BACK' =>$lang['back'], 260 'L_COMMENT_TITLE' =>$lang['comments_title'], 261 'L_ADD_COMMENT' =>$lang['comments_add'], 262 'L_DELETE_COMMENT' =>$lang['comments_del'], 263 'L_DELETE' =>$lang['delete'], 264 'L_SUBMIT' =>$lang['submit'], 265 'L_AUTHOR' =>$lang['author'], 266 267 'T_DEL_IMG' =>'./template/'.$user['template'].'/theme/delete.gif', 268 269 'U_PREV_IMG' => add_session_id($picture['prev']['url']), 270 'U_NEXT_IMG' => add_session_id($picture['next']['url']), 271 'U_HOME' => add_session_id($url_home), 272 'U_ADMIN' => add_session_id($url_admin), 273 'U_ADD_COMMENT' => add_session_id(str_replace( '&', '&', $_SERVER['REQUEST_URI'] )) 274 ) 275 ); 276 277 //-------------------------------------------------------- slideshow management 278 if ( isset( $_GET['slideshow'] ) ) 279 { 280 if ( !is_numeric( $_GET['slideshow'] ) ) $_GET['slideshow'] = $conf['slideshow_period'][0]; 281 282 $template->assign_block_vars('stop_slideshow', array( 283 'U_SLIDESHOW'=>add_session_id( $picture['current']['url'] ) 284 )); 285 } 286 else 287 { 288 $template->assign_block_vars('start_slideshow', array()); 289 foreach ( $conf['slideshow_period'] as $option ) 290 { 291 $template->assign_block_vars('start_slideshow.second', array( 292 'SLIDESHOW_SPEED'=>$option, 293 'U_SLIDESHOW'=>add_session_id( $picture['current']['url'].'&slideshow='.$option) 294 )); 295 } 296 } 297 298 if ($prev>=0) $template->assign_block_vars('previous', array()); 299 if ($next) $template->assign_block_vars('next', array()); 300 301 //--------------------------------------------------------- picture information 302 // author 303 if ( !empty($picture['current']['author']) ) 304 { 305 $template->assign_block_vars('info_line', array( 306 'INFO'=>$lang['author'], 307 'VALUE'=>$picture['current']['author'] 308 )); 309 } 310 // creation date 311 if ( !empty($picture['current']['date_creation']) ) 312 { 313 $template->assign_block_vars('info_line', array( 314 'INFO'=>$lang['creation_date'], 315 'VALUE'=>format_date( $picture['current']['date_creation'] ) 316 )); 317 } 318 // date of availability 319 $template->assign_block_vars('info_line', array( 320 'INFO'=>$lang['registration_date'], 321 'VALUE'=>format_date( $picture['current']['date_available'] ) 322 )); 323 // size in pixels 324 if ( $original_width != $picture_size[0] or $original_height != $picture_size[1] ) 325 { 326 $content = '[ <a href="'.$picture['current']['url'].'" title="'.$lang['true_size'].'">'; 327 $content.= $original_width.'*'.$original_height.'</a> ]'; 328 } 329 else 330 { 331 $content = $original_width.'*'.$original_height; 332 } 333 $template->assign_block_vars('info_line', array( 334 'INFO'=>$lang['size'], 335 'VALUE'=>$content 336 )); 337 // file 338 $template->assign_block_vars('info_line', array( 339 'INFO'=>$lang['file'], 340 'VALUE'=>$picture['current']['file'] 341 )); 342 // filesize 343 if ( empty($picture['current']['filesize'])) 344 { 345 $poids = floor ( filesize( $picture['current']['url'] ) / 1024 ); 346 } 347 else 348 { 349 $poids = $picture['current']['filesize']; 350 } 351 352 $template->assign_block_vars('info_line', array( 353 'INFO'=>$lang['filesize'], 354 'VALUE'=>$poids.' KB' 355 )); 356 // keywords 357 if ( !empty($picture['current']['keywords'])) 358 { 359 $keywords = explode( ',', $picture['current']['keywords'] ); 360 $content = ''; 361 $url = './category.php?cat=search'; 362 if ( isset( $_GET['expand'] ) ) $url.= '&expand='.$_GET['expand']; 363 $url.= '&mode=OR&search='; 364 foreach ( $keywords as $i => $keyword ) { 365 $local_url = add_session_id( $url.$keyword ); 366 if ( $i > 0 ) $content.= ','; 367 $content.= '<a href="'.$local_url.'">'.$keyword.'</a>'; 368 } 369 $template->assign_block_vars('info_line', array( 370 'INFO'=>$lang['keywords'], 371 'VALUE'=>$content 372 )); 373 } 374 // number of visits 375 $template->assign_block_vars('info_line', array( 376 'INFO'=>$lang['visited'], 377 'VALUE'=>$picture['current']['hit'].' '.$lang['times'] 378 )); 379 380 //------------------------------------------------------- favorite manipulation 381 if ( !$user['is_the_guest'] ) 382 { 383 // verify if the picture is already in the favorite of the user 384 $query = 'SELECT COUNT(*) AS nb_fav'; 385 $query.= ' FROM '.FAVORITES_TABLE.' WHERE image_id = '.$_GET['image_id']; 386 $query.= ' AND user_id = '.$user['id'].';'; 387 $result = mysql_query( $query ); 388 $row = mysql_fetch_array( $result ); 389 if (!$row['nb_fav']) 390 { 391 $url = './picture.php?cat='.$page['cat'].'&image_id='.$_GET['image_id']; 392 if (isset($_GET['expand'])) 393 $url.= '&expand='.$_GET['expand']; 394 $url.='&add_fav=1'; 395 if ( $page['cat'] == 'search' ) 396 { 397 $url.= '&search='.$_GET['search'].'&mode='.$_GET['mode']; 398 } 399 $template->assign_block_vars('favorite', array( 400 'FAVORITE_IMG' => './template/'.$user['template'].'/theme/favorite.gif', 401 'FAVORITE_HINT' =>$lang['add_favorites_hint'], 402 'FAVORITE_ALT' =>'[ '.$lang['add_favorites_alt'].' ]', 403 'U_FAVORITE'=> add_session_id( $url ) 404 )); 405 } 406 else 407 { 408 $url = './picture.php?cat='.$page['cat'].'&image_id='.$_GET['image_id']; 409 $url.= '&expand='.$_GET['expand'].'&add_fav=0'; 410 $template->assign_block_vars('favorite', array( 411 'FAVORITE_IMG' => './template/'.$user['template'].'/theme/del_favorite.gif', 412 'FAVORITE_HINT' =>$lang['del_favorites_hint'], 413 'FAVORITE_ALT' =>'[ '.$lang['del_favorites_alt'].' ]', 414 'U_FAVORITE'=> add_session_id( $url ) 415 )); 416 } 417 } 418 //------------------------------------ admin link for information modifications 419 if ( $user['status'] == 'admin' ) 420 { 421 $template->assign_block_vars('modification', array()); 422 } 423 424 //---------------------------------------------------- users's comments display 425 if ( $conf['show_comments'] ) 426 { 427 // comment registeration 189 //--------------------------------------------------------- comment registeration 428 190 if ( isset( $_POST['content'] ) && !empty($_POST['content']) ) 429 191 { … … 498 260 mysql_query( $query ); 499 261 } 262 263 // 264 // Start output of page 265 // 266 267 $title = $picture['current']['name']; 268 $refresh = 0; 269 if ( isset( $_GET['slideshow'] ) && $next) 270 { 271 $refresh= $_GET['slideshow']; 272 $url_link = $picture['next']['url']; 273 } 274 275 $title_img = $picture['current']['name']; 276 $title_nb = ''; 277 if (is_numeric( $page['cat'] )) 278 { 279 $title_img = replace_space(get_cat_display_name( $page['cat_name'], " > ","font-style:italic;" )); 280 $n = $page['num'] + 1; 281 $title_nb = "Photo".' '.$n.'/'; 282 $title_nb.= $page['cat_nb_images']; 283 //$title_img.= $picture['current']['name']; 284 } 285 else if ( $page['cat'] == 'search' ) 286 { 287 $title_img = replace_search( $title_img, $_GET['search'] ); 288 } 289 290 // calculation of width and height 291 if ( empty($picture['current']['width'])) 292 { 293 $taille_image = @getimagesize( $lien_image ); 294 $original_width = $taille_image[0]; 295 $original_height = $taille_image[1]; 296 } 297 else 298 { 299 $original_width = $picture['current']['width']; 300 $original_height = $picture['current']['height']; 301 } 302 303 $picture_size = get_picture_size( $original_width, $original_height, 304 $user['maxwidth'], $user['maxheight'] ); 305 306 include(PHPWG_ROOT_PATH.'include/page_header.php'); 307 $template->set_filenames(array('picture'=>'picture.tpl')); 308 309 $template->assign_vars(array( 310 'CATEGORY' => $title_img, 311 'PHOTO' => $title_nb, 312 'TITLE' => $picture['current']['name'], 313 'PREV_TITLE_IMG' => $picture['prev']['name'], 314 'NEXT_TITLE_IMG' => $picture['next']['name'], 315 'PREV_IMG' => $picture['prev']['thumbnail'], 316 'NEXT_IMG' => $picture['next']['thumbnail'], 317 'SRC_IMG' => $picture['current']['src'], 318 'ALT_IMG' => $picture['current']['file'], 319 'WIDTH_IMG' => $picture_size[0], 320 'HEIGHT_IMG' => $picture_size[1], 321 'COMMENT_IMG' => $picture['current']['comment'], 322 323 'L_SLIDESHOW' => $lang['slideshow'], 324 'L_TIME' => $lang['period_seconds'], 325 'L_STOP_SLIDESHOW' => $lang['slideshow_stop'], 326 'L_PREV_IMG' =>$lang['previous_image'].' : ', 327 'L_ADMIN' =>$lang['link_info_image'], 328 'L_BACK' =>$lang['back'], 329 'L_COMMENT_TITLE' =>$lang['comments_title'], 330 'L_ADD_COMMENT' =>$lang['comments_add'], 331 'L_DELETE_COMMENT' =>$lang['comments_del'], 332 'L_DELETE' =>$lang['delete'], 333 'L_SUBMIT' =>$lang['submit'], 334 'L_AUTHOR' =>$lang['author'], 335 'L_COMMENT' =>$lang['comment'], 336 337 'T_DEL_IMG' =>PHPWG_ROOT_PATH.'template/'.$user['template'].'/theme/delete.gif', 338 339 'U_PREV_IMG' => add_session_id($picture['prev']['url']), 340 'U_NEXT_IMG' => add_session_id($picture['next']['url']), 341 'U_HOME' => add_session_id($url_home), 342 'U_ADMIN' => add_session_id($url_admin), 343 'U_ADD_COMMENT' => add_session_id(str_replace( '&', '&', $_SERVER['REQUEST_URI'] )) 344 ) 345 ); 346 347 //-------------------------------------------------------- slideshow management 348 if ( isset( $_GET['slideshow'] ) ) 349 { 350 if ( !is_numeric( $_GET['slideshow'] ) ) $_GET['slideshow'] = $conf['slideshow_period'][0]; 351 352 $template->assign_block_vars('stop_slideshow', array( 353 'U_SLIDESHOW'=>add_session_id( $picture['current']['url'] ) 354 )); 355 } 356 else 357 { 358 $template->assign_block_vars('start_slideshow', array()); 359 foreach ( $conf['slideshow_period'] as $option ) 360 { 361 $template->assign_block_vars('start_slideshow.second', array( 362 'SLIDESHOW_SPEED'=>$option, 363 'U_SLIDESHOW'=>add_session_id( $picture['current']['url'].'&slideshow='.$option) 364 )); 365 } 366 } 367 368 if ($prev>=0) $template->assign_block_vars('previous', array()); 369 if ($next) $template->assign_block_vars('next', array()); 370 371 //--------------------------------------------------------- picture information 372 // legend 373 if ( !empty($picture['current']['comment']) ) 374 { 375 $template->assign_block_vars('legend', array()); 376 } 377 378 // author 379 if ( !empty($picture['current']['author']) ) 380 { 381 $template->assign_block_vars('info_line', array( 382 'INFO'=>$lang['author'], 383 'VALUE'=>$picture['current']['author'] 384 )); 385 } 386 // creation date 387 if ( !empty($picture['current']['date_creation']) ) 388 { 389 $template->assign_block_vars('info_line', array( 390 'INFO'=>$lang['creation_date'], 391 'VALUE'=>format_date( $picture['current']['date_creation'] ) 392 )); 393 } 394 // date of availability 395 $template->assign_block_vars('info_line', array( 396 'INFO'=>$lang['registration_date'], 397 'VALUE'=>format_date( $picture['current']['date_available'] ) 398 )); 399 // size in pixels 400 if ( $original_width != $picture_size[0] or $original_height != $picture_size[1] ) 401 { 402 $content = '[ <a href="'.$picture['current']['url'].'" title="'.$lang['true_size'].'">'; 403 $content.= $original_width.'*'.$original_height.'</a> ]'; 404 } 405 else 406 { 407 $content = $original_width.'*'.$original_height; 408 } 409 $template->assign_block_vars('info_line', array( 410 'INFO'=>$lang['size'], 411 'VALUE'=>$content 412 )); 413 // file 414 $template->assign_block_vars('info_line', array( 415 'INFO'=>$lang['file'], 416 'VALUE'=>$picture['current']['file'] 417 )); 418 // filesize 419 if ( empty($picture['current']['filesize'])) 420 { 421 $poids = floor ( filesize( $picture['current']['url'] ) / 1024 ); 422 } 423 else 424 { 425 $poids = $picture['current']['filesize']; 426 } 427 428 $template->assign_block_vars('info_line', array( 429 'INFO'=>$lang['filesize'], 430 'VALUE'=>$poids.' KB' 431 )); 432 // keywords 433 if ( !empty($picture['current']['keywords'])) 434 { 435 $keywords = explode( ',', $picture['current']['keywords'] ); 436 $content = ''; 437 $url = PHPWG_ROOT_PATH.'category.php?cat=search'; 438 $url.= '&mode=OR&search='; 439 foreach ( $keywords as $i => $keyword ) { 440 $local_url = add_session_id( $url.$keyword ); 441 if ( $i > 0 ) $content.= ','; 442 $content.= '<a href="'.$local_url.'">'.$keyword.'</a>'; 443 } 444 $template->assign_block_vars('info_line', array( 445 'INFO'=>$lang['keywords'], 446 'VALUE'=>$content 447 )); 448 } 449 // number of visits 450 $template->assign_block_vars('info_line', array( 451 'INFO'=>$lang['visited'], 452 'VALUE'=>$picture['current']['hit'].' '.$lang['times'] 453 )); 454 455 //------------------------------------------------------- favorite manipulation 456 if ( !$user['is_the_guest'] ) 457 { 458 // verify if the picture is already in the favorite of the user 459 $query = 'SELECT COUNT(*) AS nb_fav'; 460 $query.= ' FROM '.FAVORITES_TABLE.' WHERE image_id = '.$_GET['image_id']; 461 $query.= ' AND user_id = '.$user['id'].';'; 462 $result = mysql_query( $query ); 463 $row = mysql_fetch_array( $result ); 464 if (!$row['nb_fav']) 465 { 466 $url = PHPWG_ROOT_PATH.'picture.php?cat='.$page['cat'].'&image_id='.$_GET['image_id']; 467 $url.='&add_fav=1'; 468 if ( $page['cat'] == 'search' ) 469 { 470 $url.= '&search='.$_GET['search'].'&mode='.$_GET['mode']; 471 } 472 $template->assign_block_vars('favorite', array( 473 'FAVORITE_IMG' => PHPWG_ROOT_PATH.'template/'.$user['template'].'/theme/favorite.gif', 474 'FAVORITE_HINT' =>$lang['add_favorites_hint'], 475 'FAVORITE_ALT' =>'[ '.$lang['add_favorites_alt'].' ]', 476 'U_FAVORITE'=> add_session_id( $url ) 477 )); 478 } 479 else 480 { 481 $url = PHPWG_ROOT_PATH.'picture.php?cat='.$page['cat'].'&image_id='.$_GET['image_id']; 482 $url.= '&add_fav=0'; 483 $template->assign_block_vars('favorite', array( 484 'FAVORITE_IMG' => PHPWG_ROOT_PATH.'template/'.$user['template'].'/theme/del_favorite.gif', 485 'FAVORITE_HINT' =>$lang['del_favorites_hint'], 486 'FAVORITE_ALT' =>'[ '.$lang['del_favorites_alt'].' ]', 487 'U_FAVORITE'=> add_session_id( $url ) 488 )); 489 } 490 } 491 //------------------------------------ admin link for information modifications 492 if ( $user['status'] == 'admin' ) 493 { 494 $template->assign_block_vars('modification', array()); 495 } 496 497 //---------------------------------------------------- users's comments display 498 if ( $conf['show_comments'] ) 499 { 500 500 // number of comment for this picture 501 501 $query = 'SELECT COUNT(*) AS nb_comments'; … … 506 506 507 507 // navigation bar creation 508 $url = './picture.php?cat='.$page['cat'].'&image_id='.$_GET['image_id']; 509 if (isset($_GET['expand'])) 510 $url.= '&expand='.$_GET['expand']; 508 $url = PHPWG_ROOT_PATH.'picture.php?cat='.$page['cat'].'&image_id='.$_GET['image_id']; 511 509 if ( $page['cat'] == 'search' ) 512 510 { -
trunk/profile.php
r369 r393 128 128 } 129 129 //----------------------------------------------------- template initialization 130 // 131 // Start output of page 132 // 130 $expand = ($user['expand']=='true')?'EXPAND_TREE_YES':'EXPAND_TREE_NO'; 131 $nb_comments = ($user['show_nb_comments']=='true')?'NB_COMMENTS_YES':'NB_COMMENTS_NO'; 132 133 133 $title = $lang['customize_page_title']; 134 134 include(PHPWG_ROOT_PATH.'include/page_header.php'); 135 135 136 136 $template->set_filenames(array('profile'=>'profile.tpl')); 137 initialize_template();138 137 139 138 $template->assign_vars(array( 140 'L_TITLE' => $lang['customize_title'], 139 'LANG_SELECT'=>language_select($user['language'], 'language'), 140 'NB_IMAGE_LINE'=>$user['nb_image_line'], 141 'NB_ROW_PAGE'=>$user['nb_line_page'], 142 'STYLE_SELECT'=>style_select($user['template'], 'template'), 143 'SHORT_PERIOD'=>$user['short_period'], 144 'LONG_PERIOD'=>$user['long_period'], 145 146 $expand=>'checked="checked"', 147 $nb_comments=>'checked="checked"', 148 149 'L_TITLE' => $lang['customize_title'], 141 150 'L_PASSWORD' => $lang['password'], 142 151 'L_NEW' => $lang['new'], 143 152 'L_CONFIRM' => $lang['reg_confirm'], 144 'L_SUBMIT' => $lang['submit'],145 153 'L_COOKIE' => $lang['create_cookie'], 146 147 'F_ACTION' => add_session_id( './profile.php' ), 148 149 'U_RETURN' => add_session_id('./category.php?'.$_SERVER['QUERY_STRING']) 154 'L_CONFIRM'=>$lang['conf_confirmation'], 155 'L_LANG_SELECT'=>$lang['customize_language'], 156 'L_NB_IMAGE_LINE'=>$lang['customize_nb_image_per_row'], 157 'L_NB_ROW_PAGE'=>$lang['customize_nb_row_per_page'], 158 'L_STYLE_SELECT'=>$lang['customize_theme'], 159 'L_SHORT_PERIOD'=>$lang['customize_short_period'], 160 'L_LONG_PERIOD'=>$lang['customize_long_period'], 161 'L_EXPAND_TREE'=>$lang['customize_expand'], 162 'L_NB_COMMENTS'=>$lang['customize_show_nb_comments'], 163 'L_YES'=>$lang['yes'], 164 'L_NO'=>$lang['no'], 165 'L_SUBMIT'=>$lang['submit'], 166 167 'F_ACTION'=>add_session_id(PHPWG_ROOT_PATH.'profile.php'), 168 169 'U_RETURN' => add_session_id(PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING']) 150 170 )); 151 171 … … 160 180 } 161 181 162 $template->assign_block_vars('select',array(163 'F_LABEL'=>$lang['customize_nb_image_per_row'],164 'F_NAME'=>'nb_image_line',165 'F_OPTIONS'=>make_jumpbox($conf['nb_image_row'], $user['nb_image_line'])166 ));167 168 $template->assign_block_vars('select',array(169 'F_LABEL'=>$lang['customize_nb_row_per_page'],170 'F_NAME'=>'nb_line_page',171 'F_OPTIONS'=>make_jumpbox($conf['nb_row_page'], $user['nb_line_page'])172 ));173 174 $template->assign_block_vars('select',array(175 'F_LABEL'=>$lang['customize_template'],176 'F_NAME'=>'template',177 'F_OPTIONS'=>make_jumpbox(get_dirs( './template' ), $user['template'])178 ));179 180 $template->assign_block_vars('select',array(181 'F_LABEL'=>$lang['customize_language'],182 'F_NAME'=>'language',183 'F_OPTIONS'=>make_jumpbox($lang['lang'], $user['language'], true)184 ));185 186 $template->assign_block_vars('text',array(187 'F_LABEL'=>$lang['customize_short_period'],188 'F_NAME'=>'short_period',189 'F_VALUE'=>$user['short_period']190 ));191 192 $template->assign_block_vars('text',array(193 'F_LABEL'=>$lang['customize_long_period'],194 'F_NAME'=>'long_period',195 'F_VALUE'=>$user['long_period']196 ));197 198 182 $template->assign_block_vars('text',array( 199 183 'F_LABEL'=>$lang['maxwidth'], … … 214 198 )); 215 199 216 $template->assign_block_vars('radio',array(217 'F_LABEL'=>$lang['customize_expand'],218 'F_OPTIONS'=>make_radio('expand', array(true=>$lang['yes'], false=>$lang['no']), $user['expand'], true)219 ));220 221 $template->assign_block_vars('radio',array(222 'F_LABEL'=>$lang['customize_show_nb_comments'],223 'F_OPTIONS'=>make_radio('show_nb_comments', array(true=>$lang['yes'], false=>$lang['no']), $user['show_nb_comments'], true)224 ));225 226 200 //----------------------------------------------------------- html code display 227 201 $template->pparse('profile'); -
trunk/register.php
r369 r393 52 52 } 53 53 54 $login = empty($_POST['login'])?$_POST['login']:'';55 $email = empty($_POST['login'])?$_POST['login']:'';54 $login = !empty($_POST['login'])?$_POST['login']:''; 55 $email = !empty($_POST['login'])?$_POST['login']:''; 56 56 57 57 //----------------------------------------------------- template initialization … … 63 63 64 64 $template->set_filenames( array('register'=>'register.tpl') ); 65 initialize_template();66 67 65 $template->assign_vars(array( 68 66 'L_TITLE' => $lang['register_title'], … … 80 78 81 79 //-------------------------------------------------------------- errors display 82 if ( sizeof( $error s) != 0 )80 if ( sizeof( $error ) != 0 ) 83 81 { 84 82 $template->assign_block_vars('errors',array()); 85 for ( $i = 0; $i < sizeof( $error s); $i++ )83 for ( $i = 0; $i < sizeof( $error ); $i++ ) 86 84 { 87 85 $template->assign_block_vars('errors.error',array('ERROR'=>$errors[$i])); -
trunk/search.php
r369 r393 70 70 71 71 $template->set_filenames( array('search'=>'search.tpl') ); 72 initialize_template();73 74 72 $template->assign_vars(array( 75 73 'L_TITLE' => $lang['search_title'], -
trunk/template/default/about.tpl
r364 r393 1 <table style="width:100%;height:100%"> 2 <tr align="center" valign="middle"> 3 <td> 4 {T_START}1px{T_BEGIN} 5 <div class="titrePage">{PAGE_TITLE}</div> 6 {T_END} 7 <div style="margin-bottom:5px;"> </div> 8 {T_START}50%{T_BEGIN} 9 <div class="menu" style="white-space:normal;margin:10px;"> 10 {L_ABOUT} 11 </div> 12 {T_END} 13 <div style="text-align:center;margin:5px;"> 14 <a href="{U_RETURN}">{L_RETURN}</a> 15 </div> 16 <div style="text-align:center;margin:5px;"> 17 <img src="./template/default/images/php_sqreuil_artistes.gif" alt="php logo" /> 18 </div> 19 </td> 20 </tr> 21 </table> 1 <div class="titrePage">{PAGE_TITLE}</div> 2 <div class="menu" style="white-space:normal;margin:10px;"> 3 {L_ABOUT} 4 </div> 5 <div style="text-align:center;margin:5px;"> 6 <a href="{U_RETURN}">{L_RETURN}</a> 7 </div> 8 <div style="text-align:center;margin:5px;"> 9 <img src="./template/default/images/php_sqreuil_artistes.gif" alt="php logo" /> 10 </div> -
trunk/template/default/category.tpl
r388 r393 21 21 <span title="{category.NB_SUBCATS} {L_SUBCAT}">{category.NB_SUBCATS}</span> - <span title="{category.TOTAL_CAT} {L_IMG_AVAILABLE}">{category.TOTAL_CAT}</span> ]</span>{category.CAT_ICON}<br /> 22 22 <!-- END category --> 23 24 23 <div class="totalImages">[ {NB_PICTURE} {L_TOTAL} ]</div> 25 <!-- BEGIN favorites --> 26 <br /> <img src="{T_COLLAPSED}" alt='' /> <a href="{U_FAVORITE}"><span title="{L_FAVORITE_HINT}" style="font-weight:bold;">{L_FAVORITE}</span></a> <span class="menuInfoCat">[ {favorites.NB_FAV} ]</span> 27 <!-- END favorites --> 28 <br /> <img src="{T_COLLAPSED}" alt='' /> <span style="font-weight:bold;">{L_STATS}</span> 29 <br /> <img src="{T_COLLAPSED}" alt='' /> <a href="{U_MOST_VISITED}"><span title="{L_MOST_VISITED_HINT}" style="font-weight:bold;">{TOP_VISITED} {L_MOST_VISITED}</span></a> 30 <br /> <img src="{T_COLLAPSED}" alt='' /> <a href="{U_RECENT}"><span title="{L_RECENT_HINT}" style="font-weight:bold;">{L_RECENT}</span></a> {T_SHORT} 24 <br /> 25 <ul class="menu"> 26 <!-- BEGIN favorites --> 27 <li><a href="{U_FAVORITE}"><span title="{L_FAVORITE_HINT}" style="font-weight:bold;">{L_FAVORITE}</span></a> <span class="menuInfoCat">[ {favorites.NB_FAV} ]</span></li> 28 <!-- END favorites --> 29 <li><span style="font-weight:bold;">{L_STATS}</span></li> 30 <ul class="menu"> 31 <li><a href="{U_MOST_VISITED}"><span title="{L_MOST_VISITED_HINT}" style="font-weight:bold;">{TOP_VISITED} {L_MOST_VISITED}</span></a></li> 32 <li><a href="{U_RECENT}"><span title="{L_RECENT_HINT}" style="font-weight:bold;">{L_RECENT}</span></a> {T_SHORT}</li> 33 </ul> 34 </ul> 31 35 </div> 32 36 <div class="titreMenu">{L_SUMMARY}</div> 33 37 <div class="menu"> 38 <ul class="menu"> 34 39 <!-- BEGIN summary --> 35 <img src="{T_COLLAPSED}" alt=''/> <a href="{summary.U_SUMMARY}" title="{summary.TITLE}">{summary.NAME}</a><br />40 <li><a href="{summary.U_SUMMARY}" title="{summary.TITLE}">{summary.NAME}</a></li> 36 41 <!-- END summary --> 37 42 <!-- BEGIN upload --> 38 < br /> <img src="{T_COLLAPSED}" alt=''/> <a href="{upload.U_UPLOAD}">{L_UPLOAD}</a>43 <li><a href="{upload.U_UPLOAD}">{L_UPLOAD}</a></li> 39 44 <!-- END upload --> 45 </ul> 40 46 </div> 41 47 <div class="titreMenu">{L_IDENTIFY}</div> … … 47 53 <input type="text" name="username" size="15" value="" /><br /> 48 54 {L_PASSWORD}<br /> 49 <input type="password" name="password" size="15"><br /> <br />55 <input type="password" name="password" size="15"><br /> 50 56 <input type="submit" name="login" value="{L_SUBMIT}" class="bouton" /> 51 57 </form> … … 71 77 <!-- BEGIN thumbnail --> 72 78 <td class="thumbnail"> 73 <a href="{thumbnails.line.thumbnail.U_IMG_LINK}" class="back">79 <a href="{thumbnails.line.thumbnail.U_IMG_LINK}"> 74 80 <img src="{thumbnails.line.thumbnail.IMAGE}" 75 81 alt="{thumbnails.line.thumbnail.IMAGE_ALT}" 76 82 title="{thumbnails.line.thumbnail.IMAGE_TITLE}" 77 class=" imgLink" />83 class="thumbLink" /> 78 84 <br /> 79 85 {thumbnails.line.thumbnail.IMAGE_NAME}</a> 80 86 {thumbnails.line.thumbnail.IMAGE_TS} 81 87 <!-- BEGIN nb_comments --> 82 <br />{thumbnails.line.thumbnail. NB_COMMENTS} {L_COMMENTS}88 <br />{thumbnails.line.thumbnail.nb_comments.NB_COMMENTS} {L_COMMENT} 83 89 <!-- END nb_comments --> 84 90 </td> -
trunk/template/default/comments.tpl
r355 r393 1 <table style="width:100%;"> 2 <tr align="center" valign="middle"> 3 <td> 4 {T_START}1px{T_BEGIN} 5 <div class="titrePage">{L_TITLE}</div> 6 {T_END} 7 <div style="margin-bottom:20px"></div> 8 {T_START}90%{T_BEGIN} 9 <table style="width:100%;"> 10 <tr> 11 <th> 1 <!-- BEGIN title --> 2 <div class="titrePage">{L_COMMENT_TITLE}</div> 3 <!-- END title --> 4 <div class="admin"> 12 5 [ 13 6 <!-- BEGIN last_day_option --> 14 <a href="{last_day_option.U_OPTION}" style="{last_day_option.T_STYLE}">{last_day_option.OPTION}</a>{T_SEPARATION}7 <a class="admin" href="{last_day_option.U_OPTION}" style="{last_day_option.T_STYLE}">{last_day_option.OPTION}</a>{T_SEPARATION} 15 8 <!-- END last_day_option --> 16 {L_ STATS}9 {L_COMMENT_STATS} 17 10 ] 18 [ <a href="{U_HOME}">{L_RETURN}</a> ] 19 </th> 20 </tr> 11 <!-- BEGIN title --> 12 [ <a class="admin" href="{U_HOME}">{L_COMMENT_RETURN}</a> ] 13 <!-- END title --> 14 </div> 15 <!-- BEGIN validation --> 16 <form action="{F_ACTION}" method="post"> 17 <!-- END validation --> 18 <table class="table2"> 19 <!-- BEGIN picture --> 20 <tr class="row1"> 21 <td > 22 <a href="{picture.U_THUMB}" title="{picture.TITLE_IMG}"> 23 <img src="{picture.I_THUMB}" class="thumbLink" alt="{picture.THUMB_ALT_IMG}"/> 24 </a> 25 </td> 26 <td class="tablecompact"> 27 <div class="commentTitle">{picture.TITLE_IMG}</div> 28 <div class="commentsNavigationBar">{picture.NAV_BAR}</div> 29 <table class="tablecompact"> 30 <!-- BEGIN comment --> 31 <tr class="throw"> 32 <td class="throw"> 33 {picture.comment.COMMENT_AUTHOR} 34 </td> 35 <td class="commentDate"> 36 {picture.comment.COMMENT_DATE} 37 <!-- BEGIN validation --> 38 <input type="checkbox" name="comment_id[]" value="{picture.comment.validation.ID}" {picture.comment.validation.CHECKED} /> 39 <!-- END validation --> 40 </td> 41 </tr> 42 <tr class="row1"> 43 <td class="comment" colspan="2">{picture.comment.COMMENT}</td> 44 </tr> 45 <!-- END comment --> 46 </table> 47 </td> 48 </tr> 49 <!-- END picture --> 21 50 </table> 22 <!-- BEGIN picture --> 23 <div style="border:2px solid gray;margin:2px;padding:2px;"> 24 <table style="width:100%;"> 25 <tr> 26 <td valign="top" style="width:15%;"> 27 <!-- the thumbnail of the picture, linked to the full size page --> 28 <a href="{picture.U_THUMB}" title="{picture.TITLE_IMG}"> 29 <img src="{picture.I_THUMB}" class="imgLink" alt="{picture.THUMB_ALT_IMG}"/> 30 </a> 31 </td> 32 <td style="padding:10px;width:85%;"> 33 <div style="font-weight:bold;padding-left:10px;text-align:left;">{picture.TITLE_IMG}</div> 34 <!-- BEGIN comment --> 35 <table class="tableComment"> 36 <tr> 37 <td rowspan="2" valign="top" class="cellAuthor"> 38 <div class="commentsAuthor">{picture.comment.AUTHOR}</div> 39 </td> 40 <td class="cellInfo"> 41 <div class="commentsInfos"> 42 {picture.comment.DATE} 43 </div> 44 </td> 45 </tr> 46 <tr> 47 <td> 48 <div class="commentsContent">{picture.comment.CONTENT}</div> 49 </td> 50 </tr> 51 </table> 52 <!-- END comment --> 53 </td> 54 </tr> 55 </table> 56 </div> 57 <!-- END picture --> 58 {T_END} 59 </td> 60 </tr> 61 </table> 51 <!-- BEGIN validation --> 52 <input type="submit" name="validate" class="bouton" value="{L_VALIDATE}" /> 53 <input type="submit" name="delete" class="bouton" value="{L_DELETE}" /> 54 </form> 55 <!-- END validation --> -
trunk/template/default/default.css
r375 r393 2 2 3 3 body { 4 font-family: Verdana, Arial, Helvetica, sans-serif;4 font-family: Verdana, Geneva, Arial, sans-serif; 5 5 font-size:10px; 6 6 background-color:#000000; … … 15 15 a:hover { 16 16 text-decoration:underline; 17 color:#FFFFAA; 18 } 19 17 color:#FFF48E; 18 } 19 20 a.none:hover { 21 text-decoration:none; 22 } 20 23 /* Navigation styles */ 21 24 … … 49 52 } 50 53 51 .menu 52 { 54 .menu { 53 55 margin:10px 5px 10px 5px; 54 56 white-space:nowrap; 55 57 font-size:11px; 58 text-align:left; 59 } 60 61 ul.menu { 62 text-align:left; 63 list-style-image : url(theme/collapsed.gif); 64 list-style-type: square ; 65 padding-left:15px; 66 margin:5px; 67 } 68 69 .navigationBar { 70 text-align:center; 71 margin-top:10px; 72 margin-bottom:10px; 56 73 } 57 74 58 75 /* Image related styles */ 59 76 60 .imgLink { 61 border-style: solid; 62 border-width:2px; 63 border-color: #A0A0A0; 64 margin: 2px; 65 } 66 67 .imgLink:hover { 77 .image { 78 border : 3px solid #FFFFFF; 79 margin : 10px 4px 10px 4px; 80 } 81 82 a.image:hover { 68 83 text-decoration:none; 69 84 } 70 85 71 .image {72 border: 1px solid #000000;73 background-color: #FFFFFF;74 text-align:center;75 margin-top: 10px;76 margin-bottom: 20px;77 white-space: nowrap;78 padding: 0px;79 display: table;80 }81 82 86 .commentImage { 83 font-weight:bold;84 text-align:center;85 font-size:1 7px;86 color:#F0F0F0;87 text-align:justify; 88 font-style:italic; 89 font-size:16px; 90 margin-top: 10px; 87 91 margin-bottom: 10px; 88 92 } 89 93 94 .nameImage { 95 text-align:center; 96 font-size:24px; 97 background-color: #666666; 98 border-top: 1px solid #222222; 99 border-bottom: 1px solid #222222; 100 } 90 101 /* Table styles */ 91 102 … … 110 121 111 122 .table2 { 112 background : #797979;123 background-color: #797979; 113 124 border: 1px solid #000000; 114 margin: 0px 10px 10px 10px; 115 } 116 117 td{ 118 padding:0px; 119 } 120 125 margin: 0px 10px 0px 0px; 126 padding:0px; 127 } 128 129 .tablecompact{ 130 width:100%; 131 border-collapse:collapse; 132 } 133 134 .row1,.row2 { 135 text-align:left; 136 padding:5px 0px 5px 0px; 137 height:20px; 138 } 139 140 .row1 { 141 background-color:#505050; 142 } 143 144 .throw { 145 color:#FFFFCC; 146 background-color:#3F3F3F; 147 width:100%; 148 text-align:center; 149 font-weight:bold; 150 border-top: 1px solid #000000; 151 border-bottom: 1px solid #000000; 152 height:20px; 153 } 154 155 td.throw{ 156 text-align:left; 157 width:auto; 158 } 121 159 /* Thumbnails styles */ 122 160 … … 124 162 font-size:11px; 125 163 text-align:center; 126 display:inline-table;127 164 vertical-align: baseline; 165 white-space: nowrap; 128 166 } 129 167 130 168 table.thumbnail { 131 169 border-collapse:separate; 170 display:inline-table; 171 } 172 173 .thumbLink { 174 border-style: solid; 175 border-width:1px; 176 border-color: #A0A0A0; 177 margin: 2px; 178 } 179 180 a.thumbLink:hover { 181 text-decoration:none; 182 } 183 184 /* Comment styles */ 185 .commentTitle { 186 font-family: Arial, Helvetica, sans-serif; 187 font-size:12px; 188 background-color:#797979; 189 font-weight:bold; 190 padding: 15px 5px 10px 5px; 191 } 192 193 .commentDate { 194 font-weight:lighter; 195 text-align:right; 196 color:#999999; 197 border-top: 1px solid #000000; 198 border-bottom: 1px solid #000000; 199 } 200 201 .comment{ 202 color:#C6B78E; 203 } 204 /* Form styles */ 205 206 .bouton { 207 background-image: url(theme/button_bg.gif); 208 border: 1px solid #404750; 209 color:#FFFFFF; 210 padding-left: 3px; 211 padding-right: 3px; 212 font-weight:500; 213 background-position : bottom; 214 margin-top:10px; 215 } 216 217 input,select { 218 background-color:#505050; 219 border: 1px solid #797979; 220 padding: 0; 221 color:#FFFFCC; 222 } 223 224 /* Admin styles */ 225 226 .adminMenu { 227 text-align:center; 228 font-size:12px; 229 } 230 231 div.adminMenu{ 232 margin:10px 50px 10px 50px; 233 } 234 235 a.adminMenu:hover{ 236 color : #C6B78E; 237 } 238 239 a.adminMenu{ 240 color : #FFF48E; 241 } 242 243 .admin { 244 font-weight:bold; 245 background-color:#444444; 246 margin:0px 0px 12px 0px; 247 text-align: center; 248 padding:0px; 249 color : #FFF48E; 250 } 251 252 .adminMain 253 { 254 border: 1px solid #000000; 255 background-color:#656565; 256 width:95%; 257 color:#FFFFFF; 132 258 } 133 259 134 260 /* Other styles */ 135 a.back { 136 color:#E0E0E0; 137 } 138 139 input { 140 font-family: Verdana, Arial, Helvetica, sans-serif; 141 font-size:11px; 142 } 143 144 .info,.commentsAuthor,.commentsTitle,.commentsInfos,.commentsContent,.commentsNavigationBar { 261 .info { 145 262 color:#E0E0E0; 146 263 background-color:#444444; 147 }148 .info {149 264 margin-bottom:5px; 150 265 white-space:nowrap; … … 164 279 } 165 280 166 . comments, .infoCat, .navigationBar{281 .infoCat { 167 282 margin-top:10px; 168 283 margin-bottom:10px; 169 }170 .comments {171 text-align:justify;172 font-style:italic;173 }174 .navigationBar {175 text-align:center;176 }177 .infoCat {178 284 text-align:left; 179 285 } … … 184 290 letter-spacing:-1px; 185 291 } 186 187 .bouton {188 background:#E0E0E0;189 }190 textarea,input {191 color:black;192 }193 194 195 292 196 293 .errors { … … 210 307 padding:5px; 211 308 } 212 .commentsAuthor, .commentsTitle, .commentsInfos, .commentsContent, .commentsNavigationBar { 213 214 font-family:arial, sans-Serif; 215 font-size:12px; 216 } 217 .commentsTitle, .commentsAuthor { 218 text-align:center; 219 font-weight:bold; 220 } 221 .commentsInfos { 222 padding:3px 3px 3px 10px; 223 font-size:11px; 224 text-align:right; 225 } 226 .commentsContent { 227 margin:10px; 228 } 229 .commentsTitle { 230 margin-top:15px; 231 } 232 .commentsAuthor { 233 margin:5px; 234 } 235 .commentsNavigationBar { 236 margin:10px; 237 } 309 238 310 .tableComment,.cellAuthor,.cellInfo { 239 311 border-color:#E0E0E0; … … 255 327 border-bottom-width:1px; 256 328 } 257 258 .miniature {259 border:solid 1px black;260 }261 .titretable1 {262 color:black;263 background-color:#D3DCE3;264 text-align:center;265 border:2px solid #006699;266 font-weight:bold;267 border-bottom:0px;268 }269 .grostitre {270 text-align:center;271 margin:10px 50px 10px 50px;272 font-size:20px;273 width:300px;274 }275 .plan {276 margin:10px 10px 10px 2px;277 white-space:nowrap;278 }279 .cat_plan {280 font-weight:bold;281 }282 .retrait {283 margin:10px;284 margin-left:30px;285 margin-top:2px;286 }287 .erreur {288 color:red;289 text-align:center;290 }291 .errors_title {292 margin:5px;293 font-weight:bold;294 font-size:120%;295 text-align:center;296 color:red;297 }298 -
trunk/template/default/header.tpl
r375 r393 1 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang=" fr" lang="fr">2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{LANG}" lang="{LANG}" dir="{DIR}"> 3 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset={ S_CONTENT_ENCODING}" />4 <meta http-equiv="Content-Type" content="text/html; charset={CONTENT_ENCODING}" /> 5 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 6 <!-- BEGIN refresh --> 7 <meta http-equiv="refresh" content="{ S_REFRESH_TIME};url={U_REFRESH}">7 <meta http-equiv="refresh" content="{REFRESH_TIME};url={U_REFRESH}"> 8 8 <!-- END refresh --> 9 9 <title>{PAGE_TITLE}</title> 10 10 <link rel="stylesheet" href="{T_STYLE}" type="text/css" /> 11 <script type="text/javascript" src="include/scripts.js"></script> 11 12 </head> 12 13 <body> -
trunk/template/default/htmlfunctions.inc.php
r375 r393 39 39 { 40 40 $icon_url.= 'new_short.gif'; 41 41 $title .= $user['short_period']; 42 42 } 43 43 else 44 44 { 45 45 $icon_url.= 'new_long.gif'; 46 46 $title .= $user['long_period']; 47 47 } 48 48 $title .= ' '.$lang['days']; 49 49 $size = getimagesize( $icon_url ); 50 50 $output = '<img title="'.$title.'" src="'.$icon_url.'" style="border:0;'; … … 108 108 } 109 109 110 function get_frame_start()111 {112 return '<table style="padding:0px;border-collapse:collapse; width:';113 }114 110 115 function get_frame_begin()116 {117 global $user;118 $path = './template/'.$user['template'].'/theme/';119 $size_01 = getimagesize( $path.'01.gif' );120 $size_02 = getimagesize( $path.'02.gif' );121 $size_03 = getimagesize( $path.'03.gif' );122 return ';">123 <tr>124 <td><img src="'.$path.'01.gif" style="margin:auto;width:'.$size_01[0].'px;display:box;" alt="" /></td>125 <td><img src="'.$path.'02.gif" style="margin:auto;display:box;width:100%;height:'.$size_02[1].'px;" alt="" /></td>126 <td><img src="'.$path.'03.gif" style="margin:auto;display:box;width:'.$size_03[0].'px;" alt="" /></td>127 </tr>128 <tr>129 <td style="margin:autox;background:url('.$path.'04.gif);"></td>130 <td style="margin:auto;background:url('.$path.'05.gif);width:100%;">';131 }132 133 function get_frame_end()134 {135 global $user;136 $path = './template/'.$user['template'].'/theme/';137 $size_08 = getimagesize( $path.'08.gif' );138 return '139 </td>140 <td style="margin:auto;background:url('.$path.'06.gif);"></td>141 </tr>142 <tr >143 <td><img src="'.$path.'07.gif" style="margin:auto;" alt="" /></td>144 <td><img src="'.$path.'08.gif" style="margin:auto;width:100%;height:'.$size_08[1].'px;" alt="" /></td>145 <td><img src="'.$path.'09.gif" style="margin:auto;" alt="" /></td>146 </tr>147 </table>';148 }149 150 function initialize_template()151 {152 global $template, $user, $lang;153 154 $template->assign_vars(array(155 'T_START' => get_frame_start(),156 'T_BEGIN' => get_frame_begin(),157 'T_END' => get_frame_end()158 )159 );160 }161 111 162 112 function make_jumpbox($value, $selected, $usekeys=false) … … 189 139 return $boxstring; 190 140 } 141 142 // 143 // Pick a language, any language ... 144 // 145 function language_select($default, $select_name = "language") 146 { 147 global $lang_info; 148 $dir = opendir(PHPWG_ROOT_PATH . 'language'); 149 $available_lang= array(); 150 151 while ( $file = readdir($dir) ) 152 { 153 if (is_dir ( realpath(PHPWG_ROOT_PATH.'language/'.$file) ) 154 && !is_link(realpath(PHPWG_ROOT_PATH . 'language/' . $file)) 155 && isset($lang_info['language'][$file])) 156 { 157 $available_lang[$file] = $lang_info['language'][$file]; 158 } 159 } 160 closedir($dir); 161 @asort($available_lang); 162 @reset($available_lang); 163 164 $lang_select = '<select name="' . $select_name . '" onchange="this.form.submit()">'; 165 while ( list($code, $displayname) = @each($available_lang) ) 166 { 167 $selected = ( strtolower($default) == strtolower($code) ) ? ' selected="selected"' : ''; 168 $lang_select .= '<option value="' . $code . '"' . $selected . '>' . ucwords($displayname) . '</option>'; 169 } 170 $lang_select .= '</select>'; 171 172 return $lang_select; 173 } 174 175 // 176 // Pick a template/theme combo, 177 // 178 function style_select($default_style, $select_name = "style") 179 { 180 $dir = opendir(PHPWG_ROOT_PATH . 'template'); 181 $style_select = '<select name="' . $select_name . '">'; 182 while ( $file = readdir($dir) ) 183 { 184 if (is_dir ( realpath(PHPWG_ROOT_PATH.'template/'.$file) ) 185 && !is_link(realpath(PHPWG_ROOT_PATH . 'template/' . $file)) 186 && !strstr($file,'.')) 187 { 188 $selected = ( $file == $default_style ) ? ' selected="selected"' : ''; 189 $style_select .= '<option value="' . $file . '"' . $selected . '>' . $file . '</option>'; 190 } 191 } 192 closedir($dir); 193 return $style_select; 194 } 191 195 ?> -
trunk/template/default/identification.tpl
r375 r393 1 <table style="width:100%;height:100%"> 2 <tr align="center" valign="middle"> 3 <td> 4 {T_START}1px{T_BEGIN} 5 <div class="titrePage">{L_TITLE}</div> 6 {T_END} 7 <div style="margin-bottom:5px;"> </div> 8 {T_START}50%{T_BEGIN} 9 <div style="text-align:center;"> 10 <form action="{F_LOGIN_ACTION}" method="post"> 11 <table width="100%" cellpadding="4" cellspacing="1" border="0" align="center"> 12 <!-- BEGIN errors --> 13 <tr> 14 <td colspan="2"> 15 <div class="errors"> 16 <ul> 17 <!-- BEGIN error --> 18 <li>{errors.error.ERROR}</li> 19 <!-- END error --> 20 </ul> 21 </div> 22 </td> 23 </tr> 24 <!-- END errors --> 25 <tr> 26 <td colspan="2" align="center"> </td> 27 </tr> 28 <tr> 29 <td width="45%" align="right"><span class="gentbl">{L_USERNAME}:</span></td> 30 <td> 31 <input class="login" type="text" name="username" size="25" maxlength="40" value="{USERNAME}" /> 32 </td> 33 </tr> 34 <tr> 35 <td align="right"><span class="gentbl">{L_PASSWORD}:</span></td> 36 <td> 37 <input class="login" type="password" name="password" size="25" maxlength="25" /> 38 </td> 39 </tr> 40 <tr align="center"> 41 <td colspan="2"><input type="submit" name="login" value="{L_LOGIN}" class="bouton" /></td> 42 </tr> 1 <div class="titrePage">{L_TITLE}</div> 2 <div style="margin-top:15px;text-align:center;"> 3 <table width="60%" cellpadding="4" cellspacing="1" border="0" align="center"> 4 <form action="{F_LOGIN_ACTION}" method="post"> 5 <!-- BEGIN errors --> 6 <tr> 7 <td colspan="2"> 8 <div class="errors"> 9 <ul> 10 <!-- BEGIN error --> 11 <li>{errors.error.ERROR}</li> 12 <!-- END error --> 13 </ul> 14 </div> 15 </td> 16 </tr> 17 <!-- END errors --> 18 <tr> 19 <td colspan="2" align="center"> </td> 20 </tr> 21 <tr> 22 <td width="45%" align="right"><span class="gentbl">{L_USERNAME}:</span></td> 23 <td> 24 <input class="login" type="text" name="username" size="25" maxlength="40" value="{USERNAME}" /> 25 </td> 26 </tr> 27 <tr> 28 <td align="right"><span class="gentbl">{L_PASSWORD}:</span></td> 29 <td> 30 <input class="login" type="password" name="password" size="25" maxlength="25" /> 31 </td> 32 </tr> 33 <tr align="center"> 34 <td colspan="2"><input type="submit" name="login" value="{L_LOGIN}" class="bouton" /></td> 35 </tr> 36 </form> 37 </table> 43 38 39 <table style="width:80%;margin-left:auto;margin-right:auto;"> 40 <tr> 41 <td colspan="3" align="center"> 42 <!-- BEGIN free_access --> 43 <p><a href="./category.php">[ {L_GUEST} ]</a></p> 44 <a href="register.php"><img src="./template/{T_STYLE}/theme/register.gif" style="border:0;" alt=""/> {L_REGISTER}</a> - 45 <!-- END free_access --> 46 <a href="mailto:{MAIL_ADMIN}?subject=[PhpWebGallery] {L_FORGET}"><img src="./template/{T_STYLE}/theme/lost.gif" style="border:0;" alt=""/> {L_FORGET}</a> 47 </td> 48 </tr> 44 49 </table> 45 </form> 46 <table style="width:80%;margin-left:auto;margin-right:auto;"> 47 <tr> 48 <td colspan="3" align="center"> 49 <!-- BEGIN free_access --> 50 <p><a href="./category.php">[ {L_GUEST} ]</a></p> 51 <a href="register.php"><img src="./template/{T_STYLE}/theme/register.gif" style="border:0;" alt=""/> {L_REGISTER}</a> - 52 <!-- END free_access --> 53 <a href="mailto:{MAIL_ADMIN}?subject=[PhpWebGallery] {L_FORGET}"><img src="./template/{T_STYLE}/theme/lost.gif" style="border:0;" alt=""/> {L_FORGET}</a> 54 </td> 55 </tr> 56 </table> 57 </div> 58 {T_END} 59 </td> 60 </tr> 61 </table> 50 </div> -
trunk/template/default/install.tpl
r380 r393 6 6 <meta http-equiv="Content-Style-Type" content="text/css" /> 7 7 <title>PhpWebGallery {RELEASE}</title> 8 <link rel="stylesheet" href="{T_STYLE}" type="text/css" /> 8 <style type="text/css"> 9 a, a:hover { 10 color:#006699; 11 } 12 13 body,table,input,form,select { 14 font-family:arial,verdana,sans-serif; 15 font-size:12px; 16 color:#000000; 17 text-align:left; 18 } 19 table 20 { 21 border-collapse:separate; 22 } 23 body { 24 background-color:#E5E5E5; 25 margin:5px; 26 } 27 28 .contenucellule { 29 background-color:#EEEEEE; 30 border:2px solid #006699; 31 } 32 33 th { 34 font-weight:bold; 35 background-color:#D3DCE3; 36 margin-bottom:10px; 37 text-align: center; 38 } 39 td.row1 { 40 background-color:#E6E4E4; 41 } 42 td.row2 43 { 44 background-color:#E8E8E8; 45 } 46 47 .info { 48 color:darkblue; 49 text-align:center; 50 } 51 .errors { 52 text-align:left; 53 margin:25px; 54 background-color:#ffe1e1; 55 border:1px solid red; 56 color:black; 57 } 58 .grostitre { 59 text-align : center; 60 font-size : 20px; 61 margin-bottom : 20px; 62 } 63 </style> 9 64 </head> 10 65 <body> … … 58 113 <td width="30%">{L_LANG_TITLE}</td> 59 114 <td colspan="2" align="left"> 60 <select name="language" onchange="this.form.submit()"> 61 {F_LANG_SELECT} 62 </select> 115 {F_LANG_SELECT} 63 116 </td> 64 117 </tr> -
trunk/template/default/picture.tpl
r375 r393 22 22 <div class="titrePage">{CATEGORY}</div> 23 23 <div class="titreImg">{PHOTO}</div> 24 <div class="image">25 24 <a href="{U_HOME}"> 26 <img class="im gLink" src="{SRC_IMG}" style="width:{WIDTH_IMG}px;height:{HEIGHT_IMG}px;" alt="{ALT_IMG}"/>25 <img class="image" src="{SRC_IMG}" style="width:{WIDTH_IMG}px;height:{HEIGHT_IMG}px;" alt="{ALT_IMG}"/> 27 26 </a> 28 < /div>29 < div class="commentImage">{TITLE}</div>27 <div class="nameImage">{TITLE}</div> 28 <!-- BEGIN legend --> 30 29 <div class="commentImage">{COMMENT_IMG}</div> 30 <!-- END legend --> 31 31 </div> 32 32 <table style="width:100%;"> … … 34 34 <td style="width:30%;"> 35 35 <!-- BEGIN previous --> 36 <a href="{U_PREV_IMG}" title="{L_PREV_IMG}{PREV_TITLE_IMG}"> 37 <img style="border:none;" class="imgLink" width="30" height="100" src="template/default/theme/left-arrow.jpg" alt="" /> 38 <img src="{PREV_IMG}" class="imgLink" style="margin-right:10px;margin-left:5px;" alt="{PREV_TITLE_IMG}"/></a> 36 <a class="none" href="{U_PREV_IMG}" title="{L_PREV_IMG}{PREV_TITLE_IMG}"> 37 <img style="border:none;" width="30" height="100" src="template/default/theme/left-arrow.jpg" alt="" /> 38 <img src="{PREV_IMG}" class="thumbLink" style="margin-right:10px;margin-left:5px;" alt="{PREV_TITLE_IMG}"/> 39 </a> 39 40 <!-- END previous --> 40 41 </td> … … 51 52 <td style="width:30%;"> 52 53 <!-- BEGIN next --> 53 <a href="{U_NEXT_IMG}" title="{L_NEXT_IMG}{NEXT_TITLE_IMG}"><img src="{NEXT_IMG}" class="imgLink" style="margin-right:10px;margin-left:5px;" alt="{NEXT_TITLE_IMG}"/> 54 <img style="border:none;" class="imgLink" width="30" height="100" src="template/default/theme/right-arrow.jpg" alt="" /></a> 54 <a class="none" href="{U_NEXT_IMG}" title="{L_NEXT_IMG}{NEXT_TITLE_IMG}"> 55 <img class="thumbLink" src="{NEXT_IMG}" style="margin-right:10px;margin-left:5px;" alt="{NEXT_TITLE_IMG}"/> 56 <img style="border:none;" class="thumbLink" width="30" height="100" src="template/default/theme/right-arrow.jpg" alt="" /> 57 </a> 55 58 <!-- END next --> 56 59 </td> … … 75 78 <!-- BEGIN comments --> 76 79 <tr align="center" valign="middle"> 77 <td colspan="5"> 78 {T_START}100%{T_BEGIN} 79 <table style="width:100%;"> 80 <tr align="center"> 81 <td> 82 <div class="commentsTitle"> 80 <td colspan="3" class="table2"> 81 <div class="commentTitle"> 83 82 [{comments.NB_COMMENT}] {L_COMMENT_TITLE} 84 83 </div> 85 84 <div class="commentsNavigationBar">{comments.NAV_BAR}</div> 85 <table class="tablecompact"> 86 86 <!-- BEGIN comment --> 87 <table class="tableComment"> 88 <tr> 89 <td rowspan="2" valign="top" class="cellAuthor"> 90 <div class="commentsAuthor">{comments.comment.COMMENT_AUTHOR}</div> 91 </td> 92 <td align="right" class="cellInfo"> 93 <div class="commentsInfos">{comments.comment.COMMENT_DATE} 94 <!-- BEGIN delete --> 95 <a href="{comments.comment.delete.U_COMMENT_DELETE}" title="{L_DELETE_COMMENT}"><img src="{T_DEL_IMG}" style="border:none;margin-left:5px;" alt="[{L_DELETE}]"/></a> 96 <!-- END delete --> 97 </div> 98 </td> 99 </tr> 100 <tr> 101 <td> 102 <div class="commentsContent">{comments.comment.COMMENT}</div> 103 </td> 104 </tr> 105 </table> 87 <tr class="throw"> 88 <td class="throw"> 89 {comments.comment.COMMENT_AUTHOR} 90 </td> 91 <td colspan="2" class="commentDate"> 92 {comments.comment.COMMENT_DATE} 93 <!-- BEGIN delete --> 94 <a href="{comments.comment.delete.U_COMMENT_DELETE}" title="{L_DELETE_COMMENT}"><img src="{T_DEL_IMG}" style="border:none;vertical-align:middle; margin-left:5px;" alt="[{L_DELETE}]"/></a> 95 <!-- END delete --> 96 </td> 97 </tr> 98 <tr class="row1"> 99 <td class="comment" colspan="3">{comments.comment.COMMENT}</td> 100 </tr> 106 101 <!-- END comment --> 107 <div class="commentsNavigationBar">{comments.NAV_BAR}</div>108 </td>109 </tr>110 </table>111 102 <!-- BEGIN add_comment --> 112 <form method="post" action="{U_ADD_COMMENT}"> 113 <table style="width:100%;"> 114 <tr align="center"> 115 <td> 116 <div class="commentsTitle">{L_ADD_COMMENT}</div> 103 <tr class="throw"> 104 <td colspan="3">{L_ADD_COMMENT}</td> 105 </tr> 106 <form method="post" action="{U_ADD_COMMENT}"> 107 <tr class="row1"> 108 <td class="comment" > 117 109 <!-- BEGIN author_field --> 118 <div class="menu">{L_AUTHOR} : <input type="text" name="author" style="margin-top:5px;"/></div> 110 {L_AUTHOR}</td><td colspan="2"><input type="text" name="author" /> 111 </td></tr> 112 <tr class="row1"> 113 <td class="comment" > 119 114 <!-- END author_field --> 120 115 <!-- BEGIN author_known --> 121 <input type="hidden" name="author" value="{comments.add_comment.author_known.KNOWN_AUTHOR}" />116 <input type="hidden" name="author" value="{comments.add_comment.author_known.KNOWN_AUTHOR}" /> 122 117 <!-- END author_known --> 123 <textarea name="content" rows="10" cols="50" style="overflow:auto;width:450px;margin:10px;"></textarea><br /> 124 <input type="submit" value="{L_SUBMIT}" class="bouton" /> 125 </td> 126 </tr> 127 </table> 128 </form> 118 {L_COMMENT}</td> 119 <td style="width:100%;"> 120 <input name="content" type="text" maxlength="200" style="width:100%;" value="" /></td><td> 121 <input type="submit" value="{L_SUBMIT}" class="bouton" /> 122 </td> 123 </tr> 124 </form> 125 </table> 129 126 <!-- END add_comment --> 130 {T_END}131 127 </td> 132 128 </tr> -
trunk/template/default/profile.tpl
r364 r393 1 <table style="width:100%;height:100%"> 2 <tr align="center" valign="middle"> 3 <td> 4 {T_START}1px{T_BEGIN} 5 <div class="titrePage">{L_TITLE}</div> 6 {T_END} 7 <div style="margin-bottom:20px"></div> 8 {T_START}50%{T_BEGIN} 9 <form method="post" action="{F_ACTION}"> 10 <table style="width:100%;margin-top:10px;margin-bottom:10px;"> 11 <tr align="center" valign="middle"> 12 <td> 13 <table width="80%"> 14 <!-- BEGIN errors --> 15 <tr> 16 <td colspan="2"> 17 <div class="errors"> 18 <ul> 19 <!-- BEGIN error --> 20 <li>{errors.error.ERROR}</li> 21 <!-- END error --> 22 </ul> 23 </div> 24 </td> 25 </tr> 26 <!-- END errors --> 27 <!-- BEGIN select --> 28 <tr> 29 <td class="menu">{select.F_LABEL}</td> 30 <td class="menu"> 31 <select name="{select.F_NAME}"> 32 {select.F_OPTIONS} 33 </select> 34 </td> 35 </tr> 36 <!-- END select --> 37 <!-- BEGIN text --> 38 <tr> 39 <td class="menu">{text.F_LABEL}</td> 40 <td class="menu"> 41 <input type="text" name="{text.F_NAME}" value="{text.F_VALUE}" /> 42 </td> 43 </tr> 44 <!-- END text --> 45 <!-- BEGIN radio --> 46 <tr> 47 <td class="menu">{radio.F_LABEL}</td> 48 <td class="menu"> 49 {radio.F_OPTIONS} 50 </td> 51 </tr> 52 <!-- END radio --> 53 <tr> 54 <td colspan="2"> </td> 55 </tr> 56 <tr> 57 <td class="menu">{L_NEW} {L_PASSWORD} <input type="checkbox" name="use_new_pwd" value="1" /></td> 58 <td class="menu"><input type="password" name="password" value="" /></td> 59 </tr> 60 <tr> 61 <td class="menu">{L_CONFIRM}</td> 62 <td class="menu"><input type="password" name="passwordConf" value="" /></td> 63 </tr> 64 <!-- BEGIN cookie --> 65 <tr> 66 <td colspan="2"> </td> 67 </tr> 68 <tr> 69 <td class="menu">{L_COOKIE} <input type="checkbox" name="create_cookie" value="1" /></td> 70 <td class="menu"> 71 <select name="cookie_expiration"> 72 <!-- BEGIN expiration_option --> 73 <option value="{#value}">{#option}</option> 74 <!-- END expiration_option --> 75 </select> 76 </td> 77 </tr> 78 <!-- END cookie --> 79 <tr> 80 <td colspan="2"> </td> 81 </tr> 82 <tr> 83 <td colspan="2" align="center"> 84 <input type="submit" name="submit" value="{L_SUBMIT}" style="margin:5px;"/> 85 </td> 86 </tr> 87 </table> 88 </td> 89 </tr> 90 </table> 91 </form> 92 {T_END} 93 </td> 94 </tr> 95 </table> 1 <div class="titrePage">{L_TITLE}</div> 2 <form method="post" action="{F_ACTION}"> 3 <!-- BEGIN errors --> 4 <div class="errors"> 5 <ul> 6 <!-- BEGIN error --> 7 <li>{errors.error.ERROR}</li> 8 <!-- END error --> 9 </ul> 10 </div> 11 <!-- END errors --> 12 <table width="70%" align="center"> 13 <tr> 14 <td width="60%">{L_NB_IMAGE_LINE}</td> 15 <td width="40%"><input type="text" size="3" maxlength="2" name="nb_image_line" value="{NB_IMAGE_LINE}" /></td> 16 </tr> 17 <tr> 18 <td>{L_NB_ROW_PAGE}</td> 19 <td><input type="text" size="3" maxlength="2" name="nb_line_page" value="{NB_ROW_PAGE}" /></td> 20 </tr> 21 <tr> 22 <td>{L_STYLE_SELECT}</td> 23 <td>{STYLE_SELECT}</td> 24 </tr> 25 <tr> 26 <td>{L_LANG_SELECT}</td> 27 <td>{LANG_SELECT}</td> 28 </tr> 29 <tr> 30 <td>{L_SHORT_PERIOD}</td> 31 <td><input type="text" size="3" maxlength="2" name="short_period" value="{SHORT_PERIOD}" /></td> 32 </tr> 33 <tr> 34 <td>{L_LONG_PERIOD}</td> 35 <td><input type="text" size="3" maxlength="2" name="long_period" value="{LONG_PERIOD}" /></td> 36 </tr> 37 <tr> 38 <td>{L_EXPAND_TREE}</td> 39 <td><input type="radio" class="radio" name="expand" value="true" {EXPAND_TREE_YES} />{L_YES} 40 <input type="radio" class="radio" name="expand" value="false" {EXPAND_TREE_NO} />{L_NO}</td> 41 </tr> 42 <tr> 43 <td>{L_NB_COMMENTS}</td> 44 <td><input type="radio" class="radio" name="show_nb_comments" value="true" {NB_COMMENTS_YES} />{L_YES} 45 <input type="radio" class="radio" name="show_nb_comments" value="false" {NB_COMMENTS_NO} />{L_NO}</td> 46 </tr> 47 <!-- BEGIN text --> 48 <tr> 49 <td class="menu">{text.F_LABEL}</td> 50 <td class="menu"> 51 <input type="text" name="{text.F_NAME}" value="{text.F_VALUE}" /> 52 </td> 53 </tr> 54 <!-- END text --> 55 <tr> 56 <td colspan="2"> </td> 57 </tr> 58 <tr> 59 <td class="menu">{L_NEW} {L_PASSWORD} <input type="checkbox" name="use_new_pwd" value="1" /></td> 60 <td class="menu"><input type="password" name="password" value="" /></td> 61 </tr> 62 <tr> 63 <td class="menu">{L_CONFIRM}</td> 64 <td class="menu"><input type="password" name="passwordConf" value="" /></td> 65 </tr> 66 <tr> 67 <td colspan="2"> </td> 68 </tr> 69 <tr> 70 <td colspan="2" align="center"> 71 <input type="submit" name="submit" value="{L_SUBMIT}" class="bouton" /> 72 </td> 73 </tr> 74 </table> 75 </form> -
trunk/template/default/register.tpl
r365 r393 1 <table style="width:100%;height:100%"> 2 <tr align="center" valign="middle"> 3 <td> 4 {T_START}1px{T_BEGIN} 5 <div class="titrePage">{L_TITLE}</div> 6 {T_END} 7 <div style="margin-bottom:20px"></div> 8 {T_START}50%{T_BEGIN} 9 <form method="post" action="{F_ACTION}"> 10 <table style="width:80%;margin-top:10px;margin-bottom:10px;margin-left:auto;margin-right:auto;"> 11 <!-- BEGIN errors --> 12 <tr> 13 <td colspan="2"> 14 <div class="errors"> 15 <ul> 16 <!-- BEGIN error --> 17 <li>{errors.error.ERROR}</li> 18 <!-- END error --> 19 </ul> 20 </div> 21 </td> 22 </tr> 23 <!-- END errors --> 24 <tr> 25 <td class="menu">{L_USERNAME}</td> 26 <td class="menu"> 27 <input type="text" name="login" value="{F_LOGIN}" /> 28 </td> 29 </tr> 30 <tr> 31 <td class="menu">{L_PASSWORD}</td> 32 <td class="menu"> 33 <input type="password" name="password" /> 34 </td> 35 </tr> 36 <tr> 37 <td class="menu">{L_CONFIRM_PASSWORD}</td> 38 <td class="menu"> 39 <input type="password" name="password_conf" /> 40 </td> 41 </tr> 42 <tr> 43 <td class="menu">{L_EMAIL}</td> 44 <td class="menu"> 45 <input type="text" name="mail_address" value="{F_EMAIL}" /> 46 </td> 47 </tr> 48 <tr> 49 <td colspan="2"> </td> 50 </tr> 51 <tr> 52 <tr> 53 <td colspan="2" align="center"> 54 <input type="submit" name="submit" value="{L_SUBMIT}" style="margin:5px;"/> 55 </td> 56 </tr> 57 <tr> 58 <td colspan="2" align="center"> 59 <a href="./category.php">[ {L_GUEST} ]</a> 60 </td> 61 </tr> 62 </table> 63 </form> 64 {T_END} 65 </td> 66 </tr> 67 </table> 1 <div class="titrePage">{L_TITLE}</div> 2 <form method="post" action="{F_ACTION}"> 3 <table style="width:60%;" align="center"> 4 <!-- BEGIN errors --> 5 <tr> 6 <td colspan="2"> 7 <div class="errors"> 8 <ul> 9 <!-- BEGIN error --> 10 <li>{errors.error.ERROR}</li> 11 <!-- END error --> 12 </ul> 13 </div> 14 </td> 15 </tr> 16 <!-- END errors --> 17 <tr> 18 <td width="60%">{L_USERNAME}</td> 19 <td width="40%"> 20 <input type="text" name="login" value="{F_LOGIN}" /> 21 </td> 22 </tr> 23 <tr> 24 <td >{L_PASSWORD}</td> 25 <td > 26 <input type="password" name="password" /> 27 </td> 28 </tr> 29 <tr> 30 <td >{L_CONFIRM_PASSWORD}</td> 31 <td > 32 <input type="password" name="password_conf" /> 33 </td> 34 </tr> 35 <tr> 36 <td >{L_EMAIL}</td> 37 <td > 38 <input type="text" name="mail_address" value="{F_EMAIL}" /> 39 </td> 40 </tr> 41 <tr> 42 <td colspan="2"> </td> 43 </tr> 44 <tr> 45 <tr> 46 <td colspan="2" align="center"> 47 <input type="submit" name="submit" value="{L_SUBMIT}" class="bouton" /> 48 </td> 49 </tr> 50 <tr> 51 <td colspan="2" align="center"> 52 <a href="./category.php">[ {L_GUEST} ]</a> 53 </td> 54 </tr> 55 </table> 56 </form> -
trunk/template/default/search.tpl
r355 r393 1 <table style="width:100%;height:100%"> 2 <tr align="center" valign="middle"> 3 <td> 4 {T_START}1px{T_BEGIN} 5 <div class="titrePage">{L_TITLE}</div> 6 {T_END} 7 <div style="margin-bottom:5px;"> </div> 8 {T_START}50%{T_BEGIN} 9 <div style="margin-left:auto;margin-right:auto;text-align:center;"> 10 <form method="post" action="{F_ACTION}"> 11 <table style="width:80%;margin-left:auto;margin-right:auto;"> 12 <!-- BEGIN errors --> 13 <tr> 14 <td colspan="2"> 15 <div class="errors"> 16 <ul> 17 <!-- BEGIN error --> 18 <li>{errors.error.ERROR}</li> 19 <!-- END error --> 20 </ul> 21 </div> 22 </td> 23 </tr> 24 <!-- END errors --> 25 <tr> 26 <td colspan="2"> 27 <div style="margin-bottom:10px;"> </div> 28 </td> 29 </tr> 30 <tr> 31 <td class="menu">{L_SEARCH}</td> 32 <td class="menu"> 33 <input type="text" name="search" size="40" value="{F_TEXT_VALUE}" /><br /> 34 <input class="radio" type="radio" name="mode" value="OR" checked="checked" /> {L_SEARCH_OR} 35 <input class="radio" type="radio" name="mode" value="AND" /> {L_SEARCH_AND} 36 </td> 37 </tr> 38 <tr> 39 <td align="center" colspan="2"> 40 <input type="submit" name="submit" value="{L_SUBMIT}" class="bouton" style="margin:10px;" /> 41 </td> 42 </tr> 43 <tr> 44 <td align="center" colspan="2"> 45 <a href="{U_HOME}">[ {L_RETURN} ]</a> 46 </td> 47 </tr> 48 <tr> 49 <td colspan="2"> 50 <div style="margin-top:10px;">* : {L_COMMENTS}</div> 51 </td> 52 </tr> 53 </table> 54 </form> 55 </div> 56 {T_END} 57 </td> 58 </tr> 59 </table> 1 <div class="titrePage">{L_TITLE}</div> 2 <BR /> 3 <form method="post" action="{F_ACTION}" style="text-align:center"> 4 <!-- BEGIN errors --> 5 <div class="errors"> 6 <ul> 7 <!-- BEGIN error --> 8 <li>{errors.error.ERROR}</li> 9 <!-- END error --> 10 </ul> 11 </div> 12 <!-- END errors --> 13 {L_SEARCH} 14 <input type="text" name="search" size="40" value="{F_TEXT_VALUE}" /><br /> 15 <input class="radio" type="radio" name="mode" value="OR" checked="checked" /> {L_SEARCH_OR} 16 <input class="radio" type="radio" name="mode" value="AND" /> {L_SEARCH_AND} <BR /> 17 <input type="submit" name="submit" value="{L_SUBMIT}" class="bouton" /><BR /> 18 <a href="{U_HOME}">[ {L_RETURN} ]</a><BR /> 19 <div style="margin-top:10px;">* : {L_COMMENTS}</div> 20 </form>
Note: See TracChangeset
for help on using the changeset viewer.