<%@ include file="globalPaths.jsp" %> <%-- Site global definitions, depending on particular server and location. --%><%@ include file="globalDefinitions.jsp" %><% String logged=(String)session.getValue("logged"); String artist = null; boolean userLogged = true; if ((logged==null)||(!logged.equals("yes"))) { userLogged = false; } else { artist = (String)session.getValue("loggedartist"); } Cookie[] cookies; cookies = request.getCookies(); String cookieArtist = ""; for (int icook = 0; cookies!=null && icook < cookies.length; icook++) { Cookie cookie = cookies[icook]; if ((cookie.getName()).equals("galleryArtistID")) { cookieArtist = cookie.getValue(); } } String remoteIP = "UndefinedIP"; if (request.getRemoteAddr() != null) { remoteIP = request.getRemoteAddr(); } Connection connection = null; Statement statement = null; ResultSet resultSet = null; String query = ""; String errorDescription = ""; String referrer = null; String email = null; String width="0"; int intWidth=0; String height="0"; String artistName = ""; String artistId = ""; String artworkName = ""; String artistPersonalLink = ""; String snapshot = ""; String screenshot = ""; String showEmail = ""; String phone = ""; String showPhone = ""; String website = ""; String artworkId = null; String url = null; Vector opsIds = new Vector(); Vector opsNames = new Vector(); Vector opsStartdates = new Vector(); Vector opsEnddates = new Vector(); Vector opsAddresses = new Vector(); Vector opsDistricts = new Vector(); Vector opsCities = new Vector(); Vector opsStates = new Vector(); Vector opsZips = new Vector(); Vector opsCountries = new Vector(); Vector opsComments = new Vector(); Vector exIds = new Vector(); Vector exNames = new Vector(); Vector exStartdates = new Vector(); Vector exEnddates = new Vector(); Vector exReceptiondates = new Vector(); Vector exAddresses = new Vector(); Vector exAddressComments = new Vector(); Vector exCities = new Vector(); Vector exStates = new Vector(); Vector exZips = new Vector(); Vector exCountries = new Vector(); Vector exComments = new Vector(); Vector woIds = new Vector(); Vector woNames = new Vector(); Vector woStartdates = new Vector(); Vector woEnddates = new Vector(); Vector woReceptiondates = new Vector(); Vector woAddresses = new Vector(); Vector woAddressComments = new Vector(); Vector woCities = new Vector(); Vector woStates = new Vector(); Vector woZips = new Vector(); Vector woCountries = new Vector(); Vector woComments = new Vector(); Vector keys=new Vector(); keys.addElement("eroiw"); keys.addElement("zxmbw"); keys.addElement("woijx"); keys.addElement("qpowe"); keys.addElement("vowps"); keys.addElement("fwous"); keys.addElement("fgqos"); keys.addElement("slkje"); keys.addElement("vbwpd"); keys.addElement("typwe"); int keyIndex=(int)Math.floor(Math.random()*keys.size()); String key=(String)keys.elementAt(keyIndex); // String captcha = request.getParameter("captcha"); boolean enableCaptcha=true; String captchaResponseToken = request.getParameter("resptoken"); boolean scam = false; boolean ok = false; if (request.getParameter("submit")==null) { referrer = request.getHeader("referer"); } else { referrer = request.getParameter("ref"); } try { artworkId = request.getParameter("artwork"); requireInteger("artwork", artworkId, false); connection = openConnection(); statement = connection.createStatement(); if (artworkId!=null) { query = "SELECT W.snapshot,W.heightImage,W.widthImage," + " A.firstName, A.lastName, A.id" + " FROM galleryArtwork W, galleryArtist A" + " WHERE A.id = W.artist AND W.id=" + artworkId; resultSet = statement.executeQuery(query); if (resultSet.next()) { snapshot=resultSet.getString("W.snapshot"); height=resultSet.getString("W.heightImage"); width=resultSet.getString("W.widthImage"); intWidth=resultSet.getInt("W.widthImage"); artistId = resultSet.getString("A.id"); String fn; String ln; fn = resultSet.getString("A.firstName"); ln = resultSet.getString("A.lastName"); if (fn.equals("")) { artistName = toUpperCaseFirstLetter(ln); } else { artistName = toUpperCaseFirstLetter(fn) + " " + toUpperCaseFirstLetter(ln); } } else { throw new UserInputException("Artwork not found"); } resultSet.close(); } if (userLogged && (request.getParameter("submit")==null)) { query = "SELECT firstName, lastName, email, portfolio FROM galleryArtist WHERE id=" + quoteString(getParameter("loggedartist")); resultSet = statement.executeQuery(query); if (resultSet.next()) { email=resultSet.getString("email"); } else { throw new UserInputException("Artist not found"); } resultSet.close(); } // if (request.getParameter("submit")==null) // { // // Remember captcha key // session.setAttribute("mailtofriend.captcha", key); // } if (request.getParameter("submit")!=null) { if (((request.getParameter("emailfriend")==null) ||(!checkEmail(request.getParameter("emailfriend"))) ||(request.getParameter("emailfriend").equals(""))) && request.getParameter("ToMailingList") == null) { throw new UserInputException("Please specify a correct recipient email"); } if (!"tru1218".equals(request.getParameter("jscheck"))) { scam = true; } // String storedCaptcha = (String)session.getAttribute("mailtofriend.captcha"); // if (storedCaptcha == null || !storedCaptcha.equals(captcha)) // { // scam = true; // } if (scam) { throw new UserInputException("There was a problem submitting your message. Unknown Error."); } if (enableCaptcha) { if (captchaResponseToken == null) { throw new UserInputException("Missing required captcha parameter"); } boolean flag = verifyCaptchaResponse(captchaResponseToken, remoteIP, null); if (!flag) { throw new UserInputException("\"I'm not a robot\" challenge failed"); } } if (request.getParameter("comments").equals("")) { // } if (request.getParameter("email").equals("")) { // } if (isSpam(request.getParameter("comments"), true, false)) { scam = true; throw new UserInputException("A problem has occured while recording you message."); } Vector names = new Vector(); Vector emails = new Vector(); artworkId = request.getParameter("artwork"); requireInteger("artwork", artworkId, false); if (request.getParameter("ToMailingList") != null) { query = "SELECT treatment, email FROM galleryArtistMailingList WHERE artist=" + quoteString(artist); resultSet = statement.executeQuery(query); while (resultSet.next()) { names.addElement(resultSet.getString("treatment")); emails.addElement(resultSet.getString("email")); } resultSet.close(); } if (referrer==null || "null".equals(referrer)) { referrer = globalSite+"/mailToFriend.jsp?artwork=" + artworkId; } String commentsnn = ""; if (!request.getParameter("comments").equals("")) { commentsnn = "You were sent the following message from MesArt visitor" + " <" + request.getParameter("email") + ">:" + "

