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


PHP AWS_APP::pagination方法代码示例

本文整理汇总了PHP中AWS_APP::pagination方法的典型用法代码示例。如果您正苦于以下问题:PHP AWS_APP::pagination方法的具体用法?PHP AWS_APP::pagination怎么用?PHP AWS_APP::pagination使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AWS_APP的用法示例。


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

示例1: list_action

 public function list_action()
 {
     if ($this->is_post()) {
         foreach ($_POST as $key => $val) {
             if ($key == 'start_date' or $key == 'end_date') {
                 $val = base64_encode($val);
             }
             if ($key == 'keyword' or $key == 'user_name') {
                 $val = rawurlencode($val);
             }
             $param[] = $key . '-' . $val;
         }
         H::ajax_json_output(AWS_APP::RSM(array('url' => get_js_url('/admin/article/list/' . implode('__', $param))), 1, null));
     }
     $where = array();
     if ($_GET['keyword']) {
         $where[] = "(`title` LIKE '%" . $this->model('article')->quote($_GET['keyword']) . "%')";
     }
     if ($_GET['start_date']) {
         $where[] = 'add_time >= ' . strtotime(base64_decode($_GET['start_date']));
     }
     if ($_GET['end_date']) {
         $where[] = 'add_time <= ' . strtotime('+1 day', strtotime(base64_decode($_GET['end_date'])));
     }
     if ($_GET['user_name']) {
         $user_info = $this->model('account')->get_user_info_by_username($_GET['user_name']);
         $where[] = 'uid = ' . intval($user_info['uid']);
     }
     if ($_GET['comment_count_min']) {
         $where[] = 'comments >= ' . intval($_GET['comment_count_min']);
     }
     if ($_GET['answer_count_max']) {
         $where[] = 'comments <= ' . intval($_GET['comment_count_max']);
     }
     if ($articles_list = $this->model('article')->fetch_page('article', implode(' AND ', $where), 'id DESC', $_GET['page'], $this->per_page)) {
         $search_articles_total = $this->model('article')->found_rows();
     }
     if ($articles_list) {
         foreach ($articles_list as $key => $val) {
             $articles_list_uids[$val['uid']] = $val['uid'];
         }
         if ($articles_list_uids) {
             $articles_list_user_infos = $this->model('account')->get_user_info_by_uids($articles_list_uids);
         }
         foreach ($articles_list as $key => $val) {
             $articles_list[$key]['user_info'] = $articles_list_user_infos[$val['uid']];
         }
     }
     $url_param = array();
     foreach ($_GET as $key => $val) {
         if (!in_array($key, array('app', 'c', 'act', 'page'))) {
             $url_param[] = $key . '-' . $val;
         }
     }
     TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/admin/article/list/') . implode('__', $url_param), 'total_rows' => $search_articles_total, 'per_page' => $this->per_page))->create_links());
     $this->crumb(AWS_APP::lang()->_t('文章管理'), 'admin/article/list/');
     TPL::assign('articles_count', $search_articles_total);
     TPL::assign('list', $articles_list);
     TPL::output('admin/article/list');
 }
开发者ID:wenyinos,项目名称:wecenter,代码行数:60,代码来源:article.php

示例2: index_action

 public function index_action()
 {
     if ($_GET['tag']) {
         $this->crumb(AWS_APP::lang()->_t('标签') . ': ' . $_GET['tag'], '/favorite/tag-' . $_GET['tag']);
     }
     //边栏可能感兴趣的人或话题
     if (TPL::is_output('block/sidebar_recommend_users_topics.tpl.htm', 'favorite/index')) {
         $recommend_users_topics = $this->model('module')->recommend_users_topics($this->user_id);
         TPL::assign('sidebar_recommend_users_topics', $recommend_users_topics);
     }
     if ($action_list = $this->model('favorite')->get_item_list($_GET['tag'], $this->user_id, calc_page_limit($_GET['page'], get_setting('contents_per_page')))) {
         foreach ($action_list as $key => $val) {
             $item_ids[] = $val['item_id'];
         }
         TPL::assign('list', $action_list);
     } else {
         if (!$_GET['page'] or $_GET['page'] == 1) {
             $this->model('favorite')->remove_favorite_tag(null, null, $_GET['tag'], $this->user_id);
         }
     }
     if ($item_ids) {
         $favorite_items_tags = $this->model('favorite')->get_favorite_items_tags_by_item_id($this->user_id, $item_ids);
         TPL::assign('favorite_items_tags', $favorite_items_tags);
     }
     TPL::assign('favorite_tags', $this->model('favorite')->get_favorite_tags($this->user_id));
     TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/favorite/tag-' . $_GET['tag']), 'total_rows' => $this->model('favorite')->count_favorite_items($this->user_id, $_GET['tag']), 'per_page' => get_setting('contents_per_page')))->create_links());
     TPL::output('favorite/index');
 }
