* “main_prev_url”: “http://www.coolshow.com/1.jpg“, * “prev_img_num”:3, * “prev_imgs”: * [ * {“img_url”: “http://www.coolshow.com/1.jpg”}, * {“img_url”:” http://www.coolshow.com/2.jpg”}, * {“img_url”:” http://www.coolshow.com/3.jpg”} * ] * }, * ... *], *} */ //以下部分测试通过 require_once 'public/public.php'; $nPage = isset($_GET['page']) ? $_GET['page'] : 0; $nNum = isset($_GET['reqnum']) ? $_GET['reqnum'] : 10; $nStart = $nNum * $nPage; if (!is_numeric($req_num) || !is_numeric($req_page)) { echo get_rsp_result(false, 'get param is not num'); exit; //错误请求 } require_once "tasks/CoolShow/CoolShowSearch.class.php"; $nCoolType = (int) (isset($_GET['mtype']) ? $_GET['mtype'] : COOLXIU_TYPE_THEMES); $coolshow = new CoolShowSearch(); $json_result = $coolshow->getCoolShow($nCoolType, $nStart, $nNum); echo $json_result; require_once 'tasks/Records/RecordTask.class.php'; $rt = new RecordTask(); $rt->saveRequest($type);
<?php if (isset($_GET['page']) && isset($_GET['reqNum'])) { $req_page = isset($_GET['page']) ? $_GET['page'] : 0; $req_num = isset($_GET['reqNum']) ? $_GET['reqNum'] : 10; $start = $req_num * $req_page; } else { $req_page = isset($_POST['start']) ? $_POST['start'] : 0; $req_num = isset($_POST['limit']) ? $_POST['limit'] : 10; $start = $req_page; } if ($req_num === null || $req_page === null || !is_numeric($req_num) || !is_numeric($req_page)) { $result = get_rsp_result(false, 'request skip or limit failed'); exit; } require_once "tasks/CoolShow/CoolShowSearch.class.php"; $coolshow = new CoolShowSearch(); $json_result = $coolshow->getCoolShow(COOLXIU_TYPE_THEMES, $req_page, $req_num); echo $json_result;