aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/http/www/Discover.java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2014-07-25 17:56:18 +0700
committerGravatar Ugnich Anton2014-07-25 17:56:18 +0700
commita0a9e4151991111886d88b565fda7db9fba1dfd8 (patch)
tree7f8ff1a97b2830f584d7c9d616997b1906422966 /src/java/com/juick/http/www/Discover.java
parent2b9c93ac6d216b67e95ccc0cfb30bc5f58c9744a (diff)
SEO, advertising
Diffstat (limited to 'src/java/com/juick/http/www/Discover.java')
-rw-r--r--src/java/com/juick/http/www/Discover.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/java/com/juick/http/www/Discover.java b/src/java/com/juick/http/www/Discover.java
index ca78f41e..201139c4 100644
--- a/src/java/com/juick/http/www/Discover.java
+++ b/src/java/com/juick/http/www/Discover.java
@@ -17,6 +17,7 @@
*/
package com.juick.http.www;
+import com.juick.server.AdsQueries;
import com.juick.server.MessagesQueries;
import com.juick.server.TagQueries;
import java.io.IOException;
@@ -90,7 +91,16 @@ public class Discover {
out.println("<section id=\"content\">");
if (mids.size() > 0) {
- PageTemplates.printMessages(out, sql, null, mids, visitor, visitor == null ? 2 : 3, 0);
+ int vuid = visitor != null ? visitor.UID : 0;
+ int ad_mid = AdsQueries.getAdMID(sql, vuid);
+ if (ad_mid > 0 && mids.indexOf(ad_mid) == -1) {
+ mids.add(0, ad_mid);
+ AdsQueries.logAdMID(sql, vuid, ad_mid);
+ } else {
+ ad_mid = 0;
+ }
+
+ PageTemplates.printMessages(out, sql, null, mids, visitor, visitor == null ? 2 : 3, ad_mid);
}
if (mids.size() >= 20) {