<?
/////////////////////////////////////////////////////
//  险情文章管理 1.0正式版本--php文本存储格式          //
//  作者：上海财经大学99国际工管    险情               //
//  email：indraw@sina.com                         //
//  qq：   30467826                                //
//  技术支持：http://shcj.51.net/wdb                //
//  最新演示：http://xqart.126.com                  //
//  2002/4/10                                      //
//  最新下载地址 http;//shcj.51.net/wdb             //
/////////////////////////////////////////////////////
require("head.php");
require("config.php");
require("xqfunc.php");
if (empty($keyword)){
head_form();
  $msg="您没有填写关键词";
  $turn_page="javascript:history.back(1);";
  error_0($msg,$turn_page);
  exit;
}
############################以下为按照指定分类搜索###############################################
if ($searchtype!="all"){
$file_sort=file("data/"."xq.php");
$file_count=count($file_sort)-1;
////////
////////////////////按指定分类--标题搜索//////////////////////////////////////////////
if ( $title and $keyword and empty($text)) {
    $user=file("data/$searchtype/list.php");
    $user_count=count($user);
    for ($i=0;$i<$user_count;$i++){
    $user_array =explode("|", $user[$i]);
    $SEARCH_IDX[]=$user_array[0];
    }
$Bad_Keyword_Array = array("?", " ", "[", "]", "(", ")", "+", "\\", "|", "$");
for ($q = 0 ; $q < sizeof($Bad_Keyword_Array); $q++)
{
        if (strstr($keyword, $Bad_Keyword_Array[$q])) {
                $keyword = "";
        }
}
/////////////////////////////////////////
        $end =count($SEARCH_IDX);
        for($sss=0; $sss<=$end-1; $sss++) {
                $search_file = chop($SEARCH_IDX[$sss]);
                if( is_file("data/$searchtype/$search_file.num") and is_file("data/$searchtype/$search_file.txt")) {
                        $FILES_ARRAY_DATA = file("data/$searchtype/$search_file.num");
                        $FILES_ARRAY = explode("|", $FILES_ARRAY_DATA[0]);
                                if ( eregi($keyword, $FILES_ARRAY[1])) {
                                        $IDX[] = $search_file;
                                }
                              }
                          }
              }
////////////////////////按照指定分类--内容搜索//////////////////////
if ( $text and $keyword and empty($title)) {
    $user=file("data/$searchtype/list.php");
    $user_count=count($user);
    for ($i=0;$i<$user_count;$i++){
    $user_array =explode("|", $user[$i]);
    $SEARCH_IDX[]=$user_array[0];
    }
$Bad_Keyword_Array = array("?", " ", "[", "]", "(", ")", "+", "\\", "|", "$");
for ($q = 0 ; $q < sizeof($Bad_Keyword_Array); $q++)
{
        if (strstr($keyword, $Bad_Keyword_Array[$q])) {
                $keyword = "";
        }
}
///////////////////
        $end =count($SEARCH_IDX);
        for($sss=0; $sss<=$end-1; $sss++) {
                $search_file = chop($SEARCH_IDX[$sss]);
                if( is_file("data/$searchtype/$search_file.num")  and is_file("data/$searchtype/$search_file.txt")) {
                        $FILES_ARRAY_DATA = file("data/$searchtype/$search_file.txt");
                                if ( eregi($keyword, $FILES_ARRAY_DATA[0])) {
                                        $IDX[] = $search_file;
                                }
                              }
                          }
              }
/////////////////////////按照指定分类综合搜索//////////////////////
if ( $text and $keyword and $title) {
    $user=file("data/$searchtype/list.php");
    $user_count=count($user);
    for ($i=0;$i<$user_count;$i++){
    $user_array =explode("|", $user[$i]);
    $SEARCH_IDX[]=$user_array[0];
    }
$Bad_Keyword_Array = array("?", " ", "[", "]", "(", ")", "+", "\\", "|", "$");
for ($q = 0 ; $q < sizeof($Bad_Keyword_Array); $q++)
{
        if (strstr($keyword, $Bad_Keyword_Array[$q])) {
                $keyword = "";
        }
}
        $end =count($SEARCH_IDX);
        for($sss=0; $sss<=$end-1; $sss++) {
                $search_file = chop($SEARCH_IDX[$sss]);
                if( is_file("data/$searchtype/$search_file.num") and is_file("data/$searchtype/$search_file.txt")) {
                        $FILES_txt_DATA = file("data/$searchtype/$search_file.txt");
                        $FILES_num_DATA = file("data/$searchtype/$search_file.num");
                        $FILES_num_code = explode("|", $FILES_num_DATA[0]);
                                if ( eregi($keyword, $FILES_num_code[1]) or eregi($keyword, $FILES_txt_DATA[0])) {
                                        $IDX[] = $search_file;
                                }
                              }
                          }
              }
$total_search=count($IDX);
$recnum = $page_list_pg;
$listnum = 10;
$totalnum = intval(($total_search)/$recnum)+1;
///////////////
echo "<title>文章管理</title>\n";
echo "<center>\n";
echo "<table border=0 bgcolor=#eeeeee cellspacing=1 cellpadding=3 width=100%>\n";
echo "<tr bgcolor=#eeeeee>\n";
echo "<td class=shadow2>\n";
echo "<img src=../images/arrow2.gif>\n";
echo "<a class=shadow2 href=index.php>文章首页</a>　\n";
for ($i=0;$i<=$file_count;$i++) {
        $file_name=explode("|",$file_sort[$i]);
        if  ($file_name[0]=="form")
        echo "<img src=../images/arrow5.gif>"."&nbsp;<a class=shadow2 href=listform.php?form=$file_name[1]>$file_name[2]"."</a>\n";
        if ($file_name[1]==$searchtype)
            $msg.="&nbsp;<img src=../images/arrow.gif>&nbsp;$file_name[2]";
        }
echo "</td>\n";
echo "</tr>\n";
echo "<tr bgcolor=$fuse_color>\n";
echo "<td class=shadow2>\n";
echo ">>$msg-文章搜索结果\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
//////////////////////////////////////////////////////
echo "<table border=0 cellpadding=10 cellspacing=0 style='border-collapse:collapse' bordercolor=$main_color width=735>\n";
echo "<tr>\n";
echo "<td class=shadow2 valign=bottom>\n";
echo "<img src=../images/arrow3.gif> 取得文章总数/搜索文章分类：<b><font color=red>$total_search</font>/$end</b>";
echo "</td>\n";
echo "</td>\n";
echo "<form method='post' action='search.php'>";
echo "<td align=right valign=bottom>\n";
echo "<img src='./images/search.gif' width=16 heigth=16> ";
echo "标题<input type=checkbox name=title value='1' ";
echo ">\n";
echo "内容<input type=checkbox name=text value='1' ";
echo ">\n";
echo "<input class=border type=text name=keyword size=12 style='color:#000000; background-color:$fuse_color'>\n";
echo "<select size=1 name=searchtype style='color:#000000; border-style:solid; border-width:1; background-color:$fuse_color'>\n";
echo "<option value='all'>-=所有文章=-</option>";
for ($i=0;$i<=$file_count;$i++) {
        $file_name=explode("|",$file_sort[$i]);
        if ($file_name[0]=="type"){
        echo "<option value=".$file_name[1].">".$file_name[2]."</option>";
        } }
echo "</select> \n";
echo "<input class=border type=submit value=搜索 name=search style='color: #000000; background-color: $main_color'>\n";
echo "</td>";
echo"</form>";
echo "</tr>\n";
echo "</table>\n";
echo "<table border=0 cellspacing=0 style='border-collapse:collapse' width=735 height=233 cellpadding=3>\n";
echo "<tr>\n";
echo "<td width=60% height=233 valign=top>\n";

/////////////将搜索结果分页显示//////////////////////////////
echo "<table border=1 cellpadding=3 cellspacing=0 style='border-collapse:collapse' bordercolor=$biankuang_color width=100%>\n";
echo "<tr>\n";
echo "<td width=100% align=right class=shadow2>\n";
page_menu($totalnum);
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<center><table border=0 bgcolor=\"white\" cellspacing=1 cellpadding=1 width=100%>\n";
if ( !$p ) { $p = 1; }
for ($i = $total_search-(($p-1)*$recnum)-1; $i > $total_search-($p*$recnum)-1;$i--) {
  if ( "$IDX[$i]" && "$IDX[$i]" != '.' && "$IDX[$i]" != '..') {
  $user=file("data/$searchtype/$IDX[$i].num");
  $xqfile_info=explode("|",$user[0]);
   $len = strlen($xqfile_info[1]);
  if ($len <= $page_list_code)
    $title_new = $xqfile_info[1];
  else
    $title_new =substr($xqfile_info[1],0,$page_list_code)."...";
    $NO=$i+1;
  echo "<tr><td width=22 height=\"22\"align=center bgcolor=\"$fuse_color\" onmouseover=\"this.bgColor='white';\" onmouseout=\"this.bgColor='$fuse_color';\">";
  echo "$NO</td>";
  echo "<td height=\"22\" bgcolor=\"white\" onmouseover=\"this.bgColor='$fuse_color';\" onmouseout=\"this.bgColor='white';\">";
  echo "</b><a target=_blank href='show.php?type=$searchtype&id=$xqfile_info[0]'><span style=font:9pt>$title_new</span></a>";
  if (!empty($xqfile_info[5])) {
        $FILE = split("\.", $xqfile_info[5]);
        $FILE_count=count($FILE);
        $ftype = GET_FILE_TYPE($FILE[$FILE_count-1]);
echo ".<a href=\"artdown.php?type=$searchtype&id=$xqfile_info[0]\" target=blank><IMG border=0 SRC='images/file/$ftype'></a>/$xqfile_info[19]\n";
}
  if ($xqfile_info[2]!="")
  echo " - <font color=#c0c0c0>$xqfile_info[2]/文 </font>";
  $xqfile_time=explode(" ",$xqfile_info[6]);
  echo "<font color=#c0c0c0>$xqfile_time[0]</font><br>";
}   }
echo "</td>\n";
echo "</tr>\n";
echo "</table></center>\n";
if ($total_search==0)
echo"&nbsp;<img src=./images/dot1.gif>共搜索<font color=red>".$end."</font>篇文章，没有找到符合搜索条件的文章";
elseif ($total_search>0)
echo"&nbsp;<img src=./images/dot1.gif>共搜索<font color=red>".$end."</font>篇文章，搜索到个<font color=red>".$total_search."</font>符合条件";
echo "<table border=1 cellpadding=3 cellspacing=0 style='border-collapse:collapse' bordercolor=$biankuang_color width=100%>\n";
echo "<tr>\n";
echo "<td width=100% align=right class=shadow2>\n";
page_menu($totalnum);
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</td>\n";
echo "<td width=40% valign=top>\n";

/////////////////////////////本类最新文章//////////////////////////////////////////////////
echo "<table border=0 bgcolor=\"$main_color\" cellspacing=1 cellpadding=1 width=100%>\n";
echo "<tr>\n";
echo "<td width=100% bgcolor=$main_color>\n";
echo "<img src='../images/subscribe.gif' width=16 heigth=16> 本类最新文章\n";
echo "</td>\n";
echo "</tr>\n";
$file_new_sort=file("data/$searchtype".".new");
$file_new_count=count($file_new_sort)-1;
for ($i=$file_new_count;$i>=$file_new_count-$page_list_new+1;$i--) {
        $file_new_name=explode("|",$file_new_sort[$i]);
    if ( "$file_new_name[0]" && "$file_new_name[0]" != '.' && "$file_new_name[0]" != '..') {
  $file_new_array=file("data/$file_new_name[1]/$file_new_name[0].num");
  $file_new_info=explode("|",$file_new_array[0]);

     $len = strlen($file_new_info[1]);
  if ($len <= $new_hot_code)
     $title_new = $file_new_info[1];
  else
    $title_new =substr($file_new_info[1],0,$new_hot_code)."...";
echo "<tr><td align=left bgcolor=\"white\" onmouseover=\"this.bgColor='$fuse_color';\" onmouseout=\"this.bgColor='white';\">";
echo "<img src=./images/dot1.gif>&nbsp;<a target=_blank href=show.php?type=$searchtype&id=$file_new_info[0]>$title_new</a>\n";
$file_time=explode(" ",$file_new_info[6]);
echo "<font color=#c0c0c0>-$file_time[0]</font>";
echo "<br>";
echo "</td>\n";
echo "</tr>\n";
 }
}
echo "</table>\n";
echo "<br>\n";

/////////////////////本类热门文章/////////////////////////////////////////////////////////
echo "<table border=0 bgcolor=\"$main_color\" cellspacing=1 cellpadding=1 width=100%>\n";
echo "<tr>\n";
echo "<td width=100% bgcolor=$main_color>\n";
echo "<img src='../images/subscribe.gif' width=16 heigth=16> 本类热门文章\n";
echo "</td>\n";
echo "</tr>\n";
$file_new_sort=file("data/$searchtype".".hot");
$file_new_count=count($file_new_sort)-1;
for ($i=$file_new_count-$page_list_new+1;$i<=$file_new_count;$i++) {
        $file_new_name=explode("|",$file_new_sort[$i]);
    if ( "$file_new_name[0]" && "$file_new_name[0]" != '.' && "$file_new_name[0]" != '..') {
  $file_new_array=file("data/$file_new_name[1]/$file_new_name[0].num");
  $file_new_info=explode("|",$file_new_array[0]);

     $len = strlen($file_new_info[1]);
  if ($len <= $new_hot_code)
     $title_new = $file_new_info[1];
  else
    $title_new =substr($file_new_info[1],0,$new_hot_code)."...";
echo "<tr><td align=left bgcolor=\"white\" onmouseover=\"this.bgColor='$fuse_color';\" onmouseout=\"this.bgColor='white';\">";
echo "<img src=./images/dot1.gif>&nbsp;<a target=_blank href=show.php?type=$searchtype&id=$file_new_info[0]>$title_new</a>\n";
echo "<font color=#c0c0c0>阅:</font><font color=red>$file_new_info[16]/$file_new_info[17]</font>";
echo " <font color=#c0c0c0>评:$file_new_info[18]</font>";
echo "<br>";
echo "</td>\n";
echo "</tr>\n";
 }
}
echo "</table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<TR > <TD  colspan='2' vAlign=top width='100%'><P align=right class=small><A href='http://shcj.51.net'><FONTcolor=#000000>Powered by XqArt 1.08</FONT></A></P></TD></TR></TBODY></TABLE></DIV></TD></TR>";
echo "</table>\n";
require("foot.php");
############################以下为全站搜索###############################################
}else{
if ( $title and $keyword and empty($text)) {
//////////////获取分类id////////
$type_list=file("data/xq.php");
$type_list_count=count($type_list);
for ($i=0;$i<$type_list_count;$i++){
    $type_list_code =explode("|", $type_list[$i]);
    if ($type_list_code[0]=="type") {
/////////////////////////////////
    $user=file("data/$type_list_code[1]/list.php");
    $user_count=count($user);
    for ($j=0;$j<$user_count;$j++){
    $SEARCH_IDX[]=$user[$j];
    }
    }
    }
/////////////////////////////////////
$Bad_Keyword_Array = array("?", " ", "[", "]", "(", ")", "+", "\\", "|", "$");
for ($q = 0 ; $q < sizeof($Bad_Keyword_Array); $q++)
{
        if (strstr($keyword, $Bad_Keyword_Array[$q])) {
                $keyword = "";
        }
}
/////////////////////////////////////////
        $end =count($SEARCH_IDX);
        for($sss=0; $sss<=$end-1; $sss++) {
                $SEARCH_IDX_code = explode("|", $SEARCH_IDX[$sss]);
                if( is_file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].num") and is_file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].txt")) {
                        $FILES_ARRAY_DATA = file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].num");
                        $FILES_ARRAY = explode("|", $FILES_ARRAY_DATA[0]);
                                if ( eregi($keyword, $FILES_ARRAY[1])) {
                                        $IDX[] = $FILES_ARRAY[0]."|".$SEARCH_IDX_code[1];
                                }
                              }
                          }
              }
