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

Contents of /fenglin/www/journal.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations)
Fri Jul 28 11:45:21 2023 UTC (2 years, 7 months ago) by sysadm
Branch: MAIN
Changes since 1.6: +14 -11 lines
1. Replace strftime with date for PHP 8.x compatibility
2. Fix bug of loading relies in article list
3. Other minor fix

1 <?
2 if (isset($_GET["jid"]))
3 $jid=intval($_GET["jid"]);
4 else
5 $jid=0;
6 if (isset($_GET["uid"]))
7 $uid=intval($_GET["uid"]);
8 else
9 $uid=0;
10 if (isset($_GET["as_email"]))
11 $base_url="http://www.fenglin.info";
12 else
13 $base_url="";
14
15 $sql_charset="utf8";
16
17 $db_conn=include "./db_open.inc.php";
18
19 $rs=mysql_query("select * from journal_index where JID=$jid and enable")
20 or die("Query journal_index error!");
21 if ($row=mysql_fetch_array($rs))
22 {
23 $dt=$row["dt"];
24 }
25 else
26 {
27 echo ("Journal ID not exists!");
28 exit();
29 }
30 mysql_free_result($rs);
31
32 $f_section_list="-1,";
33 if ($uid==0)
34 {
35 $rs=mysql_query("select SID from section_config where enable")
36 or die("Query section_config error!");
37 }
38 else
39 {
40 $rs=mysql_query("select SID,UID from section_favorite where UID=$uid")
41 or die("Query section_favorite error!");
42 if (mysql_num_rows($rs)==0)
43 {
44 mysql_free_result($rs);
45 $rs=mysql_query("select SID from section_config where enable")
46 or die("Query section_config error!");
47 }
48 }
49 while($row=mysql_fetch_array($rs))
50 {
51 $f_section_list=$f_section_list.$row["SID"].",";
52 }
53 mysql_free_result($rs);
54 $f_section_list=substr($f_section_list,0,strlen($f_section_list)-1);
55
56 $section_list="-1,";
57 $rs=mysql_query("select SID from journal_data inner join bbs on journal_data.AID=bbs.AID".
58 " where journal_data.JID=$jid and bbs.SID in ($f_section_list)")
59 or die("Query journal_data error!");
60 while($row=mysql_fetch_array($rs))
61 {
62 $section_list=$section_list.$row["SID"].",";
63 }
64 mysql_free_result($rs);
65 $section_list=substr($section_list,0,strlen($section_list)-1);
66
67 $class_list="-1,";
68 $rs=mysql_query("select CID from section_config where SID in ($section_list) and enable")
69 or die("Query section_config error!");
70 while($row=mysql_fetch_array($rs))
71 {
72 $class_list=$class_list.$row["CID"].",";
73 }
74 mysql_free_result($rs);
75 $class_list=substr($class_list,0,strlen($class_list)-1);
76 ?>
77 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
78 <html>
79 <head>
80 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
81 <title>枫林在线 -- 精品导读</title>
82 </head>
83 <body marginheight="15" marginwidth="15" leftmargin="15" topmargin="15" link="#000066" bgcolor="#FFFFFF" alink="#990000" vlink="#444464">
84 <center>
85 <a name="top"></a>
86 <table cellpadding="0" cellspacing="0" border="0" width="600">
87 <tr>
88 <td width="600" colspan="3" align="center">
89 <?
90 if (isset($_GET["as_email"]))
91 {
92 ?>
93 <font color="#CCCCCC" size="-2">如果您无法阅读本邮件,请访问<a href="<? echo $base_url; ?>/www/journal.php?jid=<? echo $jid; ?>&uid=<? echo $uid; ?>" target="_blank"><? echo $base_url; ?>/www/journal.php?jid=<? echo $jid; ?>&uid=<? echo $uid; ?></a></font><br>&nbsp;</td>
94 <?
95 }
96 ?>
97 </tr>
98 <tr>
99 <td width="1" colspan="3" bgcolor="#999999"><img src="<? echo $base_url; ?>/www/images/spacer.gif" width="1" height="1" border="0"></td>
100 </tr>
101 <tr>
102 <td width="1" bgcolor="#999999"><img src="<? echo $base_url; ?>/www/images/spacer.gif" width="1" height="1" border="0"></td>
103 <td width="598">
104 <table width="598" border="0" cellspacing="0" cellpadding="0">
105 <tr>
106 <td background="<? echo $base_url; ?>/www/images/spacer_bkgd.gif" height="55" colspan="6">
107 <table cellpadding="0" cellspacing="0" border="0">
108 <tr>
109 <td>
110 <img src="<? echo $base_url; ?>/www/images/spacer.gif" width="198" height="1" border="0" alt=""><br>
111 <font face="Times New Roman,Times,Serif" size="-1" color="#333333">&nbsp;&nbsp;<? echo date ("l, F d, Y",strtotime($dt)); ?><br>
112 </font></td>
113 <td align="center"><img src="<? echo $base_url; ?>/images/logo/fenglinonline.gif" alt="" width="130" height="50" border="0"></td>
114 <td><img src="<? echo $base_url; ?>/www/images/spacer.gif" width="198" height="1" border="0" alt=""></td>
115 </tr>
116 </table>
117 </td>
118 </tr>
119 <tr>
120 <td colspan="6"><img src="<? echo $base_url; ?>/www/images/line.gif" alt="" width="598" height="4" border="0"></td>
121 </tr>
122 <tr>
123 <td width="5" bgcolor="#ffffff"><img src="<? echo $base_url; ?>/www/images/spacer.gif" width="5" height="1" border="0" alt=""></td>
124 <td width="393" valign="top">
125 <table width="393" border="0" cellpadding="0" cellspacing="0">
126 <tr>
127 <td width="393">
128 <table border="0" width="393" cellpadding="0" cellspacing="0">
129 <tr>
130 <td width="131" colspan="2"><font face="Times New Roman,Times,Serif" size="-1"><strong>本期推荐:</strong></font></td>
131 </tr>
132 <tr>
133 <td width="393" colspan="2"><br></td>
134 </tr>
135 <tr>
136 <td width="393" colspan="2" valign="top" align="left">
137 <font face="Times New Roman,Times,Serif" size="-1">
138 <?
139 $cl_index=0;
140 $rs=mysql_query("select * from section_class where CID in ($class_list)".
141 " and enable order by sort_order")
142 or die("Query section_class error!");
143 while($row=mysql_fetch_array($rs))
144 {
145 ?>
146 <a href="#<? echo $row["cname"]; ?>"><? echo $row["title"]; ?></a>&nbsp;|&nbsp;
147 <?
148 $cl_index++;
149 if ($cl_index>=5)
150 {
151 echo ("<br>");
152 $cl_index=0;
153 }
154 }
155 mysql_free_result($rs);
156 ?>
157 </font><br><br>
158 <font face="Times New Roman,Times,Serif" size="-1" color="#333333"><a href="<? echo $base_url; ?>/bbs/s_favor.php" target="_blank">设定我喜欢的栏目</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="<? echo $base_url; ?>/bbs/search_form.php" target="_blank">查找</a><br><br></font>
159 </td>
160 </tr>
161 </table>
162 </td>
163 </tr>
164 <?
165 $rs=mysql_query("select * from section_class where CID in ($class_list)".
166 " and enable order by sort_order")
167 or die("Query section_class error!");
168 while($row=mysql_fetch_array($rs))
169 {
170 ?>
171 <tr>
172 <td width="393">
173 <table border="0" width="393" cellpadding="0" cellspacing="0">
174 <tr>
175 <td width="393" bgcolor="#e4e4e4" height="24" valign="center" colspan="2">
176 <a name="<? echo $row["cname"]; ?>"></a>
177 <img src="<? echo $base_url; ?>/www/images/spacer.gif" width="1" height="1" border="0">&nbsp;<font face="times, times new roman, sans serif" size="-1"><strong><? echo $row["title"]; ?></strong></font> </td>
178 </tr>
179 <tr>
180 <td width="393" colspan="2"> <br> <font size="-1">
181 <?
182 $rs_article=mysql_query("select journal_data.abstract,bbs.*,section_config.title as s_title".
183 " from journal_data inner join bbs on journal_data.AID=bbs.AID".
184 " inner join section_config on bbs.SID=section_config.SID inner join section_class".
185 " on section_config.CID=section_class.CID".
186 " where journal_data.JID=$jid and section_class.CID=".$row["CID"].
187 " and bbs.SID in ($section_list) order by section_config.sort_order,bbs.sub_dt")
188 or die("Query journal_data error!");
189 while($row_article=mysql_fetch_array($rs_article))
190 {
191 ?>
192 <font size="3"><strong><a href="<? echo $base_url; ?>/www/show_article.php?aid=<? echo $row_article["AID"]; ?>" target="_blank"><? echo $row_article["title"]; ?></a></strong></font><br>
193 <font color="#666666" size="-1"><? echo $row_article["s_title"]; ?>&nbsp;&nbsp;
194 By <? echo $row_article["nickname"]; ?></font><br>
195 <? echo str_replace(" ","&nbsp;",str_replace("\n","<br>",htmlspecialchars($row_article["abstract"], ENT_COMPAT | ENT_HTML401, 'GB2312'))); ?><br>
196 <br>
197 <?
198 }
199 mysql_free_result($rs_article);
200 ?>
201 </font> </td>
202 </tr>
203 <tr>
204 <td width="393" align="left"> <font face="times, times new roman, sans serif" size="-1">&#149;
205 <a href="<? echo $base_url; ?>/bbs/class.php?cid=<? echo $row["CID"]; ?>" target="_blank">More Article</a></font><br> <br> </td>
206 <td width="100" align="right"> <font face="times, times new roman, sans serif" size="-1"><a href="#top">Back
207 to Top</a></font><br> <br> </td>
208 </tr>
209 </table>
210 </td>
211 </tr>
212 <?
213 }
214 mysql_free_result($rs);
215 ?>
216 </table>
217 </td>
218 <td width="5" bgcolor="#ffffff"><img src="<? echo $base_url; ?>/www/images/spacer.gif" width="1" height="1" border="0" alt=""></td>
219 <td width="1" bgcolor="#eeeeee"><img src="<? echo $base_url; ?>/www/images/spacer.gif" width="1" height="1" border="0" alt=""></td>
220 <td width="5" bgcolor="#ffffff"><img src="<? echo $base_url; ?>/www/images/spacer.gif" width="1" height="1" border="0" alt=""></td>
221 <td width="184" valign="top" align="center"><br clear="all">
222 <br clear="all">
223 <br>
224 </td>
225 </tr>
226 </table>
227 <table border="0" width="598" cellspacing="0" cellpadding="0">
228 <tr>
229 <td width="598" colspan="3" bgcolor="#999999"><img src="<? echo $base_url; ?>/www/images/spacer.gif" width="1" height="1" border="0"></td>
230 </tr>
231 <tr>
232 <td width="5"><img src="<? echo $base_url; ?>/www/images/spacer.gif" width="1" height="1" border="0"></td>
233 <td width="588"> <p>&nbsp;</p>
234 <p><font face="Times New Roman,Times,Serif" size="-1"><strong>枫林在线论坛精华区</strong><br>
235 <br>
236 枫林在线除了向您推荐近期的优秀文章外,还提供以往的精彩文章的<a href="<? echo $base_url; ?>/gen_ex/">在线浏览</a>和<a href="<? echo $base_url; ?>/bbs/bbs_ex_dl.php?sid=100">打包下载</a>服务。</font>
237 </p>
238 <hr width="588" size="1">
239 <p> <font face="Times New Roman,Times,Serif" size="-1"> <strong>关于本邮件</strong><br>
240 <br>
241 感谢您订阅枫林在线的《精品导读》,您可以从我们提供的<a href="<? echo $base_url; ?>/bbs/preference.php">个人设定</a>功能中订阅/取消订阅本刊物。<br>
242 <br>
243 如果您对我们的工作有什么意见或建议,请<a href="<? echo $base_url; ?>/www/contact_us.php">与我们联系</a>。</font></p>
244 <p><br>
245 </p></td>
246 <td width="5"><img src="<? echo $base_url; ?>/www/images/spacer.gif" width="1" height="1" border="0"></td>
247 </tr>
248 <tr>
249 <td width="598" colspan="3" bgcolor="#999999"><img src="<? echo $base_url; ?>/www/images/spacer.gif" width="1" height="1" border="0"></td>
250 </tr>
251 <tr>
252 <td width="598" colspan="3" bgcolor="#e4e4e4" height="25"> <img src="<? echo $base_url; ?>/www/images/spacer.gif" width="5" height="1" border="0">
253 <font face="Times New Roman,Times,Serif" size="-1"> Copyright &copy;
254 2003-2012 <a href="<? echo $base_url; ?>/" target="_blank">枫林在线</a> | <a href="<? echo $base_url; ?>/www/privacy.php">隐私保护</a> </font> </td>
255 </tr>
256 </table>
257 </td>
258 <td width="1" bgcolor="#999999"><img src="<? echo $base_url; ?>/www/images/spacer.gif" width="1" height="1" border="0"></td>
259 </tr>
260 <tr>
261 <td width="1" colspan="3" bgcolor="#999999"><img src="<? echo $base_url; ?>/www/images/spacer.gif" width="1" height="1" border="0"></td>
262 </tr>
263 </table>
264 </center>
265 </body>
266 </html>

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