当前位置: 首页>>代码示例>>PHP>>正文


PHP get_uid函数代码示例

本文整理汇总了PHP中get_uid函数的典型用法代码示例。如果您正苦于以下问题:PHP get_uid函数的具体用法?PHP get_uid怎么用?PHP get_uid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_uid函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: assignGroup

 private function assignGroup()
 {
     $data = S('GROUP_SHOW_DATA');
     if (empty($data)) {
         $group_ids = modC('GROUP_SHOW', '', 'Group');
         $cache_time = modC('GROUP_SHOW_CACHE_TIME', 600, 'Group');
         $group_ids = explode('|', $group_ids);
         $groupModel = new GroupModel();
         // $group= $groupModel->where(array('status' => 1,'id' => array('in',$group_ids)))->select();
         // $group=array_combine(array_column($group,'id'),$group);
         $data = array();
         foreach ($group_ids as $val) {
             if ($val != '') {
                 $g = $groupModel->getGroup($val);
                 if (!empty($g)) {
                     $data[] = $g;
                 }
             }
         }
         if (!count($data)) {
             $data = 1;
         }
         S('GROUP_SHOW_DATA', $data, $cache_time);
     }
     if ($data == 1) {
         $data = null;
     }
     $groupMemberModel = new GroupMemberModel();
     foreach ($data as &$val) {
         $val['is_attend'] = $groupMemberModel->where(array('group_id' => $val['id'], 'uid' => get_uid(), 'status' => 1))->count();
     }
     $this->assign('group_show', $data);
 }
开发者ID:tmac1997,项目名称:DormitoryWebsite,代码行数:33,代码来源:HomeBlockWidget.class.php

示例2: get_sso_token

 /**
  * @param string $api_key     API ключ UserEcho
  * @param string $project_key Ключ UserEcho
  * @param array  $user_info
  *
  * @return SSO KEY
  */
 public static function get_sso_token($api_key, $project_key, $user_info)
 {
     $sso_key = '';
     if ($uid = get_uid(false)) {
         $user = new users();
         $user->GetUserByUID($uid);
         $iv = str_shuffle('memoKomo1234QWER');
         $message = array('guid' => $uid, 'expires_date' => gmdate('Y-m-d H:i:s', time() + 86400), 'display_name' => $user->login, 'email' => $user->email, 'locale' => 'ru', 'verified_email' => true);
         // key hash, length = 16
         $key_hash = substr(hash('sha1', $api_key . $project_key, true), 0, 16);
         $message_json = json_encode(encodeCharset('CP1251', 'UTF-8', $message));
         // double XOR first block message_json
         for ($i = 0; $i < 16; ++$i) {
             $message_json[$i] = $message_json[$i] ^ $iv[$i];
         }
         // fill tail of message_json by bytes equaled count empty bytes (to 16)
         $pad = 16 - strlen($message_json) % 16;
         $message_json = $message_json . str_repeat(chr($pad), $pad);
         // encode json
         $cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', 'cbc', '');
         mcrypt_generic_init($cipher, $key_hash, $iv);
         $encrypted_bytes = mcrypt_generic($cipher, $message_json);
         mcrypt_generic_deinit($cipher);
         // encode bytes to url safe string
         $sso_key = urlencode(base64_encode($encrypted_bytes));
     }
     return $sso_key;
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:35,代码来源:userecho.php

示例3: quickPaymentBillinvoiceBank

/**
 * Выставяем счет оплаты по безналу
 * 
 * @param string $type - тип платежа (тут всегда bank)
 * @param array $data
 * @return \xajaxResponse
 */
function quickPaymentBillinvoiceBank($type, $data)
{
    $objResponse =& new xajaxResponse();
    $uid = get_uid(false);
    if ($uid <= 0) {
        return $objResponse;
    }
    $form = new BillInvoiceForm();
    if (!$form->isValid($data)) {
        $params = addslashes(urldecode(http_build_query($form->getAllMessages('<br/>'))));
        $objResponse->script("\n            var qp = window.quick_ext_payment_factory.getQuickPayment('billinvoice');\n            if(qp) qp.showElementsError('{$params}');\n        ");
        return $objResponse;
    }
    $sum = $form->getValue('sum');
    try {
        $doc = new DocGenBill();
        $file = $doc->generateBankInvoice($uid, @$_SESSION['login'], $sum);
    } catch (Exception $e) {
        $objResponse->script("\n            var qp = quick_ext_payment_factory.getQuickPayment('billinvoice');\n            if(qp) qp.show_error('{$e->getMessage()} Попробуйте еще раз.');\n        ");
        return $objResponse;
    }
    $link = WDCPREFIX . '/' . $file->path . $file->name;
    $objResponse->script(" \n        \n        var template = \$('bill_invoice_template').get('html');\n        if(template) {\n            template = template.replace('{link}','{$link}');\n            template = template.replace('{name}','{$file->original_name}');  \n            template = template.replace('{num}','{$doc->getField('id')}'); \n            \$('bill_invoice_create').addClass('b-layout_hide');    \n            \$('bill_invoice_remove').set('html', template).removeClass('b-layout_hide'); \n        }\n        \n        var qp = quick_ext_payment_factory.getQuickPayment('billinvoice');\n        if(qp) qp.close_popup();\n    ");
    return $objResponse;
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:32,代码来源:quick_payment_billinvoice.server.php

示例4: setUsedSum

 public function setUsedSum($price)
 {
     global $DB;
     $uid = get_uid(false);
     $sql = "UPDATE {$this->TABLE} SET sum = sum - ?i WHERE user_id = ?i;";
     $DB->query($sql, (int) $price, (int) $uid);
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:7,代码来源:buffer.php

示例5: init

 /**
  * Инициализация контроллера
  */
 public function init($action)
 {
     parent::init();
     $this->uid = get_uid(false);
     $this->is_adm = hasPermissions('projects', $this->uid);
     $this->layout = '//layouts/content-with-right-narrow-sidebar';
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:10,代码来源:GuestController.php

示例6: getCurrentSessions

 public function getCurrentSessions()
 {
     //每次获取到所有的id,就对这些做delete处理。防止反复提示。
     $new_talks = D('TalkPush')->where(array('uid' => get_uid(), 'status' => array('NEQ', -1)))->select();
     $new_ids = array();
     foreach ($new_talks as $push) {
         D('TalkPush')->where(array('id' => $push['id']))->setField('status', 1);
         //全部置为已提示
         $new_ids[] = $push['source_id'];
     }
     //每次获取到所有的id,就对这些做delete处理。防止反复提示。
     $new_talk_messages = D('TalkMessagePush')->where(array('uid' => get_uid(), 'status' => array('NEQ', -1)))->select();
     foreach ($new_talk_messages as $v) {
         D('TalkMessagePush')->where(array('id' => $v['id']))->setField('status', 1);
         //全部置为已提示
         $message = D('TalkMessage')->find($v['source_id']);
         if (!in_array($message['talk_id'], $new_ids)) {
             $new_ids[] = $message['talk_id'];
         }
     }
     $list = $this->where('uids like' . '"%[' . is_login() . ']%"' . ' and status=1')->order('update_time desc')->select();
     foreach ($list as $key => &$li) {
         $li = $this->getFirstUserAndLastMessage($li);
         if (in_array($li['id'], $new_ids)) {
             $list[$key]['new'] = 1;
         }
     }
     unset($li);
     return $list;
 }
开发者ID:nullog,项目名称:zhanglubao,代码行数:30,代码来源:TalkModel.class.php

示例7: init

 public function init()
 {
     $uid = get_uid(false);
     $reqvs = sbr_meta::getUserReqvs($uid);
     $form_type = @$reqvs['form_type'];
     $rez_type = @$reqvs['rez_type'];
     if ($form_type) {
         $reqvs = $reqvs[$form_type];
         if ($rez_type == sbr::RT_RU) {
             $reqvs_data = array(array('label' => 'ИНН', 'value' => @$reqvs['inn']), array('label' => 'КПП', 'value' => @$reqvs['kpp'], 'padbot' => 10), array('label' => 'Расчетный счет', 'value' => @$reqvs['bank_rs']), array('label' => 'Банк', 'value' => @$reqvs['bank_name']), array('label' => 'Корр.счет', 'value' => @$reqvs['bank_ks']), array('label' => 'БИК банка', 'value' => @$reqvs['bank_bik']), array('label' => 'ИНН банка', 'value' => @$reqvs['bank_inn']));
         } else {
             $reqvs_data = array(array('label' => 'Расчетный счет', 'value' => @$reqvs['bank_rs']), array('label' => 'Банк', 'value' => @$reqvs['bank_name']), array('label' => 'Уполномоченный Банк', 'value' => @$reqvs['bank_rf_name']), array('label' => 'Корр.счет вашего банка в уполномоченном банке', 'value' => @$reqvs['bank_rf_ks']), array('label' => 'БИК уполномоченного банка', 'value' => @$reqvs['bank_rf_bik']), array('label' => 'ИНН уполномоченного банка', 'value' => @$reqvs['bank_rf_inn']));
         }
     } else {
         $this->stopRender();
         return;
     }
     $options = array('popup_title' => 'Формирование счета', 'payments' => array(self::PAYMENT_TYPE_BANK => array('title' => 'Сформировать счет', 'class' => '', 'wait' => 'Идет создание счета')), 'reqvs' => $reqvs_data, 'rt_ru' => $rez_type == sbr::RT_RU);
     require_once 'forms/BillInvoiceForm.php';
     $form = new BillInvoiceForm();
     $this->setContent($form->render());
     /*
     $this->addWaitMessageForAll(
         //только индикатор
     );
     */
     parent::init($options);
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:28,代码来源:quickPaymentPopupBillInvoice.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     $sprache = getSprache();
     $user = get_uid();
     $is_lector = check_lektor($user);
     $p = new phrasen($sprache);
     $cutlength = 21;
     //Meine LVs Student
     if (!$is_lector) {
         $studiengang_obj = new studiengang();
         $studiengang_obj->getAll();
         if ($stsemobj = new studiensemester()) {
             $stsem = $stsemobj->getNearest();
             $qry = "SELECT distinct lehrveranstaltung_id, bezeichnung, studiengang_kz, semester, lehre, \n\t\t\t\t\t\t\tlehreverzeichnis from campus.vw_student_lehrveranstaltung \n\t\t\t\t\t\tWHERE uid='" . addslashes($user) . "' AND studiensemester_kurzbz='" . addslashes($stsem) . "'\n\t\t\t\t\t\tAND lehre=true AND lehreverzeichnis<>'' ORDER BY studiengang_kz, semester, bezeichnung";
             if ($result = $this->db_query($qry)) {
                 while ($row = $this->db_fetch_object($result)) {
                     $lv_obj = new lehrveranstaltung();
                     $lv_obj->load($row->lehrveranstaltung_id);
                     if ($row->studiengang_kz == 0 && $row->semester == 0) {
                         $this->items[] = array('title' => $lv_obj->bezeichnung_arr[$sprache], 'target' => 'content', 'link' => 'private/freifaecher/lesson.php?lvid=' . $row->lehrveranstaltung_id, 'name' => 'FF ' . $this->CutString($lv_obj->bezeichnung_arr[$sprache], $cutlength));
                     } else {
                         $this->items[] = array('title' => $lv_obj->bezeichnung_arr[$sprache], 'target' => 'content', 'link' => 'private/lehre/lesson.php?lvid=' . $row->lehrveranstaltung_id, 'name' => $studiengang_obj->kuerzel_arr[$row->studiengang_kz] . $row->semester . ' ' . $this->CutString($lv_obj->bezeichnung_arr[$sprache], $cutlength));
                     }
                 }
             } else {
                 echo "Fehler beim Auslesen der LV";
             }
         } else {
             echo "Fehler Semester beim Auslesen der LV";
         }
     }
     //Eigenen LV des eingeloggten Lektors anzeigen
     if ($is_lector) {
         if ($stsemobj = new studiensemester()) {
             $stsem = $stsemobj->getNearest();
             $qry = "SELECT distinct bezeichnung, studiengang_kz, semester, lehreverzeichnis, tbl_lehrveranstaltung.lehrveranstaltung_id, tbl_lehrveranstaltung.orgform_kurzbz  FROM lehre.tbl_lehrveranstaltung, lehre.tbl_lehreinheit, lehre.tbl_lehreinheitmitarbeiter\n\t\t\t\t        WHERE tbl_lehrveranstaltung.lehrveranstaltung_id=tbl_lehreinheit.lehrveranstaltung_id AND\n\t\t\t\t        tbl_lehreinheit.lehreinheit_id=tbl_lehreinheitmitarbeiter.lehreinheit_id AND\n\t\t\t\t        mitarbeiter_uid='" . addslashes($user) . "' AND tbl_lehreinheit.studiensemester_kurzbz='" . addslashes($stsem) . "'\n\t\t\t\t        ORDER BY studiengang_kz, semester, bezeichnung";
             if ($result = $this->db_query($qry)) {
                 $this->items[] = array('title' => $p->t("lvaliste/titel"), 'target' => 'content', 'link' => 'private/profile/lva_liste.php', 'name' => $p->t("lvaliste/titel"));
                 while ($row = $this->db_fetch_object($result)) {
                     $lv_obj = new lehrveranstaltung();
                     $lv_obj->load($row->lehrveranstaltung_id);
                     if ($row->studiengang_kz == 0 and $row->semester == 0) {
                         $this->items[] = array('title' => $lv_obj->bezeichnung_arr[$sprache], 'target' => 'content', 'link' => 'private/freifaecher/lesson.php?lvid=' . $row->lehrveranstaltung_id, 'name' => 'FF ' . $this->CutString($row->lehreverzeichnis, $cutlength));
                     } else {
                         $stg_obj = new studiengang();
                         $stg_obj->load($row->studiengang_kz);
                         $kurzbz = $stg_obj->kuerzel . '-' . $row->semester . ' ' . $row->orgform_kurzbz;
                         $this->items[] = array('title' => $lv_obj->bezeichnung_arr[$sprache], 'target' => 'content', 'link' => 'private/lehre/lesson.php?lvid=' . $row->lehrveranstaltung_id, 'name' => $kurzbz . ' ' . $this->CutString($lv_obj->bezeichnung_arr[$sprache], $cutlength));
                     }
                 }
             } else {
                 echo "Fehler beim Auslesen des Lehrfaches";
             }
         } else {
             echo "Fehler Semester beim Auslesen der LV";
         }
     }
     $this->output();
 }
开发者ID:andikoller,项目名称:FHC-3.0-FHBGLD,代码行数:60,代码来源:menu_addon_meinelv.inc.php

示例9: __construct

 public function __construct()
 {
     parent::__construct();
     $sprache = getSprache();
     $user = get_uid();
     $rechte = new benutzerberechtigung();
     $rechte->getBerechtigungen($user);
     $p = new phrasen($sprache);
     $fkt = new funktion();
     $fkt->getAll($user);
     if ($rechte->isFix() || $rechte->isBerechtigt('mitarbeiter/zeitsperre')) {
         $this->items[] = array('title' => $p->t('menu/zeitsperren'), 'target' => 'content', 'link' => 'private/profile/zeitsperre_days.php?days=12', 'name' => $p->t('menu/zeitsperren'));
         if ($rechte->isBerechtigt('admin', 0) || $rechte->isBerechtigt('mitarbeiter')) {
             $this->items[] = array('title' => $p->t('menu/resturlaub'), 'target' => 'content', 'link' => 'private/profile/resturlaub.php', 'name' => $p->t('menu/resturlaub'));
         }
         if ($rechte->isBerechtigt('admin', 0) || $rechte->isBerechtigt('mitarbeiter') || $fkt->checkFunktion('stvLtg') || $fkt->checkFunktion('gLtg') || $fkt->checkFunktion('Leitung') || $fkt->checkFunktion('ass')) {
             $this->items[] = array('title' => $p->t('menu/fixangestellte'), 'target' => 'content', 'link' => 'private/profile/zeitsperre.php?fix=true', 'name' => $p->t('menu/fixangestellte'));
             $this->items[] = array('title' => $p->t('menu/fixelektoren'), 'target' => 'content', 'link' => 'private/profile/zeitsperre.php?fix=true&lektor=true', 'name' => $p->t('menu/fixelektoren'));
             $this->items[] = array('title' => $p->t('menu/organisationseinheit'), 'target' => 'content', 'link' => 'private/profile/zeitsperre.php?organisationseinheit=', 'name' => $p->t('menu/organisationseinheit'));
             $this->items[] = array('title' => $p->t('menu/assistenz'), 'target' => 'content', 'link' => 'private/profile/zeitsperre.php?funktion=ass&stg_kz=', 'name' => $p->t('menu/assistenz'));
         }
         $stg_obj = new studiengang();
         $stg_obj->loadArray($rechte->getStgKz('admin'), 'typ, kurzbz', true);
         foreach ($stg_obj->result as $row) {
             $this->items[] = array('title' => 'Lektoren ' . $row->kurzbzlang, 'target' => 'content', 'link' => 'private/profile/zeitsperre.php?funktion=lkt&stg_kz=' . $row->studiengang_kz, 'name' => $p->t('menu/lektoren') . ' ' . $row->kurzbzlang);
         }
     }
     $this->output();
 }
开发者ID:andikoller,项目名称:FHC-3.0-FHBGLD,代码行数:29,代码来源:menu_addon_zeitsperren.inc.php

示例10: get_member

 /**
  * Get list by member
  * 
  * @access  public
  * @param   int  $member_id  target member_id
  * @return  Response (html)
  * @throws  Exception in Controller_Base::controller_common_api
  * @see  Controller_Base::controller_common_api
  */
 public function get_member($member_id = null)
 {
     $this->api_accept_formats = array('html');
     $this->controller_common_api(function () use($member_id) {
         $member_id = \Input::get('member_id', 0) ?: $member_id;
         list($is_mypage, $member) = $member_id ? $this->check_auth_and_is_mypage($member_id, true) : array(null, false);
         list($limit, $page) = $this->common_get_pager_list_params(conf('articles.limit', 'album'), conf('articles.limit_max', 'album'));
         $data = Site_Model::get_album_images($limit, $page, get_uid(), $member, $is_mypage, null, $this->format != 'html');
         $data['liked_album_image_ids'] = conf('like.isEnabled') && \Auth::check() ? \Site_Model::get_liked_ids('album_image', $this->u->id, $data['list']) : array();
         if ($this->format == 'html') {
             if ($member) {
                 $data['member'] = $member;
             }
         } else {
             $list_array = array();
             foreach ($data['list'] as $key => $obj) {
                 $row = $obj->to_array();
                 $row['album']['member'] = \Model_Member::get_one_basic4id($obj->album->member_id);
                 $list_array[] = $row;
             }
             // json response
             $data = $list_array;
         }
         $this->set_response_body_api($data, $this->format == 'html' ? 'image/_parts/list' : null);
     });
 }
开发者ID:uzura8,项目名称:flockbird,代码行数:35,代码来源:api.php

示例11: checkAcceptCode

/**
 * Проверка СМС кода для сохранения финансов.
 * 
 * @param type $code
 *
 * @return \xajaxResponse
 */
function checkAcceptCode($code)
{
    $MAX_ACCEPT_TRY = 5;
    $objResponse = new xajaxResponse();
    $uid = get_uid(false);
    if ($uid > 0 && isset($_SESSION['sms_accept_code'])) {
        $error = false;
        unset($_SESSION['sms_accept']);
        if ($_SESSION['sms_accept_try'] >= $MAX_ACCEPT_TRY) {
            $error = 'Превышен лимит попыток ввода. Получите код повторно.';
        } elseif ($code == $_SESSION['sms_accept_code']) {
            $_SESSION['sms_accept'] = true;
            unset($_SESSION['sms_accept_try']);
            $objResponse->script("\$('financeFrm').submit();");
        } else {
            $_SESSION['sms_accept_try'] = !isset($_SESSION['sms_accept_try']) ? 1 : ++$_SESSION['sms_accept_try'];
            $cnt = $MAX_ACCEPT_TRY - $_SESSION['sms_accept_try'];
            if ($cnt > 0) {
                $error = "Неправильный код. Осталось попыток: {$cnt}.";
            } else {
                $error = 'Превышен лимит попыток ввода. Получите код повторно.';
            }
        }
        if ($error) {
            $objResponse->script("\n                \$('sms_accept_error').removeClass('b-layout__txt_hide').set('html', '{$error}'); \n                \$('sms_accept_code').getParent().addClass('b-combo__input_error');");
        }
    }
    return $objResponse;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:36,代码来源:account.server.php

示例12: doSupport

 public function doSupport()
 {
     if (!is_login()) {
         exit(json_encode(array('status' => 0, 'info' => '请登陆后再点赞。')));
     }
     $appname = I('POST.appname');
     $table = I('POST.table');
     $row = I('POST.row');
     $aJump = I('POST.jump');
     $message_uid = intval(I('POST.uid'));
     $support['appname'] = $appname;
     $support['table'] = $table;
     $support['row'] = $row;
     $support['uid'] = is_login();
     if (D('Support')->where($support)->count()) {
         exit(json_encode(array('status' => 0, 'info' => '您已经赞过,不能再赞了。')));
     } else {
         $support['create_time'] = time();
         if (D('Support')->where($support)->add($support)) {
             $this->clearCache($support);
             $user = query_user(array('nickname'), get_uid());
             D('Message')->sendMessage($message_uid, $title = $user['nickname'] . '赞了您。', $user['nickname'] . '给您点了个赞。', $aJump, array('id' => $row));
             exit(json_encode(array('status' => 1, 'info' => '感谢您的支持。')));
         } else {
             exit(json_encode(array('status' => 0, 'info' => '写入数据库失败。')));
         }
     }
 }
开发者ID:naliduo,项目名称:Lightweight-social-platform,代码行数:28,代码来源:SupportController.class.php

示例13: __construct

 /**
  * ВНИМАНИЕ!!! проверка на наличие uid не делается
  * @param integer $userID
  */
 public function __construct($userID = null)
 {
     if (!$userID) {
         $userID = get_uid(0);
     }
     $this->_userID = $userID;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:11,代码来源:bar_notify.php

示例14: action_list

 /**
  * Note list
  * 
  * @access  public
  * @return  Response
  */
 public function action_list()
 {
     list($limit, $page) = $this->common_get_pager_list_params();
     $data = Site_Model::get_list($limit, $page, get_uid());
     $this->set_title_and_breadcrumbs(term('site.latest', 'note', 'site.list'));
     $this->template->content = \View::forge('_parts/list', $data);
     $this->template->post_footer = \View::forge('_parts/list_footer');
 }
开发者ID:uzura8,项目名称:flockbird,代码行数:14,代码来源:note.php

示例15: addComment

 public function addComment()
 {
     $config = get_addon_config('LocalComment');
     $can_guest_comment = $config['can_guest_comment'];
     if (!$can_guest_comment) {
         //不允许游客评论
         if (!is_login()) {
             $this->error('请登录后评论。');
         }
     }
     //获取参数
     $app = strval($_REQUEST['app']);
     $mod = strval($_REQUEST['mod']);
     $row_id = intval($_REQUEST['row_id']);
     $content = strval($_REQUEST['content']);
     $uid = intval($_REQUEST['uid']);
     //调用API接口,添加新评论
     $data = array('app' => $app, 'mod' => $mod, 'row_id' => $row_id, 'content' => $content, 'uid' => is_login());
     D($app . '/' . $mod)->where(array('id' => $row_id))->setInc('reply_count');
     $commentModel = D('Addons://LocalComment/LocalComment');
     $data = $commentModel->create($data);
     if (!$data) {
         $this->error('评论失败:' . $commentModel->getError());
     }
     $commentModel->add($data);
     if (!is_login()) {
         if ($uid) {
             $title = '游客' . '评论了您';
             $message = '评论内容:' . $content;
             $url = $_SERVER['HTTP_REFERER'];
             D('Common/Message')->sendMessage($uid, $message, $title, $url, 0, 0, $app);
         }
         //返回结果
         $this->success('评论成功', 'refresh');
     } else {
         //给评论对象发送消息
         if ($uid) {
             $user = D('User/UcenterMember')->find(get_uid());
             $title = $user['username'] . '评论了您';
             $message = '评论内容:' . $content;
             $url = $_SERVER['HTTP_REFERER'];
             D('Common/Message')->sendMessage($uid, $message, $title, $url, get_uid(), 0, $app);
         }
     }
     //通知被@到的人
     $uids = get_at_uids($content);
     $uids = array_unique($uids);
     $uids = array_subtract($uids, array($uid));
     foreach ($uids as $uid) {
         $user = D('User/UcenterMember')->find($uid);
         $title = $user['username'] . '@了您';
         $message = '评论内容:' . $content;
         $url = $_SERVER['HTTP_REFERER'];
         D('Common/Message')->sendMessage($uid, $message, $title, $url, get_uid(), 0, $app);
     }
     //返回结果
     $this->success('评论成功', 'refresh');
 }
开发者ID:nullog,项目名称:zhanglubao,代码行数:58,代码来源:IndexController.class.php


注:本文中的get_uid函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。