开发者ID:Gradven,项目名称:what3.1.7,代码行数:28,代码来源:main.php

示例3: list_action

 public function list_action()
 {
     $this->crumb(AWS_APP::lang()->_t('专题管理'), 'admin/feature/list/');
     $feature_list = $this->model('feature')->get_feature_list('id DESC', $_GET['page'], $this->per_page);
     TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/admin/feature/list/'), 'total_rows' => $this->model('feature')->found_rows(), 'per_page' => 20))->create_links());
     TPL::assign('list', $feature_list);
     TPL::output('admin/feature/list');
 }
开发者ID:egogg,项目名称:wecenter-dev,代码行数:8,代码来源:feature.php

示例4: list_action

 public function list_action()
 {
     if ($recommend_homepage_list = $this->model('recommend')->fetch_page('recommend_homepage', 'id > 0', ' add_time DESC', $_GET['page'], $this->per_page)) {
         $total_rows = $this->model('recommend')->found_rows();
         foreach ($recommend_homepage_list as $key => $val) {
             switch ($val['item_type']) {
                 case 'question':
                     $val['item_tag'] = '问题(精选)';
                     $val['item_link'] = 'question/' . $val['item_id'];
                     $question_info = $this->model('question')->get_question_info_by_id($val['item_id']);
                     if ($question_info) {
                         $val['item_title'] = $question_info['question_content'];
                     } else {
                         $val['item_title'] = '问题 #' . $val['item_id'];
                     }
                     break;
                 case 'article':
                     $val['item_tag'] = '文章(精选)';
                     $val['item_link'] = 'article/' . $val['item_id'];
                     $article_info = $this->model('article')->get_article_info_by_id($val['item_id']);
                     if ($article_info) {
                         $val['item_title'] = $article_info['title'];
                     } else {
                         $val['item_title'] = '文章 #' . $val['item_id'];
                     }
                     break;
                 case 'topic':
                     $val['item_tag'] = '专题(精选)';
                     $val['item_link'] = 'topic/' . $val['item_id'];
                     $topic_info = $this->model('topic')->get_topic_by_id($val['item_id']);
                     if ($topic_info) {
                         $val['item_title'] = $topic_info['topic_title'];
                     } else {
                         $val['item_title'] = '专题 #' . $val['item_id'];
                     }
                     break;
                 case 'top_question':
                     $val['item_tag'] = '问题(置顶)';
                     $val['item_link'] = 'question/' . $val['item_id'];
                     $question_info = $this->model('question')->get_question_info_by_id($val['item_id']);
                     if ($question_info) {
                         $val['item_title'] = $question_info['question_content'];
                     } else {
                         $val['item_title'] = '问题 #' . $val['item_id'];
                     }
                     break;
             }
             $recommend_homepage_list[$key] = $val;
         }
     }
     TPL::assign('recommend_homepage_list', $recommend_homepage_list);
     TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/admin/recommend/list/') . implode('__', $url_param), 'total_rows' => $total_rows, 'per_page' => $this->per_page))->create_links());
     $this->crumb(AWS_APP::lang()->_t('首页精选管理'), 'admin/recommend/list/');
     TPL::output('admin/recommend/list');
 }
开发者ID:egogg,项目名称:wecenter-dev,代码行数:55,代码来源:recommend.php

示例5: index_action

 public function index_action()
 {
     if ($order_list = $this->model('project')->get_sponsored_order_list($_GET['id'], $this->user_id, $_GET['page'], get_setting('contents_per_page'))) {
         TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/project/sponsored/' . $_GET['id']), 'total_rows' => $this->model('project')->found_rows(), 'per_page' => get_setting('contents_per_page')))->create_links());
         foreach ($order_list as $key => $val) {
             $order_list[$key]['order_status'] = $this->model('project')->get_order_status($val);
         }
     }
     TPL::assign('order_list', $order_list);
     TPL::output('project/sponsored/index');
 }
