コード例 #1
0
     }
     $echostring .= $ackeychar[0] . '<a href="' . $myurl . '?view=list&start=0' . $ses_param . '" accesskey="0">一覧へ戻る</a><br/>';
     break;
 case "comprev":
     $num = intval($_REQUEST["num"]);
     $p = intval($_REQUEST["p"]);
     $start = intval(isset($_REQUEST["start"]) ? $_REQUEST["start"] : 0);
     if ($CommentPerPage > 10) {
         $CommentPerPage = 10;
     }
     //コメント表示
     $postdata = get_postdata($p);
     $tmp = substr($postdata['Date'], 5, 2) . '/' . substr($postdata['Date'], 8, 2) . substr($postdata['Date'], 10, 6);
     $echostring .= '<b>' . $postdata['Title'] . '(' . $tmp . ')へのコメント</b>';
     $echostring .= '<hr />';
     $comment_num = get_number_of_comments($postdata['ID']);
     $comments = get_comments($postdata['ID'], $start, $CommentPerPage);
     if ($comments) {
         foreach ($comments as $comment) {
             $author = apply_filters('comment_author', $comment->comment_author);
             if (empty($author)) {
                 $author = 'Anonymous';
             }
             $echostring .= '<b>by ' . $author;
             $tmp = substr($comment->comment_date, 5, 2) . '/' . substr($comment->comment_date, 8, 2) . substr($comment->comment_date, 10, 6);
             $echostring .= '(' . $tmp . ')</b><br /><br />';
             $comment_text = str_replace('<trackback />', '', $comment->comment_content);
             $comment_text = str_replace('<pingback />', '', $comment_text);
             $echostring .= apply_filters('comment_text', $comment_text);
             $echostring .= '<hr />';
         }
コード例 #2
0
ファイル: index.php プロジェクト: halfbyte/janzyklopedie
            $error_message = "Logged out";
        } else {
            $headtpl->SetVariable("titel", "Get Action wrong");
            $error_message = "Wrong GET action";
        }
        # no action, must be index-style
    } else {
        $entry = get_latest_article();
        if ($entry) {
            # head- titel setzen
            $headtpl->SetVariable("titel", $entry[title]);
            # main-template laden
            $tpl->loadTemplatefile("index.tpl.html", true, true);
            $tpl->SetVariable("titel", $entry[title]);
            $tpl->SetVariable("entry_id", $entry[entry_id]);
            $number_comments = get_number_of_comments($entry[entry_id]);
            $tpl->SetVariable("anz_kommentare", $number_comments[0]['COUNT(*)']);
            $tpl->SetVariable("artikel", $entry[artikel]);
            $tpl->SetVariable("date", $entry[date]);
            $tpl->SetVariable("text", nl2br($entry[text]));
        } else {
            $headtpl->SetVariable("titel", "Data not found");
            $error_message = "Data is not found. Bad.";
        }
    }
}
$headtpl->show();
if ($error_message != "") {
    echo $error_message;
} else {
    $tpl->show();
コード例 #3
0
         }
         $echostring .= $ackeychar[8] . '<a href="' . $HTTP_SERVER_VARS["PHP_SELF"] . '?view=content&num=' . $_REQUEST["num"] . '&start=' . $nextstart . '" accesskey="8">続き&gt;&gt;</a><br />';
     }
 } else {
     $echostring .= $tmp;
 }
 $echostring .= '<hr />';
 /*
 		//post_password is empty or match cookie password
 		if (empty($posts['post_password']) || $HTTP_COOKIE_VARS['wp-postpass'] == $post['post_password']) {
 
 			$comment_author = (empty($HTTP_COOKIE_VARS["comment_author"])) ? "" : trim($HTTP_COOKIE_VARS["comment_author"]);
 			$comment_author_email = (empty($HTTP_COOKIE_VARS["comment_author"])) ? "" : trim($HTTP_COOKIE_VARS["comment_author_email"]);
 			$comment_author_url = (empty($HTTP_COOKIE_VARS["comment_author"])) ? "" : trim($HTTP_COOKIE_VARS["comment_author_url"]);
 */
 $count = get_number_of_comments($post['ID']);
 if ($count == 0) {
     $echostring .= '<a href="' . $HTTP_SERVER_VARS["PHP_SELF"] . '?view=comment&num=' . $_REQUEST["num"] . '">コメントする</a><br />';
 } else {
     $echostring .= '<a href="' . $HTTP_SERVER_VARS["PHP_SELF"] . '?view=comprev&num=' . $_REQUEST["num"] . '&page=0">コメント(' . $count . ')</a><br />';
 }
 /*
 		} //post_password is empty or match cookie password
 */
 $echostring .= '<hr />';
 $nextnum = $_REQUEST["num"] + 1;
 if (find_post($nextnum)) {
     $echostring .= $ackeychar[9] . '<a href="' . $HTTP_SERVER_VARS["PHP_SELF"] . '?view=content&num=' . $nextnum . '&page=0" accesskey="9">次の記事へ &gt;</a><br />';
 }
 $prevnum = $_REQUEST["num"] - 1;
 if ($prevnum >= 0) {