/[LeafOK_CVS]/fenglin/www/show_article.php
ViewVC logotype

Contents of /fenglin/www/show_article.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations)
Fri Mar 28 10:31:47 2025 UTC (11 months, 2 weeks ago) by sysadm
Branch: MAIN
Changes since 1.14: +5 -4 lines
Fix bug of long string display

1 <?
2 require_once "../lib/db_open.inc.php";
3 require_once "../lib/lml.inc.php";
4 require_once "../lib/str_process.inc.php";
5
6 if (isset($_GET["aid"]))
7 $aid=intval($_GET["aid"]);
8 else
9 $aid=0;
10
11 $rs=mysql_query("select * from bbs where AID=$aid and ".
12 "TID=0 and visible and SID>0 limit 1")
13 or die("Query article error!");
14 if ($row=mysql_fetch_array($rs))
15 {
16 mysql_query("update bbs set view_count=view_count+1 where AID=".$row["AID"])
17 or die("Update article error!");
18 $rs_content=mysql_query("select content from bbs_content where CID=".$row["CID"])
19 or die("Read content error!");
20 if($row_content=mysql_fetch_array($rs_content))
21 $content=$row_content["content"];
22 else
23 $content="";
24 mysql_free_result($rs_content);
25 }
26 else
27 {
28 echo ("文章不存在!");
29 exit();
30 }
31 mysql_free_result($rs);
32 ?>
33 <html>
34 <head>
35 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
36 <title>枫林在线 - <? echo $row["title"]; ?> </title>
37 <link rel="stylesheet" href="css/default.css" type="text/css">
38 <style type="text/css">
39
40 TD.content
41 {
42 font-size: 16px;
43 line-height: 26px;
44 }
45
46 </style>
47
48 <script language="JavaScript" src="/js/imageszoom.js"></script>
49 </head>
50
51 <body>
52 <center>
53 <?
54 include "./head.inc.php";
55 ?>
56 <table width="760" border="0" cellpadding="0" cellspacing="0">
57 <tr height=20 bgcolor=#F3F9FC>
58 <td width="20">&nbsp;</td>
59 <td>枫林在线 &gt;&gt; <? echo split_line(htmlspecialchars($row["title"], ENT_HTML401, 'UTF-8'), "", 65, 2); ?></td>
60 <td width="200" align="right">本文已被浏览<font color=red><? echo $row["view_count"]; ?></font>次</td>
61 <td width="20">&nbsp;</td>
62 </tr>
63 <tr>
64 <td colspan=4 height=1 bgcolor=gray></td>
65 </tr>
66 <tr height=5>
67 <td>&nbsp;</td>
68 </tr>
69 </table>
70 <table width="760" border="0" cellpadding="0" cellspacing="0">
71 <tr height="20">
72 <td width="5%"></td>
73 <td width="80%"></td>
74 <td width="15%"></td>
75 </tr>
76 <tr>
77 <td></td>
78 <td valign="top">
79 <table width="95%" border="0" cellpadding="0" cellspacing="0">
80 <tr height="30">
81 <td align="center"><font size=4><b><? echo split_line(htmlspecialchars($row["title"], ENT_HTML401, 'UTF-8'), "", 65, 2); ?></b></font> <font color=gray>[<? echo ($row["transship"]?"转载":"原创"); ?>]</font></td>
82 </tr>
83 <tr height="20">
84 <td align="center">(<? echo $row["sub_dt"]; ?>) <? echo ($row["transship"]?"转载":"作者"); ?>:<? echo htmlspecialchars($row["nickname"], ENT_HTML401, 'UTF-8'); ?></td>
85 </tr>
86 <tr height="10">
87 <td></td>
88 </tr>
89 <tr height="1">
90 <td align="center" bgcolor=gray></td>
91 </tr>
92 <tr height="20">
93 <td></td>
94 </tr>
95 <tr>
96 <td class="content"><? echo LML(htmlspecialchars($content, ENT_HTML401, 'UTF-8'), true); ?></td>
97 </tr>
98 <tr>
99 <td>
100 ========== * * * * * ==========
101 <br />
102 <?
103 $rs_attachment=mysql_query("select * from upload_file where ref_AID=".
104 $row["AID"]." and deleted=0 and deny=0 order by AID")
105 or die("Read attachment error!");
106 while($row_attachment=mysql_fetch_array($rs_attachment))
107 {
108 $filename=$row_attachment["filename"];
109 $size=$row_attachment["size"];
110 $check=$row_attachment["check"];
111 $ext=strtolower(substr($filename,(strrpos($filename,".") ? strrpos($filename,".")+1 : 0)));
112 ?>
113 <img src="images/dl.gif"><a class="s2" href="/bbs/dl_file.php?aid=<? echo $row_attachment["AID"]; ?>" target="_target"><? echo $filename; ?></a> (<? echo $size; ?>字节)
114 <? if ($check==0){?><font color=red>未验证</font><? } else { ?>
115 <br>
116 <?
117 switch ($ext)
118 {
119 case "bmp":
120 case "gif":
121 case "jpg":
122 case "jpeg":
123 ?>
124 <img onmousewheel="return bbs_img_zoom(event, this)" src="/bbs/dl_file.php?aid=<? echo $row_attachment["AID"]; ?>">
125 <?
126 break;
127 }
128 ?>
129 <? } ?>
130 <br>
131 <?
132 }
133 mysql_free_result($rs_attachment);
134 ?>
135 </td>
136 </tr>
137 <tr height="20">
138 <td>
139 </td>
140 </tr>
141 <tr height="20">
142 <td align="right">
143 已有<font color=red><? echo $row["reply_count"]; ?></font>人发表评论
144 </td>
145 </tr>
146 <tr height="10">
147 <td>
148 </td>
149 </tr>
150 <tr>
151 <td align="right">
152 【<a href="/bbs/view_article.php?id=<? echo $aid; ?>" >相关评论</a>】
153 【<a href="javascript:self.close();" >关闭窗口</a>】
154 </td>
155 </tr>
156 </table>
157 </td>
158 <td valign="top">
159 <script type="text/javascript">
160 google_ad_client = "ca-pub-3013347141025996";
161 google_ad_slot = "1068955943";
162 google_ad_width = 120;
163 google_ad_height = 600;
164 </script>
165 <!-- fenglin_content_right -->
166 <script type="text/javascript"
167 src="//pagead2.googlesyndication.com/pagead/show_ads.js">
168 </script>
169 </td>
170 </tr>
171 <tr height="20">
172 <td></td>
173 </tr>
174 </table>
175 <?
176 mysql_close($db_conn);
177 include "./foot.inc.php";
178 ?>
179 </center>
180 </body>
181 </html>

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