WebBBS.jsp
8.15 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
<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.*" %>
<%@ page import="weaver.hrm.*" %>
<%@ page import="weaver.systeminfo.*" %>
<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="rs" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page"/>
<jsp:useBean id="CustomerInfoComInfo" class="weaver.crm.Maint.CustomerInfoComInfo" 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" />
<%
//获取参数及设置基本变量
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 recordersize = 0;
int perpage=0;
String linkstr="";
String usertype = "" ;
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;
}
String mainid = newsclause ;
if (!mainid.equals("")) {
int indexTemp1 = mainid.indexOf("and") ;
if (indexTemp1!=-1){
mainid = mainid.substring(0,indexTemp1);
}
int indexTemp2 = mainid.indexOf("=") ;
if (indexTemp2!=-1){
mainid = mainid.substring(indexTemp2+1,mainid.length());
}
mainid=mainid.trim();
}
//out.print("---"+mainid+"---");
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();
}
if (!secid.equals("")) secid = "," + secid + "," ;
//out.print("---"+secid+"---");
//out.print("---"+newsclause+"---");
//获取缺省图片信息
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();
}
User user = new User() ;
if(publishtype != 0) { //如publishtype不为0则需要判断权限
//相当于init.jsp--begin
user = HrmUserVarify.checkUser(request , response) ;
if (user==null)
{
user = new User() ;
user.setUid(0);
user.setLanguage(7);
user.setLogintype("2");
}
//相当于init.jsp--end
}
String bgcolor = Util.null2String(request.getParameter("bgcolor"));
if (bgcolor.equals("")) bgcolor = "#FFFFFF" ;
%>
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<LINK href="/web/css/style_wev8.css" type=text/css rel=STYLESHEET>
</head>
<BODY bgcolor="<%=bgcolor%>">
<FORM id=form1 name=form1 method="post" action="/web/WebBBSDsp.jsp?id=<%=id%>">
<TABLE class=form valign=top>
<TBODY>
<tr>
<tr>
<td>
<table bgcolor="D8D8D8" valign=top border="0" cellspacing="1" cellpadding="0" width="100%">
<COLGROUP>
<COL width=5%>
<COL width=65%>
<COL width=15%>
<COL width=15%>
<tr bgcolor="229CC4">
<td></td>
<td><font color="#FFFFFF"><b>讨论区</b></font></td>
<td><font color="#FFFFFF"><b>主题</b></font></td>
<td><font color="#FFFFFF"><b>回复</b></font></td>
</tr>
<%
boolean isDark=false;
String tempsubidTemp = "";
String sqlStr ="select * from DocSecCategory order by subcategoryid";
rs.executeSql(sqlStr);
while(rs.next()){
String isselect = "";
String curid = rs.getString("id");
String curname = rs.getString("categoryname");
String tempsubid=rs.getString("subcategoryid");
String tempmainid=SubCategoryComInfo.getMainCategoryid(tempsubid);
if(!mainid.equals(tempmainid)){
continue;
}
if(!secid.equals("")){
if(secid.indexOf(","+curid+",")==-1)
continue;
}
String docCount = "0" ;
sqlStr = "select count(id) from DocDetail where isreply<>'1' and seccategory = " + curid;
RecordSet.executeSql(sqlStr);
if (RecordSet.next()) docCount=RecordSet.getString(1);
String replyDocCount = "0" ;
sqlStr = "select count(id) from DocDetail where isreply='1' and seccategory = " + curid;
RecordSet.executeSql(sqlStr);
if (RecordSet.next()) replyDocCount=RecordSet.getString(1);
if(!tempsubidTemp.equals(tempsubid)){%>
<tr bgcolor="#F3F3F3">
<td colspan="4"><b><%=SubCategoryComInfo.getSubCategoryname(tempsubid)%></b></td>
<%}%>
<tr bgcolor="#FFFFFF">
<td><img src="/web/images/forum_wev8.gif" ></td>
<td><a href="/web/WebBBSDsp.jsp?newsid=<%=id%>&mainid=<%=mainid%>&id=<%=curid%>"><%=curname%></a></td>
<td><%=docCount%></td>
<td><%=replyDocCount%></td>
</tr>
<%
tempsubidTemp = tempsubid;
}
%>
</table>
</td>
</tbody>
</table>
</FORM>
</body>