From 114ae324452ac88fe7b672338cba931d838ee2a4 Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 15 Mar 2006 22:44:35 +0000 Subject: 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. $page['cat'] doesn't exist anymore. $page['section'] is among 'categories', 'tags' (TODO), 'list', 'most_seen'... And sub parameters are set : $page['category'] if $page['section'] is "categories". See URL analyse in include/section_init.inc.php for details. git-svn-id: http://piwigo.org/svn/trunk@1082 68402e56-0260-453c-a942-63ccdbb3a9ee --- upload.php | 60 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'upload.php') diff --git a/upload.php b/upload.php index ea06794bf..e01778dbb 100644 --- a/upload.php +++ b/upload.php @@ -125,12 +125,10 @@ if (isset($page['cat'])) $page['cat_site_id'] = $result['site_id']; $page['cat_name'] = $result['name']; $page['cat_uploadable'] = $result['uploadable']; - if ( url_is_remote($page['cat_dir']) or !$page['cat_uploadable']) + + if (url_is_remote($page['cat_dir']) or !$page['cat_uploadable']) { - echo '
'.$lang['upload_forbidden'].'
'; - echo ''; - echo $lang['thumbnails'].'
'; - exit(); + die('Fatal: you take a wrong way, bye bye'); } } @@ -280,32 +278,34 @@ $author = !empty($_POST['author'])?$_POST['author']:''; $date_creation = !empty($_POST['date_creation'])?$_POST['date_creation']:''; $comment = !empty($_POST['comment'])?$_POST['comment']:''; -$template->assign_vars(array( - 'ADVISE_TITLE' => $advise_title, - 'NAME' => $username, - 'EMAIL' => $mail_address, - 'NAME_IMG' => $name, - 'AUTHOR_IMG' => $author, - 'DATE_IMG' => $date_creation, - 'COMMENT_IMG' => $comment, - - 'L_TITLE' => $lang['upload_title'], - 'L_USERNAME' => $lang['upload_username'], - 'L_EMAIL' => $lang['mail_address'], - 'L_NAME_IMG' => $lang['upload_name'], - 'L_SUBMIT' => $lang['submit'], - 'L_AUTHOR' => $lang['upload_author'], - 'L_CREATION_DATE' => $lang['upload_creation_date'], - 'L_COMMENT' => $lang['comment'], - 'L_RETURN' => $lang['home'], - 'L_RETURN_HINT' => $lang['home_hint'], - 'L_UPLOAD_DONE' => $lang['upload_successful'], - 'L_MANDATORY' => $lang['mandatory'], - - 'F_ACTION' => $u_form, +$template->assign_vars( + array( + 'ADVISE_TITLE' => $advise_title, + 'NAME' => $username, + 'EMAIL' => $mail_address, + 'NAME_IMG' => $name, + 'AUTHOR_IMG' => $author, + 'DATE_IMG' => $date_creation, + 'COMMENT_IMG' => $comment, + + 'L_TITLE' => $lang['upload_title'], + 'L_USERNAME' => $lang['upload_username'], + 'L_EMAIL' => $lang['mail_address'], + 'L_NAME_IMG' => $lang['upload_name'], + 'L_SUBMIT' => $lang['submit'], + 'L_AUTHOR' => $lang['upload_author'], + 'L_CREATION_DATE' => $lang['upload_creation_date'], + 'L_COMMENT' => $lang['comment'], + 'L_RETURN' => $lang['home'], + 'L_RETURN_HINT' => $lang['home_hint'], + 'L_UPLOAD_DONE' => $lang['upload_successful'], + 'L_MANDATORY' => $lang['mandatory'], + + 'F_ACTION' => $u_form, - 'U_RETURN' => PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING'] - )); + 'U_RETURN' => make_index_url(array('category' => $page['cat'])), + ) + ); if ( !$page['upload_successful'] ) { -- cgit v1.2.3