aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-04-04 00:35:12 +0000
committerrvelices <rv-github@modusoptimus.com>2006-04-04 00:35:12 +0000
commitf33fdc91b2a5cb4ce0681df52b37ca5781660503 (patch)
treeb6e1d6653e5bd8f35b8d2bb016c173653a3abcf5 /include
parent42abf4c57664d2596872d437f70b95193f9a5d18 (diff)
fix: sql query erros when: no items for the selected tag, search returns
no result, caddie is empty fix: tag cloud was showing least used tags fix: strip html tags from head/title element on the page (tag index page title contained <a>...) improvement: added 5 tag levels in css for "ready to use" tags fix: corrected png icon calendar_created.png for IE fix: english language for nbm git-svn-id: http://piwigo.org/svn/trunk@1120 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/config_default.inc.php2
-rw-r--r--include/page_header.php2
-rw-r--r--include/section_init.inc.php24
3 files changed, 18 insertions, 10 deletions
diff --git a/include/config_default.inc.php b/include/config_default.inc.php
index 57a4520c3..72363d85d 100644
--- a/include/config_default.inc.php
+++ b/include/config_default.inc.php
@@ -448,7 +448,7 @@ $conf['full_tag_cloud_items_number'] = 200;
// tags_levels: number of levels to use for display. Each level is bind to a
// CSS class tagLevelX.
-$conf['tags_levels'] = 10;
+$conf['tags_levels'] = 5;
// +-----------------------------------------------------------------------+
// | Notification by mail |
diff --git a/include/page_header.php b/include/page_header.php
index 778d5661c..f9b130c3c 100644
--- a/include/page_header.php
+++ b/include/page_header.php
@@ -48,7 +48,7 @@ $template->assign_vars(
$page['body_id'] : '',
'CONTENT_ENCODING' => $lang_info['charset'],
- 'PAGE_TITLE' => $title,
+ 'PAGE_TITLE' => strip_tags($title),
'LANG'=>$lang_info['code'],
'DIR'=>$lang_info['direction'],
diff --git a/include/section_init.inc.php b/include/section_init.inc.php
index e2ed07b42..176ebf0f0 100644
--- a/include/section_init.inc.php
+++ b/include/section_init.inc.php
@@ -161,7 +161,7 @@ else if (0 === strpos($tokens[$next_token], 'tag'))
break;
}
}
-
+
array_push(
$page['tags'],
array(
@@ -305,7 +305,7 @@ if ('categories' == $page['section'])
'cat_id_uppercat' => $result['id_uppercat'],
'uppercats' => $result['uppercats'],
- 'title' => get_cat_display_name($result['name'], null, false),
+ 'title' => get_cat_display_name($result['name'], '', false),
)
);
@@ -360,7 +360,7 @@ else
// permissions depends on category, so to only keep images that are
// reachable to the connected user, we need to check category
// associations
- if (!empty($user['forbidden_categories']))
+ if (!empty($user['forbidden_categories']) and !empty($items) )
{
$query = '
SELECT image_id
@@ -381,7 +381,7 @@ SELECT name, url_name, id
;';
$result = pwg_query($query);
$tag_infos = array();
-
+
while ($row = mysql_fetch_array($result))
{
$tag_infos[ $row['id'] ]['name'] = $row['name'];
@@ -428,20 +428,28 @@ SELECT name, url_name, id
{
include_once( PHPWG_ROOT_PATH .'include/functions_search.inc.php' );
- $query = '
+ $search_items = get_search_items($page['search']);
+ if ( !empty($search_items) )
+ {
+ $query = '
SELECT DISTINCT(id)
FROM '.IMAGES_TABLE.'
INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id
- WHERE id IN ('.implode(',', get_search_items($page['search'])).')
+ WHERE id IN ('.implode(',', $search_items).')
AND '.$forbidden.'
'.$conf['order_by'].'
-;';
+;';
+ $page['items'] = array_from_query($query, 'id');
+ }
+ else
+ {
+ $page['items'] = array();
+ }
$page = array_merge(
$page,
array(
'title' => $lang['search_result'],
- 'items' => array_from_query($query, 'id'),
'thumbnails_include' => 'include/category_default.inc.php',
)
);