开发者ID:elelianghh,项目名称:wecenter,代码行数:11,代码来源:sponsored.php

示例6: list_action

 public function list_action()
 {
     $this->crumb(AWS_APP::lang()->_t('内容审核'), 'admin/approval/list/');
     TPL::assign('menu_list', $this->model('admin')->fetch_menu_list(300));
     if (!$_GET['type']) {
         $_GET['type'] = 'question';
     }
     switch ($_GET['type']) {
         case 'weibo_msg':
         case 'received_email':
             $approval_list = $this->model('admin')->fetch_page($_GET['type'], 'question_id IS NULL', 'id ASC', $_GET['page'], $this->per_page);
             $found_rows = $this->model('admin')->found_rows();
             break;
         case 'unverified_modify':
             $approval_list = $this->model('question')->fetch_page('question', 'unverified_modify_count <> 0', 'question_id ASC', $_GET['page'], $this->per_page);
             $found_rows = $this->model('question')->found_rows();
             break;
         default:
             $approval_list = $this->model('publish')->get_approval_list($_GET['type'], $_GET['page'], $this->per_page);
             $found_rows = $this->model('publish')->found_rows();
             break;
     }
     TPL::assign('answer_count', $this->model('publish')->count('approval', "type = 'answer'"));
     TPL::assign('question_count', $this->model('publish')->count('approval', "type = 'question'"));
     TPL::assign('article_count', $this->model('publish')->count('approval', "type = 'article'"));
     TPL::assign('article_comment_count', $this->model('publish')->count('approval', "type = 'article_comment'"));
     TPL::assign('weibo_msg_count', $this->model('openid_weibo_weibo')->count('weibo_msg', 'question_id IS NULL'));
     TPL::assign('received_email_count', $this->model('edm')->count('received_email', 'question_id IS NULL'));
     TPL::assign('unverified_modifies_count', $this->model('question')->count('question', 'unverified_modify_count <> 0'));
     if ($approval_list) {
         TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/admin/approval/list/type-' . $_GET['type']), 'total_rows' => $found_rows, 'per_page' => $this->per_page))->create_links());
         if ($_GET['type'] == 'unverified_modify') {
             foreach ($approval_list as $key => $approval_info) {
                 $approval_list[$key]['uid'] = $approval_info['published_uid'];
                 if (!$approval_uids[$approval_list[$key]['uid']]) {
                     $approval_uids[$approval_list[$key]['uid']] = $approval_list[$key]['uid'];
                 }
                 $approval_list[$key]['unverified_modify'] = @unserialize($approval_info['unverified_modify']);
             }
         } else {
             foreach ($approval_list as $approval_info) {
                 if (!$approval_uids[$approval_info['uid']]) {
                     $approval_uids[$approval_info['uid']] = $approval_info['uid'];
                 }
             }
         }
         TPL::assign('users_info', $this->model('account')->get_user_info_by_uids($approval_uids));
     }
     TPL::assign($_GET['type'] . '_count', $found_rows);
     TPL::assign('approval_list', $approval_list);
     TPL::output('admin/approval/list');
 }
开发者ID:Vizards,项目名称:HeavenSpree,代码行数:52,代码来源:approval.php

