%-- Before running this, take the HTML of the current Ptech index page and save it (as ptech.jsp) on the web server in the same directory as ptindex.jsp (this file). For each site that may call this program, you must have their top and bottom templates isolated and moved to this directory. Make sure there is a line under the two Hashtables to translate the siteid to the template filename. This program is called by a url reference like: http://business.belointeractive.com/ptindex.jsp?siteid=txcn&bgcolor=ddd222 --%>
<%@ page session=false %>
<%response.setHeader("Expires", "Thu, 01 Dec 1994 16:00:00 GMT"); %>
<%-- This first statement is required by JSP programming to include a function library --%>
<%@ page import = "java.util.*" %>
<%@ page import = "java.net.*" %>
<%-- These statements are taking the siteid= and bgcolor= off the URL line after the ? --%>
<% String rsiteid = request.getParameter( "siteid" );
%>
<% String rwellcontent = request.getParameter( "page" );
%>
<%-- This is Java stuff to create a lookup table. As we test/develop with other sites, we add coding for them --%>
<%
Hashtable topsiteID = new Hashtable(); // build hashtable
topsiteID.put("txcn", "txcntech_top.jsp");
topsiteID.put("nwcn", "nwcntech_top.jsp");
topsiteID.put("dallasnews","dallasnewstech_top.jsp");
topsiteID.put("kmov","kmovtech_top.jsp");
topsiteID.put("krem","kremtech_top.jsp");
topsiteID.put("king","kingtech_top.jsp");
topsiteID.put("kgw","kgwtech_top.jsp");
topsiteID.put("inland","inlandtech_top.jsp");
topsiteID.put("kmsb","kmsbtechhead_top.jsp");
topsiteID.put("azfamily","azfamilytech_top.jsp");
topsiteID.put("ktvb","ktvbtech_top.jsp");
topsiteID.put("kskn","kskntech_top.jsp");
topsiteID.put("whas","whastech_top.jsp");
topsiteID.put("wwl","wwltech_top.jsp");
topsiteID.put("khou","khoutech_top.jsp");
topsiteID.put("kvue","kvuetechhead_top.jsp");
topsiteID.put("mysanantonio","mysanantoniotech_top.jsp");
topsiteID.put("dentonrc","dentonrctech_top.jsp");
topsiteID.put("wvec","wvectech_top.jsp");
topsiteID.put("nbc6","nbc6tech_top.jsp");
topsiteID.put("projo","projotech_top.jsp");
topsiteID.put("wfaa","wfaatech_top.jsp");
topsiteID.put("arlington","arlingtontech_top.jsp");
Hashtable botsiteID = new Hashtable(); // build hashtable
botsiteID.put("txcn", "txcntech_bot.jsp");
botsiteID.put("nwcn", "nwcntech_bot.jsp");
botsiteID.put("dallasnews","dallasnewstech_bot.jsp");
botsiteID.put("kmov","kmovtech_bot.jsp");
botsiteID.put("krem","kremtech_bot.jsp");
botsiteID.put("king","kingtech_bot.jsp");
botsiteID.put("kgw","kgwtech_bot.jsp");
botsiteID.put("inland","inlandtech_bot.jsp");
botsiteID.put("kmsb","kmsbtech_bot.jsp");
botsiteID.put("azfamily","azfamilytech_bot.jsp");
botsiteID.put("ktvb","ktvbtech_bot.jsp");
botsiteID.put("kskn","kskntech_bot.jsp");
botsiteID.put("whas","whastech_bot.jsp");
botsiteID.put("wwl","wwltech_bot.jsp");
botsiteID.put("khou","khoutech_bot.jsp");
botsiteID.put("kvue","kvuetech_bot.jsp");
botsiteID.put("mysanantonio","mysanantoniotech_bot.jsp");
botsiteID.put("dentonrc","dentonrctech_bot.jsp");
botsiteID.put("wvec","wvectech_bot.jsp");
botsiteID.put("nbc6","nbc6tech_bot.jsp");
botsiteID.put("projo","projotech_bot.jsp");
botsiteID.put("wfaa","wfaatech_bot.jsp");
botsiteID.put("arlington","arlingtontech_bot.jsp");
%>
<%-- If siteid is specified, then we use it and set a cookie to its value. Otherwise (no siteid on the URL, I look up the cookie. --%>
<% if (rsiteid == null) {
Cookie cookies[] = request.getCookies();
Cookie cookie = null;
if (cookies != null) {
for (int i=0; i < cookies.length; ++i) {
if (cookies[i].getName().equals("Siteid")) {
cookie = cookies[i];
rsiteid = URLDecoder.decode(cookie.getValue());
break;
} else {}
}
} else {}
}
else {
Cookie cookie = new Cookie("Siteid", rsiteid);
cookie.setDomain(".belointeractive.com");
cookie.setPath("/");
cookie.setMaxAge(24 * 60 * 60);
response.addCookie(cookie);
}
String Thisisthetoptemplateid = (String)topsiteID.get(rsiteid);
String Thisisthebottomtemplateid = (String)botsiteID.get(rsiteid);
%>
<%-- This JSP coding does a server-side include of the HTML which represents the top template --%>
<%-- This JSP coding does a server-side include of the HTML which represents the bottom template --%>