/[LeafOK_CVS]/fenglin/bbs/themes/gen_ex/gen_ex_article.view.php
ViewVC logotype

Contents of /fenglin/bbs/themes/gen_ex/gen_ex_article.view.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.20 - (show annotations)
Sat Nov 1 07:53:40 2025 UTC (4 months, 2 weeks ago) by sysadm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.19: +1 -1 lines
Remove $lml_tag param from LML()

1 <?php
2 // Prevent load standalone
3 if (!isset($result_set))
4 {
5 exit();
6 }
7
8 require_once "../lib/common.inc.php";
9 require_once "../lib/lml.inc.php";
10 require_once "../lib/str_process.inc.php";
11
12 // Pre-defined color setting of article display
13 $color = array(
14 "#FAFBFC",
15 "#f0F3Fa"
16 );
17 $color_index = 0;
18
19 $section_path = ($result_set["data"]["ex_dir"] != null ? str_repeat("../", substr_count($result_set["data"]["ex_dir"], "/")) : "");
20
21 $title = htmlspecialchars($result_set["data"]["title"], ENT_HTML401, 'UTF-8');
22
23 $ex_dir_link = "";
24 if ($result_set["data"]["ex_dir"] != null)
25 {
26 $ex_dir_link = <<<HTML
27 &gt;&gt;<a href="index.html">{$result_set["data"]["ex_name"]}</a>
28 HTML;
29 }
30
31 echo <<<HTML
32 <html>
33 <head>
34 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
35 <base href="/gen_ex/{$result_set['data']['sid']}/{$result_set['data']['ex_dir']}{$result_set['data']['id']}.html" />
36 <title>{$title}</title>
37 <link rel="stylesheet" href="{$section_path}../article.css" type="text/css">
38 <style type="text/css">
39 SPAN.title_normal
40 {
41 color: #909090;
42 }
43 TD.content_normal
44 {
45 font-size: 16px;
46 }
47 TD.copyright
48 {
49 font-size: 14px;
50 color: gray;
51 }
52 IMG.auto_adjust
53 {
54 display: none;
55 }
56 </style>
57 <script src="{$section_path}../../js/jquery.min.js"></script>
58 <script type="text/javascript">
59 $(document).ready(function() {
60 $("img[class=auto_adjust]").on("load", function() {
61 if ($(this).width() > {$BBS_img_max_width})
62 {
63 $(this).width({$BBS_img_max_width});
64 }
65 $(this).show();
66 })
67 .on("mousewheel", function(e) {
68 var zoom = parseFloat($(this).css("zoom"));
69 zoom *= (1 + e.originalEvent.wheelDelta / 1000);
70 if (zoom > 0)
71 {
72 $(this).css("zoom", zoom);
73 }
74 });
75 });
76 </script>
77 </head>
78 <body>
79 <a name="top"></a>
80 <center>
81 <table border="0" cellpadding="0" cellspacing="0" width="1050">
82 <tr>
83 <td>
84 <a href="{$section_path}../index.html">{$BBS_name}精华区</a>&gt;&gt;<a href="{$section_path}index.html">{$result_set["data"]["section_title"]}</a>{$ex_dir_link}
85 </td>
86 </tr>
87 <tr bgcolor="#d0d3F0" height="25">
88 <td align="center" class="title">
89 [{$result_set["data"]["id"]}]&nbsp;主题:&nbsp;{$title}
90 </td>
91 </tr>
92 </table>
93 HTML;
94
95 foreach ($result_set["data"]["articles"] as $article)
96 {
97 $color_index = ($color_index + 1) % count($color);
98
99 $username = htmlspecialchars($article["username"], ENT_HTML401, 'UTF-8');
100 $nickname = htmlspecialchars($article["nickname"], ENT_HTML401, 'UTF-8');
101 $title_f = split_line(htmlspecialchars($article["title"], ENT_HTML401, 'UTF-8'), "", 65, 2, "<br />");
102 $content_f = LML($article["content"], 80);
103
104 $transship_info = "";
105 if ($article["transship"])
106 {
107 $transship_info = <<<HTML
108 <font color="red">[转载]</font>
109 HTML;
110 }
111
112 if ($article["tid"] != 0)
113 {
114 echo <<<HTML
115 <a name="{$article['aid']}"></a>
116 <table border="0" cellpadding="0" cellspacing="0" width="1050">
117 <tr height="1" bgcolor="#202020">
118 <td>
119 </td>
120 </tr>
121 </table>
122 HTML;
123 }
124
125 $atta_list = "";
126 foreach ($article["attachments"] as $attachment)
127 {
128 if (!$attachment["check"])
129 {
130 continue;
131 }
132
133 $filename = $attachment["filename"];
134 $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
135
136 if (!copy("../bbs/upload/" . $attachment["aid"], "../gen_ex/attachment/" . $attachment["aid"] . ".$ext"))
137 {
138 continue;
139 }
140
141 $atta_list .= <<<HTML
142 <a class="s2" href="{$section_path}../attachment/{$attachment['aid']}.$ext" target="_blank">{$filename}</a> ({$attachment["size"]}字节)
143 HTML;
144
145 switch ($ext)
146 {
147 case "bmp":
148 case "gif":
149 case "jpg":
150 case "jpeg":
151 case "png":
152 case "tif":
153 case "tiff":
154 $atta_list .= <<<HTML
155 <br />
156 <img class="auto_adjust" src="{$section_path}../attachment/{$attachment['aid']}.$ext">
157 HTML;
158 break;
159 }
160
161 $atta_list .= <<<HTML
162 <br />
163 HTML;
164 }
165
166 echo <<<HTML
167 <table bgcolor="{$color[$color_index]}" border="0" cellpadding="0" cellspacing="10" width="1050">
168 <tr>
169 <td width="5%">
170 </td>
171 <td width="90%" class="body">
172 <span style="color: #606060">作者:</span>&nbsp;<span style="color: #909090">{$username} ({$nickname})</span>
173 </td>
174 <td width="5%">
175 </td>
176 </tr>
177 <tr>
178 <td>
179 </td>
180 <td class="body">
181 <span style="color: #606060">标题:</span>
182 <img src="{$section_path}../../bbs/images/expression/{$article['icon']}.gif">
183 <span class="title_normal">
184 {$title_f}
185 </span>
186 {$transship_info}
187 </td>
188 <td>
189 </td>
190 </tr>
191 <tr>
192 <td>
193 </td>
194 <td class="body">
195 <span style="color: #606060">来自:</span>&nbsp;<span style="color: #909090">{$article["sub_ip"]}</span>
196 </td>
197 <td>
198 </td>
199 </tr>
200 <tr>
201 <td>
202 </td>
203 <td class="body">
204 <span style="color: #606060">发贴时间:</span>&nbsp;<span style="color: #909090">{$article["sub_dt"]->format("Y年m月d日 H:i:s (\U\T\C P)")}</span>
205 </td>
206 <td>
207 </td>
208 </tr>
209 <tr>
210 <td>
211 </td>
212 <td class="body">
213 <span style="color: #606060">长度:</span>&nbsp;<span style="color: #909090">{$article["length"]}字</span>
214 </td>
215 <td>
216 </td>
217 </tr>
218 <tr height="2">
219 <td>
220 </td>
221 <td style="background-color: #909090">
222 </td>
223 <td>
224 </td>
225 </tr>
226 <tr>
227 <td>
228 </td>
229 <td class="content_normal">
230 <pre>{$content_f}</pre>
231 </td>
232 <td>
233 </td>
234 </tr>
235 <tr>
236 <td>
237 </td>
238 <td style="color: #000000">
239 ========== * * * * * ==========
240 <br>
241 {$atta_list}
242 </td>
243 <td>
244 </td>
245 </tr>
246 </table>
247 HTML;
248 }
249
250 $current_tm = (new DateTimeImmutable())->format("Y-m-d H:i:s (\U\T\C P)");
251
252 // Calculate executing durations
253 $page_exec_duration = round((microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"]) * 1000, 2);
254
255 echo <<<HTML
256 <table border="0" cellpadding="5" cellspacing="0" width="1050">
257 <tr bgcolor="#d0d3F0" height="10">
258 <td>
259 </td>
260 </tr>
261 <tr>
262 <td>
263 <a href="index.html">上级目录</a>
264 </td>
265 </tr>
266 <tr height="10">
267 <td>
268 </td>
269 </tr>
270 <tr>
271 <td class="copyright" align="center">
272 Copyright &copy; {$BBS_copyright_duration} {$BBS_name}({$BBS_host_name}) All Rights Reserved<br />
273 页面生成于{$current_tm},使用{$page_exec_duration}毫秒
274 </td>
275 </tr>
276 </table>
277 </center>
278 </body>
279 </html>
280 HTML;

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