示例7: index_action

 public function index_action()
 {
     $this->model('account')->update_inbox_unread($this->user_id);
     if ($inbox_dialog = $this->model('message')->get_inbox_message($_GET['page'], get_setting('contents_per_page'), $this->user_id)) {
         $inbox_total_rows = $this->model('message')->found_rows();
         foreach ($inbox_dialog as $key => $val) {
             $dialog_ids[] = $val['id'];
             if ($this->user_id == $val['recipient_uid']) {
                 $inbox_dialog_uids[] = $val['sender_uid'];
             } else {
                 $inbox_dialog_uids[] = $val['recipient_uid'];
             }
         }
     }
     if ($inbox_dialog_uids) {
         if ($users_info_query = $this->model('account')->get_user_info_by_uids($inbox_dialog_uids)) {
             foreach ($users_info_query as $user) {
                 $users_info[$user['uid']] = $user;
             }
         }
     }
     if ($dialog_ids) {
         $last_message = $this->model('message')->get_last_messages($dialog_ids);
     }
     if ($inbox_dialog) {
         foreach ($inbox_dialog as $key => $value) {
             if ($value['recipient_uid'] == $this->user_id and $value['recipient_count']) {
                 $data[$key]['user_name'] = $users_info[$value['sender_uid']]['user_name'];
                 $data[$key]['url_token'] = $users_info[$value['sender_uid']]['url_token'];
                 $data[$key]['unread'] = $value['recipient_unread'];
                 $data[$key]['count'] = $value['recipient_count'];
                 $data[$key]['uid'] = $value['sender_uid'];
                 $data[$key]['profile_update_time'] = $users_info[$value['sender_uid']]['profile_update_time'];
             } else {
                 if ($value['sender_uid'] == $this->user_id and $value['sender_count']) {
                     $data[$key]['user_name'] = $users_info[$value['recipient_uid']]['user_name'];
                     $data[$key]['url_token'] = $users_info[$value['recipient_uid']]['url_token'];
                     $data[$key]['unread'] = $value['sender_unread'];
                     $data[$key]['count'] = $value['sender_count'];
                     $data[$key]['uid'] = $value['recipient_uid'];
                     $data[$key]['profile_update_time'] = $users_info[$value['recipient_uid']]['profile_update_time'];
                 }
             }
             $data[$key]['last_message'] = $last_message[$value['id']];
             $data[$key]['update_time'] = $value['update_time'];
             $data[$key]['id'] = $value['id'];
         }
     }
     TPL::assign('list', $data);
     TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/inbox/'), 'total_rows' => $inbox_total_rows, 'per_page' => get_setting('contents_per_page')))->create_links());
     TPL::output('inbox/index');
 }
开发者ID:egogg,项目名称:wecenter-dev,代码行数:52,代码来源:main.php

示例8: receiving_list_action

 public function receiving_list_action()
 {
     $this->crumb(AWS_APP::lang()->_t('邮件导入'), "admin/edm/receiving_list");
     $receiving_email_list = $this->model('edm')->fetch_page('receiving_email_config', null, null, $_GET['page'], $this->per_page);
     $total_rows = $this->model('edm')->found_rows();
     if ($receiving_email_list) {
         foreach ($receiving_email_list as $receiving_email_config) {
             $uids[] = $receiving_email_config['uid'];
         }
         $users_info = $this->model('account')->get_user_info_by_uids($uids);
         TPL::assign('users_info', $users_info);
     }
     TPL::assign('receiving_email_list', $receiving_email_list);
     TPL::assign('accounts_total', $total_rows);
     TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/admin/edm/receiving_list/'), 'total_rows' => $total_rows, 'per_page' => $this->per_page))->create_links());
     TPL::assign('menu_list', $this->model('admin')->fetch_menu_list(807));
     TPL::output('admin/edm/receiving_list');
 }
开发者ID:egogg,项目名称:wecenter-dev,代码行数:18,代码来源:edm.php

示例9: index_square_action

 public function index_square_action()
 {
     if (is_mobile()) {
         HTTP::redirect('/m/article/');
     }
     $this->crumb(AWS_APP::lang()->_t('文章'), '/article/');
     if ($_GET['category']) {
         if (is_digits($_GET['category'])) {
             $category_info = $this->model('system')->get_category_info($_GET['category']);
         } else {
             $category_info = $this->model('system')->get_category_info_by_url_token($_GET['category']);
         }
     }
     if ($_GET['feature_id']) {
         $article_list = $this->model('article')->get_articles_list_by_topic_ids($_GET['page'], get_setting('contents_per_page'), 'add_time DESC', $this->model('feature')->get_topics_by_feature_id($_GET['feature_id']));
         $article_list_total = $this->model('article')->article_list_total;
         if ($feature_info = $this->model('feature')->get_feature_by_id($_GET['feature_id'])) {
             $this->crumb($feature_info['title'], '/article/feature_id-' . $feature_info['id']);
             TPL::assign('feature_info', $feature_info);
         }
     } else {
         $article_list = $this->model('article')->get_articles_list($category_info['id'], $_GET['page'], get_setting('contents_per_page'), 'add_time DESC');
         $article_list_total = $this->model('article')->found_rows();
     }
     if ($article_list) {
         foreach ($article_list as $key => $val) {
             $article_ids[] = $val['id'];
             $article_uids[$val['uid']] = $val['uid'];
         }
         $article_topics = $this->model('topic')->get_topics_by_item_ids($article_ids, 'article');
         $article_users_info = $this->model('account')->get_user_info_by_uids($article_uids);
         foreach ($article_list as $key => $val) {
             $article_list[$key]['user_info'] = $article_users_info[$val['uid']];
         }
     }
     // 导航
     if (TPL::is_output('block/content_nav_menu.tpl.htm', 'article/square')) {
         TPL::assign('content_nav_menu', $this->model('menu')->get_nav_menu_list('article'));
     }
     //边栏热门话题
     if (TPL::is_output('block/sidebar_hot_topics.tpl.htm', 'article/square')) {
         TPL::assign('sidebar_hot_topics', $this->model('module')->sidebar_hot_topics($category_info['id']));
     }
     if ($category_info) {
         TPL::assign('category_info', $category_info);
         $this->crumb($category_info['title'], '/article/category-' . $category_info['id']);
         $meta_description = $category_info['title'];
         if ($category_info['description']) {
             $meta_description .= ' - ' . $category_info['description'];
         }
         TPL::set_meta('description', $meta_description);
     }
     TPL::assign('article_list', $article_list);
     TPL::assign('article_topics', $article_topics);
     TPL::assign('hot_articles', $this->model('article')->get_articles_list(null, 1, 10, 'votes DESC'));
     TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/article/category_id-' . $_GET['category_id'] . '__feature_id-' . $_GET['feature_id']), 'total_rows' => $article_list_total, 'per_page' => get_setting('contents_per_page')))->create_links());
     TPL::output('article/square');
 }
