Esempio n. 1
0
     exit('err1');
 } elseif (ROLE == ROLE_VISITOR && empty($rname)) {
     exit('err2');
 } elseif (ROLE == ROLE_VISITOR && Option::get('reply_code') == 'y' && session_start() && $rcode != $_SESSION['code']) {
     exit('err3');
 }
 foreach ($user_cache as $val) {
     if (isset($val['name']) && $val['name'] == $rname) {
         exit('err4');
     }
 }
 $date = time();
 $name = subString(ROLE == ROLE_VISITOR ? $rname : addslashes($user_cache[UID]['name']), 0, 16);
 $rdata = array('tid' => $tid, 'content' => $r, 'name' => $name, 'date' => $date, 'hide' => ROLE == ROLE_VISITOR ? Option::get('ischkreply') : 'n');
 $Twitter_Model = new Twitter_Model();
 $Reply_Model = new Reply_Model();
 $rid = $Reply_Model->addReply($rdata);
 if ($rid === false) {
     exit('err5');
 }
 doAction('reply_twitter', $r, $name, $date, $tid);
 if (Option::get('ischkreply') == 'n' || ROLE != ROLE_VISITOR) {
     $Twitter_Model->updateReplyNum($tid, '+1');
 } else {
     exit('succ1');
 }
 $CACHE->updateCache('sta');
 $_SESSION['code'] = null;
 $date = smartDate($date);
 $r = htmlClean(stripslashes($r));
 $response = "\n         <li>\n         <span class=\"name\">" . stripslashes(htmlspecialchars($name)) . "</span> {$r}<span class=\"time\">{$date}</span>\n         <em><a href=\"javascript:re({$tid}, '@{$name}:');\">回复</a></em>\n         </li>";
Esempio n. 2
0
    $date = smartDate($date);
    $r = htmlClean(stripslashes($r));
    $response = "\r\n\t\t <li id=\"reply_{$rid}\" style=\"background-color:#FFEEAA\">\r\n\t\t <span class=\"name\">{$name}</span> {$r}<span class=\"time\">{$date}</span>\r\n\t\t <span><a href=\"javascript: hidereply({$rid},{$tid});\">隐藏</a></span> \r\n\t\t <a href=\"javascript: delreply({$rid},{$tid});\">删除</a> \r\n\t\t <em><a href=\"javascript:reply({$tid}, '@{$name}:');\">回复</a></em>\r\n\t\t </li>";
    echo $response;
}
// 删除回复.
if ($action == 'delreply') {
    $rid = isset($_GET['rid']) ? intval($_GET['rid']) : null;
    $tid = isset($_GET['tid']) ? intval($_GET['tid']) : null;
    $Reply_Model = new Reply_Model();
    if ($Reply_Model->delReply($rid) == 'n') {
        $Twitter_Model->updateReplyNum($tid, '-1');
    }
    echo $tid;
}
// 隐藏回复.
if ($action == 'hidereply') {
    $rid = isset($_GET['rid']) ? intval($_GET['rid']) : null;
    $tid = isset($_GET['tid']) ? intval($_GET['tid']) : null;
    $Reply_Model = new Reply_Model();
    $Reply_Model->hideReply($rid);
    $Twitter_Model->updateReplyNum($tid, '-1');
}
// 审核回复.
if ($action == 'pubreply') {
    $rid = isset($_GET['rid']) ? intval($_GET['rid']) : null;
    $tid = isset($_GET['tid']) ? intval($_GET['tid']) : null;
    $Reply_Model = new Reply_Model();
    $Reply_Model->pubReply($rid);
    $Twitter_Model->updateReplyNum($tid, '+1');
}