/[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.6 - (show annotations)
Sun Apr 13 03:29:31 2025 UTC (11 months ago) by sysadm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +0 -0 lines
FILE REMOVED
Remove deprecated files

1 <?
2 require_once "../lib/common.inc.php";
3 require_once "../lib/db_open.inc.php";
4 require_once "../bbs/session_init.inc.php";
5 require_once "../lib/lml.inc.php";
6 require_once "../lib/str_process.inc.php";
7
8 $aid = (isset($_GET["id"]) ? intval($_GET["id"]) : 0);
9 $aid = (isset($_GET["aid"]) ? intval($_GET["aid"]) : $aid);
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 $BBS_name; ?> - <? echo htmlspecialchars($row["title"], ENT_HTML401, 'UTF-8'); ?> </title>
37 <link rel="stylesheet" href="css/default.css" type="text/css">
38 <style type="text/css">
39 TD.content
40 {
41 font-size: 16px;
42 line-height: 26px;
43 }
44 </style>
45 <script type="text/javascript" src="../js/img_adjust.js"></script>
46 </head>
47 <body>
48 <center>
49 <?
50 include "./head.inc.php";
51 ?>
52 <table width="760" border="0" cellpadding="0" cellspacing="0">
53 <tr height=20 bgcolor=#F3F9FC>
54 <td width="20">&nbsp;</td>
55 <td><? echo $BBS_name; ?> &gt;&gt; <? echo split_line(htmlspecialchars($row["title"], ENT_HTML401, 'UTF-8'), "", 65, 2); ?></td>
56 <td width="200" align="right">本文已被浏览<font color=red><? echo $row["view_count"]; ?></font>次</td>
57 <td width="20">&nbsp;</td>
58 </tr>
59 <tr>
60 <td colspan=4 height=1 bgcolor=gray></td>
61 </tr>
62 <tr height=5>
63 <td>&nbsp;</td>
64 </tr>
65 </table>
66 <table width="760" border="0" cellpadding="0" cellspacing="0">
67 <tr height="20">
68 <td width="5%"></td>
69 <td width="80%"></td>
70 <td width="15%"></td>
71 </tr>
72 <tr>
73 <td></td>
74 <td valign="top">
75 <table width="95%" border="0" cellpadding="0" cellspacing="0">
76 <tr height="30">
77 <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>
78 </tr>
79 <tr height="20">
80 <td align="center">(<? echo $row["sub_dt"]; ?>) <? echo ($row["transship"]?"转载":"作者"); ?>:<? echo htmlspecialchars($row["nickname"], ENT_HTML401, 'UTF-8'); ?></td>
81 </tr>
82 <tr height="10">
83 <td></td>
84 </tr>
85 <tr height="1">
86 <td align="center" bgcolor=gray></td>
87 </tr>
88 <tr height="20">
89 <td></td>
90 </tr>
91 <tr>
92 <td class="content"><? echo LML(htmlspecialchars($content, ENT_HTML401, 'UTF-8'), true, true, 70); ?></td>
93 </tr>
94 <tr>
95 <td>
96 ========== * * * * * ==========
97 <br />
98 <?
99 $rs_attachment=mysql_query("select * from upload_file where ref_AID=".
100 $row["AID"]." and deleted=0 and deny=0 order by AID")
101 or die("Read attachment error!");
102 while($row_attachment=mysql_fetch_array($rs_attachment))
103 {
104 $filename=$row_attachment["filename"];
105 $size=$row_attachment["size"];
106 $check=$row_attachment["check"];
107 $ext=strtolower(substr($filename,(strrpos($filename,".") ? strrpos($filename,".")+1 : 0)));
108 ?>
109 <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; ?>字节)
110 <? if ($check==0){?><font color=red>未审核</font><? } else { ?>
111 <br>
112 <?
113 switch ($ext)
114 {
115 case "bmp":
116 case "gif":
117 case "jpg":
118 case "jpeg":
119 case "png":
120 case "tif":
121 case "tiff":
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