echo '此消息是私密消息不能回复'; exit; } $content = getsubstrutf8($content, 0, 140, false); $content = replace(trim($_POST['scont'])); //词语过滤 $back = atsend($content); //@ $content = $back['content']; $uids = $back['uids']; array_push($uids, $_POST['suid']); $uids = array_unique($uids); $content = daddslashes($content); $isshownew = $_POST['rck'] == "true" ? 1 : 0; //作为新的信息 $contdata = getReply($_POST[sid]); if (!$content) { echo '你还没有填写发表的内容!'; exit; } $db->query("INSERT INTO et_content (user_id,user_name,user_nickname,user_head,content_body,posttime,status_id,status_uname,status_unickname,replyshow) VALUES ('{$my['user_id']}','{$my['user_name']}','{$my['nickname']}','{$my['user_head']}','{$content}','{$addtime}','{$_POST['sid']}','{$contdata['user_name']}','{$contdata['user_nickname']}','{$isshownew}')"); $insertid = mysql_insert_id(); if ($insertid) { for ($i = 0; $i < count($uids); $i++) { $db->query("UPDATE et_users SET replyread = replyread+1 WHERE user_id='{$uids[$i]}'"); $db->query("INSERT INTO et_replyto (user_id,content_id) VALUES ('{$uids[$i]}','{$insertid}')"); } $db->query("UPDATE et_users SET msg_num=msg_num+1,lastcontent='{$content}',lastconttime='{$addtime}' where user_id='{$my['user_id']}'"); $db->query("UPDATE et_content SET replytimes=replytimes+1 where content_id='{$_POST['sid']}'"); } echo loadonelireply($insertid, ubb($content));
function makeReplies($myMentionsArr) { $rArr = array(); foreach ($myMentionsArr as $i => $mention) { $rArr[$i]['in_reply_to_status_id'] = $mention['tweetidstr']; //build the reply to tweet $botresponse = getReply($mention['useridstr'], $mention['tweet']); if ($botresponse != '') { $message = safeToTweet("@" . $mention['userscreenname'] . " " . $botresponse); $rArr[$i]['message'] = $message; } } return $rArr; }
//查询评论内容 $sql = "select complaint_id,canteenname,content,time \n\t\t\t\tfrom canteen_complaints,canteens\n\t\t\t\twhere user_id={$_POST['user_id']} and canteen_complaints.canteen_id=canteens.canteen_id\n\t\t\t order by time desc limit {$from},{$count};"; $res = $db->query($sql); if ($res === false) { echo getJsonResponse(1, $db->error, null); Log::error_log('database error:' . $db->error . ' in ' . basename(__FILE__)); } else { if (empty($res)) { $res = null; //没有评论 } else { foreach ($res as &$value) { //评论图片 getImageUrl($db, $value); //获取评论回复信息 getReply($db, $value); } } echo getJsonResponse(0, "success", $res); } $db->close(); } else { echo getJsonResponse(2, "post参数错误", null); } } else { echo getJsonResponse(2, "get参数错误", null); } function getImageUrl(&$db, &$value) { $sql = "select imageurl from canteen_complaints_images\n\t\t\twhere complaint_id={$value['complaint_id']};"; $res = $db->query($sql);
$plurk->login($plurk_api_key, $plurk_username, $plurk_password); $all_origins = array(); $default_origins = array(); while (1) { origins_init(); echo "\n\n - get plurks - \n"; $ret = $plurk->get_plurks(NULL, 30, NULL, NULL, NULL); foreach ($ret->plurks as $p) { if (!isRepeat($p->plurk_id)) { print $p->plurk_id . "\n"; print $p->content_raw . "\n"; print $p->response_count . "\n"; print $p->no_comments . "\n"; print getResponseRate($p->owner_id) . "\n"; print ($posted = date('Y-m-d\\TH:i:s', strtotime($p->posted))) . "\n"; $reply = getReply($p->content_raw, $p->response_count, $p->owner_id); if ($reply === false) { print "===> 回噗率設定 => skip\n"; logThis($p->plurk_id, $p->content_raw, '(skip)', $p->response_count, $p->no_comments, $posted); continue; } else { if ($reply == '') { print 'skip'; logThis($p->plurk_id, $p->content_raw, '(skip)', $p->response_count, $p->no_comments, $posted); continue; } } # $reply = str_replace('(worship)', 'http://ppt.cc/5aBg#.gif', $reply); print "===> {$reply}\n\n"; $plurk->add_response($p->plurk_id, $reply, 'says'); logThis($p->plurk_id, $p->content_raw, $reply, $p->response_count, $p->no_comments, $posted);
function getRootComments($conn, $product_id, $reply_number) { $stmt = $conn->prepare("SELECT ProductComments.comment_text, ProductComments.comment_id, Customers.customer_fname, Customers.customer_lname\n FROM shopdb.ProductComments, shopdb.Customers\n WHERE ProductComments.product_id = ? AND ProductComments.customer_id = Customers.customer_id AND ProductComments.comment_parent_id IS NULL;"); $stmt->bind_param("i", $product_id); $stmt->execute(); $stmt->bind_result($comment_text, $comment_id, $comment_fname, $comment_lname); $stmt->store_result(); //Loops until there are no more comments with the same parent while ($stmt->fetch()) { //display the comment displayComment($comment_text, $comment_fname, $comment_lname, $reply_number, $comment_id); //retrieve any replies to this comment getReply($conn, $comment_id, $reply_number + 1); } $stmt->free_result(); $stmt->close(); }
} else { echo '您没有填写发送的内容,返回重新填写'; exit; } } if ($act == 'getuserinfo') { $uid = $_GET['uid']; $class = $_GET['class']; $userquery = $db->query("SELECT nickname,user_head,lastcontent,lastconttime FROM et_users WHERE user_id='{$uid}'"); $user = $db->fetch_array($userquery); $head = $user['user_head'] ? "{$webaddr}/attachments/head/" . $user['user_head'] : "{$webaddr}/images/noavatar.jpg"; $content = simplecontent($user[lastcontent]); $time = $user[lastconttime] ? timeop($user[lastconttime]) : ""; echo '<div class="' . $class . '"></div><table width="200" border="0" cellpadding="0" cellspacing="0"><tr><td width="53" rowspan="2" align="left" valign="top"><img src="' . $head . '" width="48px" /></td><td><strong>' . $user[nickname] . ':</strong>' . emotionrp($content) . '</td></tr><tr><td class="followtime">' . $time . "</td></tr></table>"; exit; } if ($act == 'getreplycontent') { $contid = $_GET['contid']; $contdata = getReply($contid); if ($contdata) { $contents = ubb($contdata['content_body']); echo '<div class="status_reply_list"> <div class="top"></div> <div class="cont"> <h1 class="line">以下是原文:<a href="' . $webaddr . '/op/view/' . $contid . '">原文回复(' . $contdata['replytimes'] . ')</a></h1> <div class="replyajaxbox"><a href="' . $webaddr . '/' . $contdata['user_name'] . '">' . $contdata['user_nickname'] . '</a>:' . $contents . '</div> </div> <div class="bottom"></div> </div>'; } }