当前位置: 首页>>代码示例>>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;未经允许,请勿转载。