001: package forum;
002:
003: import javax.servlet.*;
004: import javax.servlet.http.*;
005: import java.util.*;
006:
007: public class Include {
008:
009: public static final String DOCTYPE = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 "
010: + "Transitional//EN\">";
011:
012: public static String header(String title) {
013: String head = "<Html>\n" + "<Head>\n" + "<Title>" + title
014: + "</Title>\n" + "</Head>\n";
015: return (DOCTYPE + "\n" + head);
016: }
017:
018: public static String body() {
019: String body = "<Body>\n"
020: + "<center><a href=\"..\\forum\\index.jsp\"><img src=\"..\\forum\\logo.jpg\" border=\"0\"></a></center>\n"
021: + "<br>\n";
022:
023: return (body);
024: }
025:
026: public static String body(String username) {
027: String body = Table_start()
028: + Table_title("InfoBar", 1, "left")
029: + Table_start_body()
030: + Table_body(new Date().toString(), 0)
031: + Table_close_body()
032: + Table_close()
033: + "<Body>\n"
034: + "<center><a href=\"..\\forum\\index.jsp\"><img src=\"..\\logo.jpg\" border=\"0\"></a></center>\n"
035: + "<br>\n"
036: + Table_start()
037: + Table_title("ToolBar", 1, "left")
038: + Table_start_body()
039: + Table_body("Logged in as:<b> "
040: + username.toUpperCase()
041: + "</b> "
042: + "<a href=\"forum.Profile\">Your Profile</a>",
043: 0) + Table_close_body() + Table_close()
044: + "<br>\n";
045:
046: return (body);
047: }
048:
049: public static String Table_start() {
050: String Table_start = "<TABLE cellSpacing=\"0\" cellPadding=\"0\" width=\"90%\" bgColor=\"#336699\" border=\"0\" align=\"center\">\n"
051: + "<TR>\n"
052: + "<TD>\n"
053: + "<TABLE cellSpacing=\"1\" cellPadding=\"4\" width=\"100%\" border=\"0\">\n"
054: + "<TR bgColor=\"#ccccff\">\n";
055: return Table_start;
056: }
057:
058: public static String Table_start_title() {
059: String Table_start_title = "<TR bgColor=#ccccff>";
060: return Table_start_title;
061: }
062:
063: public static String Table_title(String title, int colspan,
064: String align) {
065: String Table_title = "<TD align=\""
066: + align
067: + "\" colspan=\""
068: + colspan
069: + "\">"
070: + "<FONT face=Verdana,Arial,Helvetica color=#003366 size=1>"
071: + "<B>" + title + "</B>" + "</FONT>" + "</TD>";
072: return Table_title;
073: }
074:
075: public static String Table_start_body() {
076: String Table_start_body = "<TR bgColor=#ffffff>";
077: return Table_start_body;
078: }
079:
080: public static String Table_body(String body, int width) {
081: String Table_body = "<TD align=\"left\" valign=\"top\" width=\""
082: + width
083: + "\">"
084: + "<FONT face=Verdana,Arial,Helvetica color=#003366 size=1>"
085: + body + "</FONT>" + "</TD>";
086: return Table_body;
087: }
088:
089: public static String Table_close_body() {
090: String Table_close_body = "</TR>";
091: return Table_close_body;
092: }
093:
094: public static String Table_close() {
095: String Table_close = "</TABLE>" + "</TD>" + "</TR>"
096: + "</TABLE>";
097: return Table_close;
098: }
099:
100: public static String emoticons() {
101: String emoticons = "<table cellSpacing=\"0\" cellPadding=\"5\" width=\"100%\">\n"
102: + "<tr>\n"
103: + "<td width=100><a onclick=javascript:form.message.value+=\":mellow:\";form.message.focus();><img src=./emoticons/mellow.gif border=0></a></td>\n"
104: + "<td width=100><a onclick=javascript:form.message.value+=\":huh:\";form.message.focus();><img src=./emoticons/huh.gif border=0></a></td>\n"
105: + "<td width=100><a onclick=javascript:form.message.value+=\":rolleyes:\";form.message.focus();><img src=./emoticons/rolleyes.gif border=0></a></td>\n"
106: + "</tr>\n"
107: + "<tr>\n"
108: + "<td width=100><a onclick=javascript:form.message.value+=\":lol:\";form.message.focus();><img src=./emoticons/lol.gif border=0></a></td>\n"
109: + "<td width=100><a onclick=javascript:form.message.value+=\":wub:\";form.message.focus();><img src=./emoticons/wub.gif border=0></a></td>\n"
110: + "<td width=100><a onclick=javascript:form.message.value+=\":angry:\";form.message.focus();><img src=./emoticons/angry.gif border=0></a></td>\n"
111: + "</tr>\n"
112: + "<tr>\n"
113: + "<td width=100><a onclick=javascript:form.message.value+=\":unsure:\";form.message.focus();><img src=./emoticons/unsure.gif border=0></a></td>\n"
114: + "<td width=100><a onclick=javascript:form.message.value+=\":wacko:\";form.message.focus();><img src=./emoticons/wacko.gif border=0></a></td>\n"
115: + "<td width=100><a onclick=javascript:form.message.value+=\":blink:\";form.message.focus();><img src=./emoticons/blink.gif border=0></a></td>\n"
116: + "</tr>\n"
117: + "<tr>\n"
118: + "<td width=100><a onclick=javascript:form.message.value+=\":ph34r:\";form.message.focus();><img src=./emoticons/ph34r.gif border=0></a></td>\n"
119: + "<td width=100><a onclick=javascript:form.message.value+=\":wacko:\";form.message.focus();><img src=./emoticons/wacko.gif border=0></a></td>\n"
120: + "<td width=100><a onclick=javascript:form.message.value+=\":bounce:\";form.message.focus();><img src=./emoticons/bounce.gif border=0></a></td>\n"
121: + "</tr>\n"
122: + "<tr>\n"
123: + "<td width=100><a onclick=javascript:form.message.value+=\":fuck:\";form.message.focus();><img src=./emoticons/fuck.gif border=0></a></td>\n"
124: + "<td width=100><a onclick=javascript:form.message.value+=\":scream:\";form.message.focus();><img src=./emoticons/scream.gif border=0></a></td>\n"
125: + "<td width=100><a onclick=javascript:form.message.value+=\":silly:\";form.message.focus();><img src=./emoticons/silly.gif border=0></a></td>\n"
126: + "</tr>\n"
127: + "<tr>\n"
128: + "<td width=100><a onclick=javascript:form.message.value+=\":frusty:\";form.message.focus();><img src=./emoticons/frusty.gif border=0></a></td>\n"
129: + "<td width=100><a onclick=javascript:form.message.value+=\":kwijl:\";form.message.focus();><img src=./emoticons/kwijl.gif border=0></a></td>\n"
130: + "<td width=100><a onclick=javascript:form.message.value+=\":puke:\";form.message.focus();><img src=./emoticons/puke.gif border=0></a></td>\n"
131: + "</tr>\n"
132: + "<tr>\n"
133: + "<td width=100><a onclick=javascript:form.message.value+=\":bid:\";form.message.focus();><img src=./emoticons/bid.gif border=0></a></td>\n"
134: + "<td width=100><a onclick=javascript:form.message.value+=\":hammer:\";form.message.focus();><img src=./emoticons/hammer.gif border=0></a></td>\n"
135: + "<td width=100><a onclick=javascript:form.message.value+=\":good:\";form.message.focus();><img src=./emoticons/good.gif border=0></a></td>\n"
136: + "</tr></table>\n";
137: return emoticons;
138: }
139:
140: public static String avatars() {
141: String avatars = "<select name=\"avatar_list\" size=\"10\" onchange=\"document.images.img.src=document.profile.avatar_list.options[document.profile.avatar_list.selectedIndex].value;document.profile.link_avatar.value=document.profile.avatar_list.options[document.profile.avatar_list.selectedIndex].value;\">\n";
142: for (int i = 0; i < 55; i++) {
143: avatars = avatars + "<option value=\"../avatars/avatar_"
144: + i + ".jpg\">Avatar " + i + "</option>\n";
145: }
146: avatars = avatars + "</select>\n";
147: return avatars;
148: }
149:
150: public static String footer() {
151: String foot = "<br><center>© 2002 by <a href=mailto:grieks03@ie.hva.nl>Erwin</a></center>"
152: + "</Body>\n" + "</Html>\n";
153: return (foot);
154: }
155: }
|