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

Examples of net.sf.l2j.gameserver.communitybbs.BB.Post$CPost


  {
    _postByTopic = new FastMap<Topic,Post>();
  }
  public Post getGPosttByTopic(Topic t)
  {
    Post post = null;
    post = _postByTopic.get(t);
    if(post == null)
    {
      post = load(t);
      _postByTopic.put(t,post);
View Full Code Here


   * @param t
   * @return
   */
  private Post load(Topic t)
  {
    Post p;
    p = new Post(t);
    return p;
  }
View Full Code Here

   * @param activeChar
   * @param idp
   */
  private void showEditPost(Topic topic, Forum forum, L2PcInstance activeChar, int idp)
  {
    Post p = getGPosttByTopic(topic);
    if((forum == null)||(topic == null)||(p == null))
    {
      ShowBoard sb = new ShowBoard("<html><body><br><br><center>Error, this forum, topic or post does not exit !</center><br><br></body></html>","101");
      activeChar.sendPacket(sb);
      activeChar.sendPacket(new ShowBoard(null,"102"));
View Full Code Here

   * @param forum
   */
  private void showMemoPost(Topic topic, L2PcInstance activeChar, Forum forum)
  {
    //
    Post p = getGPosttByTopic(topic);
    Locale locale = Locale.getDefault();
    DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, locale);
        TextBuilder html = new TextBuilder("<html><body><br><br>");
    html.append("<table border=0 width=610><tr><td width=10></td><td width=600 align=left>");
    html.append("<a action=\"bypass _bbshome\">HOME</a>&nbsp;>&nbsp;<a action=\"bypass _bbsmemo\">Memo Form</a>");
    html.append("</td></tr>");
    html.append("</table>");
    html.append("<img src=\"L2UI.squareblank\" width=\"1\" height=\"10\">");
    html.append("<center>");
    html.append("<table border=0 cellspacing=0 cellpadding=0 bgcolor=333333>");
    html.append("<tr><td height=10></td></tr>");
    html.append("<tr>");
    html.append("<td fixWIDTH=55 align=right valign=top>&$413; : &nbsp;</td>");
    html.append("<td fixWIDTH=380 valign=top>"+topic.getName()+"</td>");
    html.append("<td fixwidth=5></td>");
    html.append("<td fixwidth=50></td>");
    html.append("<td fixWIDTH=120></td>");
    html.append("</tr>");
    html.append("<tr><td height=10></td></tr>");
    html.append("<tr>");
    html.append("<td align=right><font color=\"AAAAAA\" >&$417; : &nbsp;</font></td>");
    html.append("<td><font color=\"AAAAAA\">"+topic.getOwnerName()+"</font></td>");
    html.append("<td></td>");
    html.append("<td><font color=\"AAAAAA\">&$418; :</font></td>");
    html.append("<td><font color=\"AAAAAA\">"+dateFormat.format(p.getCPost(0).postDate)+"</font></td>");
    html.append("</tr>");
    html.append("<tr><td height=10></td></tr>");
    html.append("</table>");
    html.append("<br>");
    html.append("<table border=0 cellspacing=0 cellpadding=0>");
    html.append("<tr>");
    html.append("<td fixwidth=5></td>");
    String Mes = p.getCPost(0).postTxt.replace(">","&gt;");
    Mes = Mes.replace("<","&lt;");
    Mes = Mes.replace("\n","<br1>");
    html.append("<td FIXWIDTH=600 align=left>"+ Mes +"</td>");
    html.append("<td fixqqwidth=5></td>");
    html.append("</tr>");
View Full Code Here

        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

                  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);
          activeChar.sendPacket(new ShowBoard(null, "102"));
          activeChar.sendPacket(new ShowBoard(null, "103"));
        }
        else
        {
          //CPost cp = null;
          Post p = PostBBSManager.getInstance().getGPosttByTopic(t);
          if (p != null)
          {
            p.deleteme(t);
          }
          t.deleteme(f);
          parsecmd("_bbsmemo", activeChar);
        }
      }
View Full Code Here

          activeChar.sendPacket(new ShowBoard(null, "103"));
        }
        else
        {
          //CPost cp = null;
          Post p = PostBBSManager.getInstance().getGPosttByTopic(t);
          if (p != null)
          {
            p.deleteme(t);
          }
          t.deleteme(f);
          parsecmd("_bbsmemo", activeChar);
        }
      }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.communitybbs.BB.Post$CPost

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.