开发者ID:chenruixuan,项目名称:wecenter,代码行数:58,代码来源:main.php

示例10: index_square_action

 public function index_square_action()
 {
     if (!$_GET['page']) {
         $_GET['page'] = 1;
     }
     $this->crumb(AWS_APP::lang()->_t('用户列表'), '/people/');
     if ($_GET['topic_id']) {
         if ($helpful_users = $this->model('topic')->get_helpful_users_by_topic_ids($this->model('topic')->get_child_topic_ids($_GET['topic_id']), get_setting('contents_per_page'), 4)) {
             foreach ($helpful_users as $key => $val) {
                 $users_list[$key] = $val['user_info'];
                 $users_list[$key]['experience'] = $val['experience'];
                 foreach ($val['experience'] as $exp_key => $exp_val) {
                     $users_list[$key]['total_agree_count'] += $exp_val['agree_count'];
                 }
             }
         }
     } else {
         $where = array();
         if ($_GET['group_id']) {
             $where[] = 'group_id = ' . intval($_GET['group_id']);
         }
         if ($_GET['sort_type']) {
             switch ($_GET['sort_type']) {
                 case 'passed':
                     $sort_key = 'question_quiz_count_passed DESC';
                     break;
                 case 'poft':
                     $sort_key = 'question_quiz_poft_ratio DESC';
                     break;
                 case 'question_count':
                     $sort_key = 'question_count DESC';
                     break;
                 case 'quiz_count':
                     $sort_key = 'question_quiz_count_total DESC';
                     break;
                 case 'integral':
                     $sort_key = 'integral DESC';
                     break;
                 default:
                     $sort_key = 'question_quiz_success_ratio DESC';
                     break;
             }
         } else {
             $sort_key = 'question_quiz_success_ratio DESC';
         }
         $where[] = 'forbidden = 0 AND group_id >=4 AND group_id < 99';
         $users_list = $this->model('account')->get_users_list(implode('', $where), calc_page_limit($_GET['page'], get_setting('user_rank_list_perpage')), true, false, $sort_key);
         TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/people/sort_type-' . $_GET['sort_type'] . '__group_id-' . $_GET['group_id']), 'total_rows' => $this->model('account')->get_user_count(implode(' AND ', $where)), 'per_page' => get_setting('user_rank_list_perpage')))->create_links());
     }
     if ($users_list) {
         foreach ($users_list as $key => $val) {
             if ($val['reputation']) {
                 $reputation_users_ids[] = $val['uid'];
                 $users_reputations[$val['uid']] = $val['reputation'];
             }
             $uids[] = $val['uid'];
         }
         if (!$_GET['topic_id']) {
             $reputation_topics = $this->model('people')->get_users_reputation_topic($reputation_users_ids, $users_reputations, 5);
             foreach ($users_list as $key => $val) {
                 $users_list[$key]['reputation_topics'] = $reputation_topics[$val['uid']];
             }
         }
         if ($uids and $this->user_id) {
             $users_follow_check = $this->model('follow')->users_follow_check($this->user_id, $uids);
             foreach ($users_list as $key => $val) {
                 $users_list[$key]['focus'] = $users_follow_check[$val['uid']];
             }
         }
         TPL::assign('users_list', array_values($users_list));
     }
     if (!$_GET['group_id']) {
         TPL::assign('parent_topics', $this->model('topic')->get_parent_topics());
     }
     TPL::assign('custom_group', $this->model('account')->get_user_group_list(0, 1));
     if ($_GET['sort_type']) {
         TPL::assign('sort_type', $_GET['sort_type']);
     }
     TPL::import_js('js/app/rank.js');
     TPL::output('people/square');
 }
