| 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 |
echo (" <tr class=title_list><td height=20 valign=bottom><a href=\"/bbs/bbs.php?".
|
| 22 |
"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 |
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 |
}
|
| 35 |
mysql_free_result($rs);
|
| 36 |
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 |
}
|
| 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 |
echo (" <tr class=title_bar_$style><td><a class=guide href=\"/bbs/class.php?".
|
| 58 |
"cid=$cid\" target=_blank>$title>></a></td></tr>\n");
|
| 59 |
|
| 60 |
$rs_s=mysql_query("select sname from section_config where CID=".
|
| 61 |
$cid." and enable order by sort_order",$db_conn)
|
| 62 |
or die("Query section error!");
|
| 63 |
while ($row_s=mysql_fetch_array($rs_s))
|
| 64 |
{
|
| 65 |
if (in_array($row_s["sname"],$section_name_list))
|
| 66 |
load_doc_list($row_s["sname"],$num,$length,$style,true,$db_conn);
|
| 67 |
}
|
| 68 |
mysql_free_result($rs_s);
|
| 69 |
}
|
| 70 |
|
| 71 |
function load_top($num,$length,$db_conn)
|
| 72 |
{
|
| 73 |
gen_top_article(10,$db_conn);
|
| 74 |
|
| 75 |
$rs=mysql_query("select * from bbs_top_list limit $num",$db_conn)
|
| 76 |
or die("Query data error!");
|
| 77 |
|
| 78 |
echo ("<tr><td height=8></td></tr>\n");
|
| 79 |
while ($row=mysql_fetch_array($rs))
|
| 80 |
{
|
| 81 |
echo ("<tr><td height=18>·[".$row["section_title"].
|
| 82 |
"]<a href=\"show_article.php?aid=".
|
| 83 |
$row["AID"]."\" target=_blank>".mb_substr($row["bbs_title"],0,$length,'UTF-8')." </a></td></tr>\n");
|
| 84 |
}
|
| 85 |
echo ("<tr><td height=8></td></tr>\n");
|
| 86 |
|
| 87 |
mysql_free_result($rs);
|
| 88 |
}
|
| 89 |
|
| 90 |
function load_recommend($num,$length,$db_conn)
|
| 91 |
{
|
| 92 |
$rs=mysql_query("select AID,title".
|
| 93 |
" from bbs where TID=0 and recommend and visible".
|
| 94 |
" order by sub_dt desc limit $num",$db_conn)
|
| 95 |
or die("Query data error!");
|
| 96 |
|
| 97 |
echo ("<tr class=title_list><td height=8></td></tr>\n");
|
| 98 |
while ($row=mysql_fetch_array($rs))
|
| 99 |
{
|
| 100 |
echo ("<tr class=title_list><td height=18>·<a href=\"show_article.php?aid=".
|
| 101 |
$row["AID"]."\" target=_blank>".mb_substr($row["title"],0,$length,'UTF-8')." </a></td></tr>\n");
|
| 102 |
}
|
| 103 |
echo ("<tr class=title_list><td height=8></td></tr>\n");
|
| 104 |
|
| 105 |
mysql_free_result($rs);
|
| 106 |
}
|
| 107 |
?>
|
| 108 |
|