" + request.getParameter("comments") + "

"; } //new block begin if (artworkId != null) { query = "SELECT W.name, W.screenshot, W.heightImage, W.widthImage," + " A.id, A.firstName, A.lastName, A.package, A.activeflag," + " A.email, A.phone, A.showEmail, A.showPhone, A.website, A.portfolio, A.ipLastLoggedFrom" + " FROM galleryArtwork W, galleryArtist A" + " WHERE W.artist = A.id AND (W.activeflag='Y' OR W.activeflag='L' OR W.activeflag='V')" + " AND W.id=" + quoteString(artworkId); resultSet = statement.executeQuery(query); if (resultSet.next()) { if (!"admin".equals((String)session.getValue("admin.logged")) && !remoteIP.equals(resultSet.getString("A.ipLastLoggedFrom")) && !artistId.equals(cookieArtist)) { if ("N".equals(resultSet.getString("A.activeflag"))) { sendRedirect(globalErrorPage + "?"+"errorDescription=" + URLencode("The pages you are trying to view" + " belong to an account that is not currently activated." + " If this is a new account, the artist needs to complete" + " the setup process before the artwork" + " will be available on the Internet.")); return; } if ("P".equals(resultSet.getString("A.activeflag"))) { sendRedirect(globalErrorPage + "?"+"errorDescription=" + URLencode("The pages you are trying to view" + " belong to an account that has been closed." + " Please update your bookmark.")); return; } } String fn; String ln; fn = resultSet.getString("A.firstName"); ln = resultSet.getString("A.lastName"); if (fn.equals("")) { artistName = toUpperCaseFirstLetter(ln); } else { artistName = toUpperCaseFirstLetter(fn) + " " + toUpperCaseFirstLetter(ln); } artistId = resultSet.getString("A.id"); screenshot = resultSet.getString("W.screenshot"); artworkName = resultSet.getString("W.name"); email = resultSet.getString("A.email"); showEmail = resultSet.getString("A.showEmail"); phone = resultSet.getString("A.phone"); showPhone = resultSet.getString("A.showPhone"); artistPersonalLink = resultSet.getString("A.portfolio"); website = resultSet.getString("A.website"); height=resultSet.getString("W.heightImage"); width=resultSet.getString("W.widthImage"); intWidth=resultSet.getInt("W.widthImage"); } else { throw new UserInputException("Artwork not found."); } resultSet.close(); //open studios data query = "SELECT OPS.*, OPSA.address, OPSA.comments" + " FROM galleryOpenStudio OPS" + " LEFT JOIN galleryOpenStudioArtist OPA" + " ON OPA.openStudioId=OPS.id" + " LEFT JOIN galleryOpenStudioAddress OPSA" + " ON OPSA.artist=OPA.artist AND OPSA.openStudioId=OPS.id" + " WHERE OPA.artist=" + quoteString(artistId) + " GROUP BY OPS.id ORDER BY OPS.startdate"; resultSet = statement.executeQuery(query); while (resultSet.next()) { opsIds.addElement(resultSet.getString("OPS.id")); opsNames.addElement(resultSet.getString("OPS.name")); if (resultSet.getString("OPSA.address")==null || "".equals(resultSet.getString("OPSA.address"))) { opsAddresses.addElement(resultSet.getString("OPS.placement")); } else { opsAddresses.addElement(resultSet.getString("OPSA.address")); } if (resultSet.getString("OPSA.comments")==null || "".equals(resultSet.getString("OPSA.comments"))) { opsComments.addElement(resultSet.getString("OPS.comments")); } else { opsComments.addElement(resultSet.getString("OPSA.comments")); } opsCities.addElement(resultSet.getString("OPS.city")); opsDistricts.addElement(resultSet.getString("OPS.district")); if (resultSet.getString("OPS.startdate")==null) { opsStartdates.addElement("01/01/1970"); } else { String sd = resultSet.getString("OPS.startdate"); String temp=sd.substring(5,7) + "/" + sd.substring(8,10) + "/" + sd.substring(0,4); opsStartdates.addElement(temp); } if (resultSet.getString("OPS.enddate")==null) { opsEnddates.addElement("01/01/1970"); } else { String ed = resultSet.getString("OPS.enddate"); String temp=ed.substring(5,7) + "/" + ed.substring(8,10) + "/" + ed.substring(0,4); opsEnddates.addElement(temp); } opsStates.addElement(resultSet.getString("OPS.state")); opsCountries.addElement(resultSet.getString("OPS.country")); opsZips.addElement(resultSet.getString("OPS.zip")); } resultSet.close(); //workshops data query = "SELECT GAE.* FROM galleryArtistExhibition GAE" + " LEFT JOIN galleryArtist A ON A.id=GAE.artist" + " WHERE GAE.flag='0' AND GAE.artist='" + artistId + "' ORDER BY GAE.startdate"; resultSet = statement.executeQuery(query); while (resultSet.next()) { woIds.addElement(resultSet.getString("GAE.id")); woNames.addElement(resultSet.getString("GAE.name")); woAddresses.addElement(resultSet.getString("GAE.address")); woCities.addElement(resultSet.getString("GAE.city")); if (resultSet.getString("GAE.startdate")==null) { woStartdates.addElement("01/01/1970"); } else { String sd = resultSet.getString("GAE.startdate"); String temp=sd.substring(5,7) + "/" + sd.substring(8,10) + "/" + sd.substring(0,4); woStartdates.addElement(temp); } if (resultSet.getString("GAE.enddate")==null) { woEnddates.addElement("01/01/1970"); } else { String ed = resultSet.getString("GAE.enddate"); String temp=ed.substring(5,7) + "/" + ed.substring(8,10) + "/" + ed.substring(0,4); woEnddates.addElement(temp); } if (resultSet.getString("GAE.receptiondate")==null) { woReceptiondates.addElement("01/01/1970"); } else { String sd = resultSet.getString("GAE.receptiondate"); String temp=sd.substring(5,7) + "/" + sd.substring(8,10) + "/" + sd.substring(0,4); woReceptiondates.addElement(temp); } woStates.addElement(resultSet.getString("GAE.state")); woCountries.addElement(resultSet.getString("GAE.country")); woZips.addElement(resultSet.getString("GAE.zip")); woComments.addElement(resultSet.getString("GAE.comments")); woAddressComments.addElement(resultSet.getString("GAE.addressComments")); } resultSet.close(); // exhibitions data query = "SELECT GAE.* FROM galleryArtistExhibition" + " GAE LEFT JOIN galleryArtist A" + " ON A.id=GAE.artist" + " WHERE GAE.flag='1' AND GAE.artist='" + artistId + "' ORDER BY GAE.startdate"; resultSet = statement.executeQuery(query); while (resultSet.next()) { exIds.addElement(resultSet.getString("GAE.id")); exNames.addElement(resultSet.getString("GAE.name")); exAddresses.addElement(resultSet.getString("GAE.address")); exCities.addElement(resultSet.getString("GAE.city")); if (resultSet.getString("GAE.startdate")==null) { exStartdates.addElement("01/01/1970"); } else { String sd = resultSet.getString("GAE.startdate"); String temp=sd.substring(5,7) + "/" + sd.substring(8,10) + "/" + sd.substring(0,4); exStartdates.addElement(temp); } if (resultSet.getString("GAE.enddate")==null) { exEnddates.addElement("01/01/1970"); } else { String ed = resultSet.getString("GAE.enddate"); String temp=ed.substring(5,7) + "/" + ed.substring(8,10) + "/" + ed.substring(0,4); exEnddates.addElement(temp); } if (resultSet.getString("GAE.receptiondate")==null) { exReceptiondates.addElement("01/01/1970"); } else { String sd = resultSet.getString("GAE.receptiondate"); String temp=sd.substring(5,7) + "/" + sd.substring(8,10) + "/" + sd.substring(0,4); exReceptiondates.addElement(temp); } exStates.addElement(resultSet.getString("GAE.state")); exCountries.addElement(resultSet.getString("GAE.country")); exZips.addElement(resultSet.getString("GAE.zip")); exComments.addElement(resultSet.getString("GAE.comments")); exAddressComments.addElement(resultSet.getString("GAE.addressComments")); } resultSet.close(); } else { throw new UserInputException("Parameter 'artwork' missing"); } if (artistPersonalLink.indexOf("www.mesart.com") == -1) artistPersonalLink = "http://www.mesart.com/" + artistPersonalLink; htmlContent = "" + "" + "Mail To Friend" + "" + "" + "
" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "
Visit " + artistName + " Portfolio
 
