[Pmwiki-users] Discussionlink / DiscussionBackLink - 2

nexyufuli evo noskule
Tue Jan 4 11:15:01 CST 2005


Ilya Zverev wrote:

>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
>ne> without the string "-Discussion"
>ne> if (preg_match("/-Discussion$/",$pagename)) print
>ne> FmtWikiLink('',"{{str_replace("/-Discussion/",,$pagename)}}","Back") '';
>this line must be:
>FmtWikiLink('',"{{".str_replace("/-Discussion/",,$pagename)."}}","Back");
>
>ne> }
>
>
>Ilya
>  
>
hmm the point bevor str_replace seems to be very important  . . .. .so 
now if got somthing without error, so i can feel some progress :-)
but unfortunality the output is wrong . . .means

i got this:
http://www.netstreams.org/wegweisungsartikel_pmwiki/index.php?pagename=Main.HomePage-Discussion

but would like:
http://www.netstreams.org/wegweisungsartikel_pmwiki/index.php?pagename=Main.HomePage

what could be the problem here  . . .?
thanx nos


## 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");
}




function DiscussLink($pagename,$args) {
    # if the current page already ends in "-Discussion", don't make a link
    if (preg_match("/-Discussion$/",$pagename)) return '';
 
    # otherwise, generate a link using FmtWikiLink
    print FmtWikiLink('',"{{".$pagename."-Discussion}}","Discuss");
  }


-- 
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