Changeset 369
- Timestamp:
- Feb 22, 2004, 3:43:13 AM (20 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/about.php
r364 r369 34 34 // 35 35 $title= $lang['about_page_title']; 36 include( 'include/page_header.php');36 include(PHPWG_ROOT_PATH.'include/page_header.php'); 37 37 38 38 $template->set_filenames(array('about'=>'about.tpl')); … … 48 48 49 49 $template->pparse('about'); 50 include( 'include/page_tail.php');50 include(PHPWG_ROOT_PATH.'include/page_tail.php'); 51 51 ?> -
trunk/category.php
r364 r369 116 116 // 117 117 $title = $page['title']; 118 include( 'include/page_header.php');118 include(PHPWG_ROOT_PATH.'include/page_header.php'); 119 119 120 120 $template->set_filenames( array('category'=>'category.tpl') ); … … 483 483 484 484 $template->pparse('category'); 485 include( 'include/page_tail.php');485 include(PHPWG_ROOT_PATH.'include/page_tail.php'); 486 486 ?> -
trunk/comments.php
r364 r369 43 43 // 44 44 $title= $lang['title_comments']; 45 include( 'include/page_header.php');45 include(PHPWG_ROOT_PATH.'include/page_header.php'); 46 46 47 47 $template->set_filenames( array('comments'=>'comments.tpl') ); … … 168 168 //----------------------------------------------------------- html code display 169 169 $template->pparse('comments'); 170 include( 'include/page_tail.php');170 include(PHPWG_ROOT_PATH.'include/page_tail.php'); 171 171 ?> -
trunk/identification.php
r365 r369 58 58 // 59 59 $title = $lang['ident_page_title']; 60 include( 'include/page_header.php');60 include(PHPWG_ROOT_PATH.'include/page_header.php'); 61 61 62 62 $template->set_filenames( array('identification'=>'identification.tpl') ); … … 96 96 //----------------------------------------------------------- html code display 97 97 $template->pparse('identification'); 98 include( 'include/page_tail.php');98 include(PHPWG_ROOT_PATH.'include/page_tail.php'); 99 99 ?> -
trunk/language/en_UK.iso-8859-1/admin.lang.php
r367 r369 274 274 $lang['infoimage_removefromall'] = 'remove from all'; 275 275 $lang['infoimage_associate'] = 'Associate to the category'; 276 $lang['update_wrong_dirname'] = 'The name of directories and files must be composed of letters, figures, "-", "_" or "."';277 276 $lang['stats_pages_seen'] = 'pages seen'; 278 277 $lang['stats_visitors'] = 'guests'; -
trunk/language/en_UK.iso-8859-1/common.lang.php
r364 r369 233 233 $lang['hint_comments'] = 'See last users comments'; 234 234 $lang['menu_login'] = 'login'; 235 $lang['update_wrong_dirname'] = 'The name of directories and files must be composed of letters, figures, "-", "_" or "."'; 235 236 236 237 ?> -
trunk/picture.php
r368 r369 233 233 $user['maxwidth'], $user['maxheight'] ); 234 234 235 include( 'include/page_header.php');235 include(PHPWG_ROOT_PATH.'include/page_header.php'); 236 236 $template->set_filenames(array('picture'=>'picture.tpl')); 237 237 initialize_template(); … … 585 585 586 586 $template->pparse('picture'); 587 include( 'include/page_tail.php');587 include(PHPWG_ROOT_PATH.'include/page_tail.php'); 588 588 ?> -
trunk/profile.php
r364 r369 132 132 // 133 133 $title = $lang['customize_page_title']; 134 include( 'include/page_header.php');134 include(PHPWG_ROOT_PATH.'include/page_header.php'); 135 135 136 136 $template->set_filenames(array('profile'=>'profile.tpl')); … … 224 224 )); 225 225 226 //--------------------------------------------------------------- create cookie227 if ( $conf['authorize_cookies'] )228 {229 $vtp->addSession( $handle, 'cookie' );230 $options = array(231 array( 'message' => '1 '.$lang['customize_day'],232 'value' => time() + 24*60*60 ),233 array( 'message' => '1 '.$lang['customize_week'],234 'value' => time() + 7*24*60*60 ),235 array( 'message' => '1 '.$lang['customize_month'],236 'value' => time() + 30*24*60*60 ),237 array( 'message' => '1 '.$lang['customize_year'],238 'value' => time() + 365*24*60*60 )239 );240 foreach ( $options as $option ) {241 $vtp->addSession( $handle, 'expiration_option' );242 $vtp->setVar( $handle, 'expiration_option.option', $option['message'] );243 $vtp->setVar( $handle, 'expiration_option.value', $option['value'] );244 $vtp->closeSession( $handle, 'expiration_option' );245 }246 $vtp->closeSession( $handle, 'cookie' );247 }248 226 //----------------------------------------------------------- html code display 249 227 $template->pparse('profile'); 250 include( 'include/page_tail.php');228 include(PHPWG_ROOT_PATH.'include/page_tail.php'); 251 229 ?> -
trunk/register.php
r365 r369 60 60 // 61 61 $title= $lang['register_page_title']; 62 include( 'include/page_header.php');62 include(PHPWG_ROOT_PATH.'include/page_header.php'); 63 63 64 64 $template->set_filenames( array('register'=>'register.tpl') ); … … 90 90 91 91 $template->pparse('register'); 92 include( 'include/page_tail.php');92 include(PHPWG_ROOT_PATH.'include/page_tail.php'); 93 93 ?> -
trunk/search.php
r364 r369 67 67 // 68 68 $title= $lang['search_title']; 69 include( 'include/page_header.php');69 include(PHPWG_ROOT_PATH.'include/page_header.php'); 70 70 71 71 $template->set_filenames( array('search'=>'search.tpl') ); … … 101 101 mysql_close(); 102 102 $template->pparse('search'); 103 include( 'include/page_tail.php');103 include(PHPWG_ROOT_PATH.'include/page_tail.php'); 104 104 ?> -
trunk/upload.php
r364 r369 133 133 } 134 134 } 135 //----------------------------------------------------- template initialization136 //137 // Start output of page138 //139 $title= $lang['upload_title'];140 include('include/page_header.php');141 $handle = $vtp->Open( './template/'.$user['template'].'/upload.vtp' );142 initialize_template();143 144 $tpl = array( 'upload_title', 'upload_username', 'mail_address', 'submit',145 'upload_successful', 'search_return_main_page','upload_author',146 'upload_name','upload_creation_date','upload_comment',147 'mandatory' );148 templatize_array( $tpl, 'lang', $handle );149 135 150 136 $error = array(); … … 164 150 } 165 151 // test de la présence des champs obligatoires 166 if ( $_FILES['picture']['name'] == '')152 if ( empty($_FILES['picture']['name'])) 167 153 { 168 154 array_push( $error, $lang['upload_filenotfound'] ); … … 173 159 array_push( $error, $lang['reg_err_mail_address'] ); 174 160 } 175 if ( $_POST['username'] == '')161 if ( empty($_POST['username']) ) 176 162 { 177 163 array_push( $error, $lang['upload_err_username'] ); … … 179 165 180 166 $date_creation = ''; 181 if ( $_POST['date_creation'] != '')167 if ( !empty($_POST['date_creation']) ) 182 168 { 183 169 list( $day,$month,$year ) = explode( '/', $_POST['date_creation'] ); … … 206 192 if ( !preg_match( '/^[a-zA-Z0-9-_.]+$/', $_FILES['picture']['name'] ) ) 207 193 { 208 // reload language file with administration labels209 $isadmin = true;210 include( './language/'.$user['language'].'.php' );211 194 array_push( $error, $lang['update_wrong_dirname'] ); 212 195 } … … 225 208 if ( sizeof( $error ) == 0 ) 226 209 { 227 $query = 'insert into '. PREFIX_TABLE.'waiting';210 $query = 'insert into '.WAITING_TABLE; 228 211 $query.= ' (storage_category_id,file,username,mail_address,date,infos)'; 229 212 $query.= ' values '; … … 241 224 } 242 225 } 226 243 227 //------------------------------------------------------------ thumbnail upload 244 228 if ( isset( $_POST['submit'] ) and isset( $_GET['waiting_id'] ) ) … … 246 230 // upload of the thumbnail 247 231 $query = 'select file'; 248 $query.= ' from '. PREFIX_TABLE.'waiting';232 $query.= ' from '.WAITING_TABLE; 249 233 $query.= ' where id = '.$_GET['waiting_id']; 250 234 $query.= ';'; … … 264 248 if ( sizeof( $error ) == 0 ) 265 249 { 266 $query = 'update '. PREFIX_TABLE.'waiting';250 $query = 'update '.WAITING_TABLE; 267 251 $query.= " set tn_ext = '".$extension."'"; 268 252 $query.= ' where id = '.$_GET['waiting_id']; … … 273 257 } 274 258 259 // 260 // Start output of page 261 // 262 $title= $lang['upload_title']; 263 include(PHPWG_ROOT_PATH.'include/page_header.php'); 264 $template->set_filenames(array('upload'=>'upload.tpl')); 265 initialize_template(); 266 267 $u_form = PHPWG_ROOT_PATH.'upload.php?cat='.$page['cat'].'&expand='.$_GET['expand']; 268 if ( isset( $page['waiting_id'] ) ) 269 { 270 $u_form.= '&waiting_id='.$page['waiting_id']; 271 } 272 273 if ( isset( $page['waiting_id'] ) ) 274 { 275 $advise_title=$lang['upload_advise_thumbnail'].$_FILES['picture']['name']; 276 } 277 else 278 { 279 $advise_title = $lang['upload_advise']; 280 $advise_title.= get_cat_display_name( $page['cat_name'], ' - ', 'font-style:italic;' ); 281 } 282 283 $username = !empty($_POST['username'])?$_POST['username']:$user['username']; 284 $mail_address = !empty($_POST['mail_address'])?$_POST['mail_address']:$user['mail_address']; 285 $name = !empty($_POST['name'])?$_POST['name']:''; 286 $author = !empty($_POST['author'])?$_POST['author']:''; 287 $date_creation = !empty($_POST['date_creation'])?$_POST['date_creation']:''; 288 $comment = !empty($_POST['comment'])?$_POST['comment']:''; 289 290 $template->assign_vars(array( 291 'ADVISE_TITLE' => $advise_title, 292 'NAME' => $username, 293 'EMAIL' => $mail_address, 294 'NAME_IMG' => $name, 295 'AUTHOR_IMG' => $author, 296 'DATE_IMG' => $date_creation, 297 'COMMENT_IMG' => $comment, 298 299 'L_TITLE' => $lang['upload_title'], 300 'L_USERNAME' => $lang['upload_username'], 301 'L_EMAIL' => $lang['mail_address'], 302 'L_NAME_IMG' => $lang['upload_name'], 303 'L_SUBMIT' => $lang['submit'], 304 'L_AUTHOR' => $lang['upload_author'], 305 'L_CREATION_DATE' => $lang['upload_creation_date'], 306 'L_COMMENT' => $lang['upload_comment'], 307 'L_RETURN' => $lang['search_return_main_page'], 308 'L_UPLOAD_DONE' => $lang['upload_successful'], 309 'L_MANDATORY' => $lang['mandatory'], 310 311 'F_ACTION' => add_session_id( $u_form ), 312 313 'U_RETURN' => add_session_id(PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING']) 314 )); 315 275 316 if ( !$page['upload_successful'] ) 276 317 { 277 $ vtp->addSession( $handle, 'upload_not_successful');318 $template->assign_block_vars('upload_not_successful',array()); 278 319 //-------------------------------------------------------------- errors display 279 if ( sizeof( $error ) != 0 ) 280 { 281 $vtp->addSession( $handle, 'errors' ); 282 for ( $i = 0; $i < sizeof( $error ); $i++ ) 283 { 284 $vtp->addSession( $handle, 'li' ); 285 $vtp->setVar( $handle, 'li.li', $error[$i] ); 286 $vtp->closeSession( $handle, 'li' ); 287 } 288 $vtp->closeSession( $handle, 'errors' ); 289 } 290 //----------------------------------------------------------------- form action 291 $url = './upload.php?cat='.$page['cat'].'&expand='.$_GET['expand']; 292 if ( isset( $page['waiting_id'] ) ) 293 { 294 $url.= '&waiting_id='.$page['waiting_id']; 295 } 296 $vtp->setGlobalVar( $handle, 'form_action', add_session_id( $url ) ); 320 if ( sizeof( $error ) != 0 ) 321 { 322 $template->assign_block_vars('upload_not_successful.errors',array()); 323 for ( $i = 0; $i < sizeof( $error ); $i++ ) 324 { 325 $template->assign_block_vars('upload_not_successful.errors.error',array('ERROR'=>$error[$i])); 326 } 327 } 328 297 329 //--------------------------------------------------------------------- advises 298 if ( $conf['upload_maxfilesize'] != '' ) 299 { 300 $vtp->addSession( $handle, 'advise' ); 330 if ( !empty($conf['upload_maxfilesize']) ) 331 { 301 332 $content = $lang['upload_advise_filesize']; 302 333 $content.= $conf['upload_maxfilesize'].' KB'; 303 $ vtp->setVar( $handle, 'advise.content', $content);304 $vtp->closeSession( $handle, 'advise' );305 } 334 $template->assign_block_vars('upload_not_successful.advise',array('ADVISE'=>$content)); 335 } 336 306 337 if ( isset( $page['waiting_id'] ) ) 307 338 { 308 $advise_title=$lang['upload_advise_thumbnail'].$_FILES['picture']['name'];309 $vtp->setGlobalVar( $handle, 'advise_title', $advise_title );310 311 339 if ( $conf['upload_maxwidth_thumbnail'] != '' ) 312 340 { 313 $vtp->addSession( $handle, 'advise' ); 314 $content = $lang['upload_advise_width']; 341 $content = $lang['upload_advise_width']; 315 342 $content.= $conf['upload_maxwidth_thumbnail'].' px'; 316 $vtp->setVar( $handle, 'advise.content', $content ); 317 $vtp->closeSession( $handle, 'advise' ); 343 $template->assign_block_vars('upload_not_successful.advise',array('ADVISE'=>$content)); 318 344 } 319 345 if ( $conf['upload_maxheight_thumbnail'] != '' ) 320 346 { 321 $vtp->addSession( $handle, 'advise' );322 347 $content = $lang['upload_advise_height']; 323 348 $content.= $conf['upload_maxheight_thumbnail'].' px'; 324 $vtp->setVar( $handle, 'advise.content', $content ); 325 $vtp->closeSession( $handle, 'advise' ); 349 $template->assign_block_vars('upload_not_successful.advise',array('ADVISE'=>$content)); 326 350 } 327 351 } 328 352 else 329 353 { 330 $advise_title = $lang['upload_advise'];331 $advise_title.= get_cat_display_name( $page['cat_name'], ' - ',332 'font-style:italic;' );333 $vtp->setGlobalVar( $handle, 'advise_title', $advise_title );334 335 354 if ( $conf['upload_maxwidth'] != '' ) 336 355 { 337 $vtp->addSession( $handle, 'advise' );338 356 $content = $lang['upload_advise_width']; 339 357 $content.= $conf['upload_maxwidth'].' px'; 340 $vtp->setVar( $handle, 'advise.content', $content ); 341 $vtp->closeSession( $handle, 'advise' ); 358 $template->assign_block_vars('upload_not_successful.advise',array('ADVISE'=>$content)); 342 359 } 343 360 if ( $conf['upload_maxheight'] != '' ) 344 361 { 345 $vtp->addSession( $handle, 'advise' );346 362 $content = $lang['upload_advise_height']; 347 363 $content.= $conf['upload_maxheight'].' px'; 348 $vtp->setVar( $handle, 'advise.content', $content ); 349 $vtp->closeSession( $handle, 'advise' ); 350 } 351 } 352 $vtp->addSession( $handle, 'advise' ); 353 $content = $lang['upload_advise_filetype']; 354 $vtp->setVar( $handle, 'advise.content', $content ); 355 $vtp->closeSession( $handle, 'advise' ); 364 $template->assign_block_vars('upload_not_successful.advise',array('ADVISE'=>$content)); 365 } 366 } 367 $template->assign_block_vars('upload_not_successful.advise',array('ADVISE'=>$lang['upload_advise_filetype'])); 368 356 369 //----------------------------------------- optionnal username and mail address 357 370 if ( !isset( $page['waiting_id'] ) ) 358 371 { 359 $vtp->addSession( $handle, 'fields' ); 360 // username 361 if ( isset( $_POST['username'] ) ) $username = $_POST['username']; 362 else $username = $user['username']; 363 $vtp->setVar( $handle, 'fields.username', $username ); 364 // mail address 365 if ( isset( $_POST['mail_address'] ) )$mail_address=$_POST['mail_address']; 366 else $mail_address=$user['mail_address']; 367 $vtp->setGlobalVar( $handle, 'user_mail_address',$user['mail_address'] ); 368 // name of the picture 369 if (isset($_POST['name'])) 370 $vtp->setVar( $handle, 'fields.name', $_POST['name'] ); 371 // author 372 if (isset($_POST['author'])) 373 $vtp->setVar( $handle, 'fields.author', $_POST['author'] ); 374 // date of creation 375 if (isset($_POST['date_creation'])) 376 $vtp->setVar( $handle, 'fields.date_creation', $_POST['date_creation'] ); 377 // comment 378 if (isset($_POST['comment'])) 379 $vtp->setVar( $handle, 'fields.comment', $_POST['comment'] ); 380 381 $vtp->closeSession( $handle, 'fields' ); 382 383 $vtp->addSession( $handle, 'note' ); 384 $vtp->closeSession( $handle, 'note' ); 385 } 386 $vtp->closeSession( $handle, 'upload_not_successful' ); 372 $template->assign_block_vars('upload_not_successful.fields',array()); 373 $template->assign_block_vars('note',array()); 374 } 387 375 } 388 376 else 389 377 { 390 $vtp->addSession( $handle, 'upload_successful' ); 391 $vtp->closeSession( $handle, 'upload_successful' ); 392 } 393 //----------------------------------------------------- return to main page url 394 $url = './category.php?cat='.$page['cat'].'&expand='.$_GET['expand']; 395 $vtp->setGlobalVar( $handle, 'return_url', add_session_id( $url ) ); 378 $template->assign_block_vars('upload_successful',array()); 379 } 396 380 //----------------------------------------------------------- html code display 397 $code = $vtp->Display( $handle, 0 ); 398 echo $code; 399 include('include/page_tail.php'); 381 $template->pparse('upload'); 382 include(PHPWG_ROOT_PATH.'include/page_tail.php'); 400 383 ?>
Note: See TracChangeset
for help on using the changeset viewer.