Startpage >> PmWiki >> LinkVariables

Link Variables

PmWiki.LinkVariables History

Hide minor edits - Show changes to output

August 31, 2011, at 11:45 AM by Blahma -
Changed lines 1-59 from:
I'll try to put this to good use immeditaley.
to:
(:Summary:variables that control the display of links in pages:)
(:Audience: admins (advanced):)
:$EnableLinkPageRelative:When enabled, causes PmWiki to use relative urls for page links instead of absolute urls.
$EnableLinkPageRelative = 1;

:$PagePathFmt: This array lists the order in which PmWiki looks for the page that you ''most likely'' are attempting to link to. The default is listed below. Look at Cookbook:PagePaths for some ideas.
[=array('{$Group}.$1','$1.$1'.'$1.{$DefaultName}')=]

:$LinkPageExistsFmt:The (HTML) string to output for links to already existing wiki pages. Defaults to
<a class='wikilink' href='\$LinkUrl'>\$LinkText</a>

:$LinkPageCreateFmt:The (HTML) string to output for links to non-existent wiki pages. The default is to add a '?' after the link text with a link to the page edit/create form. Defaults to
<a class='createlinktext' href='\$PageUrl?action=edit'>\$LinkText</a>
<a class='createlink' href='\$PageUrl?action=edit'>?</a>

:$LinkPageCreateSpaceFmt:Same as $LinkPageCreateFmt, but used when the link text has a space in it.

:$LinkPageSelfFmt:The (HTML) string to output for self-referencing links (i.e. links to the page itself). Defaults to
<a class='selflink' href='\$LinkUrl'>\$LinkText</a>

:$UrlLinkFmt:The (HTML) string to output for URL-links that begin with 'http:', 'ftp:', etc. Defaults to
<a class='urllink' href='\$LinkUrl' rel='nofollow'>\$LinkText</a>

:$IMapLinkFmt: an array of link formats for various link "schemes". Not set as default.
->Examples of custom formats to allow different styling via classes:
->Links to http: standard url links:
$IMapLinkFmt['http:'] = "<a class='httplink urllink' href='\$LinkUrl'>\$LinkText</a>";
->Links to https: secure pages:
$IMapLinkFmt['https:'] = "<a class='httpslink urllink' href='\$LinkUrl'>\$LinkText</a>";
->Links to PmWiki: InterMap shortcut:
$IMapLinkFmt['PmWiki:'] = "<a class='pmwikilink urllink' href='\$LinkUrl'>\$LinkText</a>";

:$InterMapFiles:An array consisting a list of files and pages containing InterMap entries to be loaded (see [[CustomInterMap]]).

