示例#1
0
 scookie('comment_post_time', $timestamp);
 // 跳转到最新发表的评论
 if ($comment_parent) {
     $gocommentid = get_comment_parent($comment_parent);
 } else {
     $gocommentid = $cmid;
 }
 $cmnum = '#cm' . $gocommentid;
 $article_comment_num = (int) $options['article_comment_num'];
 if ($article_comment_num) {
     $cpost = $DB->result($DB->query("SELECT COUNT(commentid) FROM {$db_prefix}comments WHERE articleid='{$articleid}' AND visible='1' AND commentid<='{$gocommentid}' AND comment_parent='0'"), 0);
     if ($cpost / $article_comment_num <= 1) {
         $page = 1;
     } else {
         $page = @ceil($cpost / $article_comment_num);
         $article['url'] = redirect_permalink($articleid, $article['alias'], $page);
     }
 } else {
     $page = 1;
 }
 if ($spam) {
     message('添加评论成功,目前发表评论需要管理员审核才会显示,请耐心等待管理员审核.', $article['url']);
 }
 dcookies('comment_username');
 dcookies('comment_email');
 dcookies('comment_url');
 dcookies('cmcontent');
 if ($options['comment_order']) {
     //新评论靠后排序
     if ($options['showmsg']) {
         message('添加评论成功.', $article['url'] . $cmnum);
示例#2
0
        }
    } else {
        message('没有比当前更新的文章', redirect_permalink($article['articleid'], $row['alias']));
    }
} elseif ($goto == 'previous') {
    //跳转到上一篇文章
    $row = $DB->fetch_one_array("SELECT articleid,alias FROM {$db_prefix}articles WHERE dateline < '" . $article['dateline'] . "' AND visible='1' ORDER BY dateline DESC LIMIT 1");
    if ($row) {
        if ($options['showmsg']) {
            message('正在读取.请稍侯.', redirect_permalink($row['articleid'], $row['alias']));
        } else {
            @header('Location: ' . redirect_permalink($row['articleid'], $row['alias']));
            exit;
        }
    } else {
        message('没有比当前更早的文章', redirect_permalink($article['articleid'], $row['alias']));
    }
}
//跳转结束
//记录浏览过的文章
if (!$_COOKIE['articleids'][$article['articleid']]) {
    scookie('articleids[' . $article['articleid'] . ']', $article['articleid']);
}
$article['avatardb'] = get_avatar($article['email']);
//设置连接
$article['url'] = getpermalink($article['articleid'], $article['alias']);
$article['userurl'] = getuserlink($article['username']);
//隐藏变量,默认模板用不着,方便那些做模板可以单独显示月份和号数的的朋友.
$article['month'] = sadate('M', $article['dateline']);
$article['day'] = sadate('d', $article['dateline']);
$article['dateline'] = sadate($options['article_timeformat'], $article['dateline'], 1);