Changeset 1827 for trunk/picture.php


Ignore:
Timestamp:
Feb 16, 2007, 4:06:41 AM (17 years ago)
Author:
rvelices
Message:
  • adviser mode: added check on admin profile page and removed 2 read-only TAG_INPUT_ENABLED
  • simplified tag code in picture.php
  • reduced size of dark/theme.css by combining selectors with identical content
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/picture.php

    r1825 r1827  
    749749
    750750// tags
    751 $query = '
    752 SELECT id, name, url_name
    753   FROM '.IMAGE_TAG_TABLE.'
    754     INNER JOIN '.TAGS_TABLE.' ON tag_id = id
    755   WHERE image_id = '.$page['image_id'].'
    756 ;';
    757 $result = pwg_query($query);
    758 
    759 if (mysql_num_rows($result) > 0)
    760 {
    761   $tags = array();
    762   $tag_names = array();
    763 
    764   while ($row = mysql_fetch_array($result))
    765   {
    766     array_push(
    767       $tags,
    768       '<a href="'
     751$tags = get_common_tags( array($page['image_id']), -1);
     752if ( count($tags) )
     753{
     754  $infos['INFO_TAGS'] = '';
     755  foreach ($tags as $num => $tag)
     756  {
     757    $infos['INFO_TAGS'] .= $num ? ' ,' : '';
     758    $infos['INFO_TAGS'] .= '<a href="'
    769759      .make_index_url(
    770760        array(
    771           'tags' => array(
    772             array(
    773               'id' => $row['id'],
    774               'url_name' => $row['url_name'],
    775               ),
    776             )
     761          'tags' => array($tag)
    777762          )
    778763        )
    779       .'">'.$row['name'].'</a>'
    780       );
    781     array_push( $tag_names, $row['name'] );
    782   }
    783 
    784   $infos['INFO_TAGS'] = implode(', ', $tags);
    785   $header_infos['INFO_TAGS'] = implode(', ', $tag_names);
     764      .'">'.$tag['name'].'</a>';
     765  }
     766  $header_infos['INFO_TAGS'] = strip_tags($infos['INFO_TAGS']);
    786767}
    787768else
Note: See TracChangeset for help on using the changeset viewer.