Ejemplo n.º 1
0
function output_comment_form()
{
    global $pageid;
    global $comment_name;
    global $comment_body;
    global $comment_action;
    global $comment_error;
    $html_captcha = lwiki_auth_generate();
    $action = $comment_action;
    if ($action == '') {
        $action = lwiki_link_page($pageid);
    }
    echo '<div id="comment-form" style="width:400px;text-ailgn:center;border:1px solid gray;padding:10px 20px;">';
    if ($comment_error != '') {
        echo '  ' . $comment_error;
    }
    echo '  <form method="post" action="' . htmlspecialchars($action) . '">';
    echo '    <input type="hidden" name="type" value="comment_add" />';
    echo '    <input type="hidden" name="sigma" value="' . htmlspecialchars(_calculate_xsrfhash()) . '" />';
    echo '    <p style="margin:0.5em 0;">名前: <input type="text" name="name" size="20" value="' . htmlspecialchars($comment_name) . '"/></p>';
    echo '    <textarea name="body" rows="5" style="width:390px;padding:5px;">' . htmlspecialchars($comment_body) . '</textarea>';
    echo '    <div style="text-align:center;margin:0.5em;">';
    echo '      ' . $html_captcha . '<input type="submit" name="comment_post" value="投稿" />';
    echo '    </div>';
    echo '  </form>';
    echo '</div>';
}
Ejemplo n.º 2
0
<?php

// -*- mode:php -*-
require_once "lib.page-edit.php";
require_once "lib.page.php";
if (lwiki_auth_check($emsg) == 1) {
    lwiki\edit\error($emsg);
}
$frag_captcha = lwiki_auth_generate();
if (!$edit_session->exists()) {
    $frag_action = htmlspecialchars(lwiki_link_page($pageid, 'mode=edit'));
    $frag_title = '新規作成:' . $ht_page_title;
} else {
    if ($edit_session->is_part()) {
        $frag_action = htmlspecialchars(lwiki_link_page($pageid, 'mode=edit&part=' . urlencode($_GET['part'])));
        $frag_title = '部分編集:' . $ht_page_title;
    } else {
        $frag_action = htmlspecialchars(lwiki_link_page($pageid, 'mode=edit'));
        $frag_title = '編集:' . $ht_page_title;
    }
}
$frag_content = htmlspecialchars($edit_session->content());
$frag_edithash = htmlspecialchars($edit_session->edithash());
$frag_xsrfhash = htmlspecialchars($edit_session->xsrfhash());
$frag_remarks = htmlspecialchars($_POST['remarks']);
$frag_partlength = $edit_session->is_part() ? '<input type="hidden" name="partlength" value="' . $edit_session->partlength() . '" />' . PHP_EOL : '';
lwiki\page\begin_document($frag_title, '<meta name="robots" content="none" />' . PHP_EOL);
echo '<p class="lwiki-linkbar-main">';
$url_main = htmlspecialchars(lwiki_link_page());
$url_list = htmlspecialchars(lwiki_link_page(null, 'mode=list'));
echo '[ <a href="' . $url_main . '">表紙</a>' . ' | <a href="' . $url_list . '">一覧</a> ]';