$sqlSegment = "ORDER BY top DESC ,date DESC"; $sta_cache = $CACHE->readCache('sta'); $lognum = $sta_cache['lognum']; $pageurl = './?page='; $logs = $Log_Model->getLogsForHome($sqlSegment, $page, $index_lognum); $page_url = pagination($lognum, $index_lognum, $page, $pageurl); include View::getView('header'); include View::getView('log'); include View::getView('footer'); View::output(); } // 文章 if (!empty($logid)) { $Log_Model = new Log_Model(); $Comment_Model = new Comment_Model(); $logData = $Log_Model->getOneLogForHome($logid); if ($logData === false) { mMsg('不存在该条目', './'); } extract($logData); $site_title = $log_title; if (!empty($password)) { $postpwd = isset($_POST['logpwd']) ? addslashes(trim($_POST['logpwd'])) : ''; $cookiepwd = isset($_COOKIE['em_logpwd_' . $logid]) ? addslashes(trim($_COOKIE['em_logpwd_' . $logid])) : ''; authPassword($postpwd, $cookiepwd, $password, $logid); } // comments $commentPage = isset($_GET['comment-page']) ? intval($_GET['comment-page']) : 1; $verifyCode = ISLOGIN == false && Option::get('comment_code') == 'y' ? "<img src=\"../include/lib/checkcode.php\" /><br /><input name=\"imgcode\" type=\"text\" />" : ''; $comments = $Comment_Model->getComments(2, $logid, 'n', $commentPage); extract($comments);
function displayContent($params) { $comment_page = isset($params[4]) && $params[4] == 'comment-page' ? intval($params[5]) : 1; $Log_Model = new Log_Model(); $CACHE = Cache::getInstance(); $options_cache = $CACHE->readCache('options'); extract($options_cache); $logid = 0; if (isset($params[1])) { if ($params[1] == 'post') { $logid = isset($params[2]) ? intval($params[2]) : 0; } elseif (is_numeric($params[1])) { $logid = intval($params[1]); } else { $logalias_cache = $CACHE->readCache('logalias'); if (!empty($logalias_cache)) { $alias = addslashes(urldecode(trim($params[1]))); $logid = array_search($alias, $logalias_cache); if (!$logid) { show_404_page(); } } } } $Comment_Model = new Comment_Model(); $logData = $Log_Model->getOneLogForHome($logid); if ($logData === false) { show_404_page(); } extract($logData); if (!empty($password)) { $postpwd = isset($_POST['logpwd']) ? addslashes(trim($_POST['logpwd'])) : ''; $cookiepwd = isset($_COOKIE['em_logpwd_' . $logid]) ? addslashes(trim($_COOKIE['em_logpwd_' . $logid])) : ''; $Log_Model->AuthPassword($postpwd, $cookiepwd, $password, $logid); } //meta switch ($log_title_style) { case '0': $site_title = $log_title; break; case '1': $site_title = $log_title . ' - ' . $blogname; break; case '2': $site_title = $log_title . ' - ' . $site_title; break; } $site_description = extractHtmlData($log_content, 90); $log_cache_tags = $CACHE->readCache('logtags'); if (!empty($log_cache_tags[$logid])) { foreach ($log_cache_tags[$logid] as $value) { $site_key .= ',' . $value['tagname']; } } //comments $verifyCode = ISLOGIN == false && $comment_code == 'y' ? "<img src=\"" . BLOG_URL . "include/lib/checkcode.php\" align=\"absmiddle\" /><input name=\"imgcode\" type=\"text\" class=\"input\" size=\"5\" tabindex=\"5\" />" : ''; $ckname = isset($_COOKIE['commentposter']) ? htmlspecialchars(stripslashes($_COOKIE['commentposter'])) : ''; $ckmail = isset($_COOKIE['postermail']) ? htmlspecialchars($_COOKIE['postermail']) : ''; $ckurl = isset($_COOKIE['posterurl']) ? htmlspecialchars($_COOKIE['posterurl']) : ''; $comments = $Comment_Model->getComments(0, $logid, 'n', $comment_page); include View::getView('header'); if ($type == 'blog') { $Log_Model->updateViewCount($logid); $neighborLog = $Log_Model->neighborLog($timestamp); $tb = array(); $tb_url = ''; //兼容未删除引用模板 include View::getView('echo_log'); } elseif ($type == 'page') { $template = !empty($template) && file_exists(TEMPLATE_PATH . $template . '.php') ? $template : 'page'; include View::getView($template); } }
function kl_sendmail_put_reply_mail($commentId, $reply) { global $userData; include EMLOG_ROOT . '/content/plugins/kl_sendmail/kl_sendmail_config.php'; if (KL_IS_REPLY_MAIL == 'Y') { $DB = Database::getInstance(); $blogname = Option::get('blogname'); $Comment_Model = new Comment_Model(); $commentArray = $Comment_Model->getOneComment($commentId); extract($commentArray); $subject = "您在【{$blogname}】发表的评论收到了回复"; if (strpos($mail, '@139.com') === false) { $emBlog = new Log_Model(); $logData = $emBlog->getOneLogForHome($gid); $log_title = $logData['log_title']; $content = "{$poster},您好:<br /><br />您之前在《{$log_title}》发表的的评论:<br />{$comment}<br /><br />{$userData['username']}给您的回复:<br />{$reply}<br /><br /><strong>您可以点击<a href=\"" . Url::log($gid) . "#{$cid}\" target=\"_blank\">查看该日志</a></strong><br /><br /><strong>感谢您对<a href=\"" . BLOG_URL . "\" target=\"_blank\">{$blogname}</a>的关注,欢迎<a href=\"" . BLOG_URL . "rss.php\">订阅本站</a></strong><br /><br />"; } else { $content = $reply; } if ($mail != '') { kl_sendmail_do(KL_MAIL_SMTP, KL_MAIL_PORT, KL_MAIL_SENDEMAIL, KL_MAIL_PASSWORD, $mail, $subject, $content, $blogname); } } else { return; } }