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

📄 clubtopicpost.java

📁 GamVan Club v1.1 源代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
            topicOrder=topicOrder+1;
            cti.topicUpdate(topicReID,0,1); //更新主题回复次数
        }
        topicReID = topicID;
        if(topicReCount>0){
           tTree = (topicTree * 2 +1 );
        }else{
           tTree = topicTree * 2;
        }
        topicTree = tTree;
        topicLayer += 1;
        bea = topicAdd();
        return bea;
        //message=String.valueOf(topicReID);
    }  
    public boolean topicAdd() throws Exception{
        boolean bea = false;
        String sqlCommand = new String();
        ResultSet rs;
         Connection con = bridge.getConnection();//数据库链接
        try{
            sqlCommand = "Insert Into GVclubTopic(topicReID, topicOrder, topicLayer, topicTree";
            sqlCommand += ", topic, userName, ccID, ccID2, ccID1, moveCCID, topicList";
            sqlCommand += ", topicMood, topicPro, topicType, topicTypeNum, topicAddTime";
            sqlCommand += ", topicAddip, topicLastReUser, topicLastReTime, topicViewCount, topicReCount, topicLen, userID)";
            sqlCommand += " Values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
            PreparedStatement pps = con.prepareStatement(sqlCommand);
            pps.setInt(1, topicReID);
            pps.setInt(2, topicOrder);
            pps.setInt(3, topicLayer);
            pps.setInt(4, topicTree);
            pps.setString(5, topic);
            pps.setString(6, userName);
            pps.setInt(7, ccID);
            pps.setInt(8, ccID2);
            pps.setInt(9, ccID1);
            pps.setInt(10, moveCCID);
            pps.setString(11, topicColor + "|" + topicBold);
            pps.setInt(12, topicMood);
            pps.setInt(13, topicPro);
            pps.setInt(14, topicType);
            pps.setDouble(15, topicTypeNum);
            pps.setString(16, now);
            pps.setString(17, topicAddip);
            pps.setString(18, "");
            pps.setString(19, now);
            pps.setInt(20, 0);
            pps.setInt(21, 0);
            pps.setInt(22, cLeg);
            pps.setInt(23, userID);
            pps.executeUpdate();
            pps.close();
            sqlCommand="";
            sqlCommand = "Select topicID, topicReID From GVclubTopic order by topicID desc";
            PreparedStatement pps0 = con.prepareStatement(sqlCommand);
            rs = pps0.executeQuery();
            if(rs.next()){
                topicID = rs.getInt(1);
                topicReID = rs.getInt(2);
            }
            rs.close();
            pps0.close();
            sqlCommand = "";
            if(act.equals("add")){
                sqlCommand = "Update GVclubTopic set topicReID="+ topicID +" where topicID="+ topicID+"";
            }else{
                sqlCommand = "Update GVclubTopic set topicLastReTime='"+ now +"', topicLastReUser='"+ userName +"' where topicID="+ topicReID+"";
            }
            PreparedStatement pps2 = con.prepareStatement(sqlCommand);
            pps2.executeUpdate();
            pps2.close();
            sqlCommand="";
            sqlCommand = "Insert Into GVclubContent(topicID, content, contentUserPen, contentUrl";
            sqlCommand += ", contentImg, contentEmail, contentCopyRight)";
            sqlCommand += " Values(?,?,?,?,?,?,?)";
            PreparedStatement pps1 = con.prepareStatement(sqlCommand);
            if(content==null){
                content=" ";
            }
            pps1.setInt(1,topicID);
            pps1.setString(2,content);
            pps1.setInt(3, contentUserPen);
            pps1.setInt(4, contentUrl);
            pps1.setInt(5, contentImg);
            pps1.setInt(6, contentEmail);
            pps1.setInt(7, contentCopyRight);
            pps1.executeUpdate();
            pps1.close();
            con.close();
            bea = true;
            if(topicReID>0){
                ccu.counterUpdate(0, 0, 0, 1, 0, 0, 0, "");
            }else{
                ccu.counterUpdate(0, 0, 1, 0, 0, 0, 0, "");
            }
        }catch(Exception e){
            bea = false;
            con.close();
            message = "系统出现意外错误,请重新尝试,如果不成功请联系在线勤杂工!";
        }finally{
            con.close();
        }
        //message = "333333333333" + content;
        return bea;
    }

    public boolean userLogin() throws Exception{
        boolean tempbea = false;
        if(!userPass.equals(userPass2)){
            userPass = ens.encodeString("md5of16",userPass);
        }
        String sql = new String();
        Connection con = bridge.getConnection();
       try{
        ResultSet rs;
        sql = "Select * From GVclubUsers ";
        sql += " where userName = ? and userPass=?" ;
        PreparedStatement pps = con.prepareStatement(sql);
        pps.setString(1, userName);
        pps.setString(2, userPass);
        rs = pps.executeQuery();
        if(rs.next()){
            userID = rs.getInt(1);
            tempbea = true ;//更新用户登录信息,取得返回值;
        }else{
            message = "登陆失败,用户名或密码错误!";
            tempbea = false;
        }
        rs.close();
        pps.close();
       }catch(Exception e){
           message = "系统出现意外错误,请重新尝试,如果不成功请联系在线勤杂工!";
           tempbea = false;
           con.close();
       }finally{
           con.close();
       }
        return tempbea;
    }
    //
    public String getMessage(){
        return this.message;
    }
    public int getTopicID(){
        return this.topicID;
    }
    public void setTopicAddip(String addip){
        this.topicAddip = addip;
    }
    public void setAct(String act){
        this.act = act;
    }
    public void setContentUserPen(String contentUserPen){
        if(contentUserPen!=null){
            this.contentUserPen = Integer.parseInt(contentUserPen);
        }else{
            this.contentUserPen = 0;
        }
    }
    public void setContentUrl(String contentUrl){
        if(contentUrl!=null){
            this.contentUrl = Integer.parseInt(contentUrl);
        }else{
            this.contentUrl = 0;
        }
    }
    public void setContentImg(String contentImg){
        if(contentImg!=null){
            this.contentImg = Integer.parseInt(contentImg);
        }else{
            this.contentImg = 0;
        }  
    }
    public void setContentEmail(String contentEmail){
        if(contentEmail!=null){
            this.contentEmail = Integer.parseInt(contentEmail);
        }else{
            this.contentEmail = 0;
        }
    }
    public void setContentCopyRight(String contentCopyRight){
        if(contentCopyRight!=null){
            this.contentCopyRight = Integer.parseInt(contentCopyRight);
        }else{
            this.contentCopyRight = 0;
        }
    }
    
    public void setTopic(String topic){
        topic = clubgb.gb(topic.trim());
        this.topic = topic;
    }
    public void setContent(String content){
        if(content==null){
            content = " ";
        }
        content = clubgb.gb(content);
        this.content = content;
    }
    public void setUserName(String userName){
        userName = clubgb.gb(userName);
        this.userName = userName.trim();
    }
    public void setUserPass(String userPass){
        this.userPass = userPass;
    }
    public void setUserPass2(String userPass2){
        this.userPass2 = userPass2;
    }
    public void setTopicID(int topicID){
        this.topicID = topicID;
    }  
    public void setTopicReID(int topicReID){
        this.topicReID = topicReID;
    }
    public void setTopicColor(String topicColor){
        if(topicColor==null || topicColor.equals("")){
            topicColor="0";
        }
        this.topicColor = topicColor;
    }
    public void setTopicBold(String topicBold){
        if(topicBold==null){
            topicBold="0";
        }
        this.topicBold = topicBold;
    }
    public void setTopicType(int topicType){
        this.topicType = topicType;
    }
    public void setTopicTypeNum(String topicTypeNum){
        if(topicTypeNum!=null){
            this.topicTypeNum = Integer.parseInt(topicTypeNum);
        }else{
            this.topicTypeNum=0;
        }
    }
    public void setTopicMood(String topicMood){
        if(topicMood!=null){
            this.topicMood = Integer.parseInt(topicMood);
        }else{
            this.topicMood=1;
        }
    }
    public void setTopicPro(String topicPro){
        if(topicPro!=null){
            this.topicPro = Integer.parseInt(topicPro);
        }else{
            this.topicPro=0;
        }
    }
    public void setccID(String ccID){
        if(ccID!=null){
            this.ccID = Integer.parseInt(ccID);
        }else{
            this.ccID = 0;
        }
    }
    public void setccID1(String ccID1){
        if(ccID1!=null){
            this.ccID1 = Integer.parseInt(ccID1);
        }else{
            this.ccID1 = 0;
        }
    }
    public void setccID2(String ccID2){
        if(ccID2!=null){
            this.ccID2 = Integer.parseInt(ccID2);
        }else{
            this.ccID2 = 0;
        }
    }
    public void setMoveCCID(String moveCCID){
        if(moveCCID!=null){
            this.moveCCID = Integer.parseInt(moveCCID);
        }else{
            this.moveCCID = 0;
        }
    }
    public void setUserID(int userID){
        this.userID = userID;
    }
}

⌨️ 快捷键说明

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