" + " 500 ? " width=500" : "") // Limit maximum width of displayed image + " border>" + "
 
" + artistName + ". " + artworkName + "
 
" + "" + "" + artistPersonalLink + "

" + commentsnn + "

"; if ("on".equals(request.getParameter("addEvents"))) { htmlContent += "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + ""; if (opsIds.size() > 0) { htmlContent += "" + "" + "" + "" + "" + ""; for (int i=0; i < opsIds.size(); i++) { if (i>0) { htmlContent += "" + "" + "" + ""; } htmlContent += "" + "" + "" + "" + "" + "" + "" + "" + ""; if ((String)opsComments.elementAt(i)!=null && !"".equals((String)opsComments.elementAt(i))) { htmlContent += "" + "" + "" + "" + "" + "" + "" + "" + "" + ""; } htmlContent += "" + ""; } } if (exIds.size() > 0) { htmlContent += "" + "" + "" + "" + "" + "" + ""; for (int i=0; i < exIds.size(); i++) { if (i>0) { htmlContent += "" + "" + "" + ""; } htmlContent += "" + "" + "" + "" + "" + ""; if ((String)exComments.elementAt(i)!=null && !"".equals((String)exComments.elementAt(i))) { htmlContent += "" + "" + "" + "" + "" + "" + ""; } } } if (woIds.size() > 0) { htmlContent += "" + "" + "" + "" + "" + "" + "" + ""; for (int i=0; i < woIds.size(); i++) { if (i>0) { htmlContent += "" + ""; } htmlContent += "" + "" + "" + "" + "" + ""; if ((String)woComments.elementAt(i)!=null && !"".equals((String)woComments.elementAt(i))) { htmlContent += "" + "" + "" + "" + "" + "" + "" + ""; } htmlContent += ""; } } htmlContent += "
   " + "" + artistName + "'s Calendar of Art Events
 Open Studios" + "   Day & Time  Studio AddressMap
  
 