:$MakePageNameFunction:Name of a custom function to replace `MakePageName(), which converts strings into valid page names.

:$MakePageNamePatterns: $MakePageNamePatterns is an array of regular expression replacements that is used to map the page link in a ''free link'' such as [@[[free link]]@] into a page name. Currently the default sequence is: [@
"/'/" => '', # strip single-quotes
"/[^$PageNameChars]+/" => ' ', # convert non-alnums to spaces
"/((^|[^-\\w])\\w)/e"
=> "strtoupper('$1')", # initial caps after spaces
"/ /" => '' # strip spaces
@]
: :Note that if you change $MakePageNamePatterns, the documentation links may break. This can be fixed by re-setting $MakePageNamePatterns to the default in local/PmWiki.php.

:$WikiWordCountMax:The maximum number of times to convert each WikiWord encountered on a page. Defaults to 1,000,000. Common settings for this variable are zero (disable WikiWord links) and one (convert only the first occurrence of each WikiWord).
$WikiWordCountMax = 0; # disable WikiWord links
$WikiWordCountMax = 1; # convert only first WikiWord

:$WikiWordCount:An array that allows the number of WikiWord conversions to be set on a per-WikiWord basis. The default is to use $WikiWordCountMax unless a value is set in this array. By default PmWiki sets @@$WikiWordCount['PmWiki']=1@@ to limit the number of conversions of "PmWiki".
$WikiWordCount[=['PhD']=0; # Don't convert "PhD"=]
$WikiWordCount['WikiWord']=5; # Convert WikiWord 5 times
# the following lines keep a page from linking to itself
$title = [=FmtPageName=]('$Title_',$pagename);
$WikiWordCount[$title]=0;

:$EnableRedirectQuiet:Enable the @@quiet=1@@ parameter for the [[PmWiki.PageDirectives#redirect|redirect directive]]. On publicly edited wikis it is advisable not to enable quiet redirects.
$EnableRedirectQuiet = 0; # disable quiet redirects (default)
$EnableRedirectQuiet = 1; # enable quiet redirects
July 07, 2011, at 10:26 PM by Stew - qCfLJyLMShSfipVkS
Changed line 1 from:
eIFplE , [url=http://wnmrrqfohvcw.com/]wnmrrqfohvcw[/url], [link=http://zpywzddoumbn.com/]zpywzddoumbn[/link], http://ltyknsikcpsx.com/
to:
I'll try to put this to good use immeditaley.
July 07, 2011, at 03:46 PM by evxscblgqdr - FwNCUmTKlU
Changed line 1 from:
ib1ZQN <a href="http://hcrwzhvzkexo.com/">hcrwzhvzkexo</a>
to:
eIFplE , [url=http://wnmrrqfohvcw.com/]wnmrrqfohvcw[/url], [link=http://zpywzddoumbn.com/]zpywzddoumbn[/link], http://ltyknsikcpsx.com/
July 06, 2011, at 03:12 PM by jjweugjbaqz - wYmbzosVLuejVejv
Changed line 1 from:
Ppl like you get all the brains. I just get to say tahkns for he answer.
to:
ib1ZQN <a href="http://hcrwzhvzkexo.com/">hcrwzhvzkexo</a>
July 06, 2011, at 10:26 AM by Shorty - gUYYPdIGCfwOsgXsV
Changed lines 1-59 from:
(:Summary:variables that control the display of links in pages:)
(:Audience: admins (advanced):)
:$EnableLinkPageRelative:When enabled, causes PmWiki to use relative urls for page links instead of absolute urls.
$EnableLinkPageRelative = 1;

:$PagePathFmt: This array lists the order in which PmWiki looks for the page that you ''most likely'' are attempting to link to. The default is listed below. Look at Cookbook:PagePaths for some ideas.
[=array('{$Group}.$1','$1.$1'.'$1.{$DefaultName}')=]

:$LinkPageExistsFmt:The (HTML) string to output for links to already existing wiki pages. Defaults to
<a class='wikilink' href='\$LinkUrl'>\$LinkText</a>

:$LinkPageCreateFmt:The (HTML) string to output for links to non-existent wiki pages. The default is to add a '?' after the link text with a link to the page edit/create form. Defaults to
<a class='createlinktext' href='\$PageUrl?action=edit'>\$LinkText</a>
<a class='createlink' href='\$PageUrl?action=edit'>?</a>

:$LinkPageCreateSpaceFmt:Same as $LinkPageCreateFmt, but used when the link text has a space in it.

:$LinkPageSelfFmt:The (HTML) string to output for self-referencing links (i.e. links to the page itself). Defaults to
<a class='selflink' href='\$LinkUrl'>\$LinkText</a>

:$UrlLinkFmt:The (HTML) string to output for URL-links that begin with 'http:', 'ftp:', etc. Defaults to
<a class='urllink' href='\$LinkUrl' rel='nofollow'>\$LinkText</a>

:$IMapLinkFmt: an array of link formats for various link "schemes". Not set as default.
->Examples of custom formats to allow different styling via classes:
->Links to http: standard url links:
$IMapLinkFmt['http:'] = "<a class='httplink urllink' href='\$LinkUrl'>\$LinkText</a>";
->Links to https: secure pages:
$IMapLinkFmt['https:'] = "<a class='httpslink urllink' href='\$LinkUrl'>\$LinkText</a>";
->Links to PmWiki: InterMap shortcut:
$IMapLinkFmt['PmWiki:'] = "<a class='pmwikilink urllink' href='\$LinkUrl'>\$LinkText</a>";

:$InterMapFiles:An array consisting a list of files and pages containing InterMap entries to be loaded (see [[CustomInterMap]]).

:$MakePageNameFunction:Name of a custom function to replace `MakePageName(), which converts strings into valid page names.

:$MakePageNamePatterns: $MakePageNamePatterns is an array of regular expression replacements that is used to map the page link in a ''free link'' such as [@[[free link]]@] into a page name. Currently the default sequence is: [@
"/'/" => '', # strip single-quotes
"/[^$PageNameChars]+/" => ' ', # convert non-alnums to spaces
"/((^|[^-\\w])\\w)/e"
=> "strtoupper('$1')", # initial caps after spaces
"/ /" => '' # strip spaces
@]
: :Note that if you change $MakePageNamePatterns, the documentation links may break. This can be fixed by re-setting $MakePageNamePatterns to the default in local/PmWiki.php.

:$WikiWordCountMax:The maximum number of times to convert each WikiWord encountered on a page. Defaults to 1,000,000. Common settings for this variable are zero (disable WikiWord links) and one (convert only the first occurrence of each WikiWord).
$WikiWordCountMax = 0; # disable WikiWord links
$WikiWordCountMax = 1; # convert only first WikiWord

:$WikiWordCount:An array that allows the number of WikiWord conversions to be set on a per-WikiWord basis. The default is to use $WikiWordCountMax unless a value is set in this array. By default PmWiki sets @@$WikiWordCount['PmWiki']=1@@ to limit the number of conversions of "PmWiki".
$WikiWordCount[=['PhD']=0; # Don't convert "PhD"=]
$WikiWordCount['WikiWord']=5; # Convert WikiWord 5 times
# the following lines keep a page from linking to itself
$title = [=FmtPageName=]('$Title_',$pagename);
$WikiWordCount[$title]=0;

:$EnableRedirectQuiet:Enable the @@quiet=1@@ parameter for the [[PmWiki.PageDirectives#redirect|redirect directive]]. On publicly edited wikis it is advisable not to enable quiet redirects.
$EnableRedirectQuiet = 0; # disable quiet redirects (default)
$EnableRedirectQuiet = 1; # enable quiet redirects
to:
Ppl like you get all the brains. I just get to say tahkns for he answer.
Lasta ŝanĝo August 31, 2011, at 11:45 AM