Welcome! Log In Create A New Profile

Advanced

Ideas and notes

Posted by SebastienBailard 
Ideas and notes
January 22, 2010 05:28PM
It would be handy to tweek phorum so that everything like [[page]] is a link into the wiki.

I think it would help user education and uptake.

That and single sign-on for the forum and the wiki.
Re: Ideas and notes
January 30, 2010 06:39AM
I don't know phorum, but assuming it's php, it shouldn't be hard to do something like this to the page output, just before it's rendered to the user:




// supports these link formats:
// [[Collectiontongue sticking out smileyage|Description]] or
// [[Collectiontongue sticking out smileyage]]
// [[Page]]

$Pattern="/\[\[(\\w+smiling smiley?(\\w+)\\|?([^]]*)\\]\\]/im";

if (preg_match_all ( $Pattern, $pgText, $colMatches,PREG_SET_ORDER))
{
//print "
";
    //print_r($colMatches);
    //print "
";

foreach ($colMatches as $Match)
{

// because of PREG_SET_ORDER
// $Match[0] is the full match, $Match[1] is the first submatch, $Match[2] is the second submatch etc.
$Collection=$Match[1];
$PageName=$Match[2];
$LinkText=$Match[3];

// TODO - cleanup $Collection, and $PageName to not have any or etc tags in them!

if ($LinkText=="")
{
return false;
}

if (strlen($Collection)==0)
{
$Collection="Main"; // a default
}

$pgText=str_replace($Match[0],"
".$LinkText."",$pgText);
}

}
Sorry, only registered users may post in this forum.

Click here to login