mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
- tags improvement : pass to templates all fields in table #tags (handy for plugins such as type tags)
git-svn-id: http://piwigo.org/svn/branches/branch-1_7@2410 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -40,9 +40,9 @@ function get_available_tags()
|
||||
{
|
||||
// we can find top fatter tags among reachable images
|
||||
$tags_query = '
|
||||
SELECT id, name, url_name, count(*) counter
|
||||
SELECT t.*, count(*) counter
|
||||
FROM '.IMAGE_TAG_TABLE.'
|
||||
INNER JOIN '.TAGS_TABLE.' ON tag_id = id';
|
||||
INNER JOIN '.TAGS_TABLE.' t ON tag_id = id';
|
||||
|
||||
$where_tag_img =
|
||||
get_sql_condition_FandF
|
||||
@@ -101,9 +101,7 @@ SELECT DISTINCT image_id
|
||||
function get_all_tags()
|
||||
{
|
||||
$query = '
|
||||
SELECT id,
|
||||
name,
|
||||
url_name
|
||||
SELECT *
|
||||
FROM '.TAGS_TABLE.'
|
||||
;';
|
||||
$result = pwg_query($query);
|
||||
@@ -245,9 +243,9 @@ function get_common_tags($items, $max_tags, $excluded_tag_ids=null)
|
||||
return array();
|
||||
}
|
||||
$query = '
|
||||
SELECT id, name, url_name, count(*) counter
|
||||
SELECT t.*, count(*) counter
|
||||
FROM '.IMAGE_TAG_TABLE.'
|
||||
INNER JOIN '.TAGS_TABLE.' ON tag_id = id
|
||||
INNER JOIN '.TAGS_TABLE.' t ON tag_id = id
|
||||
WHERE image_id IN ('.implode(',', $items).')';
|
||||
if (!empty($excluded_tag_ids))
|
||||
{
|
||||
|
||||
21
tags.php
21
tags.php
@@ -91,16 +91,19 @@ foreach ($tags as $tag)
|
||||
{
|
||||
$template->assign_block_vars(
|
||||
'tag',
|
||||
array(
|
||||
'URL' => make_index_url(
|
||||
array(
|
||||
'tags' => array($tag),
|
||||
)
|
||||
),
|
||||
array_merge(
|
||||
$tag,
|
||||
array(
|
||||
'URL' => make_index_url(
|
||||
array(
|
||||
'tags' => array($tag),
|
||||
)
|
||||
),
|
||||
|
||||
'NAME' => $tag['name'],
|
||||
'TITLE' => $tag['counter'],
|
||||
'CLASS' => 'tagLevel'.$tag['level'],
|
||||
'NAME' => $tag['name'],
|
||||
'TITLE' => $tag['counter'],
|
||||
'CLASS' => 'tagLevel'.$tag['level'],
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user