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


PHP lazypage函數代碼示例

本文整理匯總了PHP中lazypage函數的典型用法代碼示例。如果您正苦於以下問題:PHP lazypage函數的具體用法?PHP lazypage怎麽用?PHP lazypage使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: stracelistOp

	/**
	 * 買家中心店鋪動態
	 */
	public function stracelistOp(){

		//查詢收藏的店鋪
		$model_favorites = Model('favorites');
		//條件
		$where = array('member_id' => $_SESSION['member_id']);
		$fav_store_id = $model_favorites->getStoreFavoritesList($where, 'fav_id');
		// 整理
		if(!empty($fav_store_id) && is_array($fav_store_id)){
			$storeid_array = '';
			foreach($fav_store_id as $val){
				$storeid_array[] = $val['fav_id'];
			}
			$where = array(
						'strace_storeid'=>array('in',$storeid_array),
						'strace_state'=>1
					);
			$model_stracelog = Model('store_sns_tracelog');
			$count = $model_stracelog->getStoreSnsTracelogCount($where);
			//分頁
			$page	= new Page();
			$page->setEachNum(30);
			$page->setStyle('admin');
			$page->setTotalNum($count);
			$delaypage = intval($_GET['delaypage'])>0?intval($_GET['delaypage']):1;//本頁延時加載的當前頁數
			$lazy_arr = lazypage(10,$delaypage,$count,true,$page->getNowPage(),$page->getEachNum(),$page->getLimitStart());
			//動態列表
			$limit = $lazy_arr['limitstart'].",".$lazy_arr['delay_eachnum'];
			$strace_array = $count = $model_stracelog->getStoreSnsTracelogList($where, '*', 'strace_id desc', $limit);
			if (!empty($strace_array)){
				foreach ($strace_array as $key=>$val){
					if($val['strace_content'] == ''){
						$val['strace_goodsdata'] = json_decode($val['strace_goodsdata'],true);
						if( CHARSET == 'GBK') {
							foreach ((array)$val['strace_goodsdata'] as $k=>$v){
								$val['strace_goodsdata'][$k] = Language::getGBK($v);
							}
						}
						$content = $model_stracelog->spellingStyle($val['strace_type'], $val['strace_goodsdata']);
						$strace_array[$key]['strace_content'] = str_replace("%siteurl%", SHOP_SITE_URL.DS, $content);
					}
				}
			}
			Tpl::output('show_page',$page->show());
		}
		Tpl::output('hasmore',$lazy_arr['hasmore']);
		Tpl::output('strace_array',$strace_array);
		Tpl::output('type','index');
		Tpl::showpage('member_storesns.tracelist','null_layout');
	}
開發者ID:noikiy,項目名稱:ejia,代碼行數:53,代碼來源:member_storesns.php

示例2: tracelistOp

	/**
	 * SNS動態列表
	 */
	public function tracelistOp(){
		//查詢關注以及好友列表
		$friend_model = Model('sns_friend');
		$friend_list = $friend_model->listFriend(array('friend_frommid'=>"{$_SESSION['member_id']}"),'*','','simple');
		$mutualfollowid_arr = array();
		$followid_arr = array();
		if (!empty($friend_list)){
			foreach ($friend_list as $k=>$v){
				$followid_arr[] = $v['friend_tomid'];
				if ($v['friend_followstate'] == 2){
					$mutualfollowid_arr[] = $v['friend_tomid'];
				}
			}
		}
		$tracelog_model = Model('sns_tracelog');
		//條件
		$condition = array();
		$condition['allowshow'] = '1';
		$condition['allowshow_memberid'] = "{$_SESSION['member_id']}";
		$condition['allowshow_followerin'] = "";
		if (!empty($followid_arr)){
			$condition['allowshow_followerin'] = implode("','",$followid_arr);
		}
		$condition['allowshow_friendin'] = "";
		if (!empty($mutualfollowid_arr)){
			$condition['allowshow_friendin'] = implode("','",$mutualfollowid_arr);
		}
		$condition['trace_state'] = "0";
		$count = $tracelog_model->countTrace($condition);
		//分頁
		$page	= new Page();
		$page->setEachNum(30);
		$page->setStyle('admin');
		$page->setTotalNum($count);
		$delaypage = intval($_GET['delaypage'])>0?intval($_GET['delaypage']):1;//本頁延時加載的當前頁數
		$lazy_arr = lazypage(10,$delaypage,$count,true,$page->getNowPage(),$page->getEachNum(),$page->getLimitStart());
		//動態列表
		$condition['limit'] = $lazy_arr['limitstart'].",".$lazy_arr['delay_eachnum'];
		$tracelist = $tracelog_model->getTracelogList($condition);
		if (!empty($tracelist)){
			foreach ($tracelist as $k=>$v){
				if ($v['trace_title']){
					$v['trace_title'] = str_replace("%siteurl%", SHOP_SITE_URL.DS, $v['trace_title']);
					$v['trace_title_forward'] = '|| @'.$v['trace_membername'].Language::get('nc_colon').preg_replace("/<a(.*?)href=\"(.*?)\"(.*?)>@(.*?)<\/a>([\s|:|:]|$)/is",'@${4}${5}',$v['trace_title']);
				}
				if(!empty($v['trace_content'])){
					//替換內容中的siteurl
					$v['trace_content'] = str_replace("%siteurl%", SHOP_SITE_URL.DS, $v['trace_content']);
				}
				$tracelist[$k] = $v;
			}
		}
		Tpl::output('hasmore',$lazy_arr['hasmore']);
		Tpl::output('tracelist',$tracelist);
		Tpl::output('show_page',$page->show());
		Tpl::output('type','index');
		Tpl::showpage('member_snstracelist','null_layout');
	}
