/[LeafOK_CVS]/fenglin/bbs/themes/portal/view_article.view.php
ViewVC logotype

Annotation of /fenglin/bbs/themes/portal/view_article.view.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (hide annotations)
Sun Apr 27 02:35:47 2025 UTC (10 months, 2 weeks ago) by sysadm
Branch: MAIN
Changes since 1.9: +1 -1 lines
Refine

1 sysadm 1.7 <?php
2 sysadm 1.1 // Prevent load standalone
3     if (!isset($result_set))
4     {
5     exit();
6     }
7    
8     require_once "../lib/lml.inc.php";
9     require_once "../lib/str_process.inc.php";
10     require_once "./user_level.inc.php";
11    
12     $article = $result_set["data"]["articles"][0];
13 sysadm 1.9
14     $title = htmlspecialchars($result_set["data"]["title"], ENT_HTML401, 'UTF-8');
15    
16     $css_file = get_theme_file('css/default');
17    
18     echo <<<HTML
19     <html>
20     <head>
21     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
22     <title>{$BBS_name} - {$title}</title>
23     <link rel="stylesheet" href="{$css_file}" type="text/css">
24     <style type="text/css">
25     TD.content
26     {
27     font-size: 16px;
28     line-height: 26px;
29     }
30     </style>
31     <script type="text/javascript" src="../js/img_adjust.js"></script>
32     <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3013347141025996" crossorigin="anonymous">
33     </script>
34     </head>
35     <body>
36     <center>
37     HTML;
38    
39 sysadm 1.1 include "../www/head.inc.php";
40 sysadm 1.9
41     $title_f = split_line(htmlspecialchars($result_set["data"]["title"], ENT_HTML401, 'UTF-8'), "", 70, 2, "<br />");
42     $transship_info = ($article["transship"] ? "转载" : "原创");
43     $author_type = ($article["transship"] ? "转载" : "作者");
44     $nickname = htmlspecialchars($article["nickname"], ENT_HTML401, 'UTF-8');
45     $content_f = LML(htmlspecialchars($article["content"], ENT_HTML401, 'UTF-8'), true, true, 110);
46    
47     $atta_list = "";
48     foreach ($article["attachments"] as $attachment)
49     {
50     if (!$attachment["check"])
51     {
52     continue;
53     }
54    
55     $filename = $attachment["filename"];
56    
57     $atta_list .= <<<HTML
58     <img src="../www/images/dl.gif"><a class="s2" href="../bbs/dl_file.php?aid={$attachment['aid']}" target="_target">{$filename}</a> ({$attachment["size"]}字节)
59     HTML;
60    
61 sysadm 1.10 $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
62 sysadm 1.9 switch ($ext)
63 sysadm 1.1 {
64 sysadm 1.9 case "bmp":
65     case "gif":
66     case "jpg":
67     case "jpeg":
68     case "png":
69     case "tif":
70     case "tiff":
71     $atta_list .= <<<HTML
72     <br />
73     <img onmousewheel="return bbs_img_zoom(event, this)" src="../bbs/dl_file.php?aid={$attachment['aid']}">
74     HTML;
75     break;
76     }
77    
78     $atta_list .= <<<HTML
79 sysadm 1.1 <br />
80 sysadm 1.9 HTML;
81     }
82    
83     echo <<<HTML
84     <table width="1050" border="0" cellpadding="0" cellspacing="0">
85     <tr height=20 bgcolor=#F3F9FC>
86     <td width="20">&nbsp;</td>
87     <td>{$BBS_name} &gt;&gt; {$title}</td>
88     <td width="200" align="right">本文已被浏览<font color=red>{$result_set["data"]["view_count"]}</font>次</td>
89     <td width="20">&nbsp;</td>
90     </tr>
91     <tr>
92     <td colspan="4" height="1" bgcolor="gray"></td>
93     </tr>
94     <tr height="5">
95     <td>&nbsp;</td>
96     </tr>
97     </table>
98     <table width="1050" border="0" cellpadding="0" cellspacing="0">
99     <tr height="25">
100     <td width="5%"></td>
101     <td width="90%"></td>
102     <td width="5%"></td>
103     </tr>
104     <tr>
105     <td></td>
106     <td>
107     <table width="100%" border="0" cellpadding="0" cellspacing="0">
108     <tr height="30">
109     <td align="center"><font size="4"><b>{$title_f}</b></font> <font color="gray">[{$transship_info}]</font></td>
110     </tr>
111     <tr height="25">
112     <td align="center">({$article["sub_dt"]->format("Y-m-d H:i:s")}) {$author_type}:{$nickname}</td>
113     </tr>
114     <tr height="10">
115     <td></td>
116     </tr>
117     <tr height="1">
118     <td align="center" bgcolor="gray"></td>
119     </tr>
120     <tr height="25">
121     <td></td>
122     </tr>
123     <tr>
124     <td class="content">
125     <pre>{$content_f}</pre>
126     </td>
127     </tr>
128     <tr>
129     <td>
130     <br />
131     {$atta_list}
132     </td>
133     </tr>
134     <tr height="25">
135     <td>
136     </td>
137     </tr>
138     <tr height="25">
139     <td align="right">
140     已有<font color="red">{$result_set["data"]["reply_count"]}</font>人发表评论
141     </td>
142     </tr>
143     <tr height="10">
144     <td>
145     </td>
146     </tr>
147     <tr>
148     <td align="right">
149     【<a href="../bbs/view_article.php?id={$result_set['data']['id']}">查看回复</a>】
150     </td>
151     </tr>
152     </table>
153     </td>
154     <td>
155     </td>
156     </tr>
157     <tr height="25">
158     <td></td>
159     </tr>
160     </table>
161     HTML;
162    
163 sysadm 1.1 include "../www/foot.inc.php";
164 sysadm 1.9
165     echo <<<HTML
166     </center>
167     </body>
168     </html>
169     HTML;
170 sysadm 1.1 ?>

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