| 1 |
sysadm |
1.1 |
<?
|
| 2 |
|
|
require_once "./gen_top.inc.php";
|
| 3 |
|
|
|
| 4 |
|
|
function load_doc_list($section_name,$num,$length,$style,$subtitle,$db_conn)
|
| 5 |
|
|
{
|
| 6 |
|
|
$rs=mysql_query("select SID,title from section_config where sname=".
|
| 7 |
|
|
"'$section_name'",$db_conn)
|
| 8 |
|
|
or die("Query section error!");
|
| 9 |
|
|
if ($row=mysql_fetch_array($rs))
|
| 10 |
|
|
{
|
| 11 |
|
|
$sid=$row["SID"];
|
| 12 |
|
|
$title=$row["title"];
|
| 13 |
|
|
}
|
| 14 |
|
|
else
|
| 15 |
|
|
{
|
| 16 |
|
|
$sid=0;
|
| 17 |
|
|
$title="";
|
| 18 |
|
|
}
|
| 19 |
|
|
mysql_free_result($rs);
|
| 20 |
|
|
if ($subtitle)
|
| 21 |
sysadm |
1.2 |
echo (" <tr class=title_list><td height=20 valign=bottom><a href=\"/bbs/bbs.php?".
|
| 22 |
sysadm |
1.1 |
"sid=$sid&switch_view=ex\" target=_blank><b>$title</b></a></td></tr>\n");
|
| 23 |
|
|
else
|
| 24 |
|
|
echo (" <tr class=title_bar_$style><td><a class=guide href=\"/bbs/bbs.php?".
|
| 25 |
|
|
"sid=$sid&switch_view=ex\" target=_blank>$title>></a></td></tr>\n");
|
| 26 |
|
|
echo ("<tr class=title_list><td height=8></td></tr>\n");
|
| 27 |
|
|
$rs=mysql_query("select AID,title from bbs where TID=0 and SID=$sid and excerption".
|
| 28 |
|
|
" and visible order by ontop desc, AID desc limit $num")
|
| 29 |
|
|
or die("Query article error!");
|
| 30 |
|
|
while($row=mysql_fetch_array($rs))
|
| 31 |
|
|
{
|
| 32 |
sysadm |
1.3 |
echo ("<tr class=title_list><td height=18>·<a href=\"show_article.php?aid=".
|
| 33 |
|
|
$row["AID"]."\" target=_blank>".mb_substr($row["title"],0,$length,'UTF-8')." </a></td></tr>\n");
|
| 34 |
sysadm |
1.1 |
}
|
| 35 |
|
|
mysql_free_result($rs);
|
| 36 |
sysadm |
1.2 |
echo ("<tr class=title_list><td height=8 align=right><a href=\"rss.php?sid=$sid\"".
|
| 37 |
|
|
" target=_blank><img src=\"images/xml.gif\" border=0></a></td></tr>\n");
|
| 38 |
sysadm |
1.1 |
}
|
| 39 |
|
|
|
| 40 |
|
|
function load_class_list($class_name,$section_name_list,$num,$length,$style,$db_conn)
|
| 41 |
|
|
{
|
| 42 |
|
|
$rs=mysql_query("select CID,title from section_class where cname=".
|
| 43 |
|
|
"'$class_name'",$db_conn)
|
| 44 |
|
|
or die("Query class error!");
|
| 45 |
|
|
if ($row=mysql_fetch_array($rs))
|
| 46 |
|
|
{
|
| 47 |
|
|
$cid=$row["CID"];
|
| 48 |
|
|
$title=$row["title"];
|
| 49 |
|
|
}
|
| 50 |
|
|
else
|
| 51 |
|
|
{
|
| 52 |
|
|
$cid=0;
|
| 53 |
|
|
$title="";
|
| 54 |
|
|
}
|
| 55 |
|
|
mysql_free_result($rs);
|
| 56 |
|
|
|
| 57 |
sysadm |
1.4 |
echo (" <tr class=title_bar_$style><td>$title>></td></tr>\n");
|
| 58 |
sysadm |
1.1 |
|
| 59 |
|
|
$rs_s=mysql_query("select sname from section_config where CID=".
|
| 60 |
|
|
$cid." and enable order by sort_order",$db_conn)
|
| 61 |
|
|
or die("Query section error!");
|
| 62 |
|
|
while ($row_s=mysql_fetch_array($rs_s))
|
| 63 |
|
|
{
|
| 64 |
|
|
if (in_array($row_s["sname"],$section_name_list))
|
| 65 |
|
|
load_doc_list($row_s["sname"],$num,$length,$style,true,$db_conn);
|
| 66 |
|
|
}
|
| 67 |
|
|
mysql_free_result($rs_s);
|
| 68 |
|
|
}
|
| 69 |
|
|
|
| 70 |
|
|
function load_top($num,$length,$db_conn)
|
| 71 |
|
|
{
|
| 72 |
|
|
gen_top_article(10,$db_conn);
|
| 73 |
|
|
|
| 74 |
|
|
$rs=mysql_query("select * from bbs_top_list limit $num",$db_conn)
|
| 75 |
|
|
or die("Query data error!");
|
| 76 |
|
|
|
| 77 |
|
|
echo ("<tr><td height=8></td></tr>\n");
|
| 78 |
|
|
while ($row=mysql_fetch_array($rs))
|
| 79 |
|
|
{
|
| 80 |
sysadm |
1.3 |
echo ("<tr><td height=18>·[".$row["section_title"].
|
| 81 |
sysadm |
1.1 |
"]<a href=\"show_article.php?aid=".
|
| 82 |
sysadm |
1.3 |
$row["AID"]."\" target=_blank>".mb_substr($row["bbs_title"],0,$length,'UTF-8')." </a></td></tr>\n");
|
| 83 |
sysadm |
1.1 |
}
|
| 84 |
|
|
echo ("<tr><td height=8></td></tr>\n");
|
| 85 |
|
|
|
| 86 |
|
|
mysql_free_result($rs);
|
| 87 |
|
|
}
|
| 88 |
|
|
|
| 89 |
|
|
function load_recommend($num,$length,$db_conn)
|
| 90 |
|
|
{
|
| 91 |
|
|
$rs=mysql_query("select AID,title".
|
| 92 |
|
|
" from bbs where TID=0 and recommend and visible".
|
| 93 |
|
|
" order by sub_dt desc limit $num",$db_conn)
|
| 94 |
|
|
or die("Query data error!");
|
| 95 |
|
|
|
| 96 |
|
|
echo ("<tr class=title_list><td height=8></td></tr>\n");
|
| 97 |
|
|
while ($row=mysql_fetch_array($rs))
|
| 98 |
|
|
{
|
| 99 |
sysadm |
1.3 |
echo ("<tr class=title_list><td height=18>·<a href=\"show_article.php?aid=".
|
| 100 |
|
|
$row["AID"]."\" target=_blank>".mb_substr($row["title"],0,$length,'UTF-8')." </a></td></tr>\n");
|
| 101 |
sysadm |
1.1 |
}
|
| 102 |
|
|
echo ("<tr class=title_list><td height=8></td></tr>\n");
|
| 103 |
|
|
|
| 104 |
|
|
mysql_free_result($rs);
|
| 105 |
|
|
}
|
| 106 |
|
|
?>
|
| 107 |
|
|
|