Changeset 1082 for trunk/upload.php


Ignore:
Timestamp:
Mar 15, 2006, 11:44:35 PM (18 years ago)
Author:
plg
Message:

new: cleaner URL. Instead of category.php?cat=search&search=123&start=42,
you now have category.php?/search/123/start-42. Functions make_index_url and
make_picture_url build these new URLs. Functions duplicate_picture_url and
duplicate_index_url provide shortcuts to URL creation. The current main page
page is still category.php but this can be modified easily in make_index_url
function. In this first version, no backward compatibility. Calendar
definition in URL must be discussed with rvelices.

improvement: picture.php redesigned. First actions like "set as
representative" or "delete a comment" which all lead to a redirection. Then
the page (the big mess) and includes of new sub pages to manage specific
parts of the page (metadata, user comments, rates).

new: with the cleaner URL comes a new terminology. $pagecat doesn't
exist anymore. $pagesection is among 'categories', 'tags' (TODO),
'list', 'most_seen'... And sub parameters are set : $pagecategory if
$pagesection is "categories". See URL analyse in
include/section_init.inc.php for details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/upload.php

    r1058 r1082  
    126126  $page['cat_name']       = $result['name'];
    127127  $page['cat_uploadable'] = $result['uploadable'];
    128   if ( url_is_remote($page['cat_dir']) or !$page['cat_uploadable'])
    129   {
    130     echo '<div style="text-align:center;">'.$lang['upload_forbidden'].'<br />';
    131     echo '<a href="./category.php">';
    132     echo $lang['thumbnails'].'</a></div>';
    133     exit();
     128 
     129  if (url_is_remote($page['cat_dir']) or !$page['cat_uploadable'])
     130  {
     131    die('Fatal: you take a wrong way, bye bye');
    134132  }
    135133}
     
    281279$comment = !empty($_POST['comment'])?$_POST['comment']:'';
    282280
    283 $template->assign_vars(array(
    284   'ADVISE_TITLE' => $advise_title,
    285   'NAME' => $username,
    286   'EMAIL' => $mail_address,
    287   'NAME_IMG' => $name,
    288   'AUTHOR_IMG' => $author,
    289   'DATE_IMG' => $date_creation,
    290   'COMMENT_IMG' => $comment,
    291 
    292   'L_TITLE' => $lang['upload_title'],
    293   'L_USERNAME' => $lang['upload_username'],
    294   'L_EMAIL' =>  $lang['mail_address'],
    295   'L_NAME_IMG' =>  $lang['upload_name'],
    296   'L_SUBMIT' =>  $lang['submit'],
    297   'L_AUTHOR' =>  $lang['upload_author'],
    298   'L_CREATION_DATE' =>  $lang['upload_creation_date'],
    299   'L_COMMENT' =>  $lang['comment'],
    300   'L_RETURN' =>  $lang['home'],
    301   'L_RETURN_HINT' =>  $lang['home_hint'],
    302   'L_UPLOAD_DONE' =>  $lang['upload_successful'],
    303   'L_MANDATORY' =>  $lang['mandatory'],
    304        
    305   'F_ACTION' => $u_form,
    306 
    307   'U_RETURN' => PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING']
    308   ));
     281$template->assign_vars(
     282  array(
     283    'ADVISE_TITLE' => $advise_title,
     284    'NAME' => $username,
     285    'EMAIL' => $mail_address,
     286    'NAME_IMG' => $name,
     287    'AUTHOR_IMG' => $author,
     288    'DATE_IMG' => $date_creation,
     289    'COMMENT_IMG' => $comment,
     290   
     291    'L_TITLE' => $lang['upload_title'],
     292    'L_USERNAME' => $lang['upload_username'],
     293    'L_EMAIL' =>  $lang['mail_address'],
     294    'L_NAME_IMG' =>  $lang['upload_name'],
     295    'L_SUBMIT' =>  $lang['submit'],
     296    'L_AUTHOR' =>  $lang['upload_author'],
     297    'L_CREATION_DATE' =>  $lang['upload_creation_date'],
     298    'L_COMMENT' =>  $lang['comment'],
     299    'L_RETURN' =>  $lang['home'],
     300    'L_RETURN_HINT' =>  $lang['home_hint'],
     301    'L_UPLOAD_DONE' =>  $lang['upload_successful'],
     302    'L_MANDATORY' =>  $lang['mandatory'],
     303   
     304    'F_ACTION' => $u_form,
     305
     306    'U_RETURN' => make_index_url(array('category' => $page['cat'])),
     307    )
     308  );
    309309 
    310310if ( !$page['upload_successful'] )
Note: See TracChangeset for help on using the changeset viewer.