📄 topic_make.php
字号:
<form name="form2" method="post" action="">
<table width="100%" border="0" height="109">
<tr>
<td width="7%" height="59"> </td>
<td width="86%" height="59" valign="middle">
<table width="754" border="1" cellpadding="3" cellspacing="0" align="center" bordercolor="#111111" class=border>
<tr >
<td width="138" height="20">
<div align="center"><font color="#000000">查询内容</font></div>
</td>
<td width="259" height="20">
<div align="center"><font color="#000000">时间限制</font></div>
</td>
<td width="165" height="20">
<div align="center"><font color="#000000">栏目</font></div>
</td>
</tr>
<tr bgcolor="#f7f7f7">
<td width="138" >
<div align="center">
<input type="text" name="sercont">
</div>
</td>
<td width="259">
<div align="center">
<select name="sertime" size="1">
<option value="">任何时间</option>
<option value="3">3天之内</option>
<option value="7">7天之内</option>
<option value="30">一月之内</option>
<option value="180">半年之内</option>
</select>
</div>
</td>
<td width="165">
<div align="center">
<select name="seritem">
<option value="">任何栏目</option>
<?
$sqldo="select class_id,class_name from baseclass where class_layer=1";
$result_array=$cla->db_query($sqldo);
$i=0;
$old=$result_array[$i][0];
while($result_array[$i][0]){
$temp1=$result_array[$i][0];
$temp1_name=strip_tags($result_array[$i]["CLASS_NAME"]);
$sqldo_in="select class_id,class_name from baseclass where class_father='$temp1'";
$result_array_in=$cla->db_query($sqldo_in);
$j=0;
$flg1=0;
if($result_array_in[$j][0]==""){//如果是空,也显示一次,即将第二级专题显示出来
$flg1=1;
}
while($result_array_in[$j][0] or $flg1){
$temp2=$result_array_in[$j][0];
$temp2_name=strip_tags($result_array_in[$j]["CLASS_NAME"]);
$sqldo_in_in="select class_id,class_name from baseclass where class_father='$temp2'";
$result_array_in_in=$cla->db_query($sqldo_in_in);
$k=0;
$flg2=0;
if($result_array_in_in[$k][0]==""){//如果是空,也显示一次,即将第三级专题显示出来
$flg2=1;
}
while(($result_array_in_in[$k][0]<>"") or ($flg2<>0) or ($flg1<>0)){
$temp3=$result_array_in_in[$k]['CLASS_NAME'];
$temp3_name=strip_tags($result_array_in_in[$k]['CLASS_NAME']);
?>
<option value=<? if($temp3){echo $temp3;}elseif($temp2){echo $temp2;}elseif($temp1){echo $temp1;}?>>
<? echo "$temp1_name";if($temp2_name){ echo ".$temp2_name";if($temp3_name) echo".$temp3_name";}
//echo "old:".$old;
// echo "result_array".$result_array[$i][0];
?>
</option>
<?
$flg1=0; $flg2=0; $k++;}//第四级
$j++;}//第三级
?>
<option value="">***************************</option>
<?
$old=$result_array[$i][0];$i++;}//第二级
?>
</select>
</div>
</td>
</tr>
</table>
<div align="right"></div>
</td>
<td width="7%" valign="middle" height="59"><font color="#000000">
<input type="submit" name="cmdsearc" value="搜索" >
</font></td>
</tr>
</table>
</form>
</td>
</tr>
<tr> </tr>
<tr> </tr>
<tr> </tr>
<tr> </tr>
<tr>
<td width="75%" height="70" valign="top">
<div align="right">
<table width="84%" border="0" align="center">
<tr>
<td colspan="3">
<form name="form1" method="post" action="">
<table width="84%" border="0" align="center">
<tr>
<td colspan="3">
<div align="right"> </div>
<?
if(($cmdsearc=="搜索")or($temp==1)){ //如果搜索
$sercont=trim($sercont);
$sqldo_head="select newsid,newsname,uploadertime,pub_statue,newslength,column1,uploader from news ";
$sqldo_head_c="select count(*) from news ";
$sqldo_cont="";
//echo "seritem".$seritem;
if($sercont or $sertime or $seritem){
$sqldo_cont.="where ";
}
if($sercont){
$sqldo_cont.="(instr(newsname,'$sercont')>0 or instr(newstext,'$sercont')>0) ";
}
if($sercont and $sertime){
$datetime=date("YmdHis",mktime(date(''),date(''),date(''),date("m"),date("d")-$sertime,date("Y")) );
$sqldo_cont.="and uploadertime>'$datetime' ";
}elseif($sertime){
$datetime=date("YmdHis",mktime(date(''),date(''),date(''),date("m"),date("d")-$sertime,date("Y")) );
$sqldo_cont.=" uploadertime>'$datetime' ";
}
if(($sercont or $sertime) and $seritem){
$sqldo_cont.="and column1='$seritem' ";
}elseif($seritem){
$sqldo_cont.=" column1='$seritem' ";
}
$sqldo_cont.=" order by newsid desc ";
$sqldo_s=$sqldo_head.$sqldo_cont;
// echo "sqldo".$sqldo_s."end";
$sqldo=$sqldo_s;
$sqldo_c=$sqldo_head_c.$sqldo_cont;
//$res_array=$cla->db_query($sqldo_s);
}
?>
<?
//搜索数据库
if($temp==1){
$sqldo=stripslashes($sqldo);
$sqldo_c=stripslashes($sqldo_c);
}
if($sqldo_c)
{$result=$cla->db_query($sqldo_c);
$num=$result[0][0];
} //分页显示无匹配记
$perpage=8;//每页显示文章数
$pages=ceil($num/$perpage);
$last_offset=($pages-1)*$perpage;
if (isset($jumpto))
{if ($jumpto<=$pages){
$offset=($jumpto-1)*$perpage;
} else{
$offset=$last_offset;}
}
//判断偏移量参数是否传递给了脚本,如果没有就使用默认值0
if (empty($offset))
{
$offset=0;
}
if($cmdsearc=="搜索"){
$offset=0;
}
?>
<table bordercolor="#ffffff" cellspacing="0" cellpadding="0" width="100%"
align= "center" border="1" bordercolorlight="#000000" class=>
<tr>
<td width="54%" valign="middle">
<?if(isset($num)){
?>
<a href="<?="$PHP_SELF";?>?offset=0&temp=1&num=<?="$num";?>&sercont=<?php echo $sercont;?>&sertime=<?php echo $sertime;?>&seritem=<?php echo $seritem;?>">首
页</a>
<?}else{
echo "首 页";
}?>
<?
//如果偏移量是0,不显示前一页的链接
if($offset)
{
$preoffset=$offset-$perpage;
?>
<a href="<? echo $PHP_SELF;?>?offset=<?echo $preoffset;?>&temp=1&sercont=<?php echo $sercont;?>&sertime=<?php echo $sertime;?>&seritem=<?php echo $seritem;?>">前一页</a>
<?
}else{
print "前一页 ";
}
//计算总共需要的页数
$nextoffset=$offset+$perpage;
//检查是否是最后一页
if (($pages!=0) && ($nextoffset<$num))
{
?>
<a href="<? echo $PHP_SELF;?>?offset=<?echo $nextoffset;?>&temp=1&sercont=<?php echo $sercont;?>&sertime=<?php echo $sertime;?>&seritem=<?php echo $seritem;?>">下一页</a>
<?
//print "<a href=\"$PHP_SELF?offset=$nextoffset&temp=1&sqldo= $sqldo&sqldo_c=$sqldo_c\">下一页</a> ";
}else{
print "下一页 ";
}
$this_page_no=ceil($offset/$perpage)+1;
?>
<?if(!isset($num)){
echo "末 页";
}else{ ?>
<a href="<?=$PHP_SELF;?>?offset=<?=$last_offset;?>&temp=1&num=<?=$num;?>&sercont=<?php echo $sercont;?>&sertime=<?php echo $sertime;?>&seritem=<?php echo $seritem;?>">末
页</a>
<?}?>
<div align="right">
</div></td>
<td width="46%" valign="middle"><div align="right">页次:<font class="red">
<?echo $this_page_no;?> /</font> <?echo $pages;?>
页 共<font class="red">
<?if($num<>""){
echo $num;
}
else{
echo "0";
}
?>
</font>条记录 <?echo $perpage;?> 记录/页
<input name="temp" size="50" type="hidden" value="1">
<input name="sqldo" size="50" type="hidden" value="<?php print $sqldo;?>">
<input name="sqldo_c" size="50" type="hidden" value="<?php print $sqldo_c;?>">
<br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -