aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/http/www/PageTemplates.java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2013-02-23 14:51:10 +0700
committerGravatar Ugnich Anton2013-02-23 14:51:10 +0700
commit19cf26ce2f8ee05fc8a9298e2c19b8fff589b8e6 (patch)
tree795b1a6bcdc3946c444709a3e1c68d67a64d5bb9 /src/java/com/juick/http/www/PageTemplates.java
parentcdbf949013fe140fed0e5ad79ad6111c97ea07ad (diff)
Yandex.Direct
Diffstat (limited to 'src/java/com/juick/http/www/PageTemplates.java')
-rw-r--r--src/java/com/juick/http/www/PageTemplates.java36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/java/com/juick/http/www/PageTemplates.java b/src/java/com/juick/http/www/PageTemplates.java
index 42fafaf7..70f4d1ef 100644
--- a/src/java/com/juick/http/www/PageTemplates.java
+++ b/src/java/com/juick/http/www/PageTemplates.java
@@ -52,7 +52,7 @@ public class PageTemplates {
out.println("<html>");
out.println("<head>");
out.println(" <title>" + title + "</title>");
- out.println(" <link rel=\"stylesheet\" href=\"//static.juick.com/style3.2013012601.css\"/>");
+ out.println(" <link rel=\"stylesheet\" href=\"//static.juick.com/style3.2013022002.css\"/>");
out.println(" <link rel=\"icon\" type=\"image/png\" href=\"//static.juick.com/favicon.png\"/>");
out.println(" <script type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js\" defer=\"defer\"></script>");
out.println(" <script type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js\" defer=\"defer\" async=\"async\"></script>");
@@ -351,7 +351,7 @@ public class PageTemplates {
return msg;
}
- public static void printMessages(PrintWriter out, Connection sql, com.juick.User user, ArrayList<Integer> mids, com.juick.User visitor, Locale locale) {
+ public static void printMessages(PrintWriter out, Connection sql, com.juick.User user, ArrayList<Integer> mids, com.juick.User visitor, Locale locale, int YandexID) {
ResourceBundle rb = ResourceBundle.getBundle("Global", locale);
ArrayList<com.juick.Message> msgs = MessagesQueries.getMessages(sql, mids);
@@ -365,6 +365,38 @@ public class PageTemplates {
}
for (int i = 0; i < msgs.size(); i++) {
+
+ if (i == 1 && YandexID > 0) {
+ out.println(" <li class=\"ads\"><div id=\"yandex_ad\"></div></li>");
+ out.println("<script type=\"text/javascript\">");
+ out.println("(function(w, d, n, s, t) {");
+ out.println("w[n] = w[n] || [];");
+ out.println("w[n].push(function() {");
+ out.println("Ya.Direct.insertInto(84715, \"yandex_ad\", {");
+ out.println("stat_id: " + YandexID + ",");
+ out.println("site_charset: \"utf-8\",");
+ out.println("ad_format: \"direct\",");
+ out.println("font_size: 1,");
+ out.println("type: \"flat\",");
+ out.println("limit: 1,");
+ out.println("title_font_size: 2,");
+ out.println("site_bg_color: \"FFFFFF\",");
+ out.println("title_color: \"006699\",");
+ out.println("url_color: \"000000\",");
+ out.println("text_color: \"000000\",");
+ out.println("hover_color: \"006699\"");
+ out.println("});");
+ out.println("});");
+ out.println("t = d.documentElement.firstChild;");
+ out.println("s = d.createElement(\"script\");");
+ out.println("s.type = \"text/javascript\";");
+ out.println("s.src = \"http://an.yandex.ru/system/context.js\";");
+ out.println("s.setAttribute(\"async\", \"true\");");
+ out.println("t.insertBefore(s, t.firstChild);");
+ out.println("})(window, document, \"yandex_context_callbacks\");");
+ out.println("</script>");
+ }
+
com.juick.Message msg = msgs.get(i);
String tags = msg.Tags.isEmpty() ? "" : formatTags(msg.Tags, user);