<?
function wikiinsertvertlinks($params){
  global $textdir, $db, $scripturl,$lclstr;
  $text="";
  $ext=ereg_replace(".*\.txt", "\\1", $txtfile);
  # if ($dirmatch=ereg_replace("^ +\"(.*)\"", "\\1", $params)){
  if (ereg('.*\".*\".*',$params)){
    $dirmatch=preg_replace('/^.*\"(.*)\".*$/U',"\\1",$params);
    $dirmatch=ereg_replace("(^/| )", "", $dirmatch);
    $dp=opendir ("$textdir/$db");
    while ($file=readdir($dp)){
      if ((ereg("^\.", $file))||(ereg("\.lck$",$file))){
        continue;
      }
      $file=ereg_replace("\.txt$", "", $file);
      if (ereg($dirmatch, $file)){
        $text.= "<a href=\"$scripturl/$file\">$file</a><br>";
      }
    }
  } else {
    $text.= "<hr><b>".$lclstr[paramprob]."</b><hr>";
  }
  return $text;
}
?>
