Mercurial Hosting > nabble
annotate src/global/web/Index.jtp @ 7:a04508136174
add ads to homepage for verification
author | Raymond <mazdarulez@hotmail.com> |
---|---|
date | Thu, 25 Jul 2019 11:40:07 +0000 |
parents | 7ecd1a4ef557 |
children | aba8ed4c8a06 |
rev | line source |
---|---|
0 | 1 <% |
2 package global.web; | |
3 | |
4 import fschmidt.util.servlet.JtpContext; | |
5 import fschmidt.util.servlet.ServletUtils; | |
6 import global.HtmlGlobalUtils; | |
7 import global.Site; | |
8 import nabble.view.web.more.ForumStart; | |
9 import nabble.view.web.more.MailingListRequest; | |
10 import org.apache.lucene.index.Term; | |
11 import org.apache.lucene.search.IndexSearcher; | |
12 import org.apache.lucene.search.TermQuery; | |
13 import org.apache.lucene.search.Query; | |
14 import org.apache.lucene.search.ScoreDoc; | |
15 import org.apache.lucene.search.TopDocs; | |
16 import org.slf4j.Logger; | |
17 import org.slf4j.LoggerFactory; | |
18 | |
19 import javax.servlet.ServletException; | |
20 import javax.servlet.http.HttpServlet; | |
21 import javax.servlet.http.HttpServletRequest; | |
22 import javax.servlet.http.HttpServletResponse; | |
23 import java.io.IOException; | |
24 import java.io.PrintWriter; | |
25 | |
26 | |
27 public final class Index extends HttpServlet { | |
28 | |
29 private static final Logger logger = LoggerFactory.getLogger(Index.class); | |
30 | |
31 // private static boolean hasJobsAtNabble = Init.get("hasJobsAtNabble",false); | |
32 | |
33 public static String path() { | |
34 return "/"; | |
35 } | |
36 | |
37 protected void service(HttpServletRequest request,HttpServletResponse response) | |
38 throws ServletException, IOException | |
39 { | |
40 JtpContext jtpContext = (JtpContext)getServletContext().getAttribute(JtpContext.attrName); | |
41 jtpContext.setEtag(request,response,"x"); | |
42 PrintWriter out = response.getWriter(); | |
43 %> | |
44 <!DOCTYPE html> | |
45 <html lang="en"> | |
46 <head> | |
47 <% HtmlGlobalUtils.head(request, response, "Free Forum • Embeddable Web Apps"); %> | |
48 <link rel="canonical" href="https://www.nabble.com/"> | |
49 <script src="/assets/jquery/jquery-1.9.1.min.js"></script> | |
50 <script src="/trk5.js" async="true"></script> | |
51 <meta name="description" content="Create a free forum online in less than one minute. All forums are embeddable and fully customizable with scripting language. Choose a unique style and build a discussion board for your community." /> | |
52 <meta name="keywords" content="free forum, free mailing list, mailing list archive, free photo gallery, free newspaper, free blog, best forum, free message board, message board hosting, bulletin board, customizable, private forum, phpBB, vBulletin, hosted, communities"> | |
53 <meta name="google-site-verification" content="SUurO4gVJ46SZyzANkH4pJBGH8q-6Bv5P-ZgRBH8Cck" /> | |
54 <style> | |
55 div[actions] i.fa.fa-chevron-right{color:#DDD;float:right} | |
56 a[fixed]{margin-top:-3em;position:absolute;right:1em;text-decoration:none;background-color:#555;border-radius:.5em;padding:.5em;color:#D0D0D0;text-shadow:0px 1px 1px black;border-bottom:1px dotted #757474} | |
57 @media (max-width: 950px) { | |
58 div[footer]{padding-bottom:5em} | |
59 } | |
60 </style> | |
7
a04508136174
add ads to homepage for verification
Raymond <mazdarulez@hotmail.com>
parents:
0
diff
changeset
|
61 <script async="true" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> |
a04508136174
add ads to homepage for verification
Raymond <mazdarulez@hotmail.com>
parents:
0
diff
changeset
|
62 <script> |
a04508136174
add ads to homepage for verification
Raymond <mazdarulez@hotmail.com>
parents:
0
diff
changeset
|
63 (adsbygoogle = window.adsbygoogle || []).push({ |
a04508136174
add ads to homepage for verification
Raymond <mazdarulez@hotmail.com>
parents:
0
diff
changeset
|
64 google_ad_client: "ca-pub-6750305871516672", |
a04508136174
add ads to homepage for verification
Raymond <mazdarulez@hotmail.com>
parents:
0
diff
changeset
|
65 enable_page_level_ads: true |
a04508136174
add ads to homepage for verification
Raymond <mazdarulez@hotmail.com>
parents:
0
diff
changeset
|
66 }); |
a04508136174
add ads to homepage for verification
Raymond <mazdarulez@hotmail.com>
parents:
0
diff
changeset
|
67 </script> |
0 | 68 <script> |
69 $(document).ready(function() { | |
70 var $c1 = $('div[col1]'); | |
71 var $c2 = $('div[col2]'); | |
72 function centerAlign() { | |
73 var width = $c1.width() + $c2.width(); | |
74 var margin = ($c1.parent().width() - width)/2; | |
75 margin = margin > 0? margin : 0; | |
76 $c1.css('margin-left',margin+'px'); | |
77 }; | |
78 centerAlign(); | |
79 $(window).resize(centerAlign); | |
80 }); | |
81 | |
82 if (document.cookie.indexOf('st=1') >= 0) | |
83 $(window).focus(function(){try{window.close()}catch(err){}top.location='about:blank';}); | |
84 </script> | |
85 </head> | |
86 <body lato> | |
87 <% HtmlGlobalUtils.header(request,response); %> | |
88 <div full> | |
89 <div content> | |
90 <div col1 center> | |
91 <h1 oswald>Free Forum Hosting & Online Web Apps!</h1> | |
92 <h2 lato gray>Clean Look <span light>•</span> Embeddable <span light>•</span> Customizable</h2> | |
93 <img src="/assets/images/home.png" alt="Free forum hosting and online embeddable apps"/> | |
94 </div> | |
95 <div col2 actions> | |
96 <ul> | |
97 <li><a href="<%=HtmlGlobalUtils.nabbleContextUrl%><%=ForumStart.path("forum")%>" title="Click to create a free forum">Create Free Forum</a> <i class="fa fa-chevron-right"></i></li> | |
98 <li><a href="<%=HtmlGlobalUtils.nabbleContextUrl%><%=MailingListRequest.path()%>" title="Click to archive a mailing list">Archive Mailing List</a> <i class="fa fa-chevron-right"></i></li> | |
99 <li><a href="<%=HtmlGlobalUtils.nabbleContextUrl%><%=ForumStart.path("gallery")%>" title="Click to create a free photo gallery">Create Photo Gallery</a> <i class="fa fa-chevron-right"></i></li> | |
100 <li><a href="<%=HtmlGlobalUtils.nabbleContextUrl%><%=ForumStart.path("newspaper")%>" title="Click to create a free newspaper">Create News Site</a> <i class="fa fa-chevron-right"></i></li> | |
101 <li><a href="<%=HtmlGlobalUtils.nabbleContextUrl%><%=ForumStart.path("blog")%>" title="Click to create a free blog">Create Blog</a> <i class="fa fa-chevron-right"></i></li> | |
102 <li><a clck href="https://www.super-resume.com/" title="Click to build a free resume">Resume Builder</a> <i class="fa fa-chevron-right"></i></li> | |
103 </ul> | |
104 </div> | |
105 </div> | |
106 <div content paddingTop> | |
107 <div col33 center> | |
108 <h2 oswald>Multi Language</h2> | |
109 <ul floating> | |
110 <li>English</li> | |
111 <li>Čeština (Czech Republic)</li> | |
112 <li>Español</li> | |
113 <li>Français</li> | |
114 <li>Polski</li> | |
115 <li>Português (Brasil)</li> | |
116 <li>Svenska</li> | |
117 <li>Türkçe</li> | |
118 <li>Русский</li> | |
119 <li>Ελληνικά</li> | |
120 <li>中文 (简体)</li> | |
121 <li><a href="http://support.nabble.com/Nabble-Translations-f6669344.html">Translate to other languages</a> »</li> | |
122 </ul> | |
123 </div> | |
124 <div col33 center> | |
125 <h2 oswald>Embed into any Website</h2> | |
126 <p lineHeight marginHorizontal>All Nabble apps are naturally embeddable, which means that they can be easily displayed inside any web page. | |
127 </p> | |
128 </div> | |
129 <div col33 center> | |
130 <h2 oswald>Fully Customizable</h2> | |
131 <p lineHeight marginHorizontal>All Nabble apps are built with NAML, a scripting language that gives you full control over the app pages.</p> | |
132 </div> | |
133 </div> | |
134 <div content center paddingTop> | |
135 <h2 oswald>Browse Active Nabble Apps</h2> | |
136 <% topSites(out); %> | |
137 </div> | |
138 </div> | |
139 <% HtmlGlobalUtils.footer(request,response); %> | |
140 <%/*%> | |
141 <a fixed href="http://www.blasma.com">Help design a new forum <i class="fa fa-chevron-right"></i></a> | |
142 <%*/%> | |
143 </body> | |
144 </html> | |
145 <% | |
146 } | |
147 | |
148 static Query query = new TermQuery(new Term(Site.EMBARRASSING_FLD,"false")); | |
149 | |
150 private static void topSites(PrintWriter out) | |
151 throws ServletException, IOException | |
152 { | |
153 IndexSearcher searcher; | |
154 TopDocs hits; | |
155 try { | |
156 searcher = new IndexSearcher(Site.dir()); | |
157 hits = searcher.search( query, 60, Site.SORT_BY_VALUE ); | |
158 } catch(IOException e) { | |
159 logger.error("Index error", e); | |
160 %>[Rebuilding Index]<% | |
161 return; | |
162 } | |
163 try { | |
164 %> | |
165 <ul floating center> | |
166 <% | |
167 for( ScoreDoc sd : hits.scoreDocs ) { | |
168 Site site = new Site( searcher.doc(sd.doc) ); | |
169 %> | |
170 <li><%=site.link()%></li> | |
171 <% | |
172 } | |
173 %> | |
174 </ul> | |
175 <div style="padding-top:.5em;clear:both"> | |
176 <a bold href="<%=RootForums.path()%>" title="View more active forums and apps">View More</a></b> <i class="fa fa-chevron-right"></i> | |
177 </div> | |
178 <% | |
179 } finally { | |
180 searcher.close(); | |
181 } | |
182 } | |
183 | |
184 } | |
185 %> |