开发者ID:egogg,项目名称:wecenter-dev,代码行数:81,代码来源:main.php

示例11: index_action

 public function index_action()
 {
     TPL::assign('page_list', $this->model('page')->fetch_page_list($_GET['page'], 20));
     TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/admin/page/'), 'total_rows' => $this->model('page')->found_rows(), 'per_page' => 20))->create_links());
     TPL::output('admin/page/list');
 }
开发者ID:Vizards,项目名称:HeavenSpree,代码行数:6,代码来源:page.php

示例12: index_square_action

 public function index_square_action()
 {
     if (is_mobile()) {
         HTTP::redirect('/m/people/');
     }
     if (!$_GET['page']) {
         $_GET['page'] = 1;
     }
     $this->crumb(AWS_APP::lang()->_t('用户列表'), '/people/');
     if ($_GET['topic_id']) {
         if ($helpful_users = $this->model('topic')->get_helpful_users_by_topic_ids($this->model('topic')->get_child_topic_ids($_GET['topic_id']), get_setting('contents_per_page'), 4)) {
             foreach ($helpful_users as $key => $val) {
                 $users_list[$key] = $val['user_info'];
                 $users_list[$key]['experience'] = $val['experience'];
                 foreach ($val['experience'] as $exp_key => $exp_val) {
                     $users_list[$key]['total_agree_count'] += $exp_val['agree_count'];
                 }
             }
         }
     } else {
         $where = array();
         if ($_GET['group_id']) {
             $where[] = 'group_id = ' . intval($_GET['group_id']);
         }
         $users_list = $this->model('account')->get_users_list(implode('', $where), calc_page_limit($_GET['page'], get_setting('contents_per_page')), true, false, 'reputation DESC');
         $where[] = 'forbidden = 0 AND group_id <> 3';
         TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/people/group_id-' . $_GET['group_id']), 'total_rows' => $this->model('account')->get_user_count(implode(' AND ', $where)), 'per_page' => get_setting('contents_per_page')))->create_links());
     }
     if ($users_list) {
         foreach ($users_list as $key => $val) {
             if ($val['reputation']) {
                 $reputation_users_ids[] = $val['uid'];
                 $users_reputations[$val['uid']] = $val['reputation'];
             }
             $uids[] = $val['uid'];
         }
         if (!$_GET['topic_id']) {
             $reputation_topics = $this->model('people')->get_users_reputation_topic($reputation_users_ids, $users_reputations, 5);
             foreach ($users_list as $key => $val) {
                 $users_list[$key]['reputation_topics'] = $reputation_topics[$val['uid']];
             }
         }
         if ($uids and $this->user_id) {
             $users_follow_check = $this->model('follow')->users_follow_check($this->user_id, $uids);
         }
         foreach ($users_list as $key => $val) {
             $users_list[$key]['focus'] = $users_follow_check[$val['uid']];
         }
         TPL::assign('users_list', array_values($users_list));
     }
     if (!$_GET['group_id']) {
         TPL::assign('parent_topics', $this->model('topic')->get_parent_topics());
     }
     TPL::assign('custom_group', $this->model('account')->get_user_group_list(0, 1));
     TPL::output('people/square');
 }
开发者ID:tenstone,项目名称:wecenter,代码行数:56,代码来源:main.php

