[Pmwiki-users] Discussionlink / DiscussionBackLink - 2

nexyufuli evo noskule
Tue Jan 4 11:38:19 CST 2005


now its working . .thanx very much
noskule

looks like this:

## DiscussionBackLink
-----------------------------------------------------------------------

## This adds a Link witch points back to the article
function DiscussBacklink($pagename,$args) {
        # if the pagename ends with "-Discussion", make a link with the 
pagename without the string "-Discussion"
        if (preg_match("/-Discussion$/",$pagename)) print 
FmtWikiLink('',"{{".str_replace("-Discussion",'',$pagename)."}}","Back");
}

Ilya Zverev wrote:

>ne> hmm the point bevor str_replace seems to be very important
>yup, that's string concatenation operator.
>
>ne> ## This adds a Link witch points back to the article
>ne> function DiscussBacklink($pagename,$args) {
>ne> # if the pagename ends with "-Discussion", make a link with the pagename without the string "-Discussion"
>ne> if (preg_match("/-Discussion$/",$pagename)) print 
>ne> FmtWikiLink('',"{{".str_replace("/-Discussion/",'',$pagename)."}}","Back");
>ne> }
>FmtWikiLink('',"{{".str_replace("-Discussion",'',$pagename)."}}","Back");
>
>'cause '/'s were bounds for regular expression, but there's just a
>string needen in the str_replace.
>
>
>Ilya
>
>
>
>  
>



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.7 - Release Date: 30.12.2004




More information about the pmwiki-users mailing list