/[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.13 - (show annotations)
Wed Mar 26 07:09:36 2025 UTC (11 months, 3 weeks ago) by sysadm
Branch: MAIN
Changes since 1.12: +3 -3 lines
Fix bug, replace mb_strlen() with str_length()

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

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