示例13: index_action

 public function index_action()
 {
     if ($_GET['id']) {
         if ($_GET['notification_id']) {
             $this->model('notify')->read_notification($_GET['notification_id'], $this->user_id);
         }
         /*if (is_mobile() AND HTTP::get_cookie('_ignore_ua_check') != 'TRUE')
         		{
         			HTTP::redirect('/m/project/' . $_GET['id']);
         		}*/
         if (!($project_info = $this->model('project')->get_project_info_by_id($_GET['id']))) {
             H::redirect_msg(AWS_APP::lang()->_t('项目不存在或已被删除'));
         }
         if ($project_info['approved'] != 1 or $project_info['status'] == 'OFFLINE') {
             if (!$this->user_info['permission']['is_administortar'] and !$this->user_info['permission']['is_moderator'] and $project_info['uid'] != $this->user_id) {
                 H::redirect_msg(AWS_APP::lang()->_t('项目目前待审核中或已下线'));
             }
         }
         $this->crumb($project_info['title'], '/project/' . $project_info['id']);
         $project_info['attachs'] = $this->model('publish')->get_attach('project', $project_info['id'], 'min');
         $project_info['attachs_ids'] = FORMAT::parse_attachs($project_info['description'], true);
         $project_info['description'] = FORMAT::parse_attachs(nl2br(FORMAT::parse_markdown($project_info['description'])));
         $project_info['user_info'] = $this->model('account')->get_user_info_by_uid($project_info['uid']);
         $project_info['category_info'] = $this->model('system')->get_category_info($project_info['category_id']);
         $project_topics = $this->model('topic')->get_topics_by_item_id($project_info['id'], 'project');
         TPL::assign('project_topics', $project_topics);
         TPL::assign('project_products', $this->model('project')->get_products_by_project_id($project_info['id']));
         foreach ($project_topics as $key => $val) {
             $project_topics_ids[] = $val['topic_id'];
         }
         TPL::assign('question_related_list', $this->model('posts')->get_posts_list('question', 1, 10, null, $project_topics_ids));
         TPL::assign('sponsored_users', $this->model('project')->get_sponsored_users($project_info['id'], $project_info['sponsored_users'], $project_info['project_type']));
         if ($this->user_id) {
             TPL::assign('like_status', $this->model('project')->get_like_status_by_uid($project_info['id'], $this->user_id));
             $project_order = $this->model('project')->get_single_project_order_by_uid($this->user_id, $project_info['id']);
             if (get_setting('upload_enable') == 'Y' and $project_info['project_type'] == 'EVENT' and $project_order) {
                 TPL::import_js('js/fileupload.js');
                 TPL::assign('attach_access_key', md5($this->user_id . time()));
             }
             TPL::assign('project_order', $project_order);
         }
         if ($this->model('posts')->get_posts_list_total() != $project_info['discuss_count']) {
             $this->model('project')->update_project_discuss_count($project_info['id'], $this->model('posts')->get_posts_list_total());
         }
         TPL::assign('project_info', $project_info);
         TPL::output('project/index');
     } else {
         /*if (is_mobile() AND HTTP::get_cookie('_ignore_ua_check') != 'TRUE')
         		{
         			HTTP::redirect('/m/project_square/');
         		}*/
         switch ($_GET['sort']) {
             default:
                 $order_by = 'add_time DESC';
                 break;
             case 'amount':
             case 'sponsored_users':
             case 'update_time':
                 $order_by = $_GET['sort'] . ' DESC';
                 break;
         }
         if (get_setting('category_enable') == 'Y') {
             TPL::assign('category_list', $this->model('menu')->get_nav_menu_list('project'));
         }
         if ($project_list = $this->model('project')->get_projects_list($_GET['category_id'], 1, 'ONLINE', $_GET['page'], 9, $order_by)) {
             TPL::assign('project_list', $project_list);
         }
         TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/project/'), 'total_rows' => $this->model('project')->found_rows(), 'per_page' => get_setting('contents_per_page')))->create_links());
         TPL::output('project/square');
     }
 }
开发者ID:elelianghh,项目名称:wecenter,代码行数:71,代码来源:main.php

示例14: qr_code_action

 public function qr_code_action()
 {
     $this->crumb(AWS_APP::lang()->_t('二维码管理'), "admin/weixin/qr_code/");
     if (get_setting('weixin_account_role') != 'service' or !get_setting('weixin_app_id') or !get_setting('weixin_app_secret')) {
         H::redirect_msg(AWS_APP::lang()->_t('此功能只适用于通过微信认证的服务号'), '/admin/');
     }
     $qr_code_list = $this->model('weixin')->fetch_page('weixin_qr_code', 'ticket IS NOT NULL', 'scene_id ASC', $_GET['page'], $this->per_page);
     $qr_code_rows = $this->model('weixin')->found_rows();
     TPL::assign('qr_code_list', $qr_code_list);
     TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/admin/weixin/qr_code/'), 'total_rows' => $qr_code_rows, 'per_page' => $this->per_page))->create_links());
     TPL::assign('menu_list', $this->model('admin')->fetch_menu_list(805));
     TPL::output('admin/weixin/qr_code');
 }
