- Timestamp:
- Feb 19, 2004, 1:31:09 AM (20 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 2 deleted
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/about.php
r362 r364 27 27 28 28 //----------------------------------------------------------- include 29 $phpwg_root_path = './';30 include_once( $phpwg_root_path.'include/common.inc.php' );29 define('PHPWG_ROOT_PATH','./'); 30 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 31 31 //----------------------------------------------------- template initialization 32 32 // -
trunk/admin.php
r362 r364 27 27 28 28 //----------------------------------------------------------- include 29 $phpwg_root_path = './';30 include_once( $phpwg_root_path.'include/common.inc.php' );29 define('PHPWG_ROOT_PATH','./'); 30 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 31 31 include_once( './admin/include/isadmin.inc.php' ); 32 32 //----------------------------------------------------- template initialization … … 55 55 if ( !is_numeric( $_GET['user_id'] ) ) $_GET['user_id'] = -1; 56 56 $query = 'SELECT status,username'; 57 $query.= ' FROM '. PREFIX_TABLE.'users';57 $query.= ' FROM '.USERS_TABLE; 58 58 $query.= ' WHERE id = '.$_GET['user_id']; 59 59 $query.= ';'; -
trunk/admin/cat_modify.php
r362 r364 100 100 // checking users favorites 101 101 $query = 'SELECT id'; 102 $query.= ' FROM '. PREFIX_TABLE.'users';102 $query.= ' FROM '.USERS_TABLE; 103 103 $query.= ';'; 104 104 $result = mysql_query( $query ); -
trunk/admin/cat_perm.php
r362 r364 76 76 mysql_query( $query ); 77 77 $query = 'SELECT id'; 78 $query.= ' FROM '. PREFIX_TABLE.'users';78 $query.= ' FROM '.USERS_TABLE; 79 79 $query.= ';'; 80 80 $result = mysql_query( $query ); … … 138 138 //----------------------------------------------------------------------- users 139 139 $query = 'SELECT id,username,status'; 140 $query.= ' FROM '. PREFIX_TABLE.'users';140 $query.= ' FROM '.USERS_TABLE; 141 141 // only the webmaster can modify webmaster's permissions 142 142 if ( $user['username'] != $conf['webmaster'] ) -
trunk/admin/configuration.php
r362 r364 218 218 mysql_query( $query ); 219 219 220 $query = 'UPDATE '. PREFIX_TABLE.'users';220 $query = 'UPDATE '.USERS_TABLE; 221 221 $query.= ' SET'; 222 222 foreach ( $default_user_infos as $i => $default_user_info ) { … … 258 258 259 259 $query = 'SELECT '.implode( ',', $default_user_infos ); 260 $query.= ' FROM '. PREFIX_TABLE.'users';260 $query.= ' FROM '.USERS_TABLE; 261 261 $query.= " WHERE username = 'guest'"; 262 262 $query.= ';'; -
trunk/admin/group_perm.php
r362 r364 62 62 // checking users favorites 63 63 $query = 'SELECT id'; 64 $query.= ' FROM '. PREFIX_TABLE.'users';64 $query.= ' FROM '.USERS_TABLE; 65 65 $query.= ';'; 66 66 $result = mysql_query( $query ); -
trunk/admin/include/functions.php
r362 r364 283 283 284 284 // destruction of the user 285 $query = 'DELETE FROM '. PREFIX_TABLE.'users';285 $query = 'DELETE FROM '.USERS_TABLE; 286 286 $query.= ' WHERE id = '.$user_id; 287 287 $query.= ';'; … … 323 323 { 324 324 $query = 'SELECT status,forbidden_categories'; 325 $query.= ' FROM '. PREFIX_TABLE.'users';325 $query.= ' FROM '.USERS_TABLE; 326 326 $query.= ' WHERE id = '.$user_id; 327 327 $query.= ';'; … … 853 853 854 854 $query = 'SELECT id'; 855 $query.= ' FROM '. PREFIX_TABLE.'users';855 $query.= ' FROM '.USERS_TABLE; 856 856 $query.= ';'; 857 857 $result = mysql_query( $query ); … … 902 902 903 903 $query = 'SELECT id'; 904 $query.= ' FROM '. PREFIX_TABLE.'users';904 $query.= ' FROM '.USERS_TABLE; 905 905 $query.= ', '.PREFIX_TABLE.'user_group'; 906 906 $query.= ' WHERE group_id = '.$group_id; … … 927 927 928 928 // update the users.forbidden_categories in database 929 $query = 'UPDATE '. PREFIX_TABLE.'users';929 $query = 'UPDATE '.USERS_TABLE; 930 930 $query.= ' SET forbidden_categories = '; 931 931 if ( count( $restrictions ) > 0 ) … … 951 951 952 952 $query = 'SELECT status'; 953 $query.= ' FROM '. PREFIX_TABLE.'users';953 $query.= ' FROM '.USERS_TABLE; 954 954 $query.= ' WHERE id = '.$user_id; 955 955 $query.= ';'; -
trunk/admin/include/isadmin.inc.php
r362 r364 29 29 30 30 $isadmin = true; 31 include_once( './language/'.$user['language'].'/lang_admin.php' );32 33 31 if ( $user['status'] != 'admin' ) 34 32 { -
trunk/admin/user_list.php
r362 r364 62 62 { 63 63 $query = 'SELECT username'; 64 $query.= ' FROM '. PREFIX_TABLE.'users';64 $query.= ' FROM '.USERS_TABLE; 65 65 $query.= ' WHERE id = '.$_GET['delete']; 66 66 $query.= ';'; … … 86 86 { 87 87 $query = 'SELECT COUNT(*) AS nb_result'; 88 $query.= ' FROM '. PREFIX_TABLE.'users';88 $query.= ' FROM '.USERS_TABLE; 89 89 $query.= ' WHERE id = '.$_GET['delete']; 90 90 $query.= ';'; … … 132 132 133 133 $query = 'SELECT id,username,status,mail_address'; 134 $query.= ' FROM '. PREFIX_TABLE.'users';134 $query.= ' FROM '.USERS_TABLE; 135 135 $query.= ' ORDER BY status ASC, username ASC'; 136 136 $query.= ';'; … … 234 234 $mails = array(); 235 235 $query = 'SELECT id,mail_address'; 236 $query.= ' FROM '. PREFIX_TABLE.'users';236 $query.= ' FROM '.USERS_TABLE; 237 237 $query.= ';'; 238 238 $result = mysql_query( $query ); -
trunk/admin/user_modify.php
r362 r364 42 42 $query = 'select'; 43 43 $query.= ' username,status,mail_address'; 44 $query.= ' from '. PREFIX_TABLE.'users';44 $query.= ' from '.USERS_TABLE; 45 45 $query.= ' where id = '.$_GET['user_id']; 46 46 $query.= ';'; -
trunk/category.php
r362 r364 27 27 28 28 //--------------------------------------------------------------------- include 29 $phpwg_root_path = './';30 include_once( $phpwg_root_path.'include/common.inc.php' );29 define('PHPWG_ROOT_PATH','./'); 30 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 31 31 //---------------------------------------------------------------------- logout 32 32 if ( isset( $_GET['act'] ) … … 190 190 } 191 191 192 // favoritesmanagement192 // authentification mode management 193 193 if ( !$user['is_the_guest'] ) 194 194 { … … 199 199 $row = mysql_fetch_array( $result ); 200 200 $template->assign_block_vars('favorites', array ('NB_FAV'=>$row['count']) ); 201 $template->assign_block_vars('username', array()); 201 202 } 202 203 //--------------------------------------------------------------------- summary -
trunk/comments.php
r362 r364 27 27 28 28 //----------------------------------------------------------- include 29 $phpwg_root_path = './';30 include_once( $phpwg_root_path.'include/common.inc.php' );29 define('PHPWG_ROOT_PATH','./'); 30 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 31 31 32 32 //--------------------------------------------------- number of days to display -
trunk/identification.php
r362 r364 27 27 28 28 //----------------------------------------------------------- include 29 $phpwg_root_path = './';30 include_once( $phpwg_root_path.'include/common.inc.php' );29 define('PHPWG_ROOT_PATH','./'); 30 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 31 31 32 32 //-------------------------------------------------------------- identification -
trunk/include/common.inc.php
r362 r364 25 25 // | USA. | 26 26 // +-----------------------------------------------------------------------+ 27 28 // determine the initial instant to indicate the generation time of this 29 // page 27 if( !defined("PHPWG_ROOT_PATH") ) 28 { 29 die ("Hacking attempt!"); 30 } 31 // determine the initial instant to indicate the generation time of this page 30 32 $t1 = explode( ' ', microtime() ); 31 33 $t2 = explode( '.', $t1[0] ); … … 110 112 $lang = array(); 111 113 114 115 include(PHPWG_ROOT_PATH .'config.php'); 112 116 if( !defined("PHPWG_INSTALLED") ) 113 117 { … … 116 120 } 117 121 118 include( $phpwg_root_path.'include/constants.php' ); 119 include( $phpwg_root_path.'include/functions.inc.php' ); 120 include( $phpwg_root_path.'include/template.php' ); 121 include( $phpwg_root_path.'include/vtemplate.class.php' ); 122 include( $phpwg_root_path.'include/config.inc.php' ); 122 123 include(PHPWG_ROOT_PATH . 'include/constants.php'); 124 include(PHPWG_ROOT_PATH . 'include/functions.inc.php'); 125 include(PHPWG_ROOT_PATH . 'include/template.php'); 126 include(PHPWG_ROOT_PATH . 'include/vtemplate.class.php'); 127 include(PHPWG_ROOT_PATH . 'include/config.inc.php'); 123 128 124 129 // … … 198 203 //--------------- 199 204 200 include( $phpwg_root_path. 'include/user.inc.php');205 include(PHPWG_ROOT_PATH . 'include/user.inc.php'); 201 206 202 207 // displaying the username in the language of the connected user, instead of -
trunk/include/config.inc.php
r363 r364 55 55 $conf['max_LOV_categories'] = 50; 56 56 57 $conf['default_lang'] = 'fr ancais';57 $conf['default_lang'] = 'fr_FR'; 58 58 $conf['default_style'] = 'default'; 59 59 -
trunk/include/functions.inc.php
r362 r364 261 261 function get_languages( $rep_language ) 262 262 { 263 global $lang; 263 264 $languages = array(); 264 265 $i = 0; … … 267 268 while ( $file = readdir ( $opendir ) ) 268 269 { 269 if ( is_dir ( $rep_language.$file )&& !substr_count($file,'.') )270 if ( is_dir ( $rep_language.$file )&& !substr_count($file,'.') && isset($lang['lang'][$file])) 270 271 { 271 $languages[$i++] =$ file;272 $languages[$i++] =$lang['lang'][$file]; 272 273 } 273 274 } … … 388 389 // retrieving all administrators 389 390 $query = 'SELECT username,mail_address,language'; 390 $query.= ' FROM '. PREFIX_TABLE.'users';391 $query.= ' FROM '.USERS_TABLE; 391 392 $query.= " WHERE status = 'admin'"; 392 393 $query.= ' AND mail_address IS NOT NULL'; … … 461 462 } 462 463 463 //464 // Initialise user settings on page load465 function init_userprefs($userdata)466 {467 global $conf, $template, $lang, $phpwg_root_path;468 469 $style = $conf['default_style'];470 if ( !$userdata['is_the_guest'] )471 {472 if ( !empty($userdata['language']))473 {474 $conf['default_lang'] = $userdata['language'];475 }476 if ( !empty($userdata['template']))477 {478 $style = $userdata['template'];479 }480 }481 482 if ( !file_exists(@realpath($phpwg_root_path . 'language/' . $conf['default_lang'] . '/lang_main.php')) )483 {484 $conf['default_lang'] = 'english';485 }486 487 include_once($phpwg_root_path . 'language/' . $conf['default_lang'] . '/lang_main.php');488 $template= setup_style($style);489 490 return;491 }492 493 function setup_style($style)494 {495 global $phpwg_root_path;496 497 $template_path = 'template/' ;498 $template_name = $style ;499 500 $template = new Template($phpwg_root_path . $template_path . $template_name);501 return $template;502 }503 504 function encode_ip($dotquad_ip)505 {506 $ip_sep = explode('.', $dotquad_ip);507 return sprintf('%02x%02x%02x%02x', $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]);508 }509 510 function decode_ip($int_ip)511 {512 $hexipbang = explode('.', chunk_split($int_ip, 2, '.'));513 return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]);514 }515 516 464 ?> -
trunk/include/functions_session.inc.php
r362 r364 76 76 // 2. retrieving id of the username given in parameter 77 77 $query = 'select id'; 78 $query.= ' from '. PREFIX_TABLE.'users';78 $query.= ' from '.USERS_TABLE; 79 79 $query.= " where username = '".$username."';"; 80 80 $row = mysql_fetch_array( mysql_query( $query ) ); -
trunk/include/functions_user.inc.php
r362 r364 67 67 { 68 68 $query = 'SELECT id'; 69 $query.= ' FROM '. PREFIX_TABLE.'users';69 $query.= ' FROM '.USERS_TABLE; 70 70 $query.= " WHERE username = '".$login."'"; 71 71 $query.= ';'; … … 93 93 $query.= $infos[$i]; 94 94 } 95 $query.= ' FROM '. PREFIX_TABLE.'users';95 $query.= ' FROM '.USERS_TABLE; 96 96 $query.= " WHERE username = 'guest'"; 97 97 $query.= ';'; 98 98 $row = mysql_fetch_array( mysql_query( $query ) ); 99 99 // 2. adding new user 100 $query = 'INSERT INTO '. PREFIX_TABLE.'users';100 $query = 'INSERT INTO '.USERS_TABLE; 101 101 $query.= ' ('; 102 102 $query.= ' username,password,mail_address,status'; … … 120 120 // 3. retrieving the id of the newly created user 121 121 $query = 'SELECT id'; 122 $query.= ' FROM '. PREFIX_TABLE.'users';122 $query.= ' FROM '.USERS_TABLE; 123 123 $query.= " WHERE username = '".$login."';"; 124 124 $row = mysql_fetch_array( mysql_query( $query ) ); … … 189 189 if ( sizeof( $error ) == 0 ) 190 190 { 191 $query = 'UPDATE '. PREFIX_TABLE.'users';191 $query = 'UPDATE '.USERS_TABLE; 192 192 $query.= " SET status = '".$status."'"; 193 193 if ( $use_new_password ) … … 225 225 } 226 226 } 227 228 // 229 // Initialise user settings on page load 230 function init_userprefs($userdata) 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'); 257 258 if ($userdata['status'] == 'admin') 259 { 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 268 $template= setup_style($style); 269 return; 270 } 271 272 function setup_style($style) 273 { 274 $template_path = 'template/' ; 275 $template_name = $style ; 276 277 $template = new Template(PHPWG_ROOT_PATH . $template_path . $template_name); 278 return $template; 279 } 280 281 function encode_ip($dotquad_ip) 282 { 283 $ip_sep = explode('.', $dotquad_ip); 284 return sprintf('%02x%02x%02x%02x', $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]); 285 } 286 287 function decode_ip($int_ip) 288 { 289 $hexipbang = explode('.', chunk_split($int_ip, 2, '.')); 290 return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]); 291 } 227 292 ?> -
trunk/index.php
r362 r364 27 27 28 28 //----------------------------------------------------------- include 29 $phpwg_root_path = './';30 include_once( $phpwg_root_path.'include/common.inc.php' );29 define('PHPWG_ROOT_PATH','./'); 30 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 31 31 if ( $conf['access'] == 'restricted' ) 32 32 { -
trunk/picture.php
r362 r364 26 26 // +-----------------------------------------------------------------------+ 27 27 //----------------------------------------------------------- include 28 $phpwg_root_path = './';29 include_once( $phpwg_root_path.'include/common.inc.php' );28 define('PHPWG_ROOT_PATH','./'); 29 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 30 30 //-------------------------------------------------- access authorization check 31 31 check_cat_id( $_GET['cat'] ); … … 577 577 { 578 578 $query = 'SELECT COUNT(*) AS user_exists'; 579 $query.= ' FROM '. PREFIX_TABLE.'users';579 $query.= ' FROM '.USERS_TABLE; 580 580 $query.= " WHERE username = '".$author."'"; 581 581 $query.= ';'; -
trunk/profile.php
r362 r364 28 28 // customize appearance of the site for a user 29 29 //----------------------------------------------------------- include 30 $phpwg_root_path = './';31 include_once( $phpwg_root_path.'include/common.inc.php' );30 define('PHPWG_ROOT_PATH','./'); 31 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 32 32 //-------------------------------------------------- access authorization check 33 33 check_login_authorization(); … … 86 86 if ( count( $errors ) == 0 ) 87 87 { 88 $query = 'UPDATE '. PREFIX_TABLE.'users';88 $query = 'UPDATE '.USERS_TABLE; 89 89 $query.= ' SET '; 90 90 foreach ( $infos as $i => $info ) { … … 101 101 if ( isset( $_POST['use_new_pwd'] ) ) 102 102 { 103 $query = 'UPDATE '. PREFIX_TABLE.'users';103 $query = 'UPDATE '.USERS_TABLE; 104 104 $query.= " SET password = '".md5( $_POST['password'] )."'"; 105 105 $query.= ' WHERE id = '.$user['id']; … … 112 112 cookie_path() ); 113 113 // update the expiration date of the session 114 $query = 'UPDATE '. PREFIX_TABLE.'sessions';114 $query = 'UPDATE '.SESSIONS_TABLE; 115 115 $query.= ' SET expiration = '.$_POST['cookie_expiration']; 116 116 $query.= " WHERE id = '".$page['session_id']."'"; … … 134 134 include('include/page_header.php'); 135 135 136 $ handle = $vtp->Open( './template/'.$user['template'].'/profile.vtp');136 $template->set_filenames(array('profile'=>'profile.tpl')); 137 137 initialize_template(); 138 $tpl = array( 'customize_title','password','new', 139 'reg_confirm','submit','create_cookie' ); 140 templatize_array( $tpl, 'lang', $handle ); 141 //----------------------------------------------------------------- form action 142 $url = './profile.php'; 143 $vtp->setGlobalVar( $handle, 'form_action', add_session_id( $url ) ); 138 139 $template->assign_vars(array( 140 'L_TITLE' => $lang['customize_title'], 141 'L_PASSWORD' => $lang['password'], 142 'L_NEW' => $lang['new'], 143 'L_CONFIRM' => $lang['reg_confirm'], 144 'L_SUBMIT' => $lang['submit'], 145 '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']) 150 )); 151 144 152 //-------------------------------------------------------------- errors display 145 if ( count( $errors ) != 0 ) 146 { 147 $vtp->addSession( $handle, 'errors' ); 148 foreach ( $errors as $error ) { 149 $vtp->addSession( $handle, 'li' ); 150 $vtp->setVar( $handle, 'li.li', $error ); 151 $vtp->closeSession( $handle, 'li' ); 152 } 153 $vtp->closeSession( $handle, 'errors' ); 154 } 155 //---------------------------------------------------- number of images per row 156 if ( in_array( 'nb_image_line', $infos ) ) 157 { 158 $vtp->addSession( $handle, 'line' ); 159 $vtp->setVar( $handle, 'line.name', $lang['customize_nb_image_per_row'] ); 160 $vtp->addSession( $handle, 'select' ); 161 $vtp->setVar( $handle, 'select.name', 'nb_image_line' ); 162 for ( $i = 0; $i < sizeof( $conf['nb_image_row'] ); $i++ ) 163 { 164 $vtp->addSession( $handle, 'option' ); 165 $vtp->setVar( $handle, 'option.option', $conf['nb_image_row'][$i] ); 166 if ( $conf['nb_image_row'][$i] == $user['nb_image_line'] ) 167 { 168 $vtp->setVar( $handle, 'option.selected', ' selected="selected"' ); 169 } 170 $vtp->closeSession( $handle, 'option' ); 171 } 172 $vtp->closeSession( $handle, 'select' ); 173 $vtp->closeSession( $handle, 'line' ); 174 } 175 //------------------------------------------------------ number of row per page 176 if ( in_array( 'nb_line_page', $infos ) ) 177 { 178 $vtp->addSession( $handle, 'line' ); 179 $vtp->setVar( $handle, 'line.name', $lang['customize_nb_row_per_page'] ); 180 $vtp->addSession( $handle, 'select' ); 181 $vtp->setVar( $handle, 'select.name', 'nb_line_page' ); 182 for ( $i = 0; $i < sizeof( $conf['nb_row_page'] ); $i++ ) 183 { 184 $vtp->addSession( $handle, 'option' ); 185 $vtp->setVar( $handle, 'option.option', $conf['nb_row_page'][$i] ); 186 if ( $conf['nb_row_page'][$i] == $user['nb_line_page'] ) 187 { 188 $vtp->setVar( $handle, 'option.selected', ' selected="selected"' ); 189 } 190 $vtp->closeSession( $handle, 'option' ); 191 } 192 $vtp->closeSession( $handle, 'select' ); 193 $vtp->closeSession( $handle, 'line' ); 194 } 195 //-------------------------------------------------------------------- template 196 if ( in_array( 'template', $infos ) ) 197 { 198 $vtp->addSession( $handle, 'line' ); 199 $vtp->setVar( $handle, 'line.name', $lang['customize_template'] ); 200 $vtp->addSession( $handle, 'select' ); 201 $vtp->setVar( $handle, 'select.name', 'template' ); 202 $option = get_dirs( './template' ); 203 for ( $i = 0; $i < sizeof( $option ); $i++ ) 204 { 205 $vtp->addSession( $handle, 'option' ); 206 $vtp->setVar( $handle, 'option.option', $option[$i] ); 207 if ( $option[$i] == $user['template'] ) 208 { 209 $vtp->setVar( $handle, 'option.selected', ' selected="selected"' ); 210 } 211 $vtp->closeSession( $handle, 'option' ); 212 } 213 $vtp->closeSession( $handle, 'select' ); 214 $vtp->closeSession( $handle, 'line' ); 215 } 216 //-------------------------------------------------------------------- language 217 if ( in_array( 'language', $infos ) ) 218 { 219 $vtp->addSession( $handle, 'line' ); 220 $vtp->setVar( $handle, 'line.name', $lang['customize_language'] ); 221 $vtp->addSession( $handle, 'select' ); 222 $vtp->setVar( $handle, 'select.name', 'language' ); 223 $option = get_languages( './language/' ); 224 for ( $i = 0; $i < sizeof( $option ); $i++ ) 225 { 226 $vtp->addSession( $handle, 'option' ); 227 $vtp->setVar( $handle, 'option.option', $option[$i] ); 228 if( $option[$i] == $user['language'] ) 229 { 230 $vtp->setVar( $handle, 'option.selected', ' selected="selected"' ); 231 } 232 $vtp->closeSession( $handle, 'option' ); 233 } 234 $vtp->closeSession( $handle, 'select' ); 235 $vtp->closeSession( $handle, 'line' ); 236 } 237 //---------------------------------------------------------------- short period 238 if ( in_array( 'short_period', $infos ) ) 239 { 240 $vtp->addSession( $handle, 'line' ); 241 $vtp->setVar( $handle, 'line.name', $lang['customize_short_period'] ); 242 $vtp->addSession( $handle, 'text' ); 243 $vtp->setVar( $handle, 'text.name', 'short_period' ); 244 $vtp->setVar( $handle, 'text.value', $user['short_period'] ); 245 $vtp->closeSession( $handle, 'text' ); 246 $vtp->closeSession( $handle, 'line' ); 247 } 248 //----------------------------------------------------------------- long period 249 if ( in_array( 'long_period', $infos ) ) 250 { 251 $vtp->addSession( $handle, 'line' ); 252 $vtp->setVar( $handle, 'line.name', $lang['customize_long_period'] ); 253 $vtp->addSession( $handle, 'text' ); 254 $vtp->setVar( $handle, 'text.name', 'long_period' ); 255 $vtp->setVar( $handle, 'text.value', $user['long_period'] ); 256 $vtp->closeSession( $handle, 'text' ); 257 $vtp->closeSession( $handle, 'line' ); 258 } 259 //--------------------------------------------------------- max displayed width 260 if ( in_array( 'maxwidth', $infos ) ) 261 { 262 $vtp->addSession( $handle, 'line' ); 263 $vtp->setVar( $handle, 'line.name', $lang['maxwidth'] ); 264 $vtp->addSession( $handle, 'text' ); 265 $vtp->setVar( $handle, 'text.name', 'maxwidth' ); 266 $vtp->setVar( $handle, 'text.value', $user['maxwidth'] ); 267 $vtp->closeSession( $handle, 'text' ); 268 $vtp->closeSession( $handle, 'line' ); 269 } 270 //-------------------------------------------------------- max displayed height 271 if ( in_array( 'maxheight', $infos ) ) 272 { 273 $vtp->addSession( $handle, 'line' ); 274 $vtp->setVar( $handle, 'line.name', $lang['maxheight'] ); 275 $vtp->addSession( $handle, 'text' ); 276 $vtp->setVar( $handle, 'text.name', 'maxheight' ); 277 $vtp->setVar( $handle, 'text.value', $user['maxheight'] ); 278 $vtp->closeSession( $handle, 'text' ); 279 $vtp->closeSession( $handle, 'line' ); 280 } 281 //---------------------------------------------------------------- mail address 282 if ( in_array( 'mail_address', $infos ) ) 283 { 284 $vtp->addSession( $handle, 'line' ); 285 $vtp->setVar( $handle, 'line.name', $lang['mail_address'] ); 286 $vtp->addSession( $handle, 'text' ); 287 $vtp->setVar( $handle, 'text.name', 'mail_address' ); 288 $vtp->setVar( $handle, 'text.value', $user['mail_address'] ); 289 $vtp->closeSession( $handle, 'text' ); 290 $vtp->closeSession( $handle, 'line' ); 291 } 292 //----------------------------------------------------- expand all categories ? 293 if ( in_array( 'expand', $infos ) ) 294 { 295 $vtp->addSession( $handle, 'line' ); 296 $vtp->setVar( $handle, 'line.name', $lang['customize_expand'] ); 297 $vtp->addSession( $handle, 'group' ); 298 $vtp->addSession( $handle, 'radio' ); 299 $vtp->setVar( $handle, 'radio.name', 'expand' ); 300 $vtp->setVar( $handle, 'radio.value', 'true' ); 301 $checked = ''; 302 if ( $user['expand'] ) 303 { 304 $checked = ' checked="checked"'; 305 } 306 $vtp->setVar( $handle, 'radio.checked', $checked ); 307 $vtp->setVar( $handle, 'radio.option', $lang['yes'] ); 308 $vtp->closeSession( $handle, 'radio' ); 309 $vtp->addSession( $handle, 'radio' ); 310 $vtp->setVar( $handle, 'radio.name', 'expand' ); 311 $vtp->setVar( $handle, 'radio.value', 'false' ); 312 $checked = ''; 313 if ( !$user['expand'] ) 314 { 315 $checked = ' checked="checked"'; 316 } 317 $vtp->setVar( $handle, 'radio.checked', $checked ); 318 $vtp->setVar( $handle, 'radio.option', $lang['no'] ); 319 $vtp->closeSession( $handle, 'radio' ); 320 $vtp->closeSession( $handle, 'group' ); 321 $vtp->closeSession( $handle, 'line' ); 322 } 323 //---------------------------------- show number of comments on thumbnails page 324 if ( in_array( 'show_nb_comments', $infos ) ) 325 { 326 $vtp->addSession( $handle, 'line' ); 327 $vtp->setVar( $handle, 'line.name', $lang['customize_show_nb_comments'] ); 328 $vtp->addSession( $handle, 'group' ); 329 $vtp->addSession( $handle, 'radio' ); 330 $vtp->setVar( $handle, 'radio.name', 'show_nb_comments' ); 331 $vtp->setVar( $handle, 'radio.value', 'true' ); 332 $checked = ''; 333 if ( $user['show_nb_comments'] ) 334 { 335 $checked = ' checked="checked"'; 336 } 337 $vtp->setVar( $handle, 'radio.checked', $checked ); 338 $vtp->setVar( $handle, 'radio.option', $lang['yes'] ); 339 $vtp->closeSession( $handle, 'radio' ); 340 $vtp->addSession( $handle, 'radio' ); 341 $vtp->setVar( $handle, 'radio.name', 'show_nb_comments' ); 342 $vtp->setVar( $handle, 'radio.value', 'false' ); 343 $checked = ''; 344 if ( !$user['show_nb_comments'] ) 345 { 346 $checked = ' checked="checked"'; 347 } 348 $vtp->setVar( $handle, 'radio.checked', $checked ); 349 $vtp->setVar( $handle, 'radio.option', $lang['no'] ); 350 $vtp->closeSession( $handle, 'radio' ); 351 $vtp->closeSession( $handle, 'group' ); 352 $vtp->closeSession( $handle, 'line' ); 353 } 153 if ( sizeof( $errors ) != 0 ) 154 { 155 $template->assign_block_vars('errors',array()); 156 for ( $i = 0; $i < sizeof( $errors ); $i++ ) 157 { 158 $template->assign_block_vars('errors.error',array('ERROR'=>$errors[$i])); 159 } 160 } 161 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 $template->assign_block_vars('text',array( 199 'F_LABEL'=>$lang['maxwidth'], 200 'F_NAME'=>'maxwidth', 201 'F_VALUE'=>$user['maxwidth'] 202 )); 203 204 $template->assign_block_vars('text',array( 205 'F_LABEL'=>$lang['maxheight'], 206 'F_NAME'=>'maxheight', 207 'F_VALUE'=>$user['maxheight'] 208 )); 209 210 $template->assign_block_vars('text',array( 211 'F_LABEL'=>$lang['mail_address'], 212 'F_NAME'=>'mail_address', 213 'F_VALUE'=>$user['mail_address'] 214 )); 215 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 354 226 //--------------------------------------------------------------- create cookie 355 227 if ( $conf['authorize_cookies'] ) … … 375 247 } 376 248 //----------------------------------------------------------- html code display 377 $code = $vtp->Display( $handle, 0 ); 378 echo $code; 249 $template->pparse('profile'); 379 250 include('include/page_tail.php'); 380 251 ?> -
trunk/register.php
r362 r364 27 27 28 28 //----------------------------------------------------------- include 29 $phpwg_root_path = './';30 include_once( $phpwg_root_path.'incelude/common.inc.php' );29 define('PHPWG_ROOT_PATH','./'); 30 include_once( PHPWG_ROOT_PATH.'incelude/common.inc.php' ); 31 31 //-------------------------------------------------- access authorization check 32 32 if ( $conf['access'] == "restricted" ) -
trunk/search.php
r362 r364 27 27 28 28 //----------------------------------------------------------- include 29 $phpwg_root_path = './';30 include_once( $phpwg_root_path.'include/common.inc.php' );29 define('PHPWG_ROOT_PATH','./'); 30 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 31 31 //-------------------------------------------------- access authorization check 32 32 check_login_authorization(); -
trunk/template/default/about.tpl
r351 r364 2 2 <tr align="center" valign="middle"> 3 3 <td> 4 { F_START}1px{F_BEGIN}4 {T_START}1px{T_BEGIN} 5 5 <div class="titrePage">{PAGE_TITLE}</div> 6 { F_END}6 {T_END} 7 7 <div style="margin-bottom:5px;"> </div> 8 { F_START}50%{F_BEGIN}8 {T_START}50%{T_BEGIN} 9 9 <div class="menu" style="white-space:normal;margin:10px;"> 10 10 {L_ABOUT} 11 11 </div> 12 { F_END}12 {T_END} 13 13 <div style="text-align:center;margin:5px;"> 14 14 <a href="{U_RETURN}">{L_RETURN}</a> -
trunk/template/default/category.tpl
r355 r364 97 97 {T_START}1%{T_BEGIN} 98 98 <div class="info"> 99 <!-- BEGIN username --> 99 100 {L_USER} {USERNAME}<br /> 100 {L_RECENT_IMG} {S_SHORT_PERIOD} {L_DAYS} 101 <!-- END username --> 102 {L_RECENT_IMAGE} {S_SHORT_PERIOD} {L_DAYS} 101 103 {T_SHORT}<br /> 102 104 {L_RECENT_IMAGE} {S_LONG_PERIOD} {L_DAYS} -
trunk/template/default/htmlfunctions.inc.php
r362 r364 233 233 } 234 234 } 235 236 function make_jumpbox($value, $selected, $usekeys=false) 237 { 238 $boxstring = ''; 239 $nb = sizeof( $value); 240 $keys = ($usekeys?array_keys($value):$value); 241 $value = ($usekeys?array_values($value):$value); 242 for ( $i = 0; $i < $nb; $i++ ) 243 { 244 $boxstring .= '<option value="'.$keys[$i].'"'; 245 if ($selected == $keys[$i]) $boxstring .=' selected="selected"'; 246 $boxstring .='>'.$value[$i].'</option>'; 247 } 248 return $boxstring; 249 } 250 251 function make_radio($name, $value, $selected, $usekeys=false) 252 { 253 $boxstring = ''; 254 $nb = sizeof( $value); 255 $keys = ($usekeys?array_keys($value):$value); 256 $value = ($usekeys?array_values($value):$value); 257 for ( $i = 0; $i < $nb; $i++ ) 258 { 259 $boxstring .= '<input type="radio" name="'.$name.'" value="'.$keys[$i].'"'; 260 if ($selected == $keys[$i]) $boxstring .=' checked'; 261 $boxstring .='/>'.$value[$i]; 262 } 263 return $boxstring; 264 } 235 265 ?> -
trunk/upload.php
r362 r364 25 25 // | USA. | 26 26 // +-----------------------------------------------------------------------+ 27 $phpwg_root_path = './';28 include_once( $phpwg_root_path.'include/common.inc.php' );27 define('PHPWG_ROOT_PATH','./'); 28 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 29 29 30 30 //------------------------------------------------------------------- functions
Note: See TracChangeset
for help on using the changeset viewer.