/[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.12 - (show annotations)
Sun Apr 13 05:06:12 2025 UTC (11 months ago) by sysadm
Branch: MAIN
Changes since 1.11: +0 -24 lines
Remove legacy feature

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 $sql = "SELECT SID, title FROM section_config WHERE sname = '" .
8 mysqli_real_escape_string($db_conn, $section_name) . "'";
9
10 $rs = mysqli_query($db_conn, $sql);
11 if ($rs == false)
12 {
13 echo("Query section error: " . mysqli_error($db_conn));
14 exit();
15 }
16
17 if ($row = mysqli_fetch_array($rs))
18 {
19 $sid = $row["SID"];
20 $title = $row["title"];
21 }
22 else
23 {
24 $sid = 0;
25 $title = "";
26 }
27 mysqli_free_result($rs);
28
29 if ($subtitle)
30 {
31 echo (" <tr class=title_list><td height=20 valign=bottom>" .
32 "<a href=\"/bbs/list.php?sid=$sid&ex=1\" target=_blank>" .
33 "<b>$title</b></a></td></tr>\n");
34
35 }
36 else
37 {
38 echo (" <tr class=title_bar_$style><td>" .
39 "<a class=guide href=\"/bbs/list.php?sid=$sid&ex=1\" target=_blank>" .
40 "$title&gt;&gt;</a></td></tr>\n");
41 }
42
43 echo ("<tr class=title_list><td height=8></td></tr>\n");
44
45 $sql = "SELECT AID, title FROM bbs WHERE TID = 0 AND SID = $sid AND excerption
46 AND visible ORDER BY ontop DESC, AID DESC LIMIT $num";
47
48 $rs = mysqli_query($db_conn, $sql);
49 if ($rs == false)
50 {
51 echo("Query article error: " . mysqli_error($db_conn));
52 exit();
53 }
54
55 while($row = mysqli_fetch_array($rs))
56 {
57 echo ("<tr class=title_list><td height=18>" .
58 "·<a href=\"../bbs/view_article.php?tn=portal&id=" . $row["AID"] . "\" target=_blank>" .
59 htmlspecialchars(split_line($row["title"], "", $length, 1), ENT_HTML401, 'UTF-8') .
60 "</a></td></tr>\n");
61 }
62 mysqli_free_result($rs);
63
64 echo ("<tr class=title_list><td height=8 align=right></td></tr>\n");
65 }
66
67 function load_class_list($class_name, $section_name_list, $num, $length, $style, $db_conn)
68 {
69 $sql = "SELECT CID,title FROM section_class WHERE cname = '" .
70 mysqli_real_escape_string($db_conn, $class_name) . "'";
71
72 $rs = mysqli_query($db_conn, $sql);
73 if ($rs == false)
74 {
75 echo("Query class error: " . mysqli_error($db_conn));
76 exit();
77 }
78
79 if ($row = mysqli_fetch_array($rs))
80 {
81 $cid = $row["CID"];
82 $title = $row["title"];
83 }
84 else
85 {
86 $cid = 0;
87 $title = "";
88 }
89 mysqli_free_result($rs);
90
91 echo ("<tr class=title_bar_$style><td>$title&gt;&gt;</td></tr>\n");
92
93 $sql = "SELECT sname FROM section_config WHERE CID = $cid
94 AND enable ORDER BY sort_order";
95
96 $rs = mysqli_query($db_conn, $sql);
97 if ($rs == false)
98 {
99 echo("Query section error: " . mysqli_error($db_conn));
100 exit();
101 }
102
103 while ($row = mysqli_fetch_array($rs))
104 {
105 if (in_array($row["sname"], $section_name_list))
106 {
107 load_doc_list($row["sname"], $num, $length, $style, true, $db_conn);
108 }
109 }
110 mysqli_free_result($rs);
111 }
112
113 function load_top($num, $length, $db_conn)
114 {
115 $sql = "SELECT AID, bbs.title AS title, section_config.title as s_title
116 FROM bbs INNER JOIN section_config ON bbs.SID = section_config.SID
117 WHERE section_config.recommend AND TID = 0 AND visible AND view_count >= 10
118 AND (sub_dt >= SUBDATE(NOW(), INTERVAL 7 DAY))
119 ORDER BY excerption DESC, (view_count + reply_count) DESC, transship
120 LIMIT 10";
121
122 $rs = mysqli_query($db_conn, $sql);
123 if ($rs == false)
124 {
125 echo("Query data error: " . mysqli_error($db_conn));
126 exit();
127 }
128
129 echo ("<tr><td height=8></td></tr>\n");
130
131 while ($row = mysqli_fetch_array($rs))
132 {
133 echo ("<tr><td height=18>·<a href=\"../bbs/view_article.php?tn=portal&id=" . $row["AID"] . "\" target=_blank>" .
134 htmlspecialchars(split_line("[" . $row["s_title"] . "] " . $row["title"], "", $length, 1), ENT_HTML401, 'UTF-8') .
135 "</a></td></tr>\n");
136 }
137 mysqli_free_result($rs);
138
139 echo ("<tr><td height=8></td></tr>\n");
140 }
141
142 ?>

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