diff options
Diffstat (limited to 'src/java/com/juick/http/www/Discover.java')
-rw-r--r-- | src/java/com/juick/http/www/Discover.java | 12 |
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) { |