Ignore:
Timestamp:
Apr 3, 2006, 12:26:19 AM (18 years ago)
Author:
plg
Message:

improvement: tags replace keywords. Better data model, less
limitations. Each image can be associated to as many tag as needed. Tags can
contain non ASCII characters. Oriented navigation with tags by association.

File:
1 edited

Legend:

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

    r1113 r1119  
    3232include_once( PHPWG_ROOT_PATH .'include/functions_group.inc.php' );
    3333include_once( PHPWG_ROOT_PATH .'include/functions_html.inc.php' );
     34include_once( PHPWG_ROOT_PATH .'include/functions_tag.inc.php' );
    3435include_once( PHPWG_ROOT_PATH .'include/functions_url.inc.php' );
    3536
     
    268269  return $picture_size;
    269270}
     271
     272/**
     273 * simplify a string to insert it into an URL
     274 *
     275 * based on str2url function from Dotclear
     276 *
     277 * @param string
     278 * @return string
     279 */
     280function str2url($str)
     281{
     282  $str = strtr(
     283    $str,
     284    'ÀÁÂÃÄÅàáâãäåÇçÒÓÔÕÖØòóôõöøÈÉÊËèéêëÌÍÎÏìíîïÙÚÛÜùúûü¾ÝÿýÑñ',
     285    'AAAAAAaaaaaaCcOOOOOOooooooEEEEeeeeIIIIiiiiUUUUuuuuYYyyNn'
     286    );
     287
     288  $str = str_replace('Æ', 'AE', $str);
     289  $str = str_replace('æ', 'ae', $str);
     290  $str = str_replace('¼', 'OE', $str);
     291  $str = str_replace('½', 'oe', $str);
     292
     293  $str = preg_replace('/[^a-z0-9_\s\'\:\/\[\]-]/','',strtolower($str));
     294  $str = preg_replace('/[\s\'\:\/\[\]-]+/',' ',trim($str));
     295  $res = str_replace(' ','_',$str);
     296 
     297  return $res;
     298}
     299
    270300//-------------------------------------------- PhpWebGallery specific functions
    271301
     
    830860  return $available_upgrade_ids;
    831861}
    832 
    833862?>
Note: See TracChangeset for help on using the changeset viewer.