Package net.sf.l2j.gameserver.communitybbs.BB

Examples of net.sf.l2j.gameserver.communitybbs.BB.Forum


    StringTokenizer st = new StringTokenizer(ar1, ";");
    int idf = Integer.parseInt(st.nextToken());
    int idt = Integer.parseInt(st.nextToken());
    int idp = Integer.parseInt(st.nextToken());

    Forum f = ForumsBBSManager.getInstance().getForumByID(idf);
    if(f == null)
    {
      ShowBoard sb = new ShowBoard("<html><body><br><br><center>the forum: "+idf+" does not exist !</center><br><br></body></html>","101");
      activeChar.sendPacket(sb);
      activeChar.sendPacket(new ShowBoard(null,"102"));
      activeChar.sendPacket(new ShowBoard(null,"103"));
    }
    else
    {
      Topic t = f.gettopic(idt);
      if(t == null)
      {
        ShowBoard sb = new ShowBoard("<html><body><br><br><center>the topic: "+idt+" does not exist !</center><br><br></body></html>","101");
        activeChar.sendPacket(sb);
        activeChar.sendPacket(new ShowBoard(null,"102"));
        activeChar.sendPacket(new ShowBoard(null,"103"));
      }
      else
      {
        CPost cp = null;
        Post p = getGPosttByTopic(t);
        if(p != null)
        {
          cp = p.getCPost(idp);
        }
        if(cp == null)
        {
          ShowBoard sb = new ShowBoard("<html><body><br><br><center>the post: "+idp+" does not exist !</center><br><br></body></html>","101");
          activeChar.sendPacket(sb);
          activeChar.sendPacket(new ShowBoard(null,"102"));
          activeChar.sendPacket(new ShowBoard(null,"103"));
        }
        else
        {
          p.getCPost(idp).postTxt = ar4;
          p.updatetxt(idp);
          parsecmd("_bbsposts;read;"+ f.getID() +";"+ t.getID(),activeChar);
        }
      }
    }
  }
View Full Code Here


  @Override
  public void parsewrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2PcInstance activeChar)
  {
    if (ar1.equals("crea"))
    {
      Forum f = ForumsBBSManager.getInstance().getForumByID(Integer.parseInt(ar2));
      if (f == null)
      {
        ShowBoard sb = new ShowBoard("<html><body><br><br><center>the forum: " + ar2
          + " is not implemented yet</center><br><br></body></html>", "101");
        activeChar.sendPacket(sb);
        activeChar.sendPacket(new ShowBoard(null, "102"));
        activeChar.sendPacket(new ShowBoard(null, "103"));
      }
      else
      {
        f.vload();
        Topic t = new Topic(Topic.ConstructorType.CREATE,
                  TopicBBSManager.getInstance().getMaxID(f) + 1,
                  Integer.parseInt(ar2), ar5,
                  Calendar.getInstance().getTimeInMillis(), activeChar.getName(),
                  activeChar.getObjectId(), Topic.MEMO, 0);
        f.addtopic(t);
        TopicBBSManager.getInstance().setMaxID(t.getID(), f);
        Post p = new Post(activeChar.getName(), activeChar.getObjectId(),
                  Calendar.getInstance().getTimeInMillis(), t.getID(), f.getID(), ar4);
        PostBBSManager.getInstance().addPostByTopic(p, t);
        parsecmd("_bbsmemo", activeChar);
      }

    }
    else if (ar1.equals("del"))
    {
      Forum f = ForumsBBSManager.getInstance().getForumByID(Integer.parseInt(ar2));
      if (f == null)
      {
        ShowBoard sb = new ShowBoard("<html><body><br><br><center>the forum: " + ar2
          + " does not exist !</center><br><br></body></html>", "101");
        activeChar.sendPacket(sb);
        activeChar.sendPacket(new ShowBoard(null, "102"));
        activeChar.sendPacket(new ShowBoard(null, "103"));
      }
      else
      {
        Topic t = f.gettopic(Integer.parseInt(ar3));
        if (t == null)
        {
          ShowBoard sb = new ShowBoard("<html><body><br><br><center>the topic: " + ar3
            + " does not exist !</center><br><br></body></html>", "101");
          activeChar.sendPacket(sb);
View Full Code Here

      StringTokenizer st = new StringTokenizer(command, ";");
      st.nextToken();
      st.nextToken();
      int idf = Integer.parseInt(st.nextToken());
      int idt = Integer.parseInt(st.nextToken());
      Forum f = ForumsBBSManager.getInstance().getForumByID(idf);
      if (f == null)
      {
        ShowBoard sb = new ShowBoard("<html><body><br><br><center>the forum: " + idf
          + " does not exist !</center><br><br></body></html>", "101");
        activeChar.sendPacket(sb);
        activeChar.sendPacket(new ShowBoard(null, "102"));
        activeChar.sendPacket(new ShowBoard(null, "103"));
      }
      else
      {
        Topic t = f.gettopic(idt);
        if (t == null)
        {
          ShowBoard sb = new ShowBoard("<html><body><br><br><center>the topic: " + idt
            + " does not exist !</center><br><br></body></html>", "101");
          activeChar.sendPacket(sb);
View Full Code Here

      PreparedStatement statement = con.prepareStatement("SELECT forum_id FROM forums WHERE forum_type=0");
      ResultSet result = statement.executeQuery();
      while (result.next())
      {

        Forum f = new Forum(Integer.parseInt(result.getString("forum_id")), null);
        _root.put(Integer.parseInt(result.getString("forum_id")), f);
      }
      result.close();
      statement.close();
    }
View Full Code Here

   * @param oid
   * @return
   */
  public Forum createNewForum(String name, Forum parent, int type, int perm, int oid)
  {
    Forum forum;
    forum = new Forum(name, parent, type, perm, oid);
    forum.insertindb();
    return forum;
  }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.communitybbs.BB.Forum

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.