本文整理汇总了PHP中FORMAT类的典型用法代码示例。如果您正苦于以下问题:PHP FORMAT类的具体用法?PHP FORMAT怎么用?PHP FORMAT使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FORMAT类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bbcode_to_markdown_action
public function bbcode_to_markdown_action()
{
switch ($_GET['type']) {
default:
if ($questions_list = $this->model('question')->fetch_page('question', null, 'question_id ASC', $_GET['page'], $_GET['per_page'])) {
foreach ($questions_list as $key => $val) {
$this->model('question')->update('question', array('question_detail' => FORMAT::bbcode_2_markdown($val['question_detail'])), 'question_id = ' . intval($val['question_id']));
}
H::redirect_msg(AWS_APP::lang()->_t('正在转换主题内容 BBCode') . ', ' . AWS_APP::lang()->_t('批次: %s', $_GET['page']), '/admin/tools/bbcode_to_markdown/page-' . ($_GET['page'] + 1) . '__per_page-' . $_GET['per_page']);
} else {
H::redirect_msg(AWS_APP::lang()->_t('准备继续...'), '/admin/tools/bbcode_to_markdown/page-1__type-answer__per_page-' . $_GET['per_page']);
}
break;
case 'answer':
if ($answer_list = $this->model('question')->fetch_page('answer', null, 'answer_id ASC', $_GET['page'], $_GET['per_page'])) {
foreach ($answer_list as $key => $val) {
$this->model('answer')->update_answer_by_id($val['answer_id'], array('answer_content' => FORMAT::bbcode_2_markdown($val['answer_content'])));
}
H::redirect_msg(AWS_APP::lang()->_t('正在转换回复内容 BBCode') . ', ' . AWS_APP::lang()->_t('批次: %s', $_GET['page']), '/admin/tools/bbcode_to_markdown/page-' . ($_GET['page'] + 1) . '__type-answer__per_page-' . $_GET['per_page']);
} else {
H::redirect_msg(AWS_APP::lang()->_t('准备继续...'), '/admin/tools/bbcode_to_markdown/page-1__type-topic__per_page-' . $_GET['per_page']);
}
break;
case 'topic':
if ($topic_list = $this->model('topic')->get_topic_list(null, 'topic_id ASC', $_GET['per_page'], $_GET['page'])) {
foreach ($topic_list as $key => $val) {
$this->model('topic')->update('topic', array('topic_description' => FORMAT::bbcode_2_markdown($val['topic_description'])), 'topic_id = ' . intval($val['topic_id']));
}
H::redirect_msg(AWS_APP::lang()->_t('正在转换话题内容 BBCode') . ', ' . AWS_APP::lang()->_t('批次: %s', $_GET['page']), '/admin/tools/bbcode_to_markdown/page-' . ($_GET['page'] + 1) . '__type-topic__per_page-' . $_GET['per_page']);
} else {
H::redirect_msg(AWS_APP::lang()->_t('BBCode 转换完成'), '/admin/tools/');
}
break;
}
}
示例2: questions_list_action
public function questions_list_action()
{
if ($_GET['feature_id']) {
$topic_ids = $this->model('feature')->get_topics_by_feature_id($_GET['feature_id']);
if ($topic_ids) {
$answers = $this->model('reader')->fetch_answers_list_by_topic_ids($topic_ids, $_GET['page'], 20);
}
} else {
$answers = $this->model('reader')->fetch_answers_list($_GET['page'], 20);
}
$output = array();
if ($answers) {
foreach ($answers as $key => $val) {
$question_ids[$val['question_id']] = $val['question_id'];
$uids[$val['uid']] = $val['uid'];
}
$questions_info = $this->model('question')->get_question_info_by_ids($question_ids);
$question_topics = $this->model('topic')->get_topics_by_item_ids($question_ids, 'question');
$users_info = $this->model('account')->get_user_info_by_uids($uids, TRUE);
foreach ($answers as $key => $val) {
$output['answers'][$val['answer_id']] = array('answer_id' => $val['answer_id'], 'question_id' => $val['question_id'], 'avatar' => get_avatar_url($val['uid'], 'mid'), 'user_name' => $users_info[$val['uid']]['user_name'], 'signature' => $users_info[$val['uid']]['signature'], 'agree_count' => $val['agree_count'], 'agree_users' => $this->model('answer')->get_vote_user_by_answer_id($val['answer_id']), 'answer_content' => FORMAT::parse_attachs(nl2br(FORMAT::parse_markdown($val['answer_content']))), 'add_time' => date_friendly($val['add_time']), 'uid' => $val['uid']);
}
foreach ($questions_info as $key => $val) {
$output['questions'][$val['question_id']] = array('question_id' => $val['question_id'], 'question_content' => $val['question_content'], 'question_detail' => FORMAT::parse_attachs(nl2br(FORMAT::parse_markdown($val['question_detail']))), 'answer_users' => $val['answer_users'], 'focus_count' => $val['focus_count'], 'view_count' => $val['view_count'], 'topics' => $question_topics[$val['question_id']]);
}
}
echo json_encode($output);
}
示例3: save_comment_action
public function save_comment_action()
{
if (!($article_info = $this->model('article')->get_article_info_by_id($_POST['article_id']))) {
H::ajax_json_output(AWS_APP::RSM(null, '-1', AWS_APP::lang()->_t('指定文章不存在')));
}
if ($article_info['lock'] and !($this->user_info['permission']['is_administortar'] or $this->user_info['permission']['is_moderator'])) {
H::ajax_json_output(AWS_APP::RSM(null, '-1', AWS_APP::lang()->_t('已经锁定的文章不能回复')));
}
$message = trim($_POST['message'], "\r\n\t");
if (!$message) {
H::ajax_json_output(AWS_APP::RSM(null, '-1', AWS_APP::lang()->_t('请输入回复内容')));
}
if (strlen($message) < get_setting('answer_length_lower')) {
H::ajax_json_output(AWS_APP::RSM(null, '-1', AWS_APP::lang()->_t('回复内容字数不得少于 %s 字节', get_setting('answer_length_lower'))));
}
if (!$this->user_info['permission']['publish_url'] and FORMAT::outside_url_exists($message)) {
H::ajax_json_output(AWS_APP::RSM(null, '-1', AWS_APP::lang()->_t('你所在的用户组不允许发布站外链接')));
}
if (human_valid('answer_valid_hour') and !AWS_APP::captcha()->is_validate($_POST['seccode_verify'])) {
H::ajax_json_output(AWS_APP::RSM(null, '-1', AWS_APP::lang()->_t('请填写正确的验证码')));
}
// !注: 来路检测后面不能再放报错提示
if (!valid_post_hash($_POST['post_hash'])) {
H::ajax_json_output(AWS_APP::RSM(null, '-1', AWS_APP::lang()->_t('页面停留时间过长,或内容已提交,请刷新页面')));
}
if ($this->publish_approval_valid()) {
$this->model('publish')->publish_approval('article_comment', array('article_id' => intval($_POST['article_id']), 'message' => $message, 'at_uid' => intval($_POST['at_uid'])), $this->user_id);
H::ajax_json_output(AWS_APP::RSM(array('url' => get_js_url('/publish/wait_approval/article_id-' . intval($_POST['article_id']) . '__is_mobile-' . $_POST['_is_mobile'])), 1, null));
} else {
$comment_id = $this->model('publish')->publish_article_comment($_POST['article_id'], $message, $this->user_id, $_POST['at_uid']);
$url = get_js_url('/article/' . intval($_POST['article_id']) . '?item_id=' . $comment_id);
H::ajax_json_output(AWS_APP::RSM(array('url' => $url), 1, null));
}
}
示例4: reply_action
public function reply_action()
{
$_POST['message'] = trim($_POST['message']);
if (!$_POST['message']) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('请输入回复内容')));
}
if (!$_POST['id']) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('请选择要回复的工单')));
}
$ticket_info = $this->model('ticket')->get_ticket_info_by_id($_POST['id']);
if (!$ticket_info) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('工单不存在')));
}
if ($ticket_info['status'] == 'closed') {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('工单已关闭')));
}
if (!$this->user_info['permission']['is_administortar'] and !$this->user_info['permission']['is_service'] and $ticket_info['uid'] != $this->user_id and !$this->model('ticket')->has_invited($this->user_id)) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('你没有权限回复该工单')));
}
$reply_id = $this->model('ticket')->reply_ticket($ticket_info['id'], $_POST['message'], $this->user_id, $_POST['attach_access_key']);
if (!$reply_id) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('回复失败')));
}
$this->model('draft')->delete_draft(1, 'ticket_reply', $this->user_id);
$reply_info = $this->model('ticket')->get_ticket_reply_by_id($reply_id);
if ($ticket_info['uid'] != $this->user_id) {
$this->model('notify')->send($reply_info['uid'], $ticket_info['uid'], notify_class::TYPE_TICKET_REPLIED, notify_class::CATEGORY_TICKET, 0, array('from_uid' => $reply_info['uid'], 'ticket_id' => $ticket_info['id'], 'reply_id' => $reply_info['id']));
}
$reply_info['user_info'] = $this->user_info;
$reply_info['message'] = nl2br(FORMAT::parse_markdown($reply_info['message']));
if ($reply_info['has_attach']) {
$reply_info['attachs'] = $this->model('publish')->get_attach('ticket', $reply_info['id'], 'min');
$reply_info['insert_attach_ids'] = FORMAT::parse_attachs($reply_info['message'], true);
$reply_info['message'] = FORMAT::parse_attachs($reply_info['message']);
}
if (!$ticket_info['service'] and $ticket_info['uid'] != $this->user_id and ($this->user_info['permission']['is_administortar'] or $this->user_info['permission']['is_service'])) {
$this->model('ticket')->assign_service($ticket_info['id'], $this->user_id);
}
TPL::assign('reply_info', $reply_info);
H::ajax_json_output(AWS_APP::RSM(array('ajax_html' => TPL::output('ticket/ajax/reply', false)), 1, null));
}
示例5: switch
require "../../../frame/engine.php";
ENGINE::START();
$USER = USER::VERIFY(0, TRUE);
if (empty($_GET['sSearch'])) {
$S = $_GET['string'];
} else {
$S = $_GET['sSearch'];
}
$iDS = $_GET['iDisplayStart'];
$iDL = $_GET['iDisplayLength'];
$iSC = $_GET['iSortCol_0'];
$iSD = $_GET['sSortDir_0'];
switch ($iSC) {
case 0:
$SS = 'ORDER BY c_name ' . $iSD;
break;
case 1:
$SS = 'ORDER BY c_phone ' . $iSD;
break;
case 2:
$SS = '';
break;
}
$iTotal = MYSQL::QUERY('SELECT COUNT(c_id) AS `COUNT` FROM core_customers WHERE c_name LIKE ? OR c_phone LIKE ?', array('%' . $S . '%', '%' . $S . '%'));
$iQuery = MYSQL::QUERY("SELECT * FROM core_customers WHERE c_name LIKE ? OR c_phone LIKE ? {$SS} LIMIT {$iDS},{$iDL}", array('%' . $S . '%', '%' . $S . '%'), FALSE, TRUE);
$OUTPUT = array('sEcho' => $_GET['sEcho'], 'iTotalRecords' => $iTotal[0]['COUNT'], 'iTotalDisplayRecords' => $iTotal[0]['COUNT'], 'aaData');
foreach ($iQuery as $C) {
$OUTPUT['aaData'][] = array($C['c_name'], FORMAT::PHONE($C['c_phone']), '<button onClick="LoadCustomer(' . "'" . $C['c_id'] . "'" . ')">LOAD</button>');
}
echo JSON_ENCODE($OUTPUT);
示例6: parse_link_callback
function parse_link_callback($matches)
{
if (preg_match('/^(?!http).*/i', $matches[1])) {
$url = 'http://' . $matches[1];
} else {
$url = $matches[1];
}
if (is_inside_url($url)) {
return '<a href="' . $url . '">' . FORMAT::sub_url($matches[1], 50) . '</a>';
} else {
return '<a href="' . $url . '" rel="nofollow" target="_blank">' . FORMAT::sub_url($matches[1], 50) . '</a>';
}
}
示例7: article_action
public function article_action()
{
if ($_GET['notification_id']) {
$this->model('notify')->read_notification($_GET['notification_id'], $this->user_id);
}
if (!($article_info = $this->model('article')->get_article_info_by_id($_GET['id']))) {
H::redirect_msg(AWS_APP::lang()->_t('文章不存在或已被删除'), '/home/explore/');
}
$this->crumb($article_info['title'], '/article/' . $article_info['id']);
if ($article_info['has_attach']) {
$article_info['attachs'] = $this->model('publish')->get_attach('article', $article_info['id'], 'min');
$article_info['attachs_ids'] = FORMAT::parse_attachs($article_info['message'], true);
}
$article_info['user_info'] = $this->model('account')->get_user_info_by_uid($article_info['uid'], true);
$article_info['message'] = FORMAT::parse_attachs(nl2br(FORMAT::parse_markdown($article_info['message'])));
if ($this->user_id) {
$article_info['vote_info'] = $this->model('article')->get_article_vote_by_id('article', $article_info['id'], null, $this->user_id);
}
$article_info['vote_users'] = $this->model('article')->get_article_vote_users_by_id('article', $article_info['id'], null, 10);
TPL::assign('article_info', $article_info);
TPL::assign('article_topics', $this->model('topic')->get_topics_by_item_id($article_info['id'], 'article'));
if ($_GET['item_id']) {
$comments[] = $this->model('article')->get_comment_by_id($_GET['item_id']);
} else {
$comments = $this->model('article')->get_comments($article_info['id'], $_GET['page'], 100);
}
if ($comments and $this->user_id) {
foreach ($comments as $key => $val) {
$comments[$key]['vote_info'] = $this->model('article')->get_article_vote_by_id('comment', $val['id'], 1, $this->user_id);
}
}
$this->model('article')->update_views($article_info['id']);
TPL::assign('comments', $comments);
TPL::assign('comments_count', $article_info['comments']);
TPL::assign('human_valid', human_valid('answer_valid_hour'));
TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/m/article/id-' . $article_info['id']), 'total_rows' => $article_info['comments'], 'per_page' => 100))->create_links());
TPL::output('m/article');
}
示例8: trim
<?php
require "../../../frame/engine.php";
ENGINE::START();
$user = USER::VERIFY(0, TRUE);
$Fname = FORMAT::TEXT($_GET['Fname']);
$Lname = FORMAT::TEXT($_GET['Lname']);
$Phone = trim($_GET['phone']);
$Sec = trim($_GET['secondarymethod']);
$SecInfo = trim($_GET['secinfo']);
$Zip = trim($_GET['zip']);
$Market = trim($_GET['market']);
$Market_Location = trim($_GET['market_location']);
$Corporate_Account = trim($_GET['corpacc']);
$params = array("{$Fname} {$Lname}", $Zip, $Corporate_Account, $Phone, $Sec, $SecInfo, Date("Y-m-d H:i:s"));
$Main = MYSQL::QUERY('INSERT INTO core_customers (c_name,c_zip,c_acc,c_phone,c_contact_method,c_contact_info,c_join_date) VALUES (?,?,?,?,?,?,?)', $params);
USER::LOG("Customer Added [{$Fname} {$Lname}][{$Phone}]");
TRACKING::ADVERT($Market_Location, $user);
TRACKING::CUSTOMERS($user);
echo '<option value="' . str_pad($Main, 10, "0", STR_PAD_LEFT) . '">' . $Fname . ' ' . $Lname . '</option>';
示例9: preview_action
public function preview_action()
{
if (!$_GET['action'] or $_GET['action'] != 'edit') {
$_GET['action'] = 'preview';
} else {
$this->crumb(AWS_APP::lang()->_t('待审项修改'), 'admin/approval/edit/');
TPL::assign('menu_list', $this->model('admin')->fetch_menu_list(300));
}
switch ($_GET['type']) {
case 'weibo_msg':
$approval_item = $this->model('openid_weibo_weibo')->get_msg_info_by_id($_GET['id']);
if ($approval_item['question_id']) {
exit;
}
$approval_item['type'] = 'weibo_msg';
break;
case 'received_email':
$approval_item = $this->model('edm')->get_received_email_by_id($_GET['id']);
if ($approval_item['question_id']) {
exit;
}
$approval_item['type'] = 'received_email';
break;
default:
$approval_item = $this->model('publish')->get_approval_item($_GET['id']);
break;
}
if (!$approval_item) {
exit;
}
switch ($approval_item['type']) {
case 'question':
$approval_item['title'] = htmlspecialchars($approval_item['data']['question_content']);
$approval_item['content'] = htmlspecialchars($approval_item['data']['question_detail']);
$approval_item['topics'] = htmlspecialchars(implode(',', $approval_item['data']['topics']));
break;
case 'answer':
$approval_item['content'] = htmlspecialchars($approval_item['data']['answer_content']);
break;
case 'article':
$approval_item['title'] = htmlspecialchars($approval_item['data']['title']);
$approval_item['content'] = htmlspecialchars($approval_item['data']['message']);
break;
case 'article_comment':
$approval_item['content'] = htmlspecialchars($approval_item['data']['message']);
break;
case 'weibo_msg':
$approval_item['content'] = htmlspecialchars($approval_item['text']);
if ($approval_item['has_attach']) {
$approval_item['attachs'] = $this->model('publish')->get_attach('weibo_msg', $_GET['id']);
}
break;
case 'received_email':
$approval_item['title'] = htmlspecialchars($approval_item['subject']);
$approval_item['content'] = htmlspecialchars($approval_item['content']);
break;
}
if ($approval_item['data']['attach_access_key']) {
$approval_item['attachs'] = $this->model('publish')->get_attach_by_access_key($approval_item['type'], $approval_item['data']['attach_access_key']);
}
if ($_GET['action'] != 'edit') {
$approval_item['content'] = nl2br(FORMAT::parse_markdown($approval_item['content']));
}
TPL::assign('approval_item', $approval_item);
TPL::output('admin/approval/' . $_GET['action']);
}
示例10: 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;
}
}
示例11: read_action
public function read_action()
{
if (!($dialog = $this->model('message')->get_dialog_by_id($_GET['id']))) {
H::redirect_msg(AWS_APP::lang()->_t('指定的站内信不存在'), '/inbox/');
}
if ($dialog['recipient_uid'] != $this->user_id and $dialog['sender_uid'] != $this->user_id) {
H::redirect_msg(AWS_APP::lang()->_t('指定的站内信不存在'), '/inbox/');
}
$this->model('message')->set_message_read($_GET['id'], $this->user_id);
if ($list = $this->model('message')->get_message_by_dialog_id($_GET['id'])) {
if ($dialog['sender_uid'] != $this->user_id) {
$recipient_user = $this->model('account')->get_user_info_by_uid($dialog['sender_uid']);
} else {
$recipient_user = $this->model('account')->get_user_info_by_uid($dialog['recipient_uid']);
}
foreach ($list as $key => $val) {
if ($dialog['sender_uid'] == $this->user_id and $val['sender_remove']) {
unset($list[$key]);
} else {
if ($dialog['sender_uid'] != $this->user_id and $val['recipient_remove']) {
unset($list[$key]);
} else {
$list[$key]['message'] = FORMAT::parse_links($val['message']);
$list[$key]['user_name'] = $recipient_user['user_name'];
$list[$key]['url_token'] = $recipient_user['url_token'];
}
}
}
}
$user_key = array('uid', 'user_name', 'name', 'avatar_file', 'namecard_pic', 'signature');
if (!empty($recipient_user)) {
foreach ($recipient_user as $k => $v) {
if (!in_array($k, $user_key)) {
unset($recipient_user[$k]);
}
}
}
$recipient_user['avatar_file'] = get_avatar_url($recipient_user['uid'], 'max');
H::ajax_json_output(AWS_APP::RSM(array('recipient_user' => $recipient_user, 'rows' => $list), 1, null));
}
示例12: topic_action
public function topic_action()
{
if (is_numeric($_GET['id'])) {
if (!($topic_info = $this->model('topic')->get_topic_by_id($_GET['id']))) {
$topic_info = $this->model('topic')->get_topic_by_title($_GET['id']);
}
} else {
if (!($topic_info = $this->model('topic')->get_topic_by_title($_GET['id']))) {
$topic_info = $this->model('topic')->get_topic_by_url_token($_GET['id']);
}
}
if (!$topic_info) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('话题不存在')));
}
if ($topic_info['merged_id'] and $topic_info['merged_id'] != $topic_info['topic_id']) {
if ($this->model('topic')->get_topic_by_id($topic_info['merged_id'])) {
$topic_info = $this->model('topic')->get_topic_by_id($_GET['merged_id']);
$topic_info['merged_tip'] = "您查看的话题已被合并到当前话题";
} else {
$this->model('topic')->remove_merge_topic($topic_info['topic_id'], $topic_info['merged_id']);
}
}
//此话题的最佳回答者
//TPL::assign('best_answer_users', $this->model('topic')->get_best_answer_users_by_topic_id($topic_info['topic_id'], 5));
if ($this->user_id) {
$topic_info['has_focus'] = $this->model('topic')->has_focus_topic($this->user_id, $topic_info['topic_id']);
}
$topic_info['topic_description'] = nl2br(FORMAT::parse_markdown($topic_info['topic_description']));
H::ajax_json_output(AWS_APP::RSM(array('topic_info' => $topic_info), 1, null));
}
示例13: preview_action
public function preview_action()
{
if (!$_GET['action'] or $_GET['action'] != 'edit') {
$_GET['action'] = 'preview';
} else {
$this->crumb(AWS_APP::lang()->_t('待审项修改'), 'admin/approval/edit/');
TPL::assign('menu_list', $this->model('admin')->fetch_menu_list(300));
}
switch ($_GET['type']) {
case 'weibo_msg':
if (get_setting('weibo_msg_enabled') != 'question') {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('导入微博消息至问题未启用')));
}
$approval_item = $this->model('openid_weibo_weibo')->get_msg_info_by_id($_GET['id']);
if ($approval_item['question_id']) {
exit;
}
$approval_item['type'] = 'weibo_msg';
break;
case 'received_email':
$receiving_email_global_config = get_setting('receiving_email_global_config');
if ($receiving_email_global_config['enabled'] != 'question') {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('导入邮件至问题未启用')));
}
$approval_item = $this->model('edm')->get_received_email_by_id($_GET['id']);
if ($approval_item['question_id']) {
exit;
}
$approval_item['type'] = 'received_email';
break;
default:
$approval_item = $this->model('publish')->get_approval_item($_GET['id']);
break;
}
if (!$approval_item) {
exit;
}
switch ($approval_item['type']) {
case 'question':
$approval_item['title'] = $approval_item['data']['question_content'];
$approval_item['content'] = $approval_item['data']['question_detail'];
$approval_item['topics'] = implode(',', $approval_item['data']['topics']);
break;
case 'answer':
$approval_item['content'] = $approval_item['data']['answer_content'];
break;
case 'article':
$approval_item['title'] = $approval_item['data']['title'];
$approval_item['content'] = $approval_item['data']['message'];
break;
case 'article_comment':
$approval_item['content'] = $approval_item['data']['message'];
break;
case 'weibo_msg':
$approval_item['content'] = $approval_item['text'];
if ($approval_item['has_attach']) {
$approval_item['attachs'] = $this->model('publish')->get_attach('weibo_msg', $_GET['id']);
}
break;
case 'received_email':
$approval_item['title'] = $approval_item['subject'];
$approval_item['content'] = $approval_item['content'];
break;
}
if ($approval_item['data']['attach_access_key']) {
$approval_item['attachs'] = $this->model('publish')->get_attach_by_access_key($approval_item['type'], $approval_item['data']['attach_access_key']);
}
if ($_GET['action'] != 'edit') {
$approval_item['content'] = nl2br(FORMAT::parse_bbcode($approval_item['content']));
}
TPL::assign('approval_item', $approval_item);
TPL::output('admin/approval/' . $_GET['action']);
}
示例14: index_action
public function index_action()
{
if (!($article_info = $this->model('article')->get_article_info_by_id($_GET['id']))) {
H::redirect_msg(AWS_APP::lang()->_t('文章不存在或已被删除'), '/');
}
if ($article_info['has_attach']) {
$article_info['attachs'] = $this->model('publish')->get_attach('article', $article_info['id'], 'min');
$article_info['attachs_ids'] = FORMAT::parse_attachs($article_info['message'], true);
}
$article_info['user_info'] = $this->model('account')->get_user_info_by_uid($article_info['uid'], true);
$article_info['message'] = FORMAT::parse_attachs(nl2br(FORMAT::parse_bbcode($article_info['message'])));
if ($this->user_id) {
$article_info['vote_info'] = $this->model('article')->get_article_vote_by_id('article', $article_info['id'], null, $this->user_id);
}
//赞了该文章的用户信息
$article_info['vote_users'] = $this->model('article')->get_article_vote_users_by_id('article', $article_info['id'], 1, 10);
//文章话题
$article_topics = $this->model('topic')->get_topics_by_item_id($article_info['id'], 'article');
$comments = $this->model('article')->get_comments($article_info['id'], $_GET['page'], 100);
if ($comments and $this->user_id) {
foreach ($comments as $key => $val) {
$comments[$key]['vote_info'] = $this->model('article')->get_article_vote_by_id('comment', $val['id'], 1, $this->user_id);
$comments[$key]['message'] = $this->model('question')->parse_at_user($val['message']);
}
}
$article_info['user_follow_check'] = 0;
if ($this->user_id and $this->model('follow')->user_follow_check($this->user_id, $article_info['uid'])) {
$article_info['user_follow_check'] = 1;
}
$this->model('article')->update_views($article_info['id']);
//作者信息
if ($article_info['user_info']) {
$article_info['user_info'] = $this->model('myapi')->get_clean_user_info($article_info['user_info']);
}
//点赞者信息
if (!empty($article_info['vote_users'])) {
foreach ($article_info['vote_users'] as $key => $value) {
$article_info['vote_users'][$key] = $this->model('myapi')->get_clean_user_info($value);
}
}
$topics_key = array('topic_id', 'topic_title');
if ($article_topics) {
foreach ($article_topics as $kk => $vv) {
foreach ($vv as $k => $v) {
if (!in_array($k, $topics_key)) {
unset($article_topics[$kk][$k]);
}
}
}
}
//评论里评论者信息
if (!empty($comments)) {
foreach ($comments as $key => $value) {
if (!empty($value['user_info'])) {
$comments[$key]['user_info'] = $this->model('myapi')->get_clean_user_info($value['user_info']);
}
if (!empty($value['at_user_info'])) {
$comments[$key]['at_user_info'] = $this->model('myapi')->get_clean_user_info($value['at_user_info']);
}
}
}
H::ajax_json_output(AWS_APP::RSM(array('article_info' => $article_info, 'article_topics' => $article_topics, 'comments' => $comments), 1, null));
}
示例15: str_replace
$BUTTONS['B3_F'] = 'DISABLED';
$BUTTONS['B4'] = 'Re-Open Ticket';
$BUTTONS['B4_F'] = 'onClick="ReopenTicket(' . "'" . $CODE . "'" . ')"';
break;
case 99:
$BUTTONS['B3_F'] = 'DISABLED';
$BUTTONS['B4'] = 'Re-Open Ticket';
$BUTTONS['B4_F'] = 'onClick="ReopenTicket(' . "'" . $CODE . "'" . ')"';
break;
}
$PHY = $TICKET['INFO']['t_phy'] == 1 ? "Yes" : "No";
$LIQ = $TICKET['INFO']['t_liq'] == 1 ? "Yes" : "No";
$SOF = $TICKET['INFO']['t_sof'] == 1 ? "Yes" : "No";
$MANU = $TICKET['MANU']['m_name'];
$MODEL = str_replace($MANU . " ", "", $TICKET['MODE']['m_name']);
$PHONE = FORMAT::PHONE($TICKET['CUST']['c_phone']);
$CD = date("M d, Y h:i A", strtotime($TICKET['INFO']['t_created']));
if (empty($TICKET['INFO']['t_estimate_created'])) {
$ED = "";
} else {
$ED = date("M d, Y h:i A", strtotime($TICKET['INFO']['t_estimate_created']));
}
if (empty($TICKET['INFO']['t_repair_created'])) {
$RD = "";
} else {
$RD = date("M d, Y h:i A", strtotime($TICKET['INFO']['t_repair_created']));
}
if (empty($TICKET['INFO']['t_checkout_created'])) {
$CHD = "";
} else {
$CHD = date("M d, Y h:i A", strtotime($TICKET['INFO']['t_checkout_created']));