Example #1
0
function makeLink($m)
{
    return actionLinkTag(htmlspecialchars(url2title($m[1])), 'wiki', title2url($m[1]));
}
require 'wikilib.php';
require 'Diff.php';
require 'Diff/Renderer/inline.php';
?>
<style type="text/css">
#wikidiff ins, #wikidiff del { text-decoration: none; }
#wikidiff ins { background: #060; color: #cfc; }
#wikidiff del { background: #600; color: #fcc; }
</style>
<?php 
$rev = (int) $_GET['rev'];
$page = getWikiPage($_GET['id'], $rev);
$rev = min($page['revision'], $rev);
$urltitle = $page['id'];
//urlencode($page['id']);
$nicetitle = htmlspecialchars(url2title($page['id']));
$title = 'Wiki &raquo; Diff: ' . $nicetitle;
$links = new PipeMenu();
//I think this is broken.
$links->add(new PipeMenuLinkEntry('Page', 'wiki', substr($urltitle, 5)));
$links->add(new PipeMenuLinkEntry('Discuss', 'wiki', 'Talk:' . $urltitle));
if ($page['canedit']) {
    $links->add(new PipeMenuLinkEntry('Edit', 'wikiedit', $urltitle));
}
makeLinks($links);
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Wiki"), "wiki"));
if ($page['ismain']) {
    $crumbs->add(new PipeMenuLinkEntry('Main page: Diff', 'wikidiff', $urltitle, 'rev=' . $rev));
} else {
    $crumbs->add(new PipeMenuLinkEntry($nicetitle, 'wiki', $urltitle));
} else {
    $page = getWikiPage($_GET['id']);
    $ptitle = $page['id'];
}
if (!preg_match('@[^_]@', $ptitle)) {
    Kill('You must enter a page title.');
}
if (!$page['canedit']) {
    Kill('You may not ' . ($page['new'] == 2 ? 'create pages.' : 'edit this page.'));
}
if ($page['flags'] & WIKI_PFLAG_DELETED && !$canmod) {
    Kill('This page has been deleted.');
}
$urltitle = $ptitle;
//urlencode($ptitle);
$nicetitle = htmlspecialchars(url2title($ptitle));
$title = 'Wiki &raquo; ' . ($page['new'] == 2 ? 'New page' : 'Editing: ' . $nicetitle);
$links = new PipeMenu();
if ($page['new'] != 2) {
    if ($page['istalk']) {
        $links->add(new PipeMenuLinkEntry('Page', 'wiki', substr($urltitle, 5)));
        $links->add(new PipeMenuTextEntry('Discuss'));
    } else {
        $links->add(new PipeMenuTextEntry('Page'));
        $links->add(new PipeMenuLinkEntry('Discuss', 'wiki', 'Talk:' . $urltitle));
    }
    $links->add(new PipeMenuLinkEntry('View', 'wiki', $urltitle));
}
makeLinks($links);
if (isset($_POST['saveaction'])) {
    if ($_POST['token'] !== $token) {
Example #4
0
            if ($ts == $yesterday) {
                $ts = 'Yesterday';
            }
        }
        if ($ts != $lastts) {
            $lastts = $ts;
            echo '
		<tr class="header0">
			<th colspan="2">' . $ts . '</th>
		</tr>';
        }
        $user = getDataPrefix($change, 'u_');
        $userlink = userLink($user);
        $date = formatdate($date);
        $links = actionLinkTagItem('View page', 'wiki', $change['id'], 'rev=' . $change['revision']);
        $changetext = 'Page ' . actionLinkTag(htmlspecialchars(url2title($change['id'])), 'wiki', $change['id']);
        if ($change['revision'] > 1) {
            $changetext .= ' edited by ' . $userlink . ' on ' . $date . ' (revision ' . $change['revision'] . ')';
            $links .= actionLinkTagItem('Diff', 'wikidiff', $change['id'], 'rev=' . $change['revision']);
        } else {
            $changetext .= ' created by ' . $userlink . ' on ' . $date;
        }
        echo '
		<tr class="cell' . $c . '">
			<td>' . $changetext . '</td>
			<td><ul class="pipemenu">' . $links . '</ul></td>
		</tr>';
        $c = $c == 1 ? 2 : 1;
    }
}
echo '
Example #5
0
<?php

$c1 = ircColor(Settings::pluginGet("color1"));
$c2 = ircColor(Settings::pluginGet("color2"));
$thename = $loguser["name"];
if ($loguser["displayname"]) {
    $thename = $loguser["displayname"];
}
$uncolor = ircUserColor($thename, $loguser['sex'], 0);
if ($urlRewriting) {
    $link = getServerURLNoSlash() . actionLink("wiki", $page['id'], '', '_');
} else {
    $link = getServerURL() . "?page=wiki&id=" . $page['id'];
}
if ($page['new'] == 2) {
    ircReport("{$c2}New wiki page: {$c1}" . url2title($page['id']) . " {$c2}created by {$c1}{$uncolor} {$c2} -- {$link}");
} else {
    ircReport("{$c2}Wiki page {$c1}" . url2title($page['id']) . " {$c2}edited by {$c1}{$uncolor} {$c2}(rev. {$rev}) -- {$link}");
}