////////////////////////按照指定分类--内容搜索//////////////////////
//////////////获取分类id////////
if ( $text and $keyword and empty($title)) {
//////////////获取分类id////////
$type_list=file("data/xq.php");
$type_list_count=count($type_list)-1;
for ($i=0;$i<=$type_list_count;$i++){
    $type_list_code =explode("|", $type_list[$i]);
    if ($type_list_code[0]=="type") {
    $user=file("data/$type_list_code[1]/list.php");
    $user_count=count($user);
    for ($j=0;$j<$user_count;$j++){
    $SEARCH_IDX[]=$user[$j];}
}}
//////////////////////////////
$Bad_Keyword_Array = array("?", " ", "[", "]", "(", ")", "+", "\\", "|", "$");
for ($q = 0 ; $q < sizeof($Bad_Keyword_Array); $q++)
{
        if (strstr($keyword, $Bad_Keyword_Array[$q])) {
                $keyword = "";
        }
}
///////////////////
        $end =count($SEARCH_IDX);
        for($sss=0; $sss<=$end-1; $sss++) {
                $SEARCH_IDX_code = explode("|", $SEARCH_IDX[$sss]);
                if( is_file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].num")  and is_file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].txt")) {
                        $FILES_ARRAY_DATA = file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].txt");
                                if ( eregi($keyword, $FILES_ARRAY_DATA[0])) {
                                        $IDX[] = $SEARCH_IDX_code[0]."|".$SEARCH_IDX_code[1];
                                }
                              }
                          }
              }