" + "" + "" + "
" + ""; if ("East Bay Open Studios (Pro Arts)".equals((String)opsNames.elementAt(i))) { htmlContent += "Pro Arts
East Bay
OPS"; } else { if ("San Francisco OPS".equals((String)opsNames.elementAt(i))) { htmlContent += "San Francisco
OPS"; } else { htmlContent += (String)opsNames.elementAt(i); } } htmlContent += "
" + " 
" + "
  "; if (!"01/01/1970".equals(opsEnddates.elementAt(i))) { String dateString = ""; String stday = ((String)opsStartdates.elementAt(i)).substring(3,5); if ("0".equals(stday.substring(0,1))) stday = stday.substring(1,2); String enday = ((String)opsEnddates.elementAt(i)).substring(3,5); if ("0".equals(enday.substring(0,1))) enday = enday.substring(1,2); String stmonth = ((String)opsStartdates.elementAt(i)).substring(0,2); if ("0".equals(stmonth.substring(0,1))) stmonth = stmonth.substring(1,2); if ("1".equals(stmonth)) stmonth = "January"; if ("2".equals(stmonth)) stmonth = "February"; if ("3".equals(stmonth)) stmonth = "March"; if ("4".equals(stmonth)) stmonth = "April"; if ("5".equals(stmonth)) stmonth = "May"; if ("6".equals(stmonth)) stmonth = "June"; if ("7".equals(stmonth)) stmonth = "July"; if ("8".equals(stmonth)) stmonth = "August"; if ("9".equals(stmonth)) stmonth = "September"; if ("10".equals(stmonth)) stmonth = "October"; if ("11".equals(stmonth)) stmonth = "November"; if ("12".equals(stmonth)) stmonth = "December"; String enmonth = ((String)opsEnddates.elementAt(i)).substring(0,2); if ("0".equals(enmonth.substring(0,1))) enmonth = enmonth.substring(1,2); if ("1".equals(enmonth)) enmonth = "January"; if ("2".equals(enmonth)) enmonth = "February"; if ("3".equals(enmonth)) enmonth = "March"; if ("4".equals(enmonth)) enmonth = "April"; if ("5".equals(enmonth)) enmonth = "May"; if ("6".equals(enmonth)) enmonth = "June"; if ("7".equals(enmonth)) enmonth = "July"; if ("8".equals(enmonth)) enmonth = "August"; if ("9".equals(enmonth)) enmonth = "September"; if ("10".equals(enmonth)) enmonth = "October"; if ("11".equals(enmonth)) enmonth = "November"; if ("12".equals(enmonth)) enmonth = "December"; String styear = ((String)opsStartdates.elementAt(i)).substring(6,10); String enyear = ((String)opsEnddates.elementAt(i)).substring(6,10); if (enyear.equals(styear)) { if (enmonth.equals(stmonth)) { dateString = stmonth+" "+stday+" - "+enday+", "+styear; } else { dateString = stmonth+" "+stday+" - "+enmonth+" "+enday+", "+styear; } } else { dateString = stmonth + " " + stday+", " + styear + " - " + enmonth + " " + enday + ", " + enyear; } htmlContent += dateString; } htmlContent += "" + "" + "" + "" + "" + "
