I've changed the acceptable page name patterns successfully with the
following code, so that I can have gRoup-and_also/page_nameS_like_THIS.
However, pagelists/searches still only find the pages/groups that comply to
the old standard.

I've been poking around pagelist.php, but I'm not even sure what I'm looking
for. None of the regex seems to be related to page names.

Thanks for your help!


if( $Charset=='UTF-8' ) {
  $PageNameChars='-_[:alnum:]\\x80-\\xfe';
  $MakePageNamePatterns = array(
    "/'/" => '',                           # strip single-quotes
    "/[^$PageNameChars]+/" => ' ',         # convert everything else to
space
    "/(^\\s+)|(\\s+\$)/" => '',            # trim whitespaces
    "/^([a-z])/e" => "strtoupper('$1')",   # uppercase first letter
    "/ /" => '_');                         # convert spaces to undersc
} else {
  $PageNameChars = '-_[:alnum:]';
  $MakePageNamePatterns = array(
    "/'/" => '',                           # strip single-quotes
    "/[^$PageNameChars]+/" => ' ',         # convert everything else to
space
    "/(^\\s+)|(\\s+\$)/" => '',            # trim whitespaces
    "/ /" => '_'                           # convert spaces to underscores
  );
}

$AsSpacedFunction = 'AsSpacedUnderlines';
function AsSpacedUnderlines($text) {
  return strtr($text,'_',' ');
}

Mike
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Reply via email to