開發者ID:noikiy,項目名稱:ejia,代碼行數:61,代碼來源:member_snsindex.php

示例3: tracelistOp

 /**
  * 某會員的SNS動態列表
  */
 public function tracelistOp()
 {
     $tracelog_model = Model('sns_tracelog');
     $condition = array();
     $condition['trace_memberid'] = $this->master_id;
     switch ($this->relation) {
         case 3:
             $condition['trace_privacyin'] = "";
             break;
         case 2:
             $condition['trace_privacyin'] = "0','1";
             break;
         case 1:
             $condition['trace_privacyin'] = "0";
             break;
         default:
             $condition['trace_privacyin'] = "0";
             break;
     }
     $condition['trace_state'] = "0";
     $count = $tracelog_model->countTrace($condition);
     //分頁
     $page = new Page();
     $page->setEachNum(30);
     $page->setStyle('admin');
     $page->setTotalNum($count);
     $delaypage = intval($_GET['delaypage']) > 0 ? intval($_GET['delaypage']) : 1;
     //本頁延時加載的當前頁數
     $lazy_arr = lazypage(10, $delaypage, $count, true, $page->getNowPage(), $page->getEachNum(), $page->getLimitStart());
     //動態列表
     $condition['limit'] = $lazy_arr['limitstart'] . "," . $lazy_arr['delay_eachnum'];
     $tracelist = $tracelog_model->getTracelogList($condition);
     if (!empty($tracelist)) {
         foreach ($tracelist as $k => $v) {
             if ($v['trace_title']) {
                 $v['trace_title'] = str_replace("%siteurl%", SHOP_SITE_URL . DS, $v['trace_title']);
                 $v['trace_title_forward'] = '|| @' . $v['trace_membername'] . Language::get('nc_colon') . preg_replace("/<a(.*?)href=\"(.*?)\"(.*?)>@(.*?)<\\/a>([\\s|:|:]|\$)/is", '@${4}${5}', $v['trace_title']);
             }
             if (!empty($v['trace_content'])) {
                 //替換內容中的siteurl
                 $v['trace_content'] = str_replace("%siteurl%", SHOP_SITE_URL . DS, $v['trace_content']);
             }
             $tracelist[$k] = $v;
         }
     }
     Tpl::output('hasmore', $lazy_arr['hasmore']);
     Tpl::output('tracelist', $tracelist);
     Tpl::output('show_page', $page->show());
     Tpl::output('type', 'home');
     //驗證碼
     Tpl::output('nchash', substr(md5(SHOP_SITE_URL . $_GET['act'] . $_GET['op']), 0, 8));
     Tpl::output('menu_sign', 'snstrace');
     Tpl::showpage('sns_tracelist', 'null_layout');
 }
開發者ID:mengtaolin,項目名稱:shopping,代碼行數:57,代碼來源:member_snshome.php

