Ignore:
Timestamp:
Apr 6, 2006, 4:23:54 AM (18 years ago)
Author:
rvelices
Message:

improvement: urls for tags can contain now only the tag or the id and tag

improvement: urls for category can be now id and category names (instead
of only id)

improvement: added 2 indexes (#image_tag.tag_id and #tags.url_name)

improvement: identification, register, search pages automatically set focus
on first form input

improvement: focus, nofocus css class now valid for all forms

fix: category comment is tag stripped in category_subcats.inc.php
(otherwise issues with html/scripts inside category comment)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_url.inc.php

    r1119 r1131  
    257257function make_section_in_URL($params)
    258258{
     259  global $conf;
    259260  $section_string = '';
    260261
     
    290291      {
    291292        $section_string.= '/category/'.$params['category'];
     293        if ($conf['category_url_style']=='id-name' and isset($params['cat_name']) )
     294        {
     295          if ( is_string($params['cat_name']) )
     296          {
     297            $section_string.= '-'.str2url($params['cat_name']);
     298          }
     299          elseif ( is_array( $params['cat_name'] ) and
     300                isset( $params['cat_name'][$params['category']] ) )
     301          {
     302            $section_string.= '-'
     303                .str2url($params['cat_name'][$params['category']]);
     304          }
     305        }
    292306      }
    293307
     
    305319      foreach ($params['tags'] as $tag)
    306320      {
    307         $section_string.= '/'.$tag['id'];
    308        
    309         if (isset($tag['url_name']))
     321        switch ( $conf['tag_url_style'] )
    310322        {
    311           $section_string.= '-'.$tag['url_name'];
     323          case 'id':
     324            $section_string.= '/'.$tag['id'];
     325            break;
     326          case 'tag':
     327            if (isset($tag['url_name']) and !is_numeric($tag['url_name']) )
     328            {
     329              $section_string.= '/'.$tag['url_name'];
     330              break;
     331            }
     332          default:
     333            $section_string.= '/'.$tag['id'];
     334            if (isset($tag['url_name']))
     335            {
     336              $section_string.= '-'.$tag['url_name'];
     337            }
    312338        }
    313339      }
Note: See TracChangeset for help on using the changeset viewer.