mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-10 10:42:59 +02:00
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
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
/**
|
||||
* This file is included by category.php to show thumbnails for the default
|
||||
* This file is included by the main page to show thumbnails for the default
|
||||
* case
|
||||
*
|
||||
*/
|
||||
@@ -81,25 +81,39 @@ foreach ($pictures as $row)
|
||||
}
|
||||
|
||||
// url link on picture.php page
|
||||
$url_link = PHPWG_ROOT_PATH.'picture.php?image_id='.$row['id'];
|
||||
$url_link = PHPWG_ROOT_PATH.'picture.php?/'.$row['id'];
|
||||
|
||||
if (isset($page['cat']))
|
||||
switch ($page['section'])
|
||||
{
|
||||
$url_link.= '&cat='.$page['cat'];
|
||||
|
||||
if ($page['cat'] == 'search')
|
||||
case 'categories' :
|
||||
{
|
||||
$url_link.= '&search='.$_GET['search'];
|
||||
$url_link.= '/category/'.$page['category'];
|
||||
break;
|
||||
}
|
||||
else if ($page['cat'] == 'list')
|
||||
case 'tags' :
|
||||
{
|
||||
$url_link.= '&list='.$_GET['list'];
|
||||
// TODO
|
||||
break;
|
||||
}
|
||||
case 'search' :
|
||||
{
|
||||
$url_link.= '/search/'.$page['search'];
|
||||
break;
|
||||
}
|
||||
case 'list' :
|
||||
{
|
||||
$url_link.= '/list/'.implode(',', $page['list']);
|
||||
break;
|
||||
}
|
||||
default :
|
||||
{
|
||||
$url_link.= '/'.$page['section'];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET['calendar']))
|
||||
if (isset($page['chronology']))
|
||||
{
|
||||
$url_link.= '&calendar='.$_GET['calendar'];
|
||||
$url_link.= '/chronology='.$page['chronology'];
|
||||
}
|
||||
|
||||
$template->assign_block_vars(
|
||||
@@ -125,20 +139,23 @@ foreach ($pictures as $row)
|
||||
{
|
||||
$name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
|
||||
}
|
||||
if ( isset($page['cat']) )
|
||||
|
||||
switch ($page['section'])
|
||||
{
|
||||
if ($page['cat'] == 'best_rated')
|
||||
case 'best_rated' :
|
||||
{
|
||||
$name = '('.$row['average_rate'].') '.$name;
|
||||
break;
|
||||
}
|
||||
elseif ($page['cat'] == 'most_visited')
|
||||
case 'most_visited' :
|
||||
{
|
||||
$name = '('.$row['hit'].') '.$name;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($page['cat'] == 'search')
|
||||
case 'search' :
|
||||
{
|
||||
$name = replace_search($name, $_GET['search']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +168,7 @@ foreach ($pictures as $row)
|
||||
}
|
||||
|
||||
if ($user['show_nb_comments']
|
||||
and is_numeric($page['cat'])
|
||||
and isset($page['category'])
|
||||
and $page['cat_commentable'])
|
||||
{
|
||||
$query = '
|
||||
|
||||
Reference in New Issue
Block a user