/////////////////////////按照指定分类综合搜索//////////////////////
if ( $text and $keyword and $title) {
$type_list=file("data/xq.php");
$type_list_count=count($type_list)-1;
for ($i=0;$i<=$type_list_count;$i++){
    $type_list_code =explode("|", $type_list[$i]);
    if ($type_list_code[0]=="type") {
    $user=file("data/$type_list_code[1]/list.php");
    $user_count=count($user);
    for ($j=0;$j<$user_count;$j++){
    $SEARCH_IDX[]=$user[$j];}
}}
//////////////////////
$Bad_Keyword_Array = array("?", " ", "[", "]", "(", ")", "+", "\\", "|", "$");
for ($q = 0 ; $q < sizeof($Bad_Keyword_Array); $q++)
{
        if (strstr($keyword, $Bad_Keyword_Array[$q])) {
                $keyword = "";
        }
}
        $end =count($SEARCH_IDX);
        for($sss=0; $sss<=$end-1; $sss++) {
                $SEARCH_IDX_code = explode("|", $SEARCH_IDX[$sss]);
                if( is_file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].num") and is_file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].txt")) {
                        $FILES_txt_DATA = file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].txt");
                        $FILES_num_DATA = file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].num");
                        $FILES_num_code = explode("|", $FILES_num_DATA[0]);
                                if ( eregi($keyword, $FILES_num_code[1]) or eregi($keyword, $FILES_txt_DATA[0])) {
                                        $IDX[] = $SEARCH_IDX_code[0]."|".$SEARCH_IDX_code[1];
                                }
                              }
                          }
              }
