Example #1
0
function wiki_link($target, $text, $unknown = FALSE, $version = 'Current', $fullurl = false)
{
    global $WIKI_PAGEDIR, $WIKI_REPOSITORY, $_SERVER;
    if ($fullurl) {
        $prefix = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'] . '/';
    }
    $cur = $version == 'Current';
    if ($cur) {
        $realversion = key(rcs_get_revisions($WIKI_PAGEDIR . $target));
    } else {
        $realversion = $version;
    }
    return ($unknown ? "<span class='wikiwordunknown'>{$text}" : "") . '<a href="' . $prefix . pqurlencode($target) . ($realversion ? ";{$realversion}" : '') . '"' . ($realversion ? ' title="' . $text . " v{$realversion}" . ($cur ? ' (Current)' : '') . '"' : '') . ($unknown ? '' : ' class="wikiword"') . '>' . ($unknown ? '?' : $text) . '</a>' . ($unknown ? '</span>' : '');
}
Example #2
0
 function link_known_wikipage($page, $text)
 {
     #$$e = $this->environment();
     if (is_dir($this->pagedir . $page)) {
         return parent::link_known_wikipage($page, $text);
     }
     $t = rcs_get_revisions($this->pagedir . $page);
     $realversion = key($t);
     return '<a href="' . pqurlencode($page) . ($realversion ? ";{$realversion}" : '') . '"' . ($realversion ? ' title="' . $text . " v{$realversion}" . '"' : '') . '>' . $text . '</a>';
     return $text;
 }
Example #3
0
         $links[] = hyperlink($SELF_NOVERSION . ";Current", "Current Version");
     }
     $links[] = hyperlink($_SERVER['SCRIPT_NAME'] . '?list', "List of Pages");
     $links[] = hyperlink($_SERVER['SCRIPT_NAME'] . '?recentchanges', "Recent Changes");
     $links[] = hyperlink($_SERVER['SCRIPT_NAME'], "Main Page");
     if (WIKI_LOGINS) {
         if (!is_logged_in()) {
             $links[] = hyperlink($_SERVER['PHP_SELF'] . "?login", "Log in");
         } else {
             $links[] = hyperlink($_SERVER['PHP_SELF'] . "?logout", "Log Out");
             //$links[] = ("Close your browser to log out");
         }
     }
     print "</p>";
     print "<p>" . join(' ', $links) . "</p>";
     print "<form action='" . pqurlencode($_SERVER['PHP_SELF']) . "' method='get'><p><label>Search&#xA0;<input type='text' name='search' size='10' /></label></p></form>";
 } elseif ($action == 'reply') {
     if (get_magic_quotes_gpc()) {
         $_GET['to'] = stripslashes($_GET['to']);
     }
     print replyform($page['body'], $_GET['to']);
 } elseif ($action == 'edit') {
     if ($version != $Current) {
         print "<p><em><strong>Warning:</strong> You're not editing the most recent version\n\t\t\t\tof this page.   If you make changes here, you'll save over\n\t\t\t\tsomething that was written since the page you're reading. Be\n\t\t\t\tnice and go to the <a\n\t\t\t\thref='" . rawurlencode($pagename) . ";{$Current}?edit'>current\n\t\t\t\tversion</a> and edit\n\t\t\t\tthat.</em></p><p><em>If you've already typed something, make\n\t\t\t\ta copy, don't hit save, go find where you're supposed to put\n\t\t\t\tit, and then save it there!</em></p>";
     }
     print editform($page['body'], $page['header'], rcs_dereference_version($WIKI_PAGEDIR . "{$pagename}", $version));
     if ($version != $Current) {
         print "<p><em><strong>Warning</strong>, this isn't the current\n\t\t\t\tversion of the page!</em></p>";
     }
 } else {
     die("Error. Unknown Action");
Example #4
0
function image($file, $alt = "")
{
    return "<img src='" . pqurlencode($file) . "' alt='{$alt}' />";
}