if (index < 1)
{
index = 1;
}
//header
TextBuilder html = new TextBuilder("<html><body><br><br><center>");
html.append("<br1><br1><table border=0 cellspacing=0 cellpadding=0>");
html.append("<tr><td FIXWIDTH=15> </td>");
html.append("<td width=610 height=30 align=left>");
html.append("<a action=\"bypass _bbsclan_clanlist\"> CLAN COMMUNITY </a>");
html.append("</td></tr></table>");
html.append("<table border=0 cellspacing=0 cellpadding=0 width=610 bgcolor=434343>");
html.append("<tr><td height=10></td></tr>");
html.append("<tr>");
html.append("<td fixWIDTH=5></td>");
html.append("<td fixWIDTH=600>");
html.append("<a action=\"bypass _bbsclan_clanhome;"
+ ((activeChar.getClan() != null) ? activeChar.getClan().getClanId() : 0)
+ "\">[GO TO MY CLAN]</a> ");
html.append("</td>");
html.append("<td fixWIDTH=5></td>");
html.append("</tr>");
html.append("<tr><td height=10></td></tr>");
html.append("</table>");
//body
html.append("<br>");
html.append("<table border=0 cellspacing=0 cellpadding=2 bgcolor=5A5A5A width=610>");
html.append("<tr>");
html.append("<td FIXWIDTH=5></td>");
html.append("<td FIXWIDTH=200 align=center>CLAN NAME</td>");
html.append("<td FIXWIDTH=200 align=center>CLAN LEADER</td>");
html.append("<td FIXWIDTH=100 align=center>CLAN LEVEL</td>");
html.append("<td FIXWIDTH=100 align=center>CLAN MEMBERS</td>");
html.append("<td FIXWIDTH=5></td>");
html.append("</tr>");
html.append("</table>");
html.append("<img src=\"L2UI.Squareblank\" width=\"1\" height=\"5\">");
int i = 0;
for (L2Clan cl : ClanTable.getInstance().getClans())
{
if(i > (index + 1)*7)
{
break;
}
if(i >= (index - 1)*7)
{
html.append("<img src=\"L2UI.SquareBlank\" width=\"610\" height=\"3\">");
html.append("<table border=0 cellspacing=0 cellpadding=0 width=610>");
html.append("<tr> ");
html.append("<td FIXWIDTH=5></td>");
html.append("<td FIXWIDTH=200 align=center><a action=\"bypass _bbsclan_clanhome;"
+ cl.getClanId() + "\">" + cl.getName() + "</a></td>");
html.append("<td FIXWIDTH=200 align=center>" + cl.getLeaderName() + "</td>");
html.append("<td FIXWIDTH=100 align=center>" + cl.getLevel() + "</td>");
html.append("<td FIXWIDTH=100 align=center>" + cl.getMembersCount() + "</td>");
html.append("<td FIXWIDTH=5></td>");
html.append("</tr>");
html.append("<tr><td height=5></td></tr>");
html.append("</table>");
html.append("<img src=\"L2UI.SquareBlank\" width=\"610\" height=\"3\">");
html.append("<img src=\"L2UI.SquareGray\" width=\"610\" height=\"1\">");
}
i++;
}
html.append("<img src=\"L2UI.SquareBlank\" width=\"610\" height=\"2\">");
html.append("<table cellpadding=0 cellspacing=2 border=0><tr>");
if (index == 1)
{
html.append("<td><button action=\"\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
}
else
{
html.append("<td><button action=\"_bbsclan_clanlist;" + (index - 1)
+ "\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
}
i = 0;
int nbp;
nbp = ClanTable.getInstance().getClans().length / 8;
if (nbp * 8 != ClanTable.getInstance().getClans().length)
{
nbp++;
}
for (i = 1; i <= nbp; i++)
{
if (i == index)
{
html.append("<td> " + i + " </td>");
}
else
{
html.append("<td><a action=\"bypass _bbsclan_clanlist;" + i + "\"> " + i + " </a></td>");
}
}
if (index == nbp)
{
html.append("<td><button action=\"\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
}
else
{
html.append("<td><button action=\"bypass _bbsclan_clanlist;" + (index + 1)
+ "\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
}
html.append("</tr></table>");
html.append("<table border=0 cellspacing=0 cellpadding=0>");
html.append("<tr><td width=610><img src=\"sek.cbui141\" width=\"610\" height=\"1\"></td></tr>");
html.append("</table>");
html.append("<table border=0><tr><td><combobox width=65 var=keyword list=\"Name;Ruler\"></td><td><edit var = \"Search\" width=130 height=11 length=\"16\"></td>");
//TODO: search (Write in BBS)
html.append("<td><button value=\"&$420;\" action=\"Write 5 -1 0 Search keyword keyword\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\"> </td> </tr></table>");
html.append("<br>");
html.append("<br>");
html.append("</center>");
html.append("</body>");
html.append("</html>");
separateAndSend(html.toString(), activeChar);
}