예제 #1
0
function ewiki_action_infoqdiff_plain($id, $data, $prev, $ver)
{
    $CLK = "%c";
    #-- get
    if ($d = ewiki_db::GET($id, $ver - 1)) {
        $curr = $prev;
        $prev = $d;
        $d = NULL;
    } else {
        continue;
    }
    #-- info header
    $o .= '<p>';
    $o .= 'Version: <b><a href="' . ewiki_script_url("", $id, "version={$ver}") . "\">version {$ver}</a></b> / " . 'Author: <b>' . ewiki_author_html($curr["author"]) . "</b> / " . 'Time: <b>' . strftime($CLK, $curr["lastmodified"]) . "</b>";
    $o .= '</p>';
    #-- diff part
    $diff = ewiki_stupid_diff($curr["content"], $prev["content"], $show_unchanged = 0, $magic_notes = 1);
    $o .= '<p>' . $diff . '</p>';
    return $o;
}
예제 #2
0
function ewiki_page_rc_moin(&$e, &$meta)
{
    $clockstr = ewiki_t("CLOCK");
    $o .= '<table class="changes" border="0" width="100%">' . '<colgroup><col width="35%"><col width="5%"><col width="25%"><col width="35%"></colgroup>';
    foreach ($e as $datestr => $pages) {
        $o .= "\n<tr><td colspan=\"3\"><br /><h4 class=\"date\">{$datestr}</h4></td></tr>\n";
        foreach ($pages as $id) {
            $link = '<a href="' . ewiki_script("", $id) . '">' . rawurldecode($id) . '</a>';
            $time = strftime($clockstr, $meta[$id][0][2]);
            $changes = $meta[$id];
            if (count($changes) >= 2) {
                #-- enum unique author names
                $a = array();
                foreach ($changes as $i => $str) {
                    $str = strtok($str[0], " <(");
                    $a[$str][] = $i + 1;
                }
                $str = "";
                foreach ($a as $author => $i) {
                    $author = ewiki_author_html($author, 0);
                    $str .= $author . "[" . implode(",", $i) . "]<br /> ";
                }
                $author = $str;
                #-- enum log entries
                $log = "";
                foreach ($meta[$id] as $i => $str) {
                    if ($str = $str[1]) {
                        $log .= "#" . ($i + 1) . " " . htmlentities($str) . "<br />\n";
                    }
                }
            } else {
                $author = ewiki_author_html($meta[$id][0][0]);
                $log = htmlentities($meta[$id][0][1]);
            }
            $o .= '<tr><td class="page"> &middot; ' . $link . '</td>' . '<td class="time"> [' . $time . '] </td>' . '<td class="author">' . $author . '</td>' . '<td class="log">' . $log . '</td></tr>' . "\n";
        }
    }
    $o .= "</table>\n";
    return $o;
}