$total_search=count($IDX);
$recnum = $page_list_pg;
$listnum = 10;
$totalnum = intval(($total_search)/$recnum)+1;
echo "<title>文章管理</title>\n";
echo "<center>\n";
echo "<table border=0 bgcolor=#eeeeee cellspacing=1 cellpadding=3 width=100%>\n";
echo "<tr bgcolor=#eeeeee>\n";
echo "<td class=shadow2>\n";
echo "<img src=../images/arrow2.gif>\n";
echo "<a class=shadow2 href=index.php>文章首页</a>\n";
$file_sort=file("data/"."xq.php");
$file_count=count($file_sort)-1;
$total_file=0;
for ($i=0;$i<=$file_count;$i++) {
        $file_name=explode("|",$file_sort[$i]);
        if ($file_name[0]=="type") {
        $total_file=$total_file+$file_name[4];
        $get_type_name=$get_type_name."<option value=$file_name[1]>$file_name[2]</option>\n";
        }
        else
        echo "<img src=../images/arrow5.gif heigth=16>"."&nbsp;<a class=shadow2 href=listform.php?form=$file_name[1]>$file_name[2]</a>\n";
        }

echo "</td>\n";
echo "</tr>\n";
echo "<tr bgcolor=$fuse_color walign=middle>\n";
echo "<td class=shadow2>\n";
echo ">> 欢迎光临 <a href='$web_url'>$web_title</a> 文章管理中心&nbsp;&nbsp;搜索所有版块\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<table border=0 cellpadding=10 cellspacing=0 style='border-collapse:collapse' bordercolor=$biankuang_color width=735>\n";
echo "<tr>\n";
echo "<td class=shadow2 valign=bottom>\n";
echo "<img src=../images/arrow3.gif heigth=15> 取得文章总数/搜索文章分类：<b><font color=red>$total_search</font>/$total_file</b>\n";
echo "</td>\n";
/////////////////搜索表单/////////////////////////////////////////
echo "<form method='post' action='search.php'>\n";
echo "<td align=right valign=bottom>\n";
echo "<img src='./images/search.gif' width=16 heigth=16>\n";
echo "标题<input type=checkbox name=title value='1'>\n";
echo "内容<input type=checkbox name=text value='1'>\n";
echo "<input class=border type=text name=keyword size=12 style='color:#000000; background-color:$fuse_color'>\n";
echo "<select size=1 name=searchtype style='color:#000000; border-style:solid; border-width:1; background-color:$fuse_color'>\n";
echo "<option value='all'>-=所有文章=-</option>\n";
echo $get_type_name;
echo "</select> \n";
echo "<input type=submit value=搜索 name=search class=border style='color: #000000; background-color: $main_color'>\n";
echo "</td>\n";
echo"</form>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<table border=0 cellspacing=0 style='border-collapse:collapse' width=735 height=233 cellpadding=3>\n";
echo "<tr>\n";
echo "<td width=64% valign=top>\n";

