/[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.14 - (show annotations)
Mon Apr 14 05:09:58 2025 UTC (11 months ago) by sysadm
Branch: MAIN
Changes since 1.13: +1 -1 lines
Update page layout

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

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