WebListDspSecond.jsp
11.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
<%@ page import="weaver.general.Util" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %> <%@ include file="/web/inc/init1.jsp" %>
<%@ include file="/web/inc/WebServer.jsp" %>
<jsp:useBean id="DocNewsManager" class="weaver.docs.news.DocNewsManager" scope="page" />
<jsp:useBean id="DocNewsComInfo" class="weaver.docs.news.DocNewsComInfo" scope="page" />
<jsp:useBean id="DocManager" class="weaver.docs.docs.DocManager" scope="page" />
<jsp:useBean id="DocTypeComInfo" class="weaver.docs.type.DocTypeComInfo" scope="page" />
<jsp:useBean id="LanguageComInfo" class="weaver.systeminfo.language.LanguageComInfo" scope="page" />
<jsp:useBean id="SysDefaultsComInfo" class="weaver.docs.tools.SysDefaultsComInfo" scope="page" />
<jsp:useBean id="PicUploadManager" class="weaver.docs.tools.PicUploadManager" scope="page" />
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="RecordSetImg" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="MainCategoryComInfo" class="weaver.docs.category.MainCategoryComInfo" scope="page" />
<jsp:useBean id="SecCategoryComInfo" class="weaver.docs.category.SecCategoryComInfo" scope="page" />
<jsp:useBean id="SubCategoryComInfo" class="weaver.docs.category.SubCategoryComInfo" scope="page" />
<jsp:useBean id="DocImageManager" class="weaver.docs.docs.DocImageManager" scope="page" />
<%
//获取参数及设置基本变量
int id = Util.getIntValue(request.getParameter("id"),0);
int start= Util.getIntValue(request.getParameter("start"),1);
int hstart = Util.getIntValue(request.getParameter("hstart"),1);
int journalListID = Util.getIntValue(request.getParameter("journalListID"),0);
int recordersize = 0;
int perpage=0;
String linkstr="";
String usertype = "" ;
String isTime=""+Util.getIntValue(request.getParameter("isTime"),0);
String isPageNo=""+Util.getIntValue(request.getParameter("isPageNo"),0);
String frontpagename = "" ;
String frontpagedesc = "" ;
String isactive = "" ;
int departmentid = 0 ;
String linktype = "" ;
String hasdocsubject = "" ;
String hasfrontpagelist = "" ;
int newsperpage = 0 ;
int titlesperpage = 0 ;
int defnewspicid = 0 ;
int backgroundpicid = 0 ;
int importdocid = 0 ;
int headerdocid = 0 ;
int footerdocid = 0 ;
String secopt = "" ;
int seclevelopt = 0;
int departmentopt = 0;
int dateopt = 0;
int languageopt = 0 ;
int languageid = 7 ;
String clauseopt = "" ;
String newsclause = "" ;
int defaultimgid= 0 ;
int defaultimgwidth=0;
int publishtype = 0;
//获取新闻页基本信息
if(id != 0) {
DocNewsManager.resetParameter();
DocNewsManager.setId(id);
DocNewsManager.getDocNewsInfoById();
publishtype = DocNewsManager.getPublishtype();
frontpagename = DocNewsManager.getFrontpagename();
frontpagedesc = DocNewsManager.getFrontpagedesc();
isactive = DocNewsManager.getIsactive();
departmentid = DocNewsManager.getDepartmentid();
linktype = DocNewsManager.getLinktype();
hasdocsubject = DocNewsManager.getHasdocsubject();
hasfrontpagelist = DocNewsManager.getHasfrontpagelist();
newsperpage = DocNewsManager.getNewsperpage();
titlesperpage = DocNewsManager.getTitlesperpage();
defnewspicid = DocNewsManager.getDefnewspicid();
backgroundpicid = DocNewsManager.getBackgroundpicid();
importdocid = Util.getIntValue(DocNewsManager.getImportdocid());
headerdocid = DocNewsManager.getHeaderdocid();
footerdocid = DocNewsManager.getFooterdocid();
secopt = DocNewsManager.getSecopt();
seclevelopt = DocNewsManager.getSeclevelopt();
departmentopt = DocNewsManager.getDepartmentopt();
dateopt = DocNewsManager.getDateopt();
languageopt = DocNewsManager.getLanguageopt();
languageid = DocNewsManager.getLanguageid();
clauseopt = Util.toScreenToEdit(DocNewsManager.getClauseopt(),languageid);
newsclause = DocNewsManager.getNewsclause();
DocNewsManager.closeStatement();
perpage = newsperpage;
}
//perpage = 500 ;
//out.print(newsclause);
String secid = newsclause ;
if (secid.indexOf("seccategory")==-1) secid = "";
if (!secid.equals("")) {
int indexTemp1 = secid.indexOf("and") ;
if (indexTemp1!=-1){
secid = secid.substring(indexTemp1+3,secid.length());
}
int indexTemp2 = secid.indexOf("(") ;
if (indexTemp2!=-1){
secid = secid.substring(indexTemp2+1,secid.length());
}
indexTemp2 = secid.indexOf(")") ;
if (indexTemp2!=-1){
secid = secid.substring(0,indexTemp2);
}
secid=secid.trim();
}
ArrayList journalIDList = new ArrayList() ;
if (!secid.equals(""))
{
String secidStrTemp = secid + ",";
String secidTemp = "" ;
while ((secidStrTemp.indexOf(",")+1)!=secidStrTemp.length())
{
secidTemp = secidStrTemp.substring(0,secidStrTemp.indexOf(",")) ;
journalIDList.add(secidTemp) ;
secidStrTemp= secidStrTemp.substring(secidStrTemp.indexOf(",")+1,secidStrTemp.length()) ;
}
secidTemp = secidStrTemp.substring(0,secidStrTemp.indexOf(",")) ;
journalIDList.add(secidTemp) ;
if (journalListID == 0) journalListID = Util.getIntValue(secidTemp,0);
String tempsubid=SecCategoryComInfo.getSubCategoryid(""+journalListID);
String tempmainid=SubCategoryComInfo.getMainCategoryid(tempsubid);
newsclause = " maincategory="+tempmainid+" and seccategory in("+journalListID+")";
}
//获取缺省图片信息
if(defnewspicid!=0){
PicUploadManager.resetParameter();
PicUploadManager.setId(defnewspicid);
PicUploadManager.selectImageById();
if(PicUploadManager.next()){
defaultimgid = Util.getIntValue(PicUploadManager.getImagefileid());
defaultimgwidth = PicUploadManager.getImagefilewidth();
}
int defwidth = Util.getIntValue(SysDefaultsComInfo.getFgpicwidth(),0);
String deffix = Util.null2String(SysDefaultsComInfo.getFgpicfixtype());
if(deffix.equals("2"))
defaultimgwidth = defwidth;
if(deffix.equals("3"))
if(defaultimgwidth<defwidth)
defaultimgwidth=defwidth;
if(deffix.equals("4"))
if(defaultimgwidth>defwidth)
defaultimgwidth=defwidth;
else if(defwidth != 0)
defaultimgwidth = defwidth;
PicUploadManager.closeStatement();
}
String remindMsg = "" ;
String bgcolor = Util.null2String(request.getParameter("bgcolor"));
if (bgcolor.equals("")) bgcolor = "#FFFFFF" ;
%>
<HTML><HEAD>
<script language="JavaScript">
function click() {
if (event.button==2) {return false //alert('信息查看')
}
}
document.onmousedown=click
//-->
</script>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
</head>
<BODY bgcolor="<%=bgcolor%>">
<TABLE class=form valign=top>
<TBODY>
<tr>
<tr>
<!--是否设置了页面背景图片:begin-->
<%
if(backgroundpicid!=0){
String imgid="";
int imgwidth=0;
PicUploadManager.resetParameter();
PicUploadManager.setId(backgroundpicid);
PicUploadManager.selectImageById();
if(PicUploadManager.next()){
imgid = PicUploadManager.getImagefileid();
imgwidth = PicUploadManager.getImagefilewidth();
}
PicUploadManager.closeStatement();
%>
<td background = "/weaver/weaver.file.FileDownload?fileid=<%=imgid%>">
<%}else{%>
<td>
<%}%>
<!--是否设置了页面背景图片:end-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" valign=top>
<tr>
<td width="100%" valign=top>
<table width="100%" >
<form id="journalForm" name="journalForm" action="/web/WebListDspSecond.jsp">
<input name="id" type="hidden" value="<%=id%>">
<input name="isTime" type="hidden" value="<%=isTime%>">
<tr>
<td width="70%">
<div align="right">请查看:</div>
</td>
<td width="30%">
<div align="right">
<select name="journalListID" onchange="javascript:journalForm.submit();">
<%
String journalIDTep = "0" ;
for (int i=journalIDList.size()-1;i>=0;i--) {
journalIDTep = (String)journalIDList.get(i) ;
%>
<option value="<%=journalIDTep%>" <%if(journalListID==Util.getIntValue(journalIDTep,0)) {%>
selected
<%}%>
> <%=SecCategoryComInfo.getSecCategoryname(journalIDTep)%>
</option>
<%}%>
</select>
</div>
</td>
</tr>
<tr>
<td height="1" colspan="2" background="/web/images/bg_hdotline_wev8.gif" class="p9grey"><img src="/web/images/spacer_wev8.gif" width="1" height="1"></td>
</tr>
</form>
</table><BR>
<!--主题新闻显示:begin-->
<table class=form valign=top>
<!--根据条件设置自动提取地主题新闻显示:begin-->
<%
boolean isDark = false ;
int needtr = 0;
int currec = 0;
String whereOrAnd = "" ;
//if (publishtype ==0 ) whereOrAnd =" where " ; //0为发布类型为外部的不需要判断权限
whereOrAnd =" and " ;
String newslistclause=newsclause.trim();
if(!newslistclause.equals("")) newslistclause = whereOrAnd + newslistclause ;
newslistclause = newslistclause + " and docpublishtype='2' and docstatus in('1','2') order by doclastmoddate desc, doclastmodtime desc";
if (publishtype ==0 )//0为发布类型为外部的不需要判断权限
{
DocManager.setSql_where(newslistclause);
DocManager.selectDocInfo();
}
else
{
if (userid==0)
{
DocManager.closeStatement();
response.sendRedirect("/web/login/noLogin.jsp");
return;
}
DocManager.selectNewsDocInfo(newslistclause,user);
}
if (DocManager.getCount()==0)
{
remindMsg = SystemEnv.getHtmlLabelName(23275,user.getLanguage()) +"!";
}
while(DocManager.next()){
int docid = DocManager.getDocid();
if(docid == importdocid) continue;
recordersize += 1;
currec +=1;
if(currec < start) continue;
if(currec >= start + perpage) continue;
needtr +=1;
String docsubject=DocManager.getDocsubject();
String doccontent=DocManager.getDoccontent();
String doclastmoddate=DocManager.getDoclastmoddate();
RecordSetImg.executeSql("select imagefileid from DocImageFile where docid = " + docid + " and docfiletype = '1' ");
int curimgid = 0 ;
if (RecordSetImg.next())
curimgid = Util.getIntValue(RecordSetImg.getString("imagefileid"),0);
%>
<tr>
<td width="15" valign="top"><img src="/web/images/i_wev8.gif" align="right"></td>
<td width="" class="p91" valign="top">
<a href="<%=webServer%>/web/WebDetailDsp.jsp?id=<%=docid%>&languageid=<%=languageid%>&isTime=<%=isTime%>" target="_blank">
<%=docsubject%>
</a>
</td>
<td width="80" valign="right" nowrap><%if(isTime.equals("1")){%>[<%=doclastmoddate%>]<%}%>
</td>
</tr>
<%
}
DocManager.closeStatement();
%>
<!--根据条件设置自动提取地主题新闻显示:end-->
<%if (!remindMsg.equals("")) {%>
<tr>
<td width=100% height=100% align=center valign=middle style="color:red">
<%=remindMsg%>
</td>
</tr>
<%}%>
</table>
<!--主题新闻显示:end-->
</td>
</tr>
<tr><td> </td><td></td></tr>
<%if (!remindMsg.equals("")) {%>
<tr>
<!--主题新闻分页导航:begin-->
<td align=center noWrap >
<%linkstr = "/web/WebListDspSecond.jsp?id="+id+"&hstart="+hstart+"&journalListID="+journalListID+"&isTime="+isTime;%>
<%=Util.makeNavbar4(start, recordersize , perpage, linkstr)%>
</td>
<!--主题新闻分页导航:end-->
</tr>
<%}%>
</table>
</td>
</tbody>
</table>
</body>