📄 naboard.php
字号:
<?
//////////////////////////////////start time
$start_time=time()+(double)microtime(time());
//////////////////////////////////ready
include "connect.php";
include "lib.php";
include "set_top.php";
include "header.inc";
//////////////////////////////////check
chk_bd($bd);
$chk_admin=chk_admin_return($bd);
$chk_root=chk_level_return(1);
$chk_admin=$chk_admin+$chk_root;
if(!$chk_admin){
chk_level($set[auth_list],"${error}没有权限查看",0);
}
//////////////////////////////////name set
if(!$HTTP_COOKIE_VARS[$member_cookie]){$name_value=$HTTP_COOKIE_VARS[$name_cookie];}
else{$name_value=$member[name];$name_readonly="readonly";}
//////////////////////////////////append query
include"$skin/query.php";
//////////////////////////////////If there is search word, query manufacturing -_-a
if($search_word){
$search_word=trim($search_word);
if($search_and){$and="and";}else{$and="or";}
$search_word=str_replace(" ",",",$search_word);
$search_word_arry=explode(",",$search_word);
$search_word_length=sizeof($search_word_arry);
$query_where.=" and";
for($x=0;$x<$search_word_length;$x++){
if($x){$query_where.=" $and";}
$query_where.=" (";
if($search_title){$query_where.="title like '%$search_word_arry[$x]%'";$x_1[$x]=1;}
if($search_memo){if($x_1[$x]){$or_2[$x]="or";}$query_where.="$or_2[$x] memo like '%$search_word_arry[$x]%'";$x_2[$x]=1;}
if($search_name){if($x_2[$x] || $x_1[$x]){$or_3[$x]="or";}$query_where.="$or_3[$x] name like '%$search_word_arry[$x]%'";}
$query_where.=")";
}
}
//////////////////////////////////append query, if there is category
if($cat_no){
$query_where.=" and cat='$cat_no'";
}
//////////////////////////////////total article num
$total=total("$board_table$bd","$query_where $query_skin");
//////////////////////////////////index setting
$page=$set[page];
$pagesu=ceil($total/$page);
$start=($page*$pagenum);
$num=$total-$start;
$pageviewsu=$set[pagenum];
$pagegroup=ceil(($pagenum+1)/$pageviewsu);
$pagestart=($pageviewsu*($pagegroup-1))+1;
$pageend=$pagestart+$pageviewsu-1;
$nowpage=$pagenum+1;
//////////////////////////////////variable to send
$send="bd=$bd&no=$no&pagenum=$pagenum&cat_no=$cat_no&search_word=$search_word&search_title=$search_title&search_memo=$search_memo&search_name=$search_name&search_and=$search_and&";
//////////////////////////////////width
if(!$set[width_kind]){$width_kind="%";}
echo"
<script language=javascript>
function mailing(to){
if(to){window.open('mailing.php?to='+to,'','scrollbars=yes,width=400,height=400,top=200,left=200')}
else{window.open('mailing.php','root_mailing','scrollbars=yes,width=400,height=400,top=200,left=200')}
}
function use_mail(address){
if(!confirm('${message}你是否想使用本站的在线邮件功能?如果取消将使用你系统默认的Email程序!')){return true;}
else{mailing(address);return false;}
}
function check(){
to=document.admin_check.length;
if(admin_check.ok.value==\"on\"){
for(var i=0;i<to;i++){document.admin_check[i].checked=true;}
admin_check.ok.value=\"off\";
admin_check2.sel.value=\"取消选择\";
}
else{
for(var i=0;i<to;i++){document.admin_check[i].checked=false;}
admin_check.ok.value=\"on\";
admin_check2.sel.value=\"选择全部\";
}
}
function chk_admin(){
admin_check.mode.value=admin_check2.mode.value;
admin_check.to.value=admin_check2.to.value;
if(admin_check.mode.value!=\"del\" && admin_check.to.value==\"$bd\"){alert('${error}请选择一个要移动或拷贝的讨论区');admin_check2.to.focus();return false;}
if(!confirm('${warning}是否真的要执行这项任务?')){return false;}
admin_check.submit();
}
</script>
<table border=0 width='$set[table_width]$width_kind' cellpadding=0 cellspacing=0 align=center>
<tr>";
//////////////////////////////////to show category
if($set[cat_on]){
echo"<td width=1% nowrap valign=top>";
$total_category=total("$cat_table$bd","");
include"$skin/category_top.php";
$category_query="select * from $cat_table$bd order by name";
$category_result=mysql_query($category_query,$connect);
while($category=mysql_fetch_array($category_result))
{
$total_this_category=total("$board_table$bd","and cat='$category[no]'");
$name_this_category=$category[name];
$no_this_category=$category[no];
include"$skin/category_main.php";
}
include"$skin/category_bottom.php";
echo"</td><td width=1% nowrap> </td>";
}
echo"
<td width=98% valign=top>";
//////////////////////////////////skin top
include"$skin/list_top.php";
//////////////////////////////////board administration form
echo"<form method=post name=admin_check action=admin_ing.php onsubmit=\"return admin_check()\">
<input type=hidden name=bd value=$bd>
<input type=hidden name=ok value=on>
<input type=hidden name=mode value=''>
<input type=hidden name=to value=''>
<input type=hidden name=count value=$set[page]>";
//////////////////////////////////today
$check_today=date('Y-m-d');
//////////////////////////////////to take out article
$int=0;
$query="select * from $board_table$bd where 1 $query_where $query_skin order by abs,step,level limit $start,$page";
$result=mysql_query($query,$connect);
while($data=mysql_fetch_array($result))
{
//////////////////////////////////reply block
$block="";
for($i=0;$i>=$data[level];$i--){$block.=" ";}
//////////////////////////////////Length control
if($set[title_length]){$data[title]=cut($data[title],$set[title_length]);}
if($set[name_length]){$data[name]=cut($data[name],$set[name_length]);}
//////////////////////////////////slash chopping
$data[name]=stripslashes($data[name]);
$data[title]=stripslashes($data[title]);
$data[memo]=nl2br(stripslashes($data[memo]));
//////////////////////////////////emphasis searching word
for($i=0;$i<$search_word_length;$i++){
if($search_title)
{$data[title]=str_replace("$search_word_arry[$i]","#≮$search_word_arry[$i]≠#",$data[title]);}
if($search_memo)
{$data[memo]=str_replace("$search_word_arry[$i]","#≮$search_word_arry[$i]≠#",$data[memo]);}
if($search_name)
{$data[name]=str_replace("$search_word_arry[$i]","#≮$search_word_arry[$i]≠#",$data[name]);}
}
if($search_title){
$data[title]=str_replace("#≮","<font color=red>",$data[title]);
$data[title]=str_replace("≠#","</font>",$data[title]);
}
if($search_memo){
$data[memo]=str_replace("#≮","<font color=red>",$data[memo]);
$data[memo]=str_replace("≠#","</font>",$data[memo]);
}
if($search_name){
$data[name]=str_replace("#≮","<font color=red>",$data[name]);
$data[name]=str_replace("≠#","</font>",$data[name]);
}
//////////////////////////////////mark establishment
$check_regday=date('Y-m-d',$data[date]);
$data[mark]="<img src=$skin/mark_old.gif align=absmiddle>";
if($check_regday==$check_today){$data[mark]="<img src=$skin/mark_new.gif align=absmiddle>";}
if($data[abs]==-2147483648){$data[mark]="<img src=$skin/mark_notice.gif align=absmiddle>";}
if($data[no]==$no){$data[mark]="<img src=$skin/mark_this.gif align=absmiddle>";}
if($data[step]){$data[re_mark]="<img src=$skin/mark_re.gif align=absmiddle>";}else{$data[re_mark]="";}
if($data[secret]){$data[sec_mark]="<img src=$skin/mark_secret.gif align=absmiddle>";}else{$data[sec_mark]="";}
//////////////////////////////////category name
if($set[cat]){$category_name=selects("$cat_table$bd","and no='$data[cat]'");$data[cat_name]=$category_name[name];}
//////////////////////////////////cool mark
if($set[best]<=$data[hit] && $set[best]){$data[cool]=1;}else{$data[cool]="";}
//////////////////////////////////comment num
$data[com_num]=total("$com_table$bd","and no=$data[no]");
//////////////////////////////////Administration check button
if($chk_root+$chk_admin){$check_button="<input type=checkbox name=check_button[$int] value=$data[no]>";}
//////////////////////////////////set member icon
if($data[id]){
$image_exist=file_exists("member_icon/$data[id].gif");
if($image_exist){$data[name]="<img src='member_icon/$data[id].gif' border=0 align=absmiddle>";}
}
//////////////////////////////////skin middle
include"$skin/list_engine.php";
//////////////////////////////////-0-
$num--;
$int++;
}
echo"</form>";
//////////////////////////////////skin bottom
include"$skin/list_bottom.php";
echo"</td></tr></table>";
//////////////////////////////////output time indication + article administration
if($chk_root+$chk_admin){
$end_time=time()+(double)microtime(time());
echo "
<table border=0 width='$set[table_width]$width_kind' cellpadding=0 cellspacing=0 align=center>
<tr><td>页面处理信息:处理过程共花费了:".($end_time-$start_time)."秒</td></tr>
<form method=post name=admin_check2>
<tr><td>";
$tables=list_bd();
$total=count($tables);
echo"
<input type=button name=sel class=button value='选择全部' onclick=check() onfocus=blur()>
<select name=mode><option value=del>删除</option><option value=move>移动</option><option value=copy>拷贝</option></select>
-> <select name=to>";
for($i=0;$i<$total;$i++){
$board_name=str_replace("$board_table","",$tables[$i]);
if($board_name!=$bd){echo"<option value='$board_name'>$board_name</option>";}
}
echo"
</select> <input type=button class=input value=excute onclick=chk_admin()></td></tr>
</form>
</table>";}
//////////////////////////////////end~
include"set_bottom.php";
mysql_close($connect);
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -