當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FORMAT類代碼示例

本文整理匯總了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;
     }
 }
開發者ID:Vizards,項目名稱:HeavenSpree,代碼行數:35,代碼來源:tools.php

示例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);
 }
開發者ID:chenruixuan,項目名稱:wecenter,代碼行數:28,代碼來源:ajax.php

示例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));
     }
 }
開發者ID:chenruixuan,項目名稱:wecenter,代碼行數:34,代碼來源:ajax.php

示例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));
 }
開發者ID:elelianghh,項目名稱:wecenter,代碼行數:41,代碼來源:ajax.php

示例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);
開發者ID:Nvenom,項目名稱:Cellwiz,代碼行數:30,代碼來源:cid.php

示例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>';
    }
}
開發者ID:Gradven,項目名稱:what3.1.7,代碼行數:13,代碼來源:functions.app.php

示例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');
 }
開發者ID:Vizards,項目名稱:HeavenSpree,代碼行數:38,代碼來源:main.php

示例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>';
開發者ID:Nvenom,項目名稱:Cellwiz,代碼行數:20,代碼來源:add.php

示例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']);
 }
開發者ID:Vizards,項目名稱:HeavenSpree,代碼行數:66,代碼來源:approval.php

示例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;
     }
 }
開發者ID:lincoln2015,項目名稱:18duchengxuyuan_server,代碼行數:33,代碼來源:test.php

示例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));
 }
開發者ID:androiddream,項目名稱:WeCenterMobile-Api,代碼行數:40,代碼來源:inbox.php

示例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));
 }
開發者ID:androiddream,項目名稱:WeCenterMobile-Api,代碼行數:30,代碼來源:topic.php

示例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']);
 }
開發者ID:ddxmaaa,項目名稱:wecenter-loudong,代碼行數:73,代碼來源:approval.php

示例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));
 }
開發者ID:androiddream,項目名稱:WeCenterMobile-Api,代碼行數:63,代碼來源:article.php

示例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']));
開發者ID:Nvenom,項目名稱:Cellwiz,代碼行數:31,代碼來源:tpanel.php


注:本文中的FORMAT類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。