"; if (opsAddresses.elementAt(i)!=null) { url = "http://maps.yahoo.com/py/maps.py?Pyt=Tmap&"; if (!"".equals(opsAddresses.elementAt(i))) { url += "desc="+ substituteTokens(artistName+"-"+(String)opsNames.elementAt(i), " ", "+"); String tempo = substituteTokens((String)opsAddresses.elementAt(i), " ", "+") ; tempo = substituteTokens(tempo, "\"", "\'"); tempo = substituteTokens(tempo, " ", ""); url += "&addr="+tempo; htmlContent += opsAddresses.elementAt(i) + "
"; } if (!"".equals(opsDistricts.elementAt(i))) { htmlContent += opsDistricts.elementAt(i)+"
"; } if (!"".equals(opsCities.elementAt(i))) { url += "&city="+substituteTokens((String)opsCities.elementAt(i), " ", "+"); htmlContent += opsCities.elementAt(i); } if (!"".equals(opsStates.elementAt(i))) { url += "&state="+substituteTokens((String)opsStates.elementAt(i), " ", "+"); htmlContent += ", "+opsStates.elementAt(i); } if (!"".equals(opsZips.elementAt(i))) { url += "&zip="+substituteTokens((String)opsZips.elementAt(i), " ", "+"); htmlContent += " "+opsZips.elementAt(i); } if (!"".equals(opsCountries.elementAt(i)) && !"US".equals(opsCountries.elementAt(i)) ) { if ( "Canada".equals(opsCountries.elementAt(i))) { url += "&country=ca"; } htmlContent += "
"+opsCountries.elementAt(i); } else { if ( "US".equals(opsCountries.elementAt(i))) { url += "&country=us"; } else { url = null; } } } htmlContent += "
"; if ("US".equals(opsCountries.elementAt(i)) || "Canada".equals(opsCountries.elementAt(i))) { if (opsAddresses.elementAt(i)!=null && url != null) { htmlContent += "[" + "" + " Map]"; } } htmlContent += "
 
 " + "" + "" + "" + "
  " + convertHTMLSymbolsToPlainNew((String)opsComments.elementAt(i)) + "
 
 
 
