📄 list.php
字号:
<?php
define('DUOXUN','OK');
require_once('global.php');
echo "<!--
/******************************************************************************
* 程序名称:DuoXun CMS *
* 程序开发:多讯网 http://www.duoxun.com *
* 帮助中心: *
* 1)QQ:405228655 *
* 2)E-mail:duoxun@163.com *
* 更多联系方法请登陆:多讯网 http://www.duoxun.com *
******************************************************************************/
-->";
include_once(R_P.'cache/set.php');
$perpage=$set['list_num'];
$mainurl=$set['ifhtml']=='1' && file_exists(R_P.'index.html') ? 'index.html' : 'index.php';
empty($_GET['order']) ? $order='aid' : $order=$_GET['order'];
if(empty($_GET['id']) && empty($_GET['type'])) {
$count="SELECT COUNT(*) AS count FROM duoxun_subject WHERE ifshow=1 AND topped=0";
} else {
if(!empty($_GET['id'])) {
$id=$_GET['id'];
$count="SELECT COUNT(*) AS count FROM duoxun_subject WHERE sid=$id AND ifshow=1 AND topped=0";
}
if(!empty($_GET['type'])) {
if($_GET['type']==='news') {
$count="SELECT COUNT(*) AS count FROM duoxun_news WHERE topped=0";
}
}
}
$rs=get_one($count);
$num=$rs['count'];
$pages=ceil($num/$perpage);
if(empty($_GET['page']) || $_GET['page']<1) {
$page=1;
$start=0;
} elseif($_GET['page']>$pages) {
$page=$pages;
$start=($page-1)*$perpage;
} else {
$page=$_GET['page'];
$start=($page-1)*$perpage;
}
if(empty($_GET['id']) && empty($_GET['type'])) {
$sql_top="SELECT * FROM duoxun_subject WHERE ifshow=1 AND topped!=0 ORDER BY topped ASC";
$sql="SELECT * FROM duoxun_subject WHERE ifshow=1 AND topped=0 ORDER BY $order DESC LIMIT $start,$perpage";
$mpurl="list.php";
$add='';
$guide='全部文章 - ';
$guidee=($set['ifhtml']=='1' && file_exists("list.html")) ? "list.html" : "list.php";
$guidee="<a href=\"{$guidee}\" class=\"guidee\">全部文章</a>";
$title1='全部排行';
$title2=$set['news'];
$top="SELECT * FROM duoxun_subject WHERE ifshow=1 ORDER BY hits LIMIT 0,{$set['listright_num']}";
$bottom="SELECT * FROM duoxun_news ORDER BY aid LIMIT 0,{$set['listright_num']}";
} else {
if(!empty($_GET['id'])) {
$id=$_GET['id'];
$sql_top="SELECT * FROM duoxun_subject WHERE sid=$id AND ifshow=1 AND topped!=0 ORDER BY topped ASC";
$sql="SELECT * FROM duoxun_subject WHERE sid=$id AND ifshow=1 AND topped=0 ORDER BY $order DESC LIMIT $start,$perpage";
$mpurl="list.php?id=$id";
$add='';
$rs=get_one("SELECT * FROM duoxun_sort WHERE sid=$id");
$guide=$rs['name'].' - ';
$guidee=($set['ifhtml']=='1' && file_exists("list_$id.html")) ? "list_$id.html" : "list.php?id=$id";
$guidee="<a href=\"{$guidee}\" class=\"guidee\">{$rs['name']}</a>";
if($order==='hits' || $order==='cnum') {
$title1='全部最新';
$title2='本类最新';
$top="SELECT * FROM duoxun_subject WHERE ifshow=1 ORDER BY aid LIMIT 0,{$set['listright_num']}";
$bottom="SELECT * FROM duoxun_subject WHERE sid=$id AND ifshow=1 ORDER BY aid LIMIT 0,{$set['listright_num']}";
} else {
$title1='全部排行';
$title2='本类排行';
$top="SELECT * FROM duoxun_subject WHERE ifshow=1 ORDER BY hits LIMIT 0,{$set['listright_num']}";
$bottom="SELECT * FROM duoxun_subject WHERE sid=$id AND ifshow=1 ORDER BY hits LIMIT 0,{$set['listright_num']}";
}
}
if(!empty($_GET['type'])) {
if($_GET['type']==='news') {
$sql_top="SELECT * FROM duoxun_news WHERE topped!=0 ORDER BY topped ASC";
$sql="SELECT * FROM duoxun_news WHERE topped=0 ORDER BY $order DESC LIMIT $start,$perpage";
$mpurl="list.php?type=news";
$add='&type=news';
$guide=$set['news'].' - ';
$guidee=($set['ifhtml']=='1' && file_exists("news.html")) ? "news.html" : "list.php?type=news";
$guidee="<a href=\"{$guidee}\" class=\"guidee\">{$set['news']}</a>";
}
$title1='全部最新';
$title2='全部排行';
$top="SELECT * FROM duoxun_subject WHERE ifshow=1 ORDER BY aid LIMIT 0,{$set['listright_num']}";
$bottom="SELECT * FROM duoxun_subject WHERE ifshow=1 ORDER BY hits LIMIT 0,{$set['listright_num']}";
}
}
$title2==$set['news'] ? $add_d='&type=news' : $add_d='';
$i=1;
$query=query($sql_top);
while($rs=fetch_array($query)) {
$toppeddb[$i]=$rs;
$i++;
}
$j=$i+$perpage*($page-1);
$query=query($sql);
while($rs=fetch_array($query)) {
$catedb[$j]=$rs;
$j++;
}
$fenye=fenye($num,$perpage,$page,$mpurl,0);
$top=query($top);
while($rs=fetch_array($top)) {
$topdb[]=$rs;
}
$bottom=query($bottom);
while($rs=fetch_array($bottom)) {
$bottomdb[]=$rs;
}
!file_exists(R_P.'cache/list_ad.php') ? touch(R_P.'cache/list_ad.php') : $list_ad=readover(R_P.'cache/list_ad.php');
$basename='list.php';
$query_string='?'.$_SERVER['QUERY_STRING'];
if(empty($_SERVER['QUERY_STRING']) || $_SERVER['QUERY_STRING']==='order=cnum' || $_SERVER['QUERY_STRING']==='order=hits') {
$newadd=$basename;
$hitsadd=$basename.'?order=hits';
$cnumadd=$basename.'?order=cnum';
} elseif(strpos($query_string, 'cnum')) {
$newadd=$basename.str_replace('&order=cnum','',$query_string);
$hitsadd=$basename.str_replace('cnum', 'hits', $query_string);
$cnumadd=$basename.$query_string;
} elseif(strpos($query_string, 'hits')) {
$newadd=$basename.str_replace('&order=hits','',$query_string);
$hitsadd=$basename.$query_string;
$cnumadd=$basename.str_replace('hits', 'cnum', $query_string);
} else {
$newadd=$basename.$query_string;
$hitsadd=$basename.$query_string.'&order=hits';
$cnumadd=$basename.$query_string.'&order=cnum';
}
require_once('head.php');
echo "<script for=window event=onload>var clink=document.links[document.links.length-1];clink.innerText='http://www.duoxun.com';clink.href='http://www.duoxun.com/';clink.title='DuoXun CMS(多讯网)';</script>";
require_once template('list');
require_once('foot.php');
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -