Package com.l2jfrozen.gameserver.communitybbs.BB

Examples of com.l2jfrozen.gameserver.communitybbs.BB.Forum


    if(_forum == null)
    {
      if(_level >= 2)
      {
        final ForumsBBSManager fbbsm = ForumsBBSManager.getInstance();
        final Forum clanRootForum = fbbsm.getForumByName("ClanRoot");
        if (clanRootForum != null)
        {
          _forum = clanRootForum.getChildByName(_name);
          if(_forum == null)
          {
            _forum = fbbsm.createNewForum(_name, clanRootForum, Forum.CLAN, Forum.CLANMEMBERONLY, getClanId());
          }
        }
View Full Code Here


    int idf = Integer.parseInt(st.nextToken());
    int idt = Integer.parseInt(st.nextToken());
    int idp = Integer.parseInt(st.nextToken());
    st = null;

    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);
      sb = null;
      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);
        sb = null;
        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 if(p != null)
        {
          p.getCPost(idp).postTxt = ar4;
          p.updatetxt(idp);
          parsecmd("_bbsposts;read;" + f.getID() + ";" + t.getID(), activeChar);
        }

        cp = null;
        p = null;
      }
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);
        sb = null;
        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);
        t = null;
        p = null;
      }
      f = null;

    }
    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);
        sb = null;
        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);
          sb = null;
View Full Code Here

      int idf = Integer.parseInt(st.nextToken());
      int idt = Integer.parseInt(st.nextToken());

      st = null;

      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);
        sb = null;
        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);
          sb = null;
View Full Code Here

      con = L2DatabaseFactory.getInstance().getConnection(false);
      PreparedStatement statement = con.prepareStatement("SELECT forum_id FROM forums WHERE forum_type=0");
      ResultSet result = statement.executeQuery();
      while(result.next())
      {
        Forum f = new Forum(result.getInt("forum_id"), null);
        addForum(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 = new Forum(name, parent, type, perm, oid);
    forum.insertindb();
    return forum;
  }
View Full Code Here

TOP

Related Classes of com.l2jfrozen.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.