getLink($num); $b = 'mockup/'; //$n = ''; break; }; } if ($link == '') { $link = $b . $n; $link = "$name $num "; } return $link; } function processFile($filename) { $text = file_get_contents($filename); $re = "/(ticket|task|mockup)\s+(\d{2,5})/i"; $ret = preg_replace_callback($re, "pcb", $text); return $ret; } /////////////////////////////////////// $mockupList = new MockupList('./mockups', array('jpg', 'png')); $mockupList->getData(); $docList = new DocList('./', array('html', 'htm')); $docs = $docList->getData(); if (($fname == '') && (sizeof($docs) > 0)) { $redirectFile = $docs[0]['filename']; header("Location: $redirectFile"); exit; } if (is_file($fname)) { $content_text = processFile($fname); } else if ($fname != 'ALL.html') { $content_text = 'NOT FOUND'; } else { $content_text = ''; $n = 1; foreach ($docs as $d) { $content_text .= '

File #' . $n . '. ' . $d['title'] . '

'; $content_text .= processFile($d['filename']); $content_text .= '
'; $n++; } }