diff options
-rw-r--r-- | src/lq/Quote.java | 2 | ||||
-rw-r--r-- | src/lq/ViewQuote.java | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/lq/Quote.java b/src/lq/Quote.java index 9d399fb..237f002 100644 --- a/src/lq/Quote.java +++ b/src/lq/Quote.java @@ -40,8 +40,8 @@ public class Quote { @Persistent private Integer numVotes; + // sum [ (rating-2.5) * abs(rating-2.5) | rating <- votes ] @Persistent - // sum [ (rating-3) * abs((rating-3)) | rating <- votes ] private Double scorePoints; public Quote(Date quoteDate, String author, String content, String ip) { diff --git a/src/lq/ViewQuote.java b/src/lq/ViewQuote.java index 2575523..5c40ac3 100644 --- a/src/lq/ViewQuote.java +++ b/src/lq/ViewQuote.java @@ -20,6 +20,8 @@ public class ViewQuote extends HttpServlet { Quote quote = QuoteUtil.getQuoteWithId(id); resp.setContentType("text/html"); + resp.getWriter().println(header); + resp.getWriter().println("<pre><hr>"); if (quote != null) { Printer printer = new Printer(resp.getWriter()); @@ -29,4 +31,21 @@ public class ViewQuote extends HttpServlet { resp.getWriter().println("Quote not found."); } } + + private final String header = + "<html> " + + "<head> " + + "<meta name=\"robots\" content=\"noindex, nofollow\" /> " + + "<title>Quotes fra #linux.no på freenode</title> " + + "<style type=\"text/css\"> " + + "body {font-family: monospace;}" + + "hr {" + + " border-style: solid;" + + " border-color: black;" + + " border-width: 1px; " + + "}" + + "</style> " + + "</head> " + + "<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#000000\" vlink=\"#000000\"> "; + } |