예제 #1
0
파일: index.php 프로젝트: LockGit/emlog
if ($action == 'cal') {
    Calendar::generate();
}
if ($action == '') {
    $user_cache = $CACHE->readCache('user');
    $options_cache = Option::getAll();
    extract($options_cache);
    $Twitter_Model = new Twitter_Model();
    $Navi_Model = new Navi_Model();
    $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
    $tws = $Twitter_Model->getTwitters($page);
    $twnum = $Twitter_Model->getTwitterNum();
    $pageurl = pagination($twnum, Option::get('index_twnum'), $page, BLOG_URL . 't/?page=');
    $avatar = empty($user_cache[UID]['avatar']) ? '../admin/views/images/avatar.jpg' : '../' . $user_cache[UID]['avatar'];
    $rcode = Option::get('reply_code') == 'y' ? "<img src=\"" . DYNAMIC_BLOGURL . "?action=ckcode&mode=t\" />" : '';
    $site_title = $Navi_Model->getNaviNameByType(Navi_Model::navitype_t) . ' - ' . $site_title;
    include View::getView('header');
    require_once View::getView('t');
    View::output();
}
// 获取回复
if ($action == 'getr') {
    $tid = isset($_GET['tid']) ? intval($_GET['tid']) : null;
    $Reply_Model = new Reply_Model();
    $replys = $Reply_Model->getReplys($tid, 'n');
    $response = '';
    if ($replys) {
        foreach ($replys as $val) {
            $sub_reply = Option::get('istreply') == 'y' ? "<a href=\"javascript:re({$tid}, '@" . addslashes($val['name']) . ":');\">回复</a>" : '';
            $response .= "\n\t         <li>\n\t         <span class=\"name\">{$val['name']}</span> {$val['content']}<span class=\"time\">{$val['date']}</span>\n\t         <em>{$sub_reply}</em>\n\t         </li>";
        }