Changeset 1120


Ignore:
Timestamp:
Apr 4, 2006, 2:35:12 AM (18 years ago)
Author:
rvelices
Message:

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

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/element_set_global.php

    r1119 r1120  
    9393    pwg_query($query);
    9494  }
    95  
     95
    9696  if ($_POST['associate'] != 0 and count($collection) > 0)
    9797  {
     
    331331  );
    332332
    333 // remove tags
    334 $query = '
    335 SELECT tag_id, name, url_name, count(*) counter
    336   FROM '.IMAGE_TAG_TABLE.'
    337     INNER JOIN '.TAGS_TABLE.' ON tag_id = id
    338   WHERE image_id IN ('.implode(',', $page['cat_elements_id']).')
    339   GROUP BY tag_id
    340   ORDER BY name ASC
    341 ;';
    342 $result = pwg_query($query);
    343 
    344 $tags = array();
    345 while($row = mysql_fetch_array($result))
    346 {
    347   array_push($tags, $row);
    348 }
    349 
    350 $template->assign_vars(
    351   array(
    352     'DEL_TAG_SELECTION' => get_html_tag_selection($tags, 'del_tags'),
    353     )
    354   );
    355 
     333if (count($page['cat_elements_id']) > 0)
     334{
     335  // remove tags
     336  $query = '
     337  SELECT tag_id, name, url_name, count(*) counter
     338    FROM '.IMAGE_TAG_TABLE.'
     339      INNER JOIN '.TAGS_TABLE.' ON tag_id = id
     340    WHERE image_id IN ('.implode(',', $page['cat_elements_id']).')
     341    GROUP BY tag_id
     342    ORDER BY name ASC
     343  ;';
     344  $result = pwg_query($query);
     345
     346  $tags = array();
     347  while($row = mysql_fetch_array($result))
     348  {
     349    array_push($tags, $row);
     350  }
     351
     352  $template->assign_vars(
     353    array(
     354      'DEL_TAG_SELECTION' => get_html_tag_selection($tags, 'del_tags'),
     355      )
     356    );
     357}
    356358// creation date
    357359$day =
  • trunk/include/config_default.inc.php

    r1119 r1120  
    449449// tags_levels: number of levels to use for display. Each level is bind to a
    450450// CSS class tagLevelX.
    451 $conf['tags_levels'] = 10;
     451$conf['tags_levels'] = 5;
    452452
    453453// +-----------------------------------------------------------------------+
  • trunk/include/page_header.php

    r1085 r1120  
    4949
    5050    'CONTENT_ENCODING' => $lang_info['charset'],
    51     'PAGE_TITLE' => $title,
     51    'PAGE_TITLE' => strip_tags($title),
    5252    'LANG'=>$lang_info['code'],
    5353    'DIR'=>$lang_info['direction'],
  • trunk/include/section_init.inc.php

    r1119 r1120  
    162162      }
    163163    }
    164    
     164
    165165    array_push(
    166166      $page['tags'],
     
    306306        'uppercats'        => $result['uppercats'],
    307307
    308         'title' => get_cat_display_name($result['name'], null, false),
     308        'title' => get_cat_display_name($result['name'], '', false),
    309309        )
    310310      );
     
    361361    // reachable to the connected user, we need to check category
    362362    // associations
    363     if (!empty($user['forbidden_categories']))
     363    if (!empty($user['forbidden_categories']) and !empty($items) )
    364364    {
    365365      $query = '
     
    382382    $result = pwg_query($query);
    383383    $tag_infos = array();
    384    
     384
    385385    while ($row = mysql_fetch_array($result))
    386386    {
     
    429429    include_once( PHPWG_ROOT_PATH .'include/functions_search.inc.php' );
    430430
    431     $query = '
     431    $search_items = get_search_items($page['search']);
     432    if ( !empty($search_items) )
     433    {
     434      $query = '
    432435SELECT DISTINCT(id)
    433436  FROM '.IMAGES_TABLE.'
    434437    INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id
    435   WHERE id IN ('.implode(',', get_search_items($page['search'])).')
     438  WHERE id IN ('.implode(',', $search_items).')
    436439    AND '.$forbidden.'
    437440  '.$conf['order_by'].'
    438 ;';
     441;';
     442      $page['items'] = array_from_query($query, 'id');
     443    }
     444    else
     445    {
     446      $page['items'] = array();
     447    }
    439448
    440449    $page = array_merge(
     
    442451      array(
    443452        'title' => $lang['search_result'],
    444         'items' => array_from_query($query, 'id'),
    445453        'thumbnails_include' => 'include/category_default.inc.php',
    446454        )
  • trunk/index.php

    r1119 r1120  
    111111$template->set_filenames( array('index'=>'index.tpl') );
    112112//-------------------------------------------------------------- category title
    113 if (isset($page['category']))
    114 {
    115   $template_title = get_cat_display_name( $page['cat_name'], '', false );
    116 }
    117 else
    118 {
    119   $template_title = $page['title'];
    120 }
    121 
     113$template_title = $page['title'];
    122114if (isset($page['cat_nb_images']) and $page['cat_nb_images'] > 0)
    123115{
     
    226218{
    227219  $template->assign_block_vars('tags', array());
    228  
     220
    229221  // display tags associated to currently tagged items, less current tags
    230   $query = '
     222  $tags = array();
     223
     224  if ( !empty($page['items']) )
     225  {
     226    $query = '
    231227SELECT tag_id, name, url_name, count(*) counter
    232228  FROM '.IMAGE_TAG_TABLE.'
     
    237233  ORDER BY name ASC
    238234;';
    239   $result = pwg_query($query);
    240 
    241   $tags = array();
    242  
    243   while($row = mysql_fetch_array($result))
    244   {
    245     array_push($tags, $row);
     235    $result = pwg_query($query);
     236    while($row = mysql_fetch_array($result))
     237    {
     238      array_push($tags, $row);
     239    }
    246240  }
    247241
     
    277271            )
    278272          ),
    279        
     273
    280274        'NAME' => $tag['name'],
    281        
     275
    282276        'TITLE' => l10n('See pictures linked to this tag only'),
    283277
     
    286280          $tag['counter']
    287281          ),
    288        
     282
    289283        'CLASS' => 'tagLevel'.$tag['level']
    290284        )
  • trunk/language/en_UK.iso-8859-1/admin.lang.php

    r1119 r1120  
    259259$lang['nbm_content_new_elements'] = 'New elements were added on %s';
    260260$lang['nbm_content_new_elements_between'] = 'New elements were added between %s and %s';
    261 $lang['nbm_content_subscribe_by_admin'] = 'You are subcribed by webmaster for the notification by mail';
    262 $lang['nbm_content_subscribe_by_himself'] = 'You are subcribed for the notification by mail';
     261$lang['nbm_content_subscribe_by_admin'] = 'The webmaster has subcribed you for receiving notifications by mail';
     262$lang['nbm_content_subscribe_by_himself'] = 'You have subcribed to receiving notifications by mail';
    263263$lang['nbm_content_subscribe_link'] = 'To subscribe, click on %s .';
    264 $lang['nbm_content_subscribe_unsubscribe_contact'] = 'On problems or questions, send a message to %s.';
    265 $lang['nbm_content_unsubscribe_by_admin'] = 'You are unsubcribed by webmaster for the notification by mail';
    266 $lang['nbm_content_unsubscribe_by_himself'] = 'You are unsubcribed for the notification by mail';
     264$lang['nbm_content_subscribe_unsubscribe_contact'] = 'If you encounter problems or have any question, please send a message to %s.';
     265$lang['nbm_content_unsubscribe_by_admin'] = 'The webmaster has unsubcribed you from receiving notifications by mail';
     266$lang['nbm_content_unsubscribe_by_himself'] = 'You have unsubcribed from receiving notifications by mail';
    267267$lang['nbm_content_unsubscribe_link'] = 'To unsubscribe, click on %s .';
    268268$lang['nbm_info_send_mail_as'] = 'With blank value, gallery title will be used';
     
    275275$lang['nbm_no_mail_to_send'] = 'No mail to send.';
    276276$lang['nbm_no_user_available_to_send_L1'] = 'No user are available in order to send mail.';
    277 $lang['nbm_no_user_available_to_send_L2'] = 'A user is available, if the are news elements to notify';
     277$lang['nbm_no_user_available_to_send_L2'] = 'A user is available, if there are new elements to notify';
    278278$lang['nbm_no_user_to send_notifications_by_mail'] = 'No user to send notifications by mail.';
    279279$lang['nbm_object_news'] = 'New elements added';
    280 $lang['nbm_object_subcribe'] = 'Subcribe of notification by mail';
    281 $lang['nbm_object_unsubcribe'] = 'Unsubcribe of notification by mail';
     280$lang['nbm_object_subcribe'] = 'Subcribe to notification by mail';
     281$lang['nbm_object_unsubcribe'] = 'Unsubcribe from notification by mail';
    282282$lang['nbm_param_mode'] = 'Parameter';
    283283$lang['nbm_send_check_all'] = 'Check All';
     
    293293$lang['nbm_subscribe_mode'] = 'Subscribe';
    294294$lang['nbm_title_param'] = 'Parameters';
    295 $lang['nbm_title_send'] = 'Select sendings';
    296 $lang['nbm_title_subscribe'] = 'Subscribe/unscribe users';
     295$lang['nbm_title_send'] = 'Select recipients';
     296$lang['nbm_title_subscribe'] = 'Subscribe/unsubscribe users';
    297297$lang['nbm_unsubscribe_col'] = 'Unsubcribed';
    298298$lang['nbm_updated_param_count'] = '%d parameters are updated.';
    299299$lang['nbm_user_change_enabled_error_on_updated_data_count'] = '%d user(s) are not updated.';
    300 $lang['nbm_user_change_enabled_false'] = 'User %s [%s] removed of subscribe list.';
    301 $lang['nbm_user_change_enabled_true'] = 'User %s [%s] added to subscribe list.';
     300$lang['nbm_user_change_enabled_false'] = 'User %s [%s] removed from the subscription list.';
     301$lang['nbm_user_change_enabled_true'] = 'User %s [%s] added to the subscription list.';
    302302$lang['nbm_user_change_enabled_updated_data_count'] = '%d user(s) are updated.';
    303 $lang['nbm_user_not_change_enabled_false'] = 'User %s [%s] not removed of subscribe list.';
    304 $lang['nbm_user_not_change_enabled_true'] = 'User %s [%s] not added to subscribe list.';
     303$lang['nbm_user_not_change_enabled_false'] = 'User %s [%s] not removed from the subscription list.';
     304$lang['nbm_user_not_change_enabled_true'] = 'User %s [%s] not added to the subscription list.';
    305305$lang['nbm_user_x_added'] = 'User %s [%s] added.';
    306 $lang['nbm_warning_subscribe_unsubcribe'] = 'Warning, subscribe or unscribe send mails to users';
     306$lang['nbm_warning_subscribe_unsubcribe'] = 'Warning: subscribing or unsubcribing will send mails to users';
    307307$lang['no_write_access'] = 'no write access';
    308308$lang['order_by'] = 'order by';
  • trunk/tags.php

    • Property eol-style set to native
    • Property keywords set to Author Date Id Revision
    r1119 r1120  
    3737  }
    3838
    39   return ($a['counter'] < $b['counter']) ? -1 : 1;
     39  return ($a['counter'] < $b['counter']) ? +1 : -1;
    4040}
    4141
     
    103103          )
    104104        ),
    105      
     105
    106106      'NAME' => $tag['name'],
    107107      'TITLE' => $tag['counter'],
  • trunk/template/yoga/default-layout.css

    r1119 r1120  
    271271  white-space: nowrap;
    272272}
     273
     274#fullTagCloud { font-size: 140%; }
     275
     276#fullTagCloud LI { display: inline; }
     277
     278.tagLevel5 { font-size: 150%; }
     279.tagLevel4 { font-size: 140%; }
     280.tagLevel3 { font-size: 120%; }
     281.tagLevel2 { font-size: 100%; }
     282.tagLevel1 { font-size: 90%; }
Note: See TracChangeset for help on using the changeset viewer.