2 Star 1 Fork 1

徐子玉/你若在线

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
newsList.php 7.61 KB
一键复制 编辑 原始数据 按行查看 历史
徐子玉 提交于 2017-07-05 11:01 . +seck
<?php
include_once 'pagination.php';
header("Content-Type: text/html; charset=UTF-8");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$client = new SoapClient("service.xml");
$center_category = "行业资讯";
$PageIndex = isset($_GET["page"]) ? $_GET["page"] : 1;
$PageSize = 10;
$parms = array("center_category" => $center_category, "PageIndex" => $PageIndex, "PageSize" => $PageSize);
$result = $client -> centerMaster_GetAppCenterList($parms);
$jsons = $result -> centerMaster_GetAppCenterListResult;
$jsonArray = json_decode($jsons, TRUE);
$totalCount = $jsonArray[0]['totalCount'];
$success = $jsonArray[0]['success'];
$newListHtml = "";
$newsList = array();
if ($totalCount > 0 && $success == true) {
foreach ($jsonArray[0]['data'] as $json) {
$newsList[] = '<div class="newsList_Condiv">';
$newsList[] = '<a href="newsPage.php?id='.$json["ident"].'" target="_blank">';
$newsList[] = '<div class="newsList_Condivpic"><img src='. $json["center_photo"] .'></div>';
$newsList[] = '<div class="newsList_CondivHead">';
$newsList[] = '<div class="nlcon_til">';
$newsList[] = '<h3>' . $json["center_theme"] . '</h3>';
$newsList[] = '<div class="til_time">';
$newsList[] = '<i></i>' . $json["center_timeout"] . '';
$newsList[] = '</div>';
$newsList[] = '</div>';
$newsList[] = '<div class="nlcon_word">';
$newsList[] = $json["center_summary"];
$newsList[] = '</div>';
$newsList[] = '</div>';
$newsList[] = '</a>';
$newsList[] = '</div>';
}00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
}
$newListHtml = implode("" , $newsList);
$totalPage = round($totalCount / 10);
if($totalPage == 0){
$totalPage = 1;
}
$base = array(
'current_page' => 1,
'total_page' => $totalPage,
'boundary' => 7,
'front_range' => 1,
'mid_range' => 5,
'rear_range' => 1
);
$page = new Pagination_lib($base);
$page_html = $page->create_html();
//输出模板
$filename = "newsList.html";
$file = @fopen($filename,"r");
if ($file) {
$contents = @fread($file, filesize($filename));
$contents = str_replace("{\$newListHtml}", $newListHtml, $contents);
$contents = str_replace("{\$page_html}", $page_html, $contents);
echo $contents;
fclose($file);
}
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xuqipeter/nrzx.git
[email protected]:xuqipeter/nrzx.git
xuqipeter
nrzx
你若在线
master

搜索帮助