Changeset 2410


Ignore:
Timestamp:
Jul 1, 2008, 4:10:13 AM (16 years ago)
Author:
rvelices
Message:
  • tags improvement : pass to templates all fields in table #tags (handy for plugins such as type tags)
Location:
branches/branch-1_7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1_7/include/functions_tag.inc.php

    r2311 r2410  
    4141  // we can find top fatter tags among reachable images
    4242  $tags_query = '
    43 SELECT id, name, url_name, count(*) counter
     43SELECT t.*, count(*) counter
    4444  FROM '.IMAGE_TAG_TABLE.'
    45     INNER JOIN '.TAGS_TABLE.' ON tag_id = id';
     45    INNER JOIN '.TAGS_TABLE.' t ON tag_id = id';
    4646
    4747  $where_tag_img =
     
    102102{
    103103  $query = '
    104 SELECT id,
    105        name,
    106        url_name
     104SELECT *
    107105  FROM '.TAGS_TABLE.'
    108106;';
     
    246244  }
    247245  $query = '
    248 SELECT id, name, url_name, count(*) counter
     246SELECT t.*, count(*) counter
    249247  FROM '.IMAGE_TAG_TABLE.'
    250     INNER JOIN '.TAGS_TABLE.' ON tag_id = id
     248    INNER JOIN '.TAGS_TABLE.' t ON tag_id = id
    251249  WHERE image_id IN ('.implode(',', $items).')';
    252250  if (!empty($excluded_tag_ids))
  • branches/branch-1_7/tags.php

    r1912 r2410  
    9292  $template->assign_block_vars(
    9393    'tag',
    94     array(
    95       'URL' => make_index_url(
    96         array(
    97           'tags' => array($tag),
    98           )
    99         ),
     94    array_merge(
     95      $tag,
     96      array(
     97        'URL' => make_index_url(
     98          array(
     99            'tags' => array($tag),
     100            )
     101          ),
    100102
    101       'NAME' => $tag['name'],
    102       'TITLE' => $tag['counter'],
    103       'CLASS' => 'tagLevel'.$tag['level'],
     103        'NAME' => $tag['name'],
     104        'TITLE' => $tag['counter'],
     105        'CLASS' => 'tagLevel'.$tag['level'],
     106        )
    104107      )
    105108    );
Note: See TracChangeset for help on using the changeset viewer.