示例4: findlistOp

 /**
  * 找人搜索列表
  */
 public function findlistOp()
 {
     if (trim($_POST['searchname']) != '') {
         // 實例化模型
         $model = Model();
         //查詢關注會員id
         $followlist = $model->table('sns_friend')->field('friend_tomid, friend_followstate')->where(array('friend_frommid' => $_SESSION['member_id']))->select();
         unset($condition_arr);
         $followlist_new = array();
         if (!empty($followlist)) {
             foreach ($followlist as $k => $v) {
                 $followlist_new[$v['friend_tomid']] = $v;
             }
         }
         //查詢會員
         // 查詢條件
         $where = array();
         $where['member_state'] = 1;
         $where['member_id'] = array('neq', $_SESSION['member_id']);
         $where['member_name'] = array('like', '%' . trim($_POST['searchname']) . '%');
         // 會員名稱
         // 省份
         if (intval($_POST['provinceid']) > 0) {
             $where['member_provinceid'] = intval($_POST['provinceid']);
         }
         // 城市
         if (intval($_POST['cityid']) > 0) {
             $where['member_cityid'] = intval($_POST['cityid']);
         }
         // 地區
         if (intval($_POST['areaid']) > 0) {
             $where['member_areainfo'] = intval($_POST['areaid']);
         }
         // 性別
         if (intval($_POST['sex']) > 0) {
             $where['member_sex'] = intval($_POST['sex']);
         }
         // 年齡
         if (intval($_POST['age']) > 0) {
             switch (intval($_POST['age'])) {
                 case 1:
                     $s_time = date('Y') - 18 . '-' . date('m-d');
                     $e_time = date('Y-m-d');
                     $where['member_birthday'] = array('BETWEEN', $s_time . ',' . $e_time);
                     break;
                 case 2:
                     $s_time = date('Y') - 24 . '-' . date('m-d');
                     $e_time = date('Y') - 18 . '-' . date('m-d');
                     $where['member_birthday'] = array('BETWEEN', $s_time . ',' . $e_time);
                     break;
                 case 3:
                     $s_time = date('Y') - 24 . '-' . date('m-d');
                     $e_time = date('Y') - 18 . '-' . date('m-d');
                     $where['member_birthday'] = array('BETWEEN', $s_time . ',' . $e_time);
                     break;
                 case 4:
                     $s_time = date('Y') - 30 . '-' . date('m-d');
                     $e_time = date('Y') - 24 . '-' . date('m-d');
                     $where['member_birthday'] = array('BETWEEN', $s_time . ',' . $e_time);
                     break;
                 case 5:
                     $e_time = date('Y') - 30 . '-' . date('m-d');
                     $where['member_birthday'] = array('elt', $e_time);
                     break;
             }
         }
         $count = $model->table('member')->where($where)->count();
         $memberlist = array();
         if ($count > 0) {
             $delaypage = intval($_POST['delaypage']) > 0 ? intval($_POST['delaypage']) : 1;
             //本頁延時加載的當前頁數
             $lazy_arr = lazypage(15, $delaypage, $count);
             $limit = $lazy_arr['limitstart'] . "," . $lazy_arr['delay_eachnum'];
             $memberlist = $model->table('member')->where($where)->limit($limit)->select();
             if (!empty($memberlist)) {
                 $followid_arr = array_keys($followlist_new);
                 foreach ($memberlist as $k => $v) {
                     if (in_array($v['member_id'], $followid_arr)) {
                         $v['followstate'] = $followlist_new[$v['member_id']]['friend_followstate'];
                     } else {
                         $v['followstate'] = 0;
                     }
                     //性別
                     $v['sex_class'] = $this->m_sex($v['member_sex']);
                     $memberlist[$k] = $v;
                 }
             }
             Tpl::output('hasmore', $lazy_arr['hasmore']);
         }
     }
     //查詢會員信息
     $this->get_member_info();
     Tpl::output('memberlist', $memberlist);
     self::profile_menu('find');
     Tpl::output('menu_sign', 'friend');
     Tpl::output('header_menu_sign', 'friend');
     //默認選中頂部“好友”菜單
//.........這裏部分代碼省略.........
開發者ID:noikiy,項目名稱:nc-1,代碼行數:101,代碼來源:member_snsfriend.php


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