" + " Exhibitions   
  
 
" + "" + "
" + "" + (String)exNames.elementAt(i) + "" + " 
  " + (String)exStartdates.elementAt(i)+"
"; if (!"01/01/1970".equals(exEnddates.elementAt(i))) { String dateString = ""; String stday = ((String)exStartdates.elementAt(i)).substring(3,5); if ("0".equals(stday.substring(0,1))) stday = stday.substring(1,2); String enday = ((String)exEnddates.elementAt(i)).substring(3,5); if ("0".equals(enday.substring(0,1))) enday = enday.substring(1,2); String stmonth = ((String)exStartdates.elementAt(i)).substring(0,2); if ("0".equals(stmonth.substring(0,1))) stmonth = stmonth.substring(1,2); if ("1".equals(stmonth)) stmonth = "January"; if ("2".equals(stmonth)) stmonth = "February"; if ("3".equals(stmonth)) stmonth = "March"; if ("4".equals(stmonth)) stmonth = "April"; if ("5".equals(stmonth)) stmonth = "May"; if ("6".equals(stmonth)) stmonth = "June"; if ("7".equals(stmonth)) stmonth = "July"; if ("8".equals(stmonth)) stmonth = "August"; if ("9".equals(stmonth)) stmonth = "September"; if ("10".equals(stmonth)) stmonth = "October"; if ("11".equals(stmonth)) stmonth = "November"; if ("12".equals(stmonth)) stmonth = "December"; String enmonth = ((String)exEnddates.elementAt(i)).substring(0,2); if ("0".equals(enmonth.substring(0,1))) enmonth = enmonth.substring(1,2); if ("1".equals(enmonth)) enmonth = "January"; if ("2".equals(enmonth)) enmonth = "February"; if ("3".equals(enmonth)) enmonth = "March"; if ("4".equals(enmonth)) enmonth = "April"; if ("5".equals(enmonth)) enmonth = "May"; if ("6".equals(enmonth)) enmonth = "June"; if ("7".equals(enmonth)) enmonth = "July"; if ("8".equals(enmonth)) enmonth = "August"; if ("9".equals(enmonth)) enmonth = "September"; if ("10".equals(enmonth)) enmonth = "October"; if ("11".equals(enmonth)) enmonth = "November"; if ("12".equals(enmonth)) enmonth = "December"; String styear = ((String)exStartdates.elementAt(i)).substring(6,10); String enyear = ((String)exEnddates.elementAt(i)).substring(6,10); if (enyear.equals(styear)) { //2004=2004 if (enmonth.equals(stmonth)) { //january=january dateString = stmonth+" "+stday+" - "+enday+", "+styear; } else { //january!=june dateString = stmonth+" "+stday+" - "+enmonth+" "+enday+", "+styear; } } else { //2004!=2005 dateString = stmonth+" "+stday+", " + styear+" - "+enmonth+" "+enday+", "+enyear; } htmlContent += dateString; } htmlContent += "
" + "" + "" + "
"; if (exAddresses.elementAt(i)!=null && !"".equals((String)exAddresses.elementAt(i))) { url = "http://maps.yahoo.com/py/maps.py?Pyt=Tmap&"; if (!"".equals(exAddresses.elementAt(i))) { url += "desc="+ substituteTokens(artistName+"-"+(String)exNames.elementAt(i), " ", "+"); String tempo = substituteTokens((String)exAddresses.elementAt(i), " ", "+") ; tempo = substituteTokens(tempo, "\"", "\'"); url += "&addr="+tempo; htmlContent += exAddresses.elementAt(i)+"
"; } if (!"".equals(exCities.elementAt(i))) { htmlContent += exCities.elementAt(i); url += "&city="+substituteTokens((String)exCities.elementAt(i), " ", "+"); } if (!"".equals(exStates.elementAt(i))) { htmlContent += ", "+exStates.elementAt(i); url += "&state="+substituteTokens((String)exStates.elementAt(i), " ", "+"); } if (!"".equals(exZips.elementAt(i))) { url += "&zip="+substituteTokens((String)exZips.elementAt(i), " ", "+"); htmlContent += " "+exZips.elementAt(i); } if (!"".equals(exCountries.elementAt(i)) && !"US".equals(exCountries.elementAt(i)) ) { if ( "Canada".equals(exCountries.elementAt(i))) { url += "&country=ca"; } htmlContent += "
"+exCountries.elementAt(i); } else { if ( "US".equals(exCountries.elementAt(i))) { url += "&country=us"; } else { url = null; } } } htmlContent += "
"; if ("US".equals(exCountries.elementAt(i)) || "Canada".equals(exCountries.elementAt(i))) { if (exAddresses.elementAt(i)!=null && !"".equals((String)exAddresses.elementAt(i))) { htmlContent += "[" + " Map]"; } } htmlContent += "
 
 " + "" + "" + "" + "
  " + convertHTMLSymbolsToPlainNew((String)exComments.elementAt(i)) + "
 
 
