⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 poll.jsp

📁 jsp bbs源代码
💻 JSP
字号:
<%
/*##################################################################**
**#  LyBBS ver 1.2.b2 (1.2.beta-2版) / 凌云论坛 ver 1.2.b2         #**
**#                                                                #**
**#  版权所有: 凌云工作室 (原流星电脑工作室)                       #**
**#                                                                #**
**#  制作人  : 星语凌 『teddy (Yongshan Ye)』                      #**
**#                                                                #**
**#  主页地址: http://www.unix-now.com/lybbs   凌云论坛主页        #**
**#            http://www.ierp.info/lybbs      凌云论坛镜像站      #**
**#            http://horseye@sina.com/        凌云论坛支持信箱    #**
**#                                                                #**
**##################################################################*/
%>
<%@ include file="include/config.jsp"%>
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="include/connect.jsp"%>
<%
int db=0;
String tempSTR="",action="";
//用户cookie变量声明
int id=0,styleid=0,membergone=0;
String cookieid="",cookiename="",username="",usermode="",cookiemode="";
//日期定义
int now_year=0,now_month=0,now_day=0,now_hour=0,now_minute=0,now_second=0;
String now_date="",now_time="";
//定义boardprepare.jsp中的变量
String onlineview="",dispview="",boardtitle="",boardname="",title="",version="",copyright="",support="",programmer="",programemail="",homename="",homeurl="",togb="1",status="",maintainreason="",announcement="1",boardurl="",showfastlogin="",dispborn="",styleQuery="";
boolean voteok=false;
String errorinfo="",titlelock="";
int floodcontrollimit=0;
String emoticons="",floodcontrol="",useemote="";
String arrawpostfontsize="",arrawpostpic="";
String htmlstat="",lycodestat="";
String banword="";
String advpost="";
%>
<%@ include file="include/boardprepare.jsp"%>
<%@ include file="include/style.jsp"%>
<%
rs=connect.executeQuery("select floodcontrollimit,floodcontrol,emoticons,useemote from config where id=1");
if(rs.next()) {
  floodcontrollimit=rs.getInt(1);
  floodcontrol=rs.getString(2);
  emoticons=rs.getString(3);
  useemote=rs.getString(4);
}
rs=connect.executeQuery("select arrawpostfontsize,arrawpostpic from style where adminselected='1'");
if(rs.next()) {
  arrawpostfontsize=rs.getString(1);
  arrawpostpic=rs.getString(2);
}
rs=connect.executeQuery("select htmlstat,lycodestat from db where id="+db);
if(rs.next()) {
  htmlstat=rs.getString(1);
  lycodestat=rs.getString(2);
}
int topic=0,myChoice=0,addmoney=0,addexperience=0,addcharm=0,maxorderby=0,postauthorid=0,postid=0;
String postusername="",postpassword="",posttitle="",postcontent="",pollcontent="",postipfrom="",pollvote="",posthtmlsupport="";
tempSTR=request.getParameter("db");
if(tempSTR!=null && !tempSTR.equals(""))
  db=Integer.parseInt(tempSTR);
tempSTR=request.getParameter("action");
if(tempSTR!=null)
  action=tempSTR;
if(action.equals("") || db==0)
  response.sendRedirect("errorPage.jsp");
