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


PHP messages::get_members方法代碼示例

本文整理匯總了PHP中messages::get_members方法的典型用法代碼示例。如果您正苦於以下問題:PHP messages::get_members方法的具體用法?PHP messages::get_members怎麽用?PHP messages::get_members使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在messages的用法示例。


在下文中一共展示了messages::get_members方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: show_notice

 public function show_notice()
 {
     $gScriptName = SCRIPTNAME;
     $n = intval($this->input['n']);
     $pp = intval($this->input['pp']) ? intval($this->input['pp']) : 0;
     $count = 50;
     switch ($n) {
         case 0:
             $this->page_title = '消息';
             include_once ROOT_PATH . 'lib/messages/messages.class.php';
             $mMessages = new messages();
             $msg_members = array();
             $from_who = $mMessages->get_members($this->user['id'], '', $pp, $count);
             $total = @array_shift($from_who);
             //分頁
             $data['totalpages'] = $total;
             $data['perpage'] = $count;
             $data['curpage'] = $pp;
             $data['onclick'] = ' onclick="javascript:document.location.href=re_back+\'?a=show_notice&pp=\'+(parseInt(this.title,10) - 1)+\'&n=0\';$(this).addClass(\'pages_current\');" ';
             $showpages = hg_build_pagelinks($data);
             ob_start();
             include hg_load_template("user_msgs");
             $html = ob_get_contents();
             ob_end_clean();
             break;
         case 1:
             $this->page_title = '通知';
             include_once ROOT_PATH . 'lib/class/notify.class.php';
             $mNotify = new notify();
             $notice_arr = $un_notice = $notice = array();
             $notice_arr = $mNotify->notify_get($this->user['id'], -1, $pp, $count);
             //分頁,這個通知要區分一下,已讀的通知和未知的通知要分開
             $notice_count = $mNotify->notify_count($this->user['id'], -1);
             $total_count = $notice_count[0];
             $total1 = array_sum($total_count);
             $data['totalpages'] = $total1;
             $data['perpage'] = $count;
             $data['curpage'] = $pp;
             $data['onclick'] = ' onclick="javascript:document.location.href=re_back+\'?a=show_notice&pp=\'+(parseInt(this.title,10) - 1)+\'&n=1\';$(this).addClass(\'pages_current\');" ';
             $showpages = hg_build_pagelinks($data);
             if ($notice_arr) {
                 $sp = '';
                 foreach ($notice_arr as $key => $n) {
                     if ($n['is_read'] == 0) {
                         if (in_array($n['type'], array(0, 1, 2, 3))) {
                             $un_notice[$n['type']]['idstr'] .= $sp . $n['id'];
                             $un_notice[$n['type']]['content'] = unserialize($n['content']);
                         } else {
                             $un_notice[$n['type']][$n['id']]['content'] = unserialize($n['content']);
                             $un_notice[$n['type']][$n['id']]['content']['notify_time'] = hg_get_date($n['notify_time']);
                         }
                         $a = $mNotify->notify_send_read($key, $this->user['id'], $n['type']);
                         //將本頁未讀通知插入到已讀表中
                         $sp = ',';
                     } else {
                         if ($n['type'] > 3) {
                             $notice[$n['type']][$n['id']]['content'] = unserialize($n['content']);
                             $notice[$n['type']][$n['id']]['content']['notify_time'] = hg_get_date($n['notify_time']);
                         }
                     }
                 }
             }
             ob_start();
             include hg_load_template("user_notices");
             $html = ob_get_contents();
             ob_end_clean();
             break;
     }
     hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'user.js');
     include hg_load_template("user_show_n");
 }
開發者ID:h3len,項目名稱:Project,代碼行數:71,代碼來源:user.php


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