本文整理匯總了PHP中FORMAT::parse_attachs2方法的典型用法代碼示例。如果您正苦於以下問題:PHP FORMAT::parse_attachs2方法的具體用法?PHP FORMAT::parse_attachs2怎麽用?PHP FORMAT::parse_attachs2使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FORMAT
的用法示例。
在下文中一共展示了FORMAT::parse_attachs2方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_all_question
public function get_all_question()
{
// return "helloword23333333";
if ($result = $this->fetch_all('question', "", "update_time DESC")) {
foreach ($result as $key => $val) {
$data[$key]['question_info'] = $val;
// here should parse answer_content for get img url directly by anxiang.xiao 20150827
$data[$key]['question_info']['question_detail'] = $this->model('question')->parse_at_user(FORMAT::parse_attachs2(nl2br(FORMAT::parse_bbcode($data[$key]['question_info']['question_detail']))));
$data[$key]['question_publish_user_info'] = $this->fetch_row('users', 'uid = ' . $val['published_uid']);
if ($data[$key]['question_publish_user_info']['avatar_file']) {
$data[$key]['question_publish_user_info']['avatar_file'] = get_avatar_url($data[$key]['question_publish_user_info']['uid'], 'min');
}
$data[$key]['category_info'] = $this->fetch_row('category', 'id = ' . $val['category_id']);
$data[$key]['question_newest_answer_info'] = $this->fetch_row('answer', 'question_id = ' . $val['question_id'], "add_time DESC");
/*
*
* $data[$key]['question_info'] = $val;
if ($val['published_uid'] != 0)
$data[$key]['question_publish_user_info'] = $this->fetch_row('users','uid = ' .$val['published_uid'] );
else
$data[$key]['question_publish_user_info'] = "{}";
if ($val['category_id'] != 0)
$data[$key]['category_info'] = $this->fetch_row('category','id = ' .$val['category_id'] );
else
$data[$key]['category_info'] = "{}";
*/
}
return $data;
// return $posts_index;
}
}
示例2: get_answer_info_action
public function get_answer_info_action()
{
if (isset($_GET['answer_id'])) {
$answer_id = trim($_GET['answer_id']);
}
$question_answer = $this->model('test')->get_answer_by_id($answer_id);
// here should parse answer_content for get img url directly by anxiang.xiao 20150827
$question_answer['answer_content'] = $this->model('question')->parse_at_user(FORMAT::parse_attachs2(nl2br(FORMAT::parse_bbcode($question_answer['answer_content']))));
echo json_encode($array = array("value" => $question_answer));
}