$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>"; } } else { $response .= "<li>还没有回复!</li>"; } echo $response; } // 回复微语 if ($action == 'reply') { $r = isset($_POST['r']) ? addslashes(trim($_POST['r'])) : ''; $rname = isset($_POST['rname']) ? addslashes(trim($_POST['rname'])) : '';
doAction('post_twitter', $t, $twid); emDirect("twitter.php?active_t=1"); } // 删除微语. if ($action == 'del') { LoginAuth::checkToken(); $id = isset($_GET['id']) ? intval($_GET['id']) : ''; $Twitter_Model->delTwitter($id); $CACHE->updateCache(array('sta', 'newtw')); emDirect("twitter.php?active_del=1"); } // 获取回复. if ($action == 'getreply') { $tid = isset($_GET['tid']) ? intval($_GET['tid']) : null; $Reply_Model = new Reply_Model(); $replys = $Reply_Model->getReplys($tid); $response = ''; foreach ($replys as $val) { if ($val['hide'] == 'n') { $style = "background-color:#FFF"; $act = "<span><a href=\"javascript: hidereply({$val['id']},{$tid});\">隐藏</a></span> "; } else { $style = "background-color:#FEE0E4"; $act = "<span><a href=\"javascript: pubreply({$val['id']},{$tid});\">审核</a></span> "; } $response .= "\r\n\t\t <li id=\"reply_{$val['id']}\" style=\"{$style}\">\r\n\t\t <span class=\"name\">{$val['name']}</span> {$val['content']}<span class=\"time\">{$val['date']}</span>{$act}\r\n\t\t <a href=\"javascript: delreply({$val['id']},{$tid});\">删除</a> \r\n\t\t <em><a href=\"javascript:reply({$tid}, '@{$val['name']}:');\">回复</a></em>\r\n\t\t </li>"; } echo $response; } // 回复微语. if ($action == 'reply') {