コード例 #1
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $page = intval($GLOBALS['request']['page']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/uc_func.php';
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
         $result = get_collect_list($limit, $user_id);
         $root['item'] = $result['list'];
         $root['page'] = array("page" => $page, "page_total" => ceil($result['count'] / app_conf("PAGE_SIZE")), "page_size" => app_conf("PAGE_SIZE"));
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     $root['program_title'] = "我的关注";
     output($root);
 }
コード例 #2
0
ファイル: uc_collectModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $result = get_collect_list($limit, $GLOBALS['user_info']['id']);
     foreach ($result['list'] as $k => $v) {
         if ($v['uname'] != "") {
             $result['list'][$k]['url'] = url('index', 'deal#' . $v['uname']);
         } else {
             $result['list'][$k]['url'] = url('index', 'deal#' . $v['id']);
         }
         $result['list'][$k]['del_url'] = url('index', 'uc_collect#del', array('id' => $v['cid'], 'type' => 'deal'));
     }
     $GLOBALS['tmpl']->assign("list", $result['list']);
     $page = new Page($result['count'], app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("page_title", "我的收藏");
     $GLOBALS['tmpl']->assign("type", "deal");
     assign_uc_nav_list();
     //左侧导航菜单
     $GLOBALS['tmpl']->display("uc/uc_collect.html");
 }
コード例 #3
0
 public function index()
 {
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $result = get_collect_list($limit, $GLOBALS['user_info']['id']);
     $GLOBALS['tmpl']->assign("list", $result['list']);
     $page = new Page($result['count'], app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_COLLECT']);
     $GLOBALS['tmpl']->assign("inc_file", "inc/uc/uc_collect_index.html");
     $GLOBALS['tmpl']->display("page/uc.html");
 }