if(action.equals("poll")) {
  tempSTR=request.getParameter("postid");
  if(tempSTR!=null && !tempSTR.equals(""))
    postid=Integer.parseInt(tempSTR);
  tempSTR=request.getParameter("topic");
  if(tempSTR!=null && !tempSTR.equals(""))
    topic=Integer.parseInt(tempSTR);
  tempSTR=request.getParameter("myChoice");
  if(tempSTR!=null && !tempSTR.equals(""))
    myChoice=Integer.parseInt(tempSTR);
  if(topic==0 || myChoice==0)
    response.sendRedirect("errorPage.jsp");
}
else if(action.equals("addnew")) {
  tempSTR=request.getParameter("posthtmlsupport");
  if(tempSTR!=null && !tempSTR.equals(""))
    posthtmlsupport=tempSTR;
  tempSTR=request.getParameter("posttitle");
  if(tempSTR!=null && !tempSTR.equals(""))
    posttitle=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  if(!posttitle.equals(""))
    posttitle=connect.toHtml(posttitle);//把链接html化
  tempSTR=request.getParameter("postcontent");
  if(tempSTR!=null && !tempSTR.equals(""))
    postcontent=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  if(!postcontent.equals("")) {
    if(htmlstat.equals("1") && posthtmlsupport.equals("1"))
      postcontent=connect.toBr(postcontent);//把\n换br
    else
      postcontent=connect.toHtml(postcontent);//去除html信息
    //是否支持凌云标签
    if(lycodestat.equals("1")) {
      String firstcode="",replacefirstcode="",lastcode="",replacelastcode="";
      rs=connect.executeQuery("select firstcode,replacefirstcode,lastcode,replacelastcode from lycode order by id");
      while(rs.next()) {
        firstcode=rs.getString(1);
        replacefirstcode=rs.getString(2);
        lastcode=rs.getString(3);
        replacelastcode=rs.getString(4);
        postcontent=connect.Replace(postcontent,firstcode,replacefirstcode);
        postcontent=connect.Replace(postcontent,lastcode,replacelastcode);
      }
      postcontent=connect.toLyCode(postcontent);
    }
    //是否支持表情符转换
    if(emoticons.equals("1")) {
      String postshowemoticons="";
      tempSTR=request.getParameter("postshowemoticons");
      if(tempSTR!=null && !tempSTR.equals(""))
        postshowemoticons=tempSTR;
      if(postshowemoticons.equals("1")) {
        String emote="",replaceemote="";
        rs=connect.executeQuery("select emote,replaceemote from showsmilies order by id");
        while(rs.next()) {
          emote=rs.getString(1);
          replaceemote=rs.getString(2);
          postcontent=connect.Replace(postcontent,emote,replaceemote);
        }
      }
    }
  }
  tempSTR=request.getParameter("username");
  if(tempSTR!=null && !tempSTR.equals(""))
    postusername=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("password");
  if(tempSTR!=null && !tempSTR.equals(""))
    postpassword=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("pollcontent");
  if(tempSTR!=null && !tempSTR.equals(""))
    pollcontent=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  if(!pollcontent.equals("")) {
    rs=connect.executeQuery("select banword from banword");
    while(rs.next()) {
      posttitle=connect.Replace(posttitle,rs.getString(1),"****");//过滤掉一些词语
      postcontent=connect.Replace(postcontent,rs.getString(1),"****");//过滤掉一些词语
      pollcontent=connect.Replace(pollcontent,rs.getString(1),"****");//过滤掉一些词语
    }
    pollcontent=connect.Replace(pollcontent," ","");//把" "转化为""
    pollcontent=connect.Replace(pollcontent," ","");//把" "转化为""
    pollcontent=connect.Replace(pollcontent,"\'","\\\'");//把"'"转化为"\'"
    pollcontent=connect.Replace(pollcontent,"\"","\\\"");//把"""转化为"\""
    pollcontent=connect.Replace(pollcontent,"\r\n\r\n","");//把"\n\n"转化为""
    if(!pollcontent.endsWith("\n")) pollcontent+="\n";
  }
  postipfrom=request.getRemoteAddr();
}
%>
<!--//html from here-->
<%@ include file="include/head.jsp"%>
<body <%=lbbody%>>
<%@ include file="include/userheader.jsp"%>
<p>
<%
String vicedbname="";
rs=connect.executeQuery("select dbname from db where id="+db);
if(rs.next())
  vicedbname=rs.getString(1);
%>
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> align=center>
 <tr>
  <td width=30% rowspan=2 valign=top>
   <%@ include file="include/viceadbanner.jsp"%>
  </td>
  <td valign=top align=left>
     <font face="宋体" color=<%=fontcolormisc%>>
     <img src="images/closedfold.gif" border=0> <a href="index.jsp"><%=boardname%></a><br>
     <img src="images/bar.gif" border=0><img src="images/closedfold.gif" border=0> <a href="db.jsp?db=<%=db%>"><%=vicedbname%></a><br>
     &nbsp;&nbsp;&nbsp;<img src="images/bar.gif" border=0><img src="images/openfold.gif" border=0> 发起新投票
     </font>
  </td>
 </tr>
</table>
<script language="JavaScript">
function HighlightAll(theField) {
  var tempval=eval("document."+theField)
  tempval.focus()
  tempval.select()
  therange=tempval.createTextRange()
  therange.execCommand("Copy")
}
function DoTitle(addTitle) {
  var revisedTitle;
  var currentTitle = document.FORM.posttitle.value;
  revisedTitle = currentTitle+addTitle;
  document.FORM.posttitle.value=revisedTitle;
  document.FORM.posttitle.focus();
  return;
}
</script>
<%
//取论坛性质
String startnewthreads="";
rs=connect.executeQuery("select startnewthreads from db where id="+db);
if(rs.next())
  startnewthreads=rs.getString(1);
if(action.equals("addnew")) {
 int havepost=0;
 if(floodcontrol.equals("1")) {
   havepost=connect.getRowNum("posts where (UNIX_TIMESTAMP(now())-UNIX_TIMESTAMP(postat))<"+floodcontrollimit+" and authorid="+cookieid);
 }
%>
<%@ include file="include/pollnew.jsp"%>
<%
}
else if(action.equals("new")) {
%>
<%@ include file="include/polltable.jsp"%>
<%
}
else if(action.equals("poll")) {
%>
<%@ include file="include/pollticket.jsp"%>
<%
}
rs.close();
connect.close();
%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -