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

Annotation of /fenglin/www/show_article.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.19 - (hide annotations)
Tue Apr 1 05:24:00 2025 UTC (11 months, 2 weeks ago) by sysadm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.18: +0 -0 lines
FILE REMOVED
Rename show_article.php to view_article.php to keep consistent with /bbs/view_article.php
Fix bug of LML [article] tag

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

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