Mercurial Hosting > nabble
annotate src/global/web/Index.jtp @ 21:aba8ed4c8a06
semiprivate
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sat, 13 Jun 2020 22:30:48 -0600 |
parents | a04508136174 |
children | e0c501fb5229 |
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/"> | |
21 | 49 <!--script src="/assets/jquery/jquery-1.9.1.min.js"></script--> |
0 | 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> | |
21 | 55 div[actions] i.fa.fa-chevron-right { |
56 color: #DDD; | |
57 float: right; | |
58 } | |
59 a[fixed] { | |
60 margin-top: -3em; | |
61 position: absolute; | |
62 right: 1em; | |
63 text-decoration: none; | |
64 background-color: #555; | |
65 border-radius: .5em; | |
66 padding: .5em; | |
67 color: #D0D0D0; | |
68 text-shadow: 0px 1px 1px black; | |
69 border-bottom: 1px dotted #757474; | |
70 } | |
71 @media (max-width: 950px) { | |
72 div[footer] { | |
73 padding-bottom: 5em; | |
74 } | |
75 } | |
76 div[note] { | |
77 margin-top: 1em; | |
78 text-align: right; | |
79 } | |
0 | 80 </style> |
7
a04508136174
add ads to homepage for verification
Raymond <mazdarulez@hotmail.com>
parents:
0
diff
changeset
|
81 <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
|
82 <script> |
a04508136174
add ads to homepage for verification
Raymond <mazdarulez@hotmail.com>
parents:
0
diff
changeset
|
83 (adsbygoogle = window.adsbygoogle || []).push({ |
a04508136174
add ads to homepage for verification
Raymond <mazdarulez@hotmail.com>
parents:
0
diff
changeset
|
84 google_ad_client: "ca-pub-6750305871516672", |
a04508136174
add ads to homepage for verification
Raymond <mazdarulez@hotmail.com>
parents:
0
diff
changeset
|
85 enable_page_level_ads: true |
a04508136174
add ads to homepage for verification
Raymond <mazdarulez@hotmail.com>
parents:
0
diff
changeset
|
86 }); |
a04508136174
add ads to homepage for verification
Raymond <mazdarulez@hotmail.com>
parents:
0
diff
changeset
|
87 </script> |
0 | 88 <script> |
21 | 89 /* |
0 | 90 $(document).ready(function() { |
91 var $c1 = $('div[col1]'); | |
92 var $c2 = $('div[col2]'); | |
93 function centerAlign() { | |
94 var width = $c1.width() + $c2.width(); | |
95 var margin = ($c1.parent().width() - width)/2; | |
96 margin = margin > 0? margin : 0; | |
97 $c1.css('margin-left',margin+'px'); | |
98 }; | |
99 centerAlign(); | |
100 $(window).resize(centerAlign); | |
101 }); | |
102 | |
103 if (document.cookie.indexOf('st=1') >= 0) | |
104 $(window).focus(function(){try{window.close()}catch(err){}top.location='about:blank';}); | |
21 | 105 */ |
0 | 106 </script> |
107 </head> | |
108 <body lato> | |
109 <% HtmlGlobalUtils.header(request,response); %> | |
110 <div full> | |
21 | 111 <div content center> |
112 <span style="display:inline-block"> | |
0 | 113 <div col1 center> |
114 <h1 oswald>Free Forum Hosting & Online Web Apps!</h1> | |
115 <h2 lato gray>Clean Look <span light>•</span> Embeddable <span light>•</span> Customizable</h2> | |
116 <img src="/assets/images/home.png" alt="Free forum hosting and online embeddable apps"/> | |
117 </div> | |
118 <div col2 actions> | |
119 <ul> | |
120 <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> | |
121 <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> | |
122 <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> | |
123 <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> | |
124 <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> | |
125 </ul> | |
126 </div> | |
21 | 127 <div note> |
128 To prevent spam, new forums and other apps will only be visible to registered users. | |
129 </div> | |
130 </span> | |
0 | 131 </div> |
132 <div content paddingTop> | |
133 <div col33 center> | |
134 <h2 oswald>Multi Language</h2> | |
135 <ul floating> | |
136 <li>English</li> | |
137 <li>Čeština (Czech Republic)</li> | |
138 <li>Español</li> | |
139 <li>Français</li> | |
140 <li>Polski</li> | |
141 <li>Português (Brasil)</li> | |
142 <li>Svenska</li> | |
143 <li>Türkçe</li> | |
144 <li>Русский</li> | |
145 <li>Ελληνικά</li> | |
146 <li>中文 (简体)</li> | |
147 <li><a href="http://support.nabble.com/Nabble-Translations-f6669344.html">Translate to other languages</a> »</li> | |
148 </ul> | |
149 </div> | |
150 <div col33 center> | |
151 <h2 oswald>Embed into any Website</h2> | |
152 <p lineHeight marginHorizontal>All Nabble apps are naturally embeddable, which means that they can be easily displayed inside any web page. | |
153 </p> | |
154 </div> | |
155 <div col33 center> | |
156 <h2 oswald>Fully Customizable</h2> | |
157 <p lineHeight marginHorizontal>All Nabble apps are built with NAML, a scripting language that gives you full control over the app pages.</p> | |
158 </div> | |
159 </div> | |
160 <div content center paddingTop> | |
161 <h2 oswald>Browse Active Nabble Apps</h2> | |
162 <% topSites(out); %> | |
163 </div> | |
164 </div> | |
165 <% HtmlGlobalUtils.footer(request,response); %> | |
166 <%/*%> | |
167 <a fixed href="http://www.blasma.com">Help design a new forum <i class="fa fa-chevron-right"></i></a> | |
168 <%*/%> | |
169 </body> | |
170 </html> | |
171 <% | |
172 } | |
173 | |
174 static Query query = new TermQuery(new Term(Site.EMBARRASSING_FLD,"false")); | |
175 | |
176 private static void topSites(PrintWriter out) | |
177 throws ServletException, IOException | |
178 { | |
179 IndexSearcher searcher; | |
180 TopDocs hits; | |
181 try { | |
182 searcher = new IndexSearcher(Site.dir()); | |
183 hits = searcher.search( query, 60, Site.SORT_BY_VALUE ); | |
184 } catch(IOException e) { | |
185 logger.error("Index error", e); | |
186 %>[Rebuilding Index]<% | |
187 return; | |
188 } | |
189 try { | |
190 %> | |
191 <ul floating center> | |
192 <% | |
193 for( ScoreDoc sd : hits.scoreDocs ) { | |
194 Site site = new Site( searcher.doc(sd.doc) ); | |
195 %> | |
196 <li><%=site.link()%></li> | |
197 <% | |
198 } | |
199 %> | |
200 </ul> | |
201 <div style="padding-top:.5em;clear:both"> | |
202 <a bold href="<%=RootForums.path()%>" title="View more active forums and apps">View More</a></b> <i class="fa fa-chevron-right"></i> | |
203 </div> | |
204 <% | |
205 } finally { | |
206 searcher.close(); | |
207 } | |
208 } | |
209 | |
210 } | |
211 %> |