本文整理匯總了PHP中settings::getMark方法的典型用法代碼示例。如果您正苦於以下問題:PHP settings::getMark方法的具體用法?PHP settings::getMark怎麽用?PHP settings::getMark使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類settings
的用法示例。
在下文中一共展示了settings::getMark方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: reply
public function reply()
{
include_once ROOT_DIR . 'lib/class/settings.class.php';
$setting = new settings();
$result_setttings = $setting->getMark('mblog_comment');
if (!empty($result_setttings) && $result_setttings['state']) {
$this->errorOutput('評論回複已關閉');
}
$userinfo = $this->mUser->verify_credentials();
if (!$userinfo['id']) {
$this->errorOutput(USENAME_NOLOGIN);
}
$status_id = intval($this->input['status_id']);
$cid = intval($this->input['cid']);
$text = urldecode($this->input['text']);
(!$status_id || !$text) && $this->errorOutput(OBJECT_NULL);
//點滴id為空就返回錯誤
$time = time();
$query_info = $this->db->query_first('SELECT member_id FROM ' . DB_PREFIX . 'status_comments WHERE id = ' . $cid);
!$query_info && $this->errorOutput(OBJECT_NULL);
$sql = 'INSERT INTO ' . DB_PREFIX . 'status_comments ( status_id , member_id , content , comment_time , reply_comment_id , reply_member_id )
VALUES(' . $status_id . ', ' . $userinfo['id'] . ', "' . $text . '" , "' . $time . '" , ' . $cid . ',' . $query_info['member_id'] . ')';
$this->db->query($sql);
$insert_id = $this->db->insert_id();
$query_info = $this->db->query_first('SELECT member_id FROM ' . DB_PREFIX . 'status_comments WHERE status_id = ' . $status_id . ' AND id = ' . $cid);
//將該條點滴的評論次數加1
$this->db->query('UPDATE ' . DB_PREFIX . 'status_extra SET comment_count = comment_count + 1 WHERE status_id = ' . $status_id);
$members = $this->mUser->getUserById($userinfo['id']);
$members = $members[0];
$status = $this->mStatus->show($status_id);
$return_array = array('id' => $insert_id, 'text' => $text, 'create_at' => $time, 'reply_member_id' => $query_info['member_id'], 'reply_comment_id' => $cid, 'status' => $status[0], 'user' => $members);
if ($userinfo['id'] != $query_info['member_id'] && $userinfo['id'] != $status[0]['user']['id']) {
$notify_userid = $query_info['member_id'] . ',' . $status[0]['user']['id'];
//加通知
include_once ROOT_PATH . 'lib/class/notify.class.php';
$notify = new notify();
$content = array('title' => '新回複', 'page_link' => SNS_MBLOG . 'all_comment.php');
$content = serialize($content);
$notyfy_arr = $notify->notify_send($notify_userid, $content, 2);
//發新評論通知
}
$this->addItem($return_array);
$this->output();
}
示例2: deal_upload
/**
* 上傳處理
*/
public function deal_upload()
{
include_once ROOT_DIR . 'lib/class/settings.class.php';
$setting = new settings();
$result_setttings = $setting->getMark('video');
if (!empty($result_setttings) && $result_setttings['state']) {
echo '視頻發布已關閉';
}
$video_path = $_FILES['videofile']['tmp_name'];
//視頻的在本地的目錄
$file_name = basename($_FILES['videofile']['name']);
//視頻的文件
$file_size = $_FILES['videofile']['size'];
//視頻的大小
$video_name = trim($this->input['video_name']);
//視頻名稱
$video_brief = trim($this->input['video_brief']);
//視頻簡介
$video_tags = trim($this->input['video_tags']);
//視頻標簽
$video_sort = $this->input['video_sort'];
//視頻分類
$video_copyright = $this->input['video_copyright'];
//視頻版權
include_once ROOT_PATH . 'lib/class/curl.class.php';
$this->curl = new curl();
$this->curl->setSubmitType('post');
$this->curl->setReturnFormat('json');
$this->curl->initPostData();
$this->curl->addRequestData('a', 'deal_upload');
$this->curl->addRequestData('video_path', $video_path);
$this->curl->addFile($_FILES);
$this->curl->addRequestData('file_name', $file_name);
$this->curl->addRequestData('file_size', $file_size);
$this->curl->addRequestData('video_name', $video_name);
$this->curl->addRequestData('video_brief', $video_brief);
$this->curl->addRequestData('video_tags', $video_tags);
$this->curl->addRequestData('video_sort', $video_sort);
$this->curl->addRequestData('video_copyright', $video_copyright);
$r = $this->curl->request('video/upload_video.php');
echo $r;
}
示例3: comment
public function comment()
{
include_once ROOT_DIR . 'lib/class/settings.class.php';
$setting = new settings();
$result_setttings = $setting->getMark('mblog_comment');
if (!empty($result_setttings) && $result_setttings['state']) {
$this->errorOutput('評論已關閉');
}
$userinfo = $this->mUser->verify_credentials();
if (!$userinfo['id']) {
$this->errorOutput(USENAME_NOLOGIN);
}
$id = $this->input['id'];
$content = urldecode($this->input['content']);
include_once ROOT_DIR . 'lib/class/banword.class.php';
$banword = new banword();
$status = 0;
$banwords = $banword->banword(urlencode($content));
if ($banwords && $banwords != 'null') {
$status = 1;
$banwords = implode(',', $banwords);
} else {
$banwords = '';
}
//此ID沒有用處
$cid = intval($this->input['cid']);
$time = time();
!$cid ? $and = '' : ($and = ' , reply_comment_id = ' . $cid);
$sql = 'INSERT INTO ' . DB_PREFIX . 'status_comments SET status_id = ' . $id . ', flag = ' . $status . ',member_id = ' . $userinfo['id'] . ',content = "' . $content . '",comment_time = "' . $time . '",ip = "' . hg_getip() . '"';
$sql .= $and;
$this->setXmlNode('comments', 'comment');
/**
* 獲取該條點滴的用戶ID
*/
$this->curl->setSubmitType('post');
$this->curl->setReturnFormat('json');
$this->curl->addRequestData('status_id', $id);
$user_id = $this->curl->request('statuses/getUserIdByStatusId.php');
/**
* 獲取該用戶的權限
*/
$this->curl->setSubmitType('post');
$this->curl->setReturnFormat('json');
$this->curl->addRequestData('id', $user_id);
$tmp = $this->curl->request('users/get_authority.php');
$authority = $tmp[0];
//評論權限
$comment_authority = intval($authority[18]);
/**
* 獲取與該用戶的關係
*/
$this->curl->setSubmitType('post');
$this->curl->setReturnFormat('json');
$this->curl->addRequestData('source_id', $userinfo['id']);
$this->curl->addRequestData('target_id', $user_id);
$relation = $this->curl->request('friendships/show.php');
//任何人可評論
if ($comment_authority == 0) {
$this->db->query($sql);
}
//關注的人可評論
if ($comment_authority == 1) {
//關注
if ($relation == 3 || $relation == 1) {
$this->db->query($sql);
} else {
$this->errorOutput(NO_AUTHORITY);
}
}
//任何人不可評論
if ($comment_authority == 2) {
$this->errorOutput(NO_AUTHORITY);
}
// $this->db->query($sql);
$insert_id = $this->db->insert_id();
$members = $this->mUser->getUserById($userinfo['id']);
//評論者的信息數組
$members = $members[0];
//將點滴的評論次數加1
$sql_str = 'UPDATE ' . DB_PREFIX . 'status_extra SET comment_count = comment_count + 1 WHERE status_id = ' . $id;
$this->db->query($sql_str);
$status_info = $this->mStatus->show($id);
$return_array = array('id' => $insert_id, 'text' => $content, 'create_at' => $time, 'user' => $members, 'status' => $status_info[0]);
$this->addItem($return_array);
$this->output();
}
示例4: update
/**
* 發布一條點滴信息
*/
public function update()
{
include_once ROOT_DIR . 'lib/class/settings.class.php';
$setting = new settings();
$result_setttings = $setting->getMark('mblog');
if (!empty($result_setttings) && $result_setttings['state']) {
$this->errorOutput('微博發布已關閉');
}
$userinfo['id'] = $this->input['user_id'] ? $this->input['user_id'] : ($this->user['user_id'] ? $this->user['user_id'] : 0);
if (empty($userinfo['id'])) {
$this->errorOutput(USENAME_NOLOGIN);
}
$text = urldecode($this->input['text']);
$source = urldecode($this->input['source']);
if (intval($source) == 1) {
$source = 'iphone客戶端';
} elseif (intval($source) == 2) {
$source = 'Android客戶端';
}
if ($this->input['id']) {
$id = $this->input['id'];
$sql = "SELECT * \r\n\t\t\t\tFROM " . DB_PREFIX . "status s\r\n\t\t\t\tLEFT JOIN " . DB_PREFIX . "status_extra e ON e.status_id = s.id WHERE id = " . $id;
$query = $this->db->query($sql);
$statusinfo = $this->db->fetch_array($query);
$last_userid = $statusinfo['member_id'];
$reply_status_id = $statusinfo['reply_status_id'];
$reply_user_id = $statusinfo['reply_user_id'];
if (!$statusinfo) {
$this->errorOutput(OBJECT_NULL);
//對象為空
}
$sql = "SELECT transmit_count,reply_count,reply_status_id,reply_user_id\r\n\t\t\t\t\tFROM " . DB_PREFIX . "status s \r\n\t\t\t\t\tLEFT JOIN " . DB_PREFIX . "status_extra e \r\n\t\t\t\t\tON e.status_id = s.id \r\n\t\t\t\t\tWHERE status_id = " . $id;
$first = $this->db->query_first($sql);
$textF = explode("//", $text);
if (empty($textF[0])) {
//更新擴展表中的轉發次數
$info = array('member_id' => $userinfo['id'], 'text' => $text, 'create_at' => TIMENOW, 'ip' => hg_getip(), 'location' => '地址', 'status' => $status, 'source' => $source);
$statusinfo = $this->insert($info, 1);
if (!$statusinfo) {
return false;
} else {
$transmit_count = $first['transmit_count'] + 1;
$sql = "UPDATE " . DB_PREFIX . "status_extra \r\n\t\t\t\t\tSET \r\n\t\t\t\t\t\ttransmit_count = " . $transmit_count . " \r\n\t\t\t\t\tWHERE status_id = " . $id;
$this->db->query($sql);
$this->verify($statusinfo['text'], $statusinfo['id']);
if ($reply_status_id) {
$sql = "UPDATE " . DB_PREFIX . "status \r\n\t\t\t\t\t\tSET \r\n\t\t\t\t\t\t\treply_status_id = " . $reply_status_id . ",\r\n\t\t\t\t\t\t\treply_user_id = " . $reply_user_id . " \r\n\t\t\t\t\t\tWHERE id = " . $statusinfo['id'];
$this->db->query($sql);
$statusinfo['reply_status_id'] = $reply_status_id;
$statusinfo['reply_user_id'] = $reply_user_id;
$sql = "UPDATE " . DB_PREFIX . "status_extra \r\n\t\t\t\t\t\t\t\tSET \r\n\t\t\t\t\t\t\t\t\ttransmit_count = transmit_count+1 \r\n\t\t\t\t\t\t\t\tWHERE status_id = " . $reply_status_id;
$this->db->query($sql);
} else {
$sql = "UPDATE " . DB_PREFIX . "status \r\n\t\t\t\t\t\tSET \r\n\t\t\t\t\t\t\treply_status_id = " . $id . ",\r\n\t\t\t\t\t\t\treply_user_id = " . $last_userid . " \r\n\t\t\t\t\t\tWHERE id = " . $statusinfo['id'];
$this->db->query($sql);
$statusinfo['reply_status_id'] = $id;
$statusinfo['reply_user_id'] = $last_userid;
}
$statusinfo['transmit_count'] = $transmit_count;
$this->setXmlNode('status', 'info');
$this->addItem($statusinfo);
return $this->output();
}
} else {
//更新擴展表的回複次數
if (mb_strlen($text) <= WORDS_NUM) {
$info = $this->verifyUrlBanword($text, $userinfo['id'], $source);
$statusinfo = $this->insert($info);
if (!$statusinfo) {
$this->errorOutput(FAILED);
} else {
$reply_count = $first['reply_count'] + 1;
$sql = "UPDATE " . DB_PREFIX . "status_extra \r\n\t\t\t\t\t\tSET \r\n\t\t\t\t\t\t\treply_count = " . $reply_count . " \r\n\t\t\t\t\t\tWHERE status_id = " . $id;
$this->db->query($sql);
$this->verify($statusinfo['text'], $statusinfo['id']);
if ($reply_status_id) {
$sql = "UPDATE " . DB_PREFIX . "status \r\n\t\t\t\t\t\t\tSET \r\n\t\t\t\t\t\t\t\treply_status_id = " . $reply_status_id . ",\r\n\t\t\t\t\t\t\t\treply_user_id = " . $reply_user_id . " \r\n\t\t\t\t\t\t\tWHERE id = " . $statusinfo['id'];
$this->db->query($sql);
$statusinfo['reply_status_id'] = $reply_status_id;
$statusinfo['reply_user_id'] = $reply_user_id;
$sql = "UPDATE " . DB_PREFIX . "status_extra \r\n\t\t\t\t\t\t\t\tSET \r\n\t\t\t\t\t\t\t\t\treply_count = reply_count + 1 \r\n\t\t\t\t\t\t\t\tWHERE status_id = " . $reply_status_id;
$this->db->query($sql);
} else {
$sql = "UPDATE " . DB_PREFIX . "status \r\n\t\t\t\t\t\t\tSET \r\n\t\t\t\t\t\t\t\treply_status_id = " . $id . ",\r\n\t\t\t\t\t\t\t\treply_user_id = " . $last_userid . " \r\n\t\t\t\t\t\t\tWHERE id = " . $statusinfo['id'];
$this->db->query($sql);
$statusinfo['reply_status_id'] = $id;
$statusinfo['reply_user_id'] = $last_userid;
}
$statusinfo['reply_count'] = $reply_count;
$this->setXmlNode('status', 'info');
$this->addItem($statusinfo);
return $this->output();
}
} else {
$this->errorOutput(FAILED);
}
}
//.........這裏部分代碼省略.........