<?
/////////////////////////////////////////////////////
//  险情文章管理 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("config.php");
require("head.php");
require("xqfunc.php");
echo "<title>文章管理</title>\n";
echo "<center>";
echo "<table border=0 bgcolor=#eeeeee cellspacing=0 cellpadding=3 width=100%>";
echo "<tr bgcolor=#eeeeee>";
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=#003333>";
echo "<td>";
echo "</td>";
echo "<tr>";
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 width=190 valign=bottom>\n";
echo "<img src=../images/arrow3.gif heigth=15> 文章总数/文章分类：<b><font color=red>$total_file</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";
///////////// 分类列表/////////////////////////
for ($i=0;$i<=$file_count;$i++) {
        $file_name=explode("|",$file_sort[$i]);
        if ($file_name[0]=="form"){
echo "<table border=1 bordercolor=$main_color cellspacing=0 cellpadding=3 style='border-collapse:collapse' width=98%>\n";
echo "<tr>\n";
echo "<td width=5% bgcolor=$fuse_color><img src=../images/arrow6.gif width=16 heigth=16></td>\n";
echo "<td width=75% bgcolor=$main_color>\n";
echo "<b><a href=listform.php?form=$file_name[1] title='$file_name[3]'>--==".$file_name[2]."==--</a></b>\n";
echo "</td>\n";
echo "<td width=10% bgcolor=$main_color align=right>\n";
echo "专题数\n";
echo "</td>\n";
echo "<td width=10% bgcolor=$main_color align=right>\n";
echo "文章数\n";
echo "</td>\n";
echo "</tr>\n";
        for ($j=$i+1;$j<=$file_count;$j++) {
        $file_typename=explode("|",$file_sort[$j]);
        if ($file_typename[0]=="type"){
echo "<tr>\n";
echo "<td width=5%></td>\n";
echo "<td width=75% bgcolor=$fuse_color><img src=./images/minus.gif width=15 heigth=11>\n";
echo "<a class=shadow2 href=list.php?form=$file_name[1]&type=$file_typename[1]>$file_typename[2]</a>\n";
echo "<br>$file_typename[3]\n";
echo "</td>\n";
echo "<td width=10% bgcolor=$fuse_color align=center>\n";
echo $file_typename[5]."\n";
echo "</td>\n";
echo "<td width=10% bgcolor=$fuse_color align=center>\n";
echo $file_typename[4]."\n";
echo "</td>\n";
echo "</tr>\n";
        }
         if ($file_typename[0]=="form"){
         break;
         }
        }
echo "</table>\n";
echo "<br>\n";
        }
        }
echo "<a href=\"usermail.php\" ><img border=0 src=./images/email.gif width=16 heigth=16> 订阅文章 </a>";
echo "<a href=\"userput.php\" ><img border=0 src=./images/mail.gif width=16 heigth=16> 提交文章 </a>";
echo "<a href=\"usersent.php\" ><img border=0 src=./images/top.gif width=16 heigth=16> 注册用户</a>";
echo "<td width=36% 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/xq".".tui");
$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";
if (empty($file_new_info[2]))
$file_new_info[2]="未知";
echo "<font color=#c0c0c0>文:$file_new_info[2]</font>";
echo "<br>";
echo "</td>\n";
echo "</tr>\n";
 }
}
echo "</table><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/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/subscribe.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");
?>