" + " Workshops   
 " + " 
 
" + "" + "
" + "" + (String)woNames.elementAt(i) + " 
  "; if (!"01/01/1970".equals(woEnddates.elementAt(i))) { String dateString = ""; String stday = ((String)woStartdates.elementAt(i)).substring(3,5); if ("0".equals(stday.substring(0,1))) stday = stday.substring(1,2); String enday = ((String)woEnddates.elementAt(i)).substring(3,5); if ("0".equals(enday.substring(0,1))) enday = enday.substring(1,2); String stmonth = ((String)woStartdates.elementAt(i)).substring(0,2); if ("0".equals(stmonth.substring(0,1))) stmonth = stmonth.substring(1,2); if ("1".equals(stmonth)) stmonth = "January"; if ("2".equals(stmonth)) stmonth = "February"; if ("3".equals(stmonth)) stmonth = "March"; if ("4".equals(stmonth)) stmonth = "April"; if ("5".equals(stmonth)) stmonth = "May"; if ("6".equals(stmonth)) stmonth = "June"; if ("7".equals(stmonth)) stmonth = "July"; if ("8".equals(stmonth)) stmonth = "August"; if ("9".equals(stmonth)) stmonth = "September"; if ("10".equals(stmonth)) stmonth = "October"; if ("11".equals(stmonth)) stmonth = "November"; if ("12".equals(stmonth)) stmonth = "December"; String enmonth = ((String)woEnddates.elementAt(i)).substring(0,2); if ("0".equals(enmonth.substring(0,1))) enmonth = enmonth.substring(1,2); if ("1".equals(enmonth)) enmonth = "January"; if ("2".equals(enmonth)) enmonth = "February"; if ("3".equals(enmonth)) enmonth = "March"; if ("4".equals(enmonth)) enmonth = "April"; if ("5".equals(enmonth)) enmonth = "May"; if ("6".equals(enmonth)) enmonth = "June"; if ("7".equals(enmonth)) enmonth = "July"; if ("8".equals(enmonth)) enmonth = "August"; if ("9".equals(enmonth)) enmonth = "September"; if ("10".equals(enmonth)) enmonth = "October"; if ("11".equals(enmonth)) enmonth = "November"; if ("12".equals(enmonth)) enmonth = "December"; String styear = ((String)woStartdates.elementAt(i)).substring(6,10); String enyear = ((String)woEnddates.elementAt(i)).substring(6,10); if (enyear.equals(styear)) { //2004=2004 if (enmonth.equals(stmonth)) { //january=january dateString = stmonth+" "+stday+" - "+enday+", "+styear; } else { //january!=june dateString = stmonth+" "+stday+" - "+enmonth+" "+enday+", "+styear; } } else { //2004!=2005 dateString = stmonth+" "+stday+", "+styear+" - "+enmonth+" "+enday+", "+enyear; } htmlContent += dateString; } htmlContent += "" + "" + "" + "" + "
