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

Contents of /fenglin/www/view_article.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations)
Sat Apr 5 04:13:45 2025 UTC (11 months, 1 week ago) by sysadm
Branch: MAIN
Changes since 1.2: +1 -5 lines
Refine JS

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

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