Revision history for WikiTrail
Revision [19449]
Last edited on 2008-01-28 00:16:02 by BrianKoontz [Modified links pointing to docs server]No Differences
Additions:
if ($param == 'list') {$list=htmlspecialchars($vars['list']);}
$pages = array();
//if we have a category as a list-page, get the pages belonging to the category
if (preg_match('/^Category/',$trailpage['tag']))
{
if ($this->CheckMySQLVersion(4,0,1))
{
$results = $this->FullCategoryTextSearch($trailpage['tag']);
}
else
{
$results = $this->FullTextSearch($trailpage['tag']);
}
foreach ($results as $cpage)
{
if (!preg_match('/^Category/', $cpage['tag']))
{
$pages[] = $cpage['tag'];
}
}
sort($pages);
}
else //search the page for a bulleted list containing Wikiwords
{
foreach(explode("\n",$trailpage['body']) as $x)
{
if (preg_match("/(~-|\\t-|~1\)|\\t1\)|~A\)|\\tA\)|~a\)|\\ta\)|~I\)|\\tI\)|~i\)|\\ti\))\\s?(\[\[)?([A-Za-z0-9ÄÖÜ]*)/",$x,$match))
{
$pages[] = $match[3];
}
}
}
//search the list of pages for this page and make the trail
for($i=0;$i<count($pages);$i++)
{
if (strtolower($pages[$i]) == strtolower($thispage))
{
$output .= '<span class="wikitrail">';
if ($i>0) $output .= $signleft.' '.$this->Link($pages[$i-1]).' '.$seperator.' ';
$output .= $this->Link($list);
if ($i+1<count($pages)) $output .= ' '.$seperator.' '.$this->Link($pages[$i+1]).' '.$signright;
$output .= '</span>';
}
}
$pages = array();
//if we have a category as a list-page, get the pages belonging to the category
if (preg_match('/^Category/',$trailpage['tag']))
{
if ($this->CheckMySQLVersion(4,0,1))
{
$results = $this->FullCategoryTextSearch($trailpage['tag']);
}
else
{
$results = $this->FullTextSearch($trailpage['tag']);
}
foreach ($results as $cpage)
{
if (!preg_match('/^Category/', $cpage['tag']))
{
$pages[] = $cpage['tag'];
}
}
sort($pages);
}
else //search the page for a bulleted list containing Wikiwords
{
foreach(explode("\n",$trailpage['body']) as $x)
{
if (preg_match("/(~-|\\t-|~1\)|\\t1\)|~A\)|\\tA\)|~a\)|\\ta\)|~I\)|\\tI\)|~i\)|\\ti\))\\s?(\[\[)?([A-Za-z0-9ÄÖÜ]*)/",$x,$match))
{
$pages[] = $match[3];
}
}
}
//search the list of pages for this page and make the trail
for($i=0;$i<count($pages);$i++)
{
if (strtolower($pages[$i]) == strtolower($thispage))
{
$output .= '<span class="wikitrail">';
if ($i>0) $output .= $signleft.' '.$this->Link($pages[$i-1]).' '.$seperator.' ';
$output .= $this->Link($list);
if ($i+1<count($pages)) $output .= ' '.$seperator.' '.$this->Link($pages[$i+1]).' '.$signright;
$output .= '</span>';
}
}
Deletions:
$pages = array();
//if we have a category as a list-page, get the pages belonging to the category
if (preg_match('/^Category/',$trailpage['tag']))
{
if ($this->CheckMySQLVersion(4,0,1))
{
$results = $this->FullCategoryTextSearch($trailpage['tag']);
}
else
{
$results = $this->FullTextSearch($trailpage['tag']);
}
foreach ($results as $cpage)
{
if (!preg_match('/^Category/', $cpage['tag']))
{
$pages[] = $cpage['tag'];
}
}
sort($pages);
}
else //search the page for a bulleted list containing Wikiwords
{
foreach(explode("\n",$trailpage['body']) as $x)
{
if (preg_match("/(~-|\\t-|~1\)|\\t1\)|~A\)|\\tA\)|~a\)|\\ta\)|~I\)|\\tI\)|~i\)|\\ti\))\\s?(\[\[)?([A-Z,a-z,0-9,ÄÖÜ]*)\\s/",$x,$match))
{
$pages[] = $match[3];
}
}
}
//search the list of pages for this page and make the trail
for($i=0;$i<count($pages);$i++)
{
if (strtolower($pages[$i]) == strtolower($thispage))
{
$output .= '<span class="wikitrail">';
if ($i>0) $output .= $signleft.' '.$this->Link($pages[$i-1]).' '.$seperator.' ';
$output .= $this->Link($list);
if ($i+1<count($pages)) $output .= ' '.$seperator.' '.$this->Link($pages[$i+1]).' '.$signright;
$output .= '</span>';
}
}
Additions:
""<< previous page | trail-page | next page >>""
===Comments?===
===Comments?===
Deletions:
==Comments?===