"; if (woAddresses.elementAt(i)!=null && !"".equals((String)woAddresses.elementAt(i))) { url = "http://maps.yahoo.com/py/maps.py?Pyt=Tmap&"; if (!"".equals(woAddresses.elementAt(i))) { url += "desc="+ substituteTokens(artistName+"-"+(String)woNames.elementAt(i), " ", "+"); String tempo = substituteTokens((String)woAddresses.elementAt(i), " ", "+") ; tempo = substituteTokens(tempo, "\"", "\'"); url += "&addr="+tempo; htmlContent += woAddresses.elementAt(i)+"
"; } if (!"".equals(woCities.elementAt(i))) { htmlContent += woCities.elementAt(i); url += "&city="+substituteTokens((String)woCities.elementAt(i), " ", "+"); } if (!"".equals(woStates.elementAt(i))) { htmlContent += ", "+woStates.elementAt(i); url += "&state="+substituteTokens((String)woStates.elementAt(i), " ", "+"); } if (!"".equals(woZips.elementAt(i))) { url += "&zip="+substituteTokens((String)woZips.elementAt(i), " ", "+"); htmlContent += " "+woZips.elementAt(i); } if (!"".equals(woCountries.elementAt(i)) && !"US".equals(woCountries.elementAt(i)) ) { if ( "Canada".equals(woCountries.elementAt(i))) { url += "&country=ca"; } htmlContent += "
"+woCountries.elementAt(i); } else { if ( "US".equals(woCountries.elementAt(i))) { url += "&country=us"; } else { url = null; } } } htmlContent += "
"; if ("US".equals(woCountries.elementAt(i)) || "Canada".equals(woCountries.elementAt(i))) { if (woAddresses.elementAt(i)!=null && !"".equals((String)woAddresses.elementAt(i))) { htmlContent += "[" + "" + " Map]"; } } htmlContent += "
 
 " + "" + "
" + "  " + convertHTMLSymbolsToPlainNew((String)woComments.elementAt(i)) + "
 
 
 
"; } htmlContent += "" + "" + "" + ""; //new block end String subject = "Message from MesArt visitor"; if ("1".equals(request.getParameter("subj"))) subject = artistName + " Portfolio"; if ("2".equals(request.getParameter("subj"))) subject = "Invitation from " + artistName; if ("3".equals(request.getParameter("subj"))) subject = "Welcome to The Upcoming Events"; if ("4".equals(request.getParameter("subj"))) subject = "Happy Holiday!"; if (request.getParameter("emailfriend") != null) { if (!send(htmlContent, plainContent,request.getParameter("emailfriend"), request.getParameter("emailfriend"), subject,request.getParameter("email"), request.getParameter("email"), contactUsEmail, request.getRemoteAddr())) { // Error will be logged inside send function } } if (request.getParameter("ToMailingList") != null) {%> <% emailSender.setEnvironmentParameters(globalMailServer, globalMailServerPort, globalMailUsername, globalMailPassword, request.getRequestURL().toString(), request.getRemoteAddr(), (String)session.getValue("loggedartistname"), artist, request.getHeader("Referer"), globalLogDir); emailSender.setParameters(htmlContent, plainContent, names, emails, subject, request.getParameter("email"), request.getParameter("email"), null); new Thread(emailSender).start(); } session.putValue("referrerPage",referrer); sendRedirect("sendMailToFriend.jsp?artwork=" + request.getParameter("artwork")); return; } } catch(UserInputException uie) { if (!scam) { errorLog(uie); } errorDescription = "Error: " + uie.getMessage(); } catch(Exception e) { errorLog(e, query); sendRedirect(globalErrorPage + "?errorDescription=" + URLEncoder.encode(e.getMessage() + ".")); return; } finally { if (resultSet != null) resultSet.close(); if (connection != null && !connection.isClosed()) connection.close(); } %> Mail to Friend Page <%@ include file="inc/head.txt" %> <%@ include file="inc/top.txt" %>





Disclaimer: MesArt is not responsible for the content of this email.

 
 
 
<% if (errorDescription != null && errorDescription.length()>0) { %> <% } if (!userLogged || email==null || "".equals(email)) { %> <% } else { %> <% } %> <% if (userLogged) { %> <% } %>
   <%=errorDescription%>


From (e-mail):  
To (e-mail):  
To My Mailing List:  
Subject:  
Message (optional):  
  Add <%= artistName %> art events

 
We will not store your or your friend's e-mail address entered in this form. They will be used only for trasmission of this message. We will not sell or rent them to third parties. We will not willingly disclose your or your friend's email address to third parties without your consent, unless required by law.


 
<% if (artworkId!=null) { %>

1.15) { %> height=150 <% } else { if ((float)(Integer.valueOf(height).intValue())/(Integer.valueOf(width).intValue()) < 1/1.15) { %> width=150 <% } else { %> width=140 <% } } %>> <% } %>
<%@ include file="inc/bottom.txt" %> <%@ include file="globalFinally.jsp" %>