/////////////将搜索结果分页显示//////////////////////////////
echo "<table border=1 cellpadding=3 cellspacing=0 style='border-collapse:collapse' bordercolor=$biankuang_color width=100%>\n";
echo "<tr>\n";
echo "<td width=100% align=right class=shadow2>\n";
page_menu($totalnum);
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<center><table border=0 bgcolor=\"white\" cellspacing=1 cellpadding=1 width=100%>\n";
if ( !$p ) { $p = 1; }
for ($i = $total_search-(($p-1)*$recnum)-1; $i > $total_search-($p*$recnum)-1;$i--) {
  $IDX_code=explode("|",$IDX[$i]);
  if ( "$IDX[$i]" && "$IDX[$i]" != '.' && "$IDX[$i]" != '..') {
  $user=file("data/$IDX_code[1]/$IDX_code[0].num");
  $xqfile_info=explode("|",$user[0]);
   $len = strlen($xqfile_info[1]);
  if ($len <= $page_list_code)
    $title_new = $xqfile_info[1];
  else
    $title_new =substr($xqfile_info[1],0,$page_list_code)."...";
    $NO=$i+1;
  echo "<tr><td width=22 height=\"22\"align=center bgcolor=\"$fuse_color\" onmouseover=\"this.bgColor='white';\" onmouseout=\"this.bgColor='$fuse_color';\">";
  echo "$NO</td>";
  echo "<td height=\"22\" bgcolor=\"white\" onmouseover=\"this.bgColor='$fuse_color';\" onmouseout=\"this.bgColor='white';\">";
  echo "</b><a target=_blank href='show.php?type=$IDX_code[1]&id=$xqfile_info[0]'><span style=font:9pt>$title_new</span></a>";
  if (!empty($xqfile_info[5])) {
        $FILE = split("\.", $xqfile_info[5]);
        $FILE_count=count($FILE);
        $ftype = GET_FILE_TYPE($FILE[$FILE_count-1]);
echo ".<a href=\"artdown.php?type=$IDX_code[1]&id=$xqfile_info[0]\" target=blank><IMG border=0 SRC='images/file/$ftype'></a>/$xqfile_info[19]\n";
}
  if ($xqfile_info[2]!="")
  echo " - <font color=#c0c0c0>$xqfile_info[2]/文 </font>";
  $xqfile_time=explode(" ",$xqfile_info[6]);
  echo "<font color=#c0c0c0>$xqfile_time[0]</font><br>";
}   }
echo "</td>\n";
echo "</tr>\n";
echo "</table></center>\n";
if ($total_search==0)
echo"&nbsp;<img src=./images/dot1.gif>共搜索<font color=red>".$end."</font>篇文章，没有找到符合搜索条件的文章";
elseif ($total_search>0)
echo"&nbsp;<img src=./images/dot1.gif>共搜索<font color=red>".$end."</font>篇文章，搜索到个<font color=red>".$total_search."</font>符合条件";
echo "<table border=1 cellpadding=3 cellspacing=0 style='border-collapse:collapse' bordercolor=$biankuang_color width=100%>\n";
echo "<tr>\n";
echo "<td width=100% align=right class=shadow2>\n";
page_menu($totalnum);
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</td>\n";
echo "<td width=40% valign=top>\n";

