/[LeafOK_CVS]/fenglin/www/load_doc_list.inc.php
ViewVC logotype

Contents of /fenglin/www/load_doc_list.inc.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations)
Tue Apr 1 05:23:05 2025 UTC (11 months, 2 weeks ago) by sysadm
Branch: MAIN
Changes since 1.8: +3 -3 lines
Update URL parameter

1 <?
2 require_once "../lib/str_process.inc.php";
3 ?>
4 <?
5 function load_doc_list($section_name,$num,$length,$style,$subtitle,$db_conn)
6 {
7 $rs=mysql_query("select SID, title from section_config where sname=".
8 "'$section_name'",$db_conn)
9 or die("Query section error!");
10 if ($row=mysql_fetch_array($rs))
11 {
12 $sid=$row["SID"];
13 $title=$row["title"];
14 }
15 else
16 {
17 $sid=0;
18 $title="";
19 }
20 mysql_free_result($rs);
21 if ($subtitle)
22 echo (" <tr class=title_list><td height=20 valign=bottom><a href=\"/bbs/bbs.php?".
23 "sid=$sid&switch_view=ex\" target=_blank><b>$title</b></a></td></tr>\n");
24 else
25 echo (" <tr class=title_bar_$style><td><a class=guide href=\"/bbs/bbs.php?".
26 "sid=$sid&switch_view=ex\" target=_blank>$title&gt;&gt;</a></td></tr>\n");
27 echo ("<tr class=title_list><td height=8></td></tr>\n");
28 $rs=mysql_query("select AID,title from bbs where TID=0 and SID=$sid and excerption".
29 " and visible order by ontop desc, AID desc limit $num")
30 or die("Query article error!");
31 while($row=mysql_fetch_array($rs))
32 {
33 echo ("<tr class=title_list><td height=18>·<a href=\"view_article.php?id=".
34 $row["AID"]."\" target=_blank>".htmlspecialchars(split_line($row["title"], "", $length, 1), ENT_HTML401, 'UTF-8')." </a></td></tr>\n");
35 }
36 mysql_free_result($rs);
37 echo ("<tr class=title_list><td height=8 align=right><a href=\"rss.php?sid=$sid\"".
38 " target=_blank><img src=\"images/xml.gif\" border=0></a></td></tr>\n");
39 }
40
41 function load_class_list($class_name,$section_name_list,$num,$length,$style,$db_conn)
42 {
43 $rs=mysql_query("select CID,title from section_class where cname=".
44 "'$class_name'",$db_conn)
45 or die("Query class error!");
46 if ($row=mysql_fetch_array($rs))
47 {
48 $cid=$row["CID"];
49 $title=$row["title"];
50 }
51 else
52 {
53 $cid=0;
54 $title="";
55 }
56 mysql_free_result($rs);
57
58 echo (" <tr class=title_bar_$style><td>$title&gt;&gt;</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 $sql = "SELECT AID, bbs.title AS title, section_config.title as s_title
74 FROM bbs INNER JOIN section_config ON bbs.SID = section_config.SID
75 WHERE section_config.recommend AND TID = 0 AND visible AND view_count >= 10
76 AND (sub_dt >= SUBDATE(NOW(), INTERVAL '7' DAY))
77 ORDER BY excerption DESC, (view_count + reply_count) DESC, transship
78 LIMIT 10";
79
80 $rs = mysqli_query($db_conn, $sql);
81 if ($rs == false)
82 {
83 echo("Query data error: " . mysqli_error($db_conn));
84 exit();
85 }
86
87 echo ("<tr><td height=8></td></tr>\n");
88 while ($row = mysqli_fetch_array($rs))
89 {
90 echo ("<tr><td height=18>·<a href=\"view_article.php?id=".
91 $row["AID"]."\" target=_blank>" .
92 htmlspecialchars(split_line("[" . $row["s_title"] . "] " . $row["title"], "", $length, 1), ENT_HTML401, 'UTF-8') .
93 " </a></td></tr>\n");
94 }
95 echo ("<tr><td height=8></td></tr>\n");
96
97 mysqli_free_result($rs);
98 }
99
100 function load_recommend($num, $length, $db_conn)
101 {
102 $rs=mysql_query("select AID,title".
103 " from bbs where TID=0 and recommend and visible".
104 " order by sub_dt desc limit $num", $db_conn)
105 or die("Query data error!");
106
107 echo ("<tr class=title_list><td height=8></td></tr>\n");
108 while ($row=mysql_fetch_array($rs))
109 {
110 echo ("<tr class=title_list><td height=18>·<a href=\"view_article.php?id=".
111 $row["AID"]."\" target=_blank>" .
112 htmlspecialchars(split_line($row["title"], "", $length, 1), ENT_HTML401, 'UTF-8') .
113 " </a></td></tr>\n");
114 }
115 echo ("<tr class=title_list><td height=8></td></tr>\n");
116
117 mysql_free_result($rs);
118 }
119 ?>

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1