aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_url.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-02-18 20:46:46 +0000
committerrvelices <rv-github@modusoptimus.com>2012-02-18 20:46:46 +0000
commita8938827898ed40d35f25b055a72a41a2c1567ef (patch)
tree4faaa2424bf609938dd526dc6c99cae8d25fdbf7 /include/functions_url.inc.php
parent3ef9e856c36e7b7b8530beb52c8667945a645cad (diff)
- multisize thumb longest side can be smaller than the square size
- remove unused css, shorten/optimize php called very often (at least theoretically should be faster) git-svn-id: http://piwigo.org/svn/trunk@13240 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_url.inc.php')
-rw-r--r--include/functions_url.inc.php68
1 files changed, 32 insertions, 36 deletions
diff --git a/include/functions_url.inc.php b/include/functions_url.inc.php
index 1b6c1daff..fdaaca589 100644
--- a/include/functions_url.inc.php
+++ b/include/functions_url.inc.php
@@ -30,22 +30,15 @@
function get_root_url()
{
global $page;
- if ( isset($page['root_path']) )
- {
- $root_url = $page['root_path'];
- }
- else
+ if ( ($root_url = @$page['root_path']) == null )
{// TODO - add HERE the possibility to call PWG functions from external scripts
$root_url = PHPWG_ROOT_PATH;
+ if ( strncmp($root_url, './', 2) == 0 )
+ {
+ return substr($root_url, 2);
+ }
}
- if ( strncmp($root_url, './', 2) != 0 )
- {
- return $root_url;
- }
- else
- {
- return (string)substr($root_url, 2);
- }
+ return $root_url;
}
/**
@@ -307,28 +300,31 @@ function make_section_in_url($params)
{
global $conf;
$section_string = '';
-
- $section_of = array(
- 'category' => 'categories',
- 'tags' => 'tags',
- 'list' => 'list',
- 'search' => 'search',
- );
-
- foreach ($section_of as $param => $section)
- {
- if (isset($params[$param]))
- {
- $params['section'] = $section;
- }
- }
-
- if (!isset($params['section']))
- {
- $params['section'] = 'none';
- }
-
- switch($params['section'])
+ $section = @$params['section'];
+ if (!isset($section))
+ {
+ $section_of = array(
+ 'category' => 'categories',
+ 'tags' => 'tags',
+ 'list' => 'list',
+ 'search' => 'search',
+ );
+
+ foreach ($section_of as $param => $s)
+ {
+ if (isset($params[$param]))
+ {
+ $section = $s;
+ }
+ }
+
+ if (!isset($section))
+ {
+ $section = 'none';
+ }
+ }
+
+ switch($section)
{
case 'categories' :
{
@@ -420,7 +416,7 @@ function make_section_in_url($params)
}
default :
{
- $section_string.= '/'.$params['section'];
+ $section_string.= '/'.$section;
}
}