/////////////////////////////本类最新文章//////////////////////////////////////////////////
echo "<table border=0 bgcolor=\"$main_color\" cellspacing=1 cellpadding=1 width=100%>\n";
echo "<tr>\n";
echo "<td width=100% bgcolor=$main_color>\n";
echo "<img src='./images/quote.gif' width=16 heigth=16> 最新文章\n";
echo "</td>\n";
echo "</tr>\n";
$file_new_sort=file("data/xq".".new");
$file_new_count=count($file_new_sort)-1;
for ($i=$file_new_count;$i>=$file_new_count-$page_list_new+1;$i--) {
        $file_new_name=explode("|",$file_new_sort[$i]);
    if ( "$file_new_name[0]" && "$file_new_name[0]" != '.' && "$file_new_name[0]" != '..') {
  $file_new_array=file("data/$file_new_name[1]/$file_new_name[0].num");
  $file_new_info=explode("|",$file_new_array[0]);
     $len = strlen($file_new_info[1]);
  if ($len <= $new_hot_code)
     $title = $file_new_info[1];
  else
    $title =substr($file_new_info[1],0,$new_hot_code)."...";
echo "<tr><td align=left bgcolor=\"white\" onmouseover=\"this.bgColor='$fuse_color';\" onmouseout=\"this.bgColor='white';\">";
echo "<img src=./images/dot1.gif width=6 heigth=9>&nbsp;<a target=_blank href=show.php?type=$file_new_name[1]&id=$file_new_info[0]>$title</a>\n";
$file_time=explode(" ",$file_new_info[6]);
echo "<font color=#c0c0c0>-$file_time[0]</font>";
echo "<br>";
echo "</td>\n";
echo "</tr>\n";
 }
}
echo "</table>\n";
echo "<br>\n";
/////////////////////////热门文章///////////////////////////////////////////
echo "<table border=0 bgcolor=\"$main_color\" cellspacing=1 cellpadding=1 width=100%>\n";
echo "<tr>\n";
echo "<td width=100% bgcolor=$main_color>\n";
echo "<img src='./images/quote.gif' width=16 heigth=16> 热门文章\n";
echo "</td>\n";
echo "</tr>\n";
$file_new_sort=file("data/xq".".hot");
$file_new_count=count($file_new_sort)-1;
for ($i=0;$i<$page_list_new;$i++) {
        $file_new_name=explode("|",$file_new_sort[$i]);
    if ( "$file_new_name[0]" && "$file_new_name[0]" != '.' && "$file_new_name[0]" != '..') {
  $file_new_array=file("data/$file_new_name[1]/$file_new_name[0].num");
  $file_new_info=explode("|",$file_new_array[0]);

     $len = strlen($file_new_info[1]);
  if ($len <= $new_hot_code)
     $title = $file_new_info[1];
  else
    $title =substr($file_new_info[1],0,$new_hot_code)."...";
echo "<tr><td align=left bgcolor=\"white\" onmouseover=\"this.bgColor='$fuse_color';\" onmouseout=\"this.bgColor='white';\">";
echo "<img src=./images/dot1.gif width=6 heigth=9>&nbsp;<a target=_blank href=show.php?type=$file_new_name[1]&id=$file_new_info[0]>$title</a>\n";
echo "<font color=#c0c0c0>阅:</font><font color=red>$file_new_info[16]/$file_new_info[17]</font>";
echo " <font color=#c0c0c0>评:$file_new_info[18]</font>";
echo "<br>";
echo "</td>\n";
echo "</tr>\n";
 }
}
echo "</table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<TR > <TD  colspan='2' vAlign=top width='100%'><P align=right class=small><A href='http://shcj.51.net/bbs'><FONTcolor=#000000>Powered by XqArt 1.08</FONT></A></P></TD></TR></TBODY></TABLE></DIV></TD></TR>";
echo "</table>\n";
require("foot.php");
}
?>