aboutsummaryrefslogtreecommitdiffstats
path: root/tags.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-10-04 04:15:28 +0000
committerrvelices <rv-github@modusoptimus.com>2012-10-04 04:15:28 +0000
commitcc558d869496f051c1b667d37e4dcfc474c007d1 (patch)
treed6447c2284e229c432139dd23aa46b422fe134f9 /tags.php
parentb90d2721e5f7f81ac821ab5075472fbbb0917c67 (diff)
php optimizations:
- use faster [] operator instead of array_push - if tags are grouped by letter, don't add level to tags, sort etc ... git-svn-id: http://piwigo.org/svn/trunk@18455 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'tags.php')
-rw-r--r--tags.php58
1 files changed, 28 insertions, 30 deletions
diff --git a/tags.php b/tags.php
index ab6fa6fd2..518d46e58 100644
--- a/tags.php
+++ b/tags.php
@@ -159,43 +159,41 @@ if ($page['display_mode'] == 'letters') {
);
}
}
+else
+{
+ // +-----------------------------------------------------------------------+
+ // | tag cloud construction |
+ // +-----------------------------------------------------------------------+
-// +-----------------------------------------------------------------------+
-// | tag cloud construction |
-// +-----------------------------------------------------------------------+
-
-// we want only the first most represented tags, so we sort them by counter
-// and take the first tags
-usort($tags, 'counter_compare');
-$tags = array_slice($tags, 0, $conf['full_tag_cloud_items_number']);
+ // we want only the first most represented tags, so we sort them by counter
+ // and take the first tags
+ usort($tags, 'counter_compare');
+ $tags = array_slice($tags, 0, $conf['full_tag_cloud_items_number']);
-// depending on its counter and the other tags counter, each tag has a level
-$tags = add_level_to_tags($tags);
+ // depending on its counter and the other tags counter, each tag has a level
+ $tags = add_level_to_tags($tags);
-// we want tags diplayed in alphabetic order
-if ('letters' != $page['display_mode'])
-{
+ // we want tags diplayed in alphabetic order
usort($tags, 'tag_alpha_compare');
-}
-// display sorted tags
-foreach ($tags as $tag)
-{
- $template->append(
- 'tags',
- array_merge(
- $tag,
- array(
- 'URL' => make_index_url(
- array(
- 'tags' => array($tag),
- )
- ),
+ // display sorted tags
+ foreach ($tags as $tag)
+ {
+ $template->append(
+ 'tags',
+ array_merge(
+ $tag,
+ array(
+ 'URL' => make_index_url(
+ array(
+ 'tags' => array($tag),
+ )
+ ),
+ )
)
- )
- );
+ );
+ }
}
-
// include menubar
$themeconf = $template->get_template_vars('themeconf');
if (!isset($themeconf['hide_menu_on']) OR !in_array('theTagsPage', $themeconf['hide_menu_on']))