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