本文整理汇总了PHP中fetch_array_value函数的典型用法代码示例。如果您正苦于以下问题:PHP fetch_array_value函数的具体用法?PHP fetch_array_value怎么用?PHP fetch_array_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fetch_array_value函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: answer_comments_action
public function answer_comments_action()
{
if (!$_GET['answer_id']) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('答案不存在')));
}
if (!($answer_info = $this->model('answer')->get_answer_by_id($_GET['answer_id']))) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('答案不存在')));
}
$per_page = get_setting('contents_per_page');
if ($_GET['per_page']) {
$per_page = $_GET['per_page'];
}
$comments = $this->model('answer')->get_answer_comments_page($_GET['answer_id'], $_GET['page'], $per_page);
if (!$comments) {
H::ajax_json_output(AWS_APP::RSM(null, 1, null));
}
$user_infos = $this->model('account')->get_user_info_by_uids(fetch_array_value($comments, 'uid'));
foreach ($comments as $key => $val) {
$at_uids = $this->model('question')->parse_at_user($comments[$key]['message'], false, true);
if ($at_uids and $at_user_info = $this->model('account')->get_user_info_by_uids($at_uids)) {
foreach ($at_user_info as $k => $v) {
$comments[$key]['at_user'][$v['uid']] = $this->model('myapi')->get_clean_user_info($v);
}
}
$comments[$key]['user_info'] = $this->model('myapi')->get_clean_user_info($user_infos[$val['uid']]);
}
H::ajax_json_output(AWS_APP::RSM($comments, 1, null));
}
开发者ID:nerverwind,项目名称:wecenter_ios_sdk,代码行数:28,代码来源:question.php
示例2: report_list_action
public function report_list_action()
{
if ($report_list = $this->model('question')->get_report_list('status = ' . intval($_GET['status']), $_GET['page'], $this->per_page)) {
$report_total = $this->model('question')->found_rows();
$userinfos = $this->model('account')->get_user_info_by_uids(fetch_array_value($report_list, 'uid'));
foreach ($report_list as $key => $val) {
$report_list[$key]['user'] = $userinfos[$val['uid']];
}
}
$this->crumb(AWS_APP::lang()->_t('用户举报'), 'admin/question/report_list/');
TPL::assign('list', $report_list);
TPL::assign('menu_list', $this->model('admin')->fetch_menu_list(306));
TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/admin/question/report_list/status-' . intval($_GET['status'])), 'total_rows' => $report_total, 'per_page' => $this->per_page))->create_links());
TPL::output('admin/question/report_list');
}
开发者ID:egogg,项目名称:wecenter-dev,代码行数:15,代码来源:question.php
示例3: get_focus_users_by_question
public function get_focus_users_by_question($question_id, $limit = 10)
{
if ($uids = $this->query_all('SELECT DISTINCT uid FROM ' . $this->get_table('question_focus') . ' WHERE question_id = ' . intval($question_id) . ' ORDER BY focus_id DESC', intval($limit))) {
$users_list = $this->model('account')->get_user_info_by_uids(fetch_array_value($uids, 'uid'));
}
return $users_list;
}
开发者ID:egogg,项目名称:wecenter-quiz,代码行数:7,代码来源:question.php
示例4: get_category_with_child_ids
public function get_category_with_child_ids($type, $category_id)
{
$category_ids[] = intval($category_id);
if ($child_ids = $this->fetch_category_data($type, $category_id)) {
$category_ids = array_merge($category_ids, fetch_array_value($child_ids, 'id'));
}
return $category_ids;
}
开发者ID:Vizards,项目名称:HeavenSpree,代码行数:8,代码来源:system.php
示例5: get_question_comments_action
public function get_question_comments_action()
{
$comments = $this->model('question')->get_question_comments($_GET['question_id']);
$user_infos = $this->model('account')->get_user_info_by_uids(fetch_array_value($comments, 'uid'));
foreach ($comments as $key => $val) {
$comments[$key]['message'] = FORMAT::parse_links($this->model('question')->parse_at_user($comments[$key]['message']));
$comments[$key]['user_name'] = $user_infos[$val['uid']]['user_name'];
$comments[$key]['url_token'] = $user_infos[$val['uid']]['url_token'];
}
TPL::assign('question', $this->model('question')->get_question_info_by_id($_GET['question_id']));
TPL::assign('comments', $comments);
TPL::output("question/ajax/comments");
}
开发者ID:tenstone,项目名称:wecenter,代码行数:13,代码来源:ajax.php
示例6: load_answers_action
function load_answers_action()
{
// 获取问题
if (!($question_info = $this->model('question')->get_question_info_by_id($_GET['question_id']))) {
return;
}
$this->model('question')->calc_popular_value($question_info['question_id']);
$this->model('question')->update_views($question_info['question_id']);
if (!$_GET['sort'] or $_GET['sort'] != 'ASC') {
$_GET['sort'] = 'DESC';
} else {
$_GET['sort'] = 'ASC';
}
if (is_digits($_GET['uid'])) {
$answer_list_where[] = 'uid = ' . intval($_GET['uid']);
$answer_count_where = 'uid = ' . intval($_GET['uid']);
} else {
if ($_GET['uid'] == 'focus' and $this->user_id) {
if ($friends = $this->model('follow')->get_user_friends($this->user_id, false)) {
foreach ($friends as $key => $val) {
$follow_uids[] = $val['uid'];
}
} else {
$follow_uids[] = 0;
}
$answer_list_where[] = 'uid IN(' . implode($follow_uids, ',') . ')';
$answer_count_where = 'uid IN(' . implode($follow_uids, ',') . ')';
$answer_order_by = 'add_time ASC';
} else {
if ($_GET['sort_key'] == 'popularity') {
$answer_order_by = "agree_count " . $_GET['sort'] . ", against_count ASC, add_time ASC";
} else {
$answer_order_by = "add_time " . $_GET['sort'];
}
}
}
if ($answer_count_where) {
$answer_count = $this->model('answer')->get_answer_count_by_question_id($question_info['question_id'], $answer_count_where);
} else {
$answer_count = $question_info['answer_count'];
}
if (isset($_GET['answer_id']) and (!$this->user_id or $_GET['single'])) {
$answer_list = $this->model('answer')->get_answer_list_by_question_id($question_info['question_id'], 1, 'answer_id = ' . intval($_GET['answer_id']));
} else {
if (!$this->user_id and !$this->user_info['permission']['answer_show']) {
if ($question_info['best_answer']) {
$answer_list = $this->model('answer')->get_answer_list_by_question_id($question_info['question_id'], 1, 'answer_id = ' . intval($question_info['best_answer']));
} else {
$answer_list = $this->model('answer')->get_answer_list_by_question_id($question_info['question_id'], 1, null, 'agree_count DESC');
}
} else {
if ($answer_list_where) {
$answer_list_where = implode(' AND ', $answer_list_where);
}
$answer_list = $this->model('answer')->get_answer_list_by_question_id($question_info['question_id'], calc_page_limit($_GET['page'], 100), $answer_list_where, $answer_order_by);
}
}
// 最佳回复预留
$answers[0] = '';
if (!is_array($answer_list)) {
$answer_list = array();
}
$answer_ids = array();
$answer_uids = array();
foreach ($answer_list as $answer) {
$answer_ids[] = $answer['answer_id'];
$answer_uids[] = $answer['uid'];
if ($answer['has_attach']) {
$has_attach_answer_ids[] = $answer['answer_id'];
}
}
if (!in_array($question_info['best_answer'], $answer_ids) and intval($_GET['page']) < 2) {
$answer_list = array_merge($this->model('answer')->get_answer_list_by_question_id($question_info['question_id'], 1, 'answer_id = ' . $question_info['best_answer']), $answer_list);
}
if ($answer_ids) {
$answer_agree_users = $this->model('answer')->get_vote_user_by_answer_ids($answer_ids);
$answer_vote_status = $this->model('answer')->get_answer_vote_status($answer_ids, $this->user_id);
$answer_users_rated_thanks = $this->model('answer')->users_rated('thanks', $answer_ids, $this->user_id);
$answer_users_rated_uninterested = $this->model('answer')->users_rated('uninterested', $answer_ids, $this->user_id);
$answer_attachs = $this->model('publish')->get_attachs('answer', $has_attach_answer_ids, 'min');
}
foreach ($answer_list as $answer) {
if ($answer['has_attach']) {
$answer['attachs'] = $answer_attachs[$answer['answer_id']];
$answer['insert_attach_ids'] = FORMAT::parse_attachs($answer['answer_content'], true);
}
$answer['user_rated_thanks'] = $answer_users_rated_thanks[$answer['answer_id']];
$answer['user_rated_uninterested'] = $answer_users_rated_uninterested[$answer['answer_id']];
$answer['answer_content'] = $this->model('question')->parse_at_user(FORMAT::parse_attachs(nl2br(FORMAT::parse_bbcode($answer['answer_content']))));
$answer['agree_users'] = $answer_agree_users[$answer['answer_id']];
$answer['agree_status'] = $answer_vote_status[$answer['answer_id']];
if ($question_info['best_answer'] == $answer['answer_id'] and intval($_GET['page']) < 2) {
$answers[0] = $answer;
} else {
$answers[] = $answer;
}
// 获取回答评论列表
$comments = $this->model('answer')->get_answer_comments($answer['answer_id']);
$user_infos = $this->model('account')->get_user_info_by_uids(fetch_array_value($comments, 'uid'));
foreach ($comments as $key => $val) {
//.........这里部分代码省略.........
开发者ID:egogg,项目名称:wecenter-dev,代码行数:101,代码来源:ajax.php
示例7: get_focus_users_by_topic
public function get_focus_users_by_topic($topic_id, $limit = 10)
{
$user_list = array();
$uids = $this->query_all("SELECT DISTINCT uid FROM " . $this->get_table('topic_focus') . " WHERE topic_id = " . intval($topic_id), $limit);
if ($uids) {
$user_list_query = $this->model('account')->get_user_info_by_uids(fetch_array_value($uids, 'uid'));
if ($user_list_query) {
foreach ($user_list_query as $user_info) {
$user_list[$user_info['uid']]['uid'] = $user_info['uid'];
$user_list[$user_info['uid']]['user_name'] = $user_info['user_name'];
$user_list[$user_info['uid']]['avatar_file'] = get_avatar_url($user_info['uid'], 'mid');
$user_list[$user_info['uid']]['url'] = get_js_url('/people/' . $user_info['url_token']);
}
}
}
return $user_list;
}
开发者ID:xuechenli,项目名称:NUAA-Question-Answering,代码行数:17,代码来源:topic.php
示例8: get_focus_users_by_topic
public function get_focus_users_by_topic($topic_id, $limit = 10)
{
if ($uids = $this->query_all("SELECT DISTINCT uid FROM " . $this->get_table('topic_focus') . " WHERE topic_id = " . intval($topic_id), $limit)) {
return $this->model('account')->get_user_info_by_uids(fetch_array_value($uids, 'uid'));
}
}
开发者ID:chenruixuan,项目名称:wecenter,代码行数:6,代码来源:topic.php
示例9: get_answer_comments_action
public function get_answer_comments_action()
{
$comments = $this->model('answer')->get_answer_comments($_GET['answer_id']);
$user_infos = $this->model('account')->get_user_info_by_uids(fetch_array_value($comments, 'uid'));
foreach ($comments as $key => $val) {
$comments[$key]['message'] = FORMAT::parse_links($this->model('question')->parse_at_user($comments[$key]['message']));
$comments[$key]['user_name'] = $user_infos[$val['uid']]['user_name'];
$comments[$key]['url_token'] = $user_infos[$val['uid']]['url_token'];
$comments[$key]['avatar_file'] = $user_infos[$val['uid']]['avatar_file'];
$comments[$key]['time'] = date_friendly($val['time']);
}
//$answer_info = $this->model('answer')->get_answer_by_id($_GET['answer_id']);
echo json_encode($array = array("value" => $comments));
/*TPL::assign('question', $this->model('question')->get_question_info_by_id($answer_info['question_id']));
TPL::assign('comments', $comments);
if (is_mobile())
{
TPL::output("m/ajax/question_comments");
}
else
{
TPL::output("question/ajax/comments");
}*/
}
开发者ID:lincoln2015,项目名称:18duchengxuyuan_server,代码行数:26,代码来源:ajax.php
注:本文中的fetch_array_value函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论