开发者ID:lincoln2015,项目名称:18duchengxuyuan_server,代码行数:13,代码来源:weixin.php

示例15: index_square_action

 public function index_square_action()
 {
     $this->crumb(AWS_APP::lang()->_t('问题'), '/question/');
     // 导航
     if (TPL::is_output('block/content_nav_menu.tpl.htm', 'question/square')) {
         TPL::assign('content_nav_menu', $this->model('menu')->get_nav_menu_list('question'));
     }
     //边栏可能感兴趣的人
     if (TPL::is_output('block/sidebar_recommend_users_topics.tpl.htm', 'question/square')) {
         TPL::assign('sidebar_recommend_users_topics', $this->model('module')->recommend_users_topics($this->user_id));
     }
     //边栏热门用户
     if (TPL::is_output('block/sidebar_hot_users.tpl.htm', 'question/square')) {
         TPL::assign('sidebar_hot_users', $this->model('module')->sidebar_hot_users($this->user_id, 5));
     }
     //边栏热门话题
     if (TPL::is_output('block/sidebar_hot_topics.tpl.htm', 'question/square')) {
         TPL::assign('sidebar_hot_topics', $this->model('module')->sidebar_hot_topics($_GET['category']));
     }
     //边栏专题
     if (TPL::is_output('block/sidebar_feature.tpl.htm', 'question/square')) {
         TPL::assign('feature_list', $this->model('module')->feature_list());
     }
     if ($_GET['category']) {
         if (is_digits($_GET['category'])) {
             $category_info = $this->model('system')->get_category_info($_GET['category']);
         } else {
             $category_info = $this->model('system')->get_category_info_by_url_token($_GET['category']);
         }
     }
     if ($category_info) {
         TPL::assign('category_info', $category_info);
         $this->crumb($category_info['title'], '/question/category-' . $category_info['id']);
         $meta_description = $category_info['title'];
         if ($category_info['description']) {
             $meta_description .= ' - ' . $category_info['description'];
         }
         TPL::set_meta('description', $meta_description);
     }
     if ($_GET['feature_id']) {
         $feature_info = $this->model('feature')->get_feature_by_id($_GET['feature_id']);
         TPL::assign('feature_info', $feature_info);
     }
     if ($feature_info['id']) {
         $topic_ids = $this->model('feature')->get_topics_by_feature_id($feature_info['id']);
     }
     if (!$_GET['sort_type']) {
         $_GET['sort_type'] = 'new';
     }
     if ($_GET['sort_type'] == 'hot') {
         $question_list = $this->model('posts')->get_hot_posts('question', $category_info['id'], $topic_ids, $_GET['day'], $_GET['page'], get_setting('contents_per_page'));
     } else {
         $question_list = $this->model('posts')->get_posts_list('question', $_GET['page'], get_setting('contents_per_page'), $_GET['sort_type'], $topic_ids, $category_info['id'], $_GET['answer_count'], $_GET['day'], $_GET['is_recommend']);
     }
     if ($question_list) {
         foreach ($question_list as $key => $val) {
             if ($val['answer_count']) {
                 $question_list[$key]['answer_users'] = $this->model('question')->get_answer_users_by_question_id($val['question_id'], 2, $val['published_uid']);
             }
         }
     }
     TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/question/sort_type-' . preg_replace("/[\\(\\)\\.;']/", '', $_GET['sort_type']) . '__category-' . $category_info['id'] . '__day-' . intval($_GET['day']) . '__is_recommend-' . $_GET['is_recommend']) . '__feature_id-' . $feature_info['id'], 'total_rows' => $this->model('posts')->get_posts_list_total(), 'per_page' => get_setting('contents_per_page')))->create_links());
     TPL::assign('posts_list', $question_list);
     TPL::assign('question_list_bit', TPL::output('explore/ajax/list', false));
     TPL::output('question/square');
 }
开发者ID:egogg,项目名称:naokr-website,代码行数:66,代码来源:main.php


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