00103: separate functions for page name and wiki word spacing

Summary: separate functions for page name and wiki word spacing
Created: 2004-10-18 18:57
Status: Closed - fixed for 2.0.devel16
Category: Feature
From: jr
Assigned:
Priority: 4
Version: pmwiki 2 dev 13
OS: all

Description: In implementing an Cookbook/AlternateNamingScheme, I found it really useful to have 2 separate functions: SpacePageName and SpaceWikiWord. By default, PmWiki would set these both to 'AsSpaced'. In particular, would it be possible to add the following to trails.php

  
    global $AsSpacedFunction,$SpaceWikiWordsFunction;
    SDV($SpaceWikiWordsFunction,$AsSpacedFunction);
    ...
    the code that wraps WikiWords in [[ ... ]] would include a
       = ($SpaceWikiWords) ? $SpaceWikiWordsFunction( ... ) : ...
  

Right now, trails built using wiki words don't work correctly with the alternate naming scheme. The above change fixes it, allowing me to use a custom $SpaceWikiWordsFunction, without affecting standard sites. There may be a better solution, but the above is simple and mostly harmless.


Instead of the above approach (which should work fine), I just modified scripts/trails.php so that it correctly uses the original markup on the trail page rather than switching "WikiWord" to "[[WikiWord]]". As a result, all of the standard markup rules (including AsSpaced) apply to the WikiWord as normal.

--Pm

Array
(
    [post_max_size] => 64M
    [$_POST keys] => 
    [$_REQUEST keys] => n
    [$_SERVER] => Array
        (
            [CONTEXT_DOCUMENT_ROOT] => /home/pmwiki/public_html
            [CONTEXT_PREFIX] => 
            [DOCUMENT_ROOT] => /home/pmwiki/public_html
            [GATEWAY_INTERFACE] => CGI/1.1
            [HTTPS] => on
            [HTTP_ACCEPT] => */*
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [HTTP_HOST] => www.pmwiki.org
            [HTTP_REFERER] => https://www.pmwiki.org/PITS/00103
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_X_HTTPS] => 1
            [PATH] => /bin:/usr/bin
            [PHP_INI_SCAN_DIR] => /opt/cpanel/ea-php70/root/etc:/opt/cpanel/ea-php70/root/etc/php.d:.
            [QUERY_STRING] => n=PITS%2f00103
            [REDIRECT_HTTPS] => on
            [REDIRECT_QUERY_STRING] => n=PITS%2f00103
            [REDIRECT_SCRIPT_URI] => https://www.pmwiki.org/wiki/PITS/00103
            [REDIRECT_SCRIPT_URL] => /wiki/PITS/00103
            [REDIRECT_SSL_TLS_SNI] => www.pmwiki.org
            [REDIRECT_STATUS] => 200
            [REDIRECT_UNIQUE_ID] => afMS5wn3kPxQZYnczDb7cwAAANM
            [REDIRECT_URL] => /wiki/PITS/00103
            [REMOTE_ADDR] => 216.73.216.25
            [REMOTE_PORT] => 4019
            [REQUEST_METHOD] => GET
            [REQUEST_SCHEME] => https
            [REQUEST_URI] => /wiki/PITS/00103
            [SCRIPT_FILENAME] => /home/pmwiki/public_html/index.php
            [SCRIPT_NAME] => /index.php
            [SCRIPT_URI] => https://www.pmwiki.org/wiki/PITS/00103
            [SCRIPT_URL] => /wiki/PITS/00103
            [SERVER_ADDR] => 23.254.203.248
            [SERVER_ADMIN] => webmaster@pmwiki.org
            [SERVER_NAME] => www.pmwiki.org
            [SERVER_PORT] => 443
            [SERVER_PROTOCOL] => HTTP/1.1
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache
            [SSL_TLS_SNI] => www.pmwiki.org
            [TZ] => America/Los_Angeles
            [UNIQUE_ID] => afMS5wn3kPxQZYnczDb7cwAAANM
            [PHP_SELF] => /index.php
            [REQUEST_TIME_FLOAT] => 1777537767.6892
            [REQUEST_TIME] => 1777537767
            [argv] => Array
                (
                    [0] => n=PITS%2f00103
                )

            [argc] => 1
        )

)