[pmwiki-devel] making pagelists work with lower case group and page names...

Michael Shanley mike at upisup.com
Tue Jan 13 10:27:50 CST 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-devel/attachments/20090113/08af428c/attachment.html 


More information about the pmwiki-devel mailing list