venice-main-classic/web/format/conf/posts.jsp

523 lines
20 KiB
Plaintext

<%--
The contents of this file are subject to the Mozilla Public License Version 1.1
(the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
WARRANTY OF ANY KIND, either express or implied. See the License for the specific
language governing rights and limitations under the License.
The Original Code is the Venice Web Communities System.
The Initial Developer of the Original Code is Eric J. Bowersox <erbo@users.sf.net>,
for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
Contributor(s):
--%>
<%@ page import = "java.util.*" %>
<%@ page import = "com.silverwrist.venice.core.*" %>
<%@ page import = "com.silverwrist.venice.ui.conf.CurrentConference" %>
<%@ page import = "com.silverwrist.venice.ui.conf.view.PostsView" %>
<%@ page import = "com.silverwrist.venice.ui.view.JSPView" %>
<%@ taglib uri="/tlds/util" prefix="util" %>
<%@ taglib uri="/tlds/post" prefix="post" %>
<%
PostsView view = PostsView.get(request);
final CommunityContext my_comm = view.getCommunity();
final ConferenceContext my_conf = view.getConference();
final TopicContext my_topic = view.getTopic();
final short my_topicnum = my_topic.getTopicNumber();
final short my_next = view.getNextTopic();
final int my_total_msg = my_topic.getTotalMessages();
final int my_unread = view.getUnread();
final int my_first = view.getFirst();
final int my_last = view.getLast();
final int my_pagesize = view.getPageSize();
final String base_locator = "cc=" + my_comm.getCommunityID() + "&conf=" + my_conf.getConfID();
final String topic_locator = base_locator + "&top=" + my_topicnum;
final String next_locator = base_locator + "&top=" + my_next;
final String restorer = "rtop=" + my_topicnum + "&rct=" + my_unread;
%>
<util:comment>
Posts <%= my_first %> through <%= my_last %> in topic #<%= my_topic.getTopicID() %>
</util:comment>
<util:header>
<util:title><%= view.getTitle() %></util:title>
<util:subtitle>
<% if (my_topic.isSticky()) { %>
(Sticky)
<% } // end if %>
<% if (my_topic.isHidden()) { %>
(Hidden)
<% } // end if %>
<% if (my_topic.isArchived()) { %>
(Archived)
<% } else if (my_topic.isFrozen()) { %>
(Frozen)
<% } // end if %>
<%= view.getSubtitle() %>
</util:subtitle>
</util:header>
<%= view.getTopCustom() %>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr valign="bottom">
<td nowrap="nowrap" align="left" colspan="2" class="content">
<util:call_jsp name="conf/posts_usercontrols.jsp"/>
</td>
</tr>
<% out.flush(); response.flushBuffer(); %>
<tr valign="bottom">
<td>&nbsp;</td>
<td nowrap="nowrap" align="right" class="content">
<util:comment>Topic admin controls section</util:comment>
<% if (my_topic.canStick()) { %>
&nbsp;
<% if (my_topic.isSticky()) { %>
<util:xlink>
<util:href type="servlet">conf/stick_topic.js.vs?<%= topic_locator %>&flag=0</util:href>
<util:text><util:button id="unstick_topic"/></util:text>
</util:xlink>
<% } else { %>
<util:xlink>
<util:href type="servlet">conf/stick_topic.js.vs?<%= topic_locator %>&flag=1</util:href>
<util:text><util:button id="stick_topic"/></util:text>
</util:xlink>
<%
} // end if
} // end if
if (my_topic.canFreeze()) {
%>
&nbsp;
<% if (my_topic.isFrozen()) { %>
<util:xlink>
<util:href type="servlet">conf/freeze_topic.js.vs?<%= topic_locator %>&flag=0</util:href>
<util:text><util:button id="unfreeze_topic"/></util:text>
</util:xlink>
<% } else { %>
<util:xlink>
<util:href type="servlet">conf/freeze_topic.js.vs?<%= topic_locator %>&flag=1</util:href>
<util:text><util:button id="freeze_topic"/></util:text>
</util:xlink>
<%
} // end if
} // end if
if (my_topic.canArchive()) {
%>
&nbsp;
<% if (my_topic.isArchived()) { %>
<util:xlink>
<util:href type="servlet">conf/archive_topic.js.vs?<%= topic_locator %>&flag=0</util:href>
<util:text><util:button id="unarchive_topic"/></util:text>
</util:xlink>
<% } else { %>
<util:xlink>
<util:href type="servlet">conf/archive_topic.js.vs?<%= topic_locator %>&flag=1</util:href>
<util:text><util:button id="archive_topic"/></util:text>
</util:xlink>
<%
} // end if
} // end if
if (my_topic.canDelete()) {
%>
&nbsp;
<util:xlink>
<util:href type="servlet">conf/delete_topic.js.vs?<%= topic_locator %></util:href>
<util:text><util:button id="delete_topic"/></util:text>
</util:xlink>
<% } // end if %>
</td>
</tr>
<% out.flush(); response.flushBuffer(); %>
<tr valign="bottom">
<td nowrap="nowrap" align="left" class="content">
<util:comment>Go box</util:comment>
<util:form verb="GET" action="conf/posts.js.vs" type="servlet"><div class="content">
<input type="hidden" name="cc" value="<%= my_comm.getCommunityID() %>" />
<input type="hidden" name="conf" value="<%= my_conf.getConfID() %>" />
<input type="hidden" name="top" value="<%= my_topicnum %>" />
<span class="cinput"><input type="text" class="cinput" name="pxg" value="" size="6"
maxlength="13"></span>&nbsp;
<util:button id="go" type="input"/>
</div></util:form>
</td>
<td nowrap="nowrap" align="right" class="content"><util:font color="content.fg" size="content">
<util:comment>Upper navigation linkset</util:comment>
<a name="top">[</a>&nbsp;
<util:xlink aclass="content">
<util:href type="servlet">conf/posts.js.vs?<%= topic_locator %>&p1=0&p2=-1</util:href>
<util:text>View All</util:text>
</util:xlink>
<% if (my_first>0) { %>
&nbsp;|&nbsp;
<util:xlink aclass="content">
<util:href type="servlet">
conf/posts.js.vs?<%= topic_locator %>&p1=<%= Math.max(my_first - my_pagesize,0) %>&p2=<%= my_first - 1 - Math.min(my_first - my_pagesize,0) %>
</util:href>
<util:text>Scroll Up <%= my_pagesize %></util:text>
</util:xlink>
<%
} // end if
if ((my_total_msg - (my_last + 1))>0) {
%>
&nbsp;|&nbsp;
<util:xlink aclass="content">
<util:href type="servlet">
conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_last + my_pagesize,my_total_msg - 1) %>
</util:href>
<util:text>Scroll Down <%= my_pagesize %></util:text>
</util:xlink>
&nbsp;|&nbsp;
<util:xlink aclass="content">
<util:href type="servlet">
conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_total_msg - my_pagesize %>&p2=<%= my_total_msg - 1 %>
</util:href>
<util:text>Scroll To End</util:text>
</util:xlink>
<% } // end if %>
&nbsp;|&nbsp;
<a class="content" href="#bottom">Bottom</a>
&nbsp;]
</util:font></td>
</tr>
<tr valign="middle">
<td align="center" colspan="2"><util:font color="content.fg" size="post-reference">
<util:xlink aclass="content">
<util:href type="servlet"><%= view.getPageQID() %></util:href>
<util:text>[Permalink to this topic]</util:text>
</util:xlink>
&nbsp;&nbsp;
<util:xlink aclass="content">
<util:href type="servlet"><%= view.getPageQID() %>.<%= my_first %>-<%= my_last %></util:href>
<util:text>[Permalink to these posts]</util:text>
</util:xlink>
</util:font></td>
</tr>
</table>
<% out.flush(); response.flushBuffer(); %>
<util:comment>Begin Actual Messages</util:comment>
<%
String last_post = "shac=1&p1=" + String.valueOf(my_total_msg - 1);
boolean can_line = false;
for (Iterator it=view.getMessages().iterator(); it.hasNext(); ) {
TopicMessageContext msg = (TopicMessageContext)(it.next());
String poster = view.getPosterName(msg);
if (can_line && (msg.getPostNumber()==(my_total_msg-my_unread))) {
out.write("<hr width=\"70%\" />\n");
} // end if
if (view.getShowAdvanced() && (view.getMessages().size()==1)) {
%>
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top"><td nowrap="nowrap" align="left" class="content">
<% } // end if %>
<util:font color="content.fg" size="content">
<%
if (!(view.bozoFilterUser(msg.getCreatorUID()))) {
out.write(view.getUserPhotoTag(JSPView.getRequestOutput(request),msg.getCreatorUID()));
} // end if
%>
<util:xlink aclass="content">
<util:href type="servlet">
conf/posts.js.vs?<%= topic_locator %>&shac=1&p1=<%= msg.getPostNumber() %>
</util:href>
<util:text><%= msg.getPostNumber() %></util:text>
</util:xlink> of
<util:xlink aclass="content">
<util:href type="servlet">conf/posts.js.vs?<%= topic_locator %>&<%= last_post %></util:href>
<util:text><%= my_total_msg - 1 %></util:text>
</util:xlink>
<util:font color="content.fg" size="post-reference">
&lt;<%= view.getTopicStem() %><%= msg.getPostNumber() %>&gt;
&nbsp;&nbsp;
<util:xlink aclass="content">
<util:href type="servlet"><%= view.getPageQID() %>.<%= msg.getPostNumber() %></util:href>
<util:text>[Permalink]</util:text>
</util:xlink>
</util:font>
<%
if (view.getShowAdvanced() && (view.getMessages().size()==1)) {
if (msg.isHidden()) {
out.write("<b><i>(Hidden)</i></b>\n");
} // end if
if (view.showBozoFilteredIndicator(msg.getCreatorUID())) {
%>
<b><i>(User filtered;
<util:xlink aclass="content">
<util:href type="servlet">
conf/message_bozo.js.vs?<%= topic_locator %>&msg=<%= msg.getPostNumber() %>&flag=0
</util:href>
<util:text>remove filter</util:text>
</util:xlink>)
</i></b>
<%
} // end if
} // end if
if (!(view.bozoFilterUser(msg.getCreatorUID()))) {
%>
<br />
<b><%= msg.getPseud() %></b>
(<i>
<util:xlink aclass="content" target="_blank">
<util:href type="servlet">user/<%= poster %></util:href>
<util:text><%= poster %></util:text>
</util:xlink>,
<%= view.formatDate(msg.getPostDate()) %>
</i>)
<% if (msg.hasAttachment()) { %>
<util:xlink>
<% if (view.displayAttachmentInNewWindow(msg)) { %>
<util:target>_blank</util:target>
<% } // end if %>
<util:href type="servlet">
conf/view_attachment.js.vs?<%= base_locator %>&msg=<%= msg.getPostID() %>
</util:href>
<util:text>
<util:image src="attachment.gif" fixup="true" width="16" height="16">
<util:alt>
(Attachment <%= msg.getAttachmentFilename() %> - <%= msg.getAttachmentLength() %> bytes)
</util:alt>
</util:image>
</util:text>
<util:linktitle>
(Attachment <%= msg.getAttachmentFilename() %> - <%= msg.getAttachmentLength() %> bytes)
</util:linktitle>
</util:xlink>
<%
} // end if
} // end if
%>
</util:font>
<p />
<% if (msg.isScribbled()) { %>
<span class="post"><tt><i><b>
(Scribbled by <%= view.getMessageBodyText(msg) %> on
<%= view.formatDate(msg.getScribbleDate()) %>)
</b></i></tt></SPAN>
<% if (view.getPhotoDims()!=null) { %><br clear="left" /><% } %><p />
<% } else if (view.bozoFilterUser(msg.getCreatorUID())) { %>
<span class="post"><tt><i><b>
<util:xlink>
<util:href type="servlet">
conf/posts.js.vs?<%= topic_locator %>&shac=1&nbz=1&p1=<%= msg.getPostNumber() %>
</util:href>
<util:text>
(Message from Filtered User:
<%= msg.getNumLines() %> <% if (msg.getNumLines()==1) { %>Line<% } else { %>Lines<% } %>)
</util:text>
</util:xlink>
</b></i></tt></span><p />
<% } else if (msg.isHidden() && (!(view.getShowAdvanced()) || (view.getMessages().size()!=1))) { %>
<span class="post"><tt><i><b>
<util:xlink>
<util:href type="servlet">
conf/posts.js.vs?<%= topic_locator %>&shac=1&p1=<%= msg.getPostNumber() %>
</util:href>
<util:text>
(Hidden Message:
<%= msg.getNumLines() %> <% if (msg.getNumLines()==1) { %>Line<% } else { %>Lines<% } %>)
</util:text>
</util:xlink>
</b></i></tt></span>
<% if (view.getPhotoDims()!=null) { %><br clear="left" /><% } %><p />
<% } else { %>
<tt><pre class="post"><post:rewrite><%= view.getMessageBodyText(msg) %></post:rewrite></pre></tt>
<% if (view.getPhotoDims()!=null) { %><br clear="left" /><% } %><p />
<%
} // end if
if (view.getShowAdvanced() && (view.getMessages().size()==1)) {
%>
</td><td nowrap="nowrap" align="right" class="content">
<%
if (!(msg.isScribbled())) {
if (msg.canHide()) {
if (msg.isHidden()) {
%>
<util:xlink>
<util:href type="servlet">
conf/hide_message.js.vs?<%= topic_locator %>&msg=<%= msg.getPostNumber() %>&flag=0
</util:href>
<util:text><util:button id="show"/></util:text>
</util:xlink><p />
<% } else { %>
<util:xlink>
<util:href type="servlet">
conf/hide_message.js.vs?<%= topic_locator %>&msg=<%= msg.getPostNumber() %>&flag=1
</util:href>
<util:text><util:button id="hide"/></util:text>
</util:xlink><p />
<%
} // end if
} // end if (can hide)
if (msg.canScribble()) {
%>
<util:xlink>
<util:href type="servlet">
conf/scribble_message.js.vs?<%= topic_locator %>&msg=<%= msg.getPostNumber() %>
</util:href>
<util:text><util:button id="scribble"/></util:text>
</util:xlink><p />
<%
} // end if (can scribble)
} // end if (not already scribbled)
if (view.showFilterButton(msg.getCreatorUID())) {
%>
<util:xlink>
<util:href type="servlet">
conf/message_bozo.js.vs?<%= topic_locator %>&msg=<%= msg.getPostNumber() %>&flag=1
</util:href>
<util:text><util:button id="filter_user"/></util:text>
</util:xlink><p />
<%
} // end if (can bozo filter)
if (msg.canNuke()) {
%>
<util:xlink>
<util:href type="servlet">
conf/nuke_message.js.vs?<%= topic_locator %>&msg=<%= msg.getPostNumber() %>
</util:href>
<util:text><util:button id="nuke"/></util:text>
</util:xlink><p />
<%
} // end if (can nuke)
if (msg.canMove() && (my_topic.getTotalMessages()>1)) {
%>
<util:xlink>
<util:href type="servlet">
conf/move_message.js.vs?<%= topic_locator %>&msg=<%= msg.getPostNumber() %>
</util:href>
<util:text><util:button id="move"/></util:text>
</util:xlink><p />
<%
} // end if (can move)
if (msg.canPublish()) {
%>
<util:xlink>
<util:href type="servlet">
conf/publish_message.js.vs?<%= topic_locator %>&msg=<%= msg.getPostNumber() %>
</util:href>
<util:text><util:button id="publish"/></util:text>
</util:xlink><p />
<% } // end if (can publish) %>
</td></tr></table><br />
<%
} // end if (showing advanced controls)
can_line = true;
out.flush();
response.flushBuffer();
} // end for
%>
<util:comment>End Actual Messages</util:comment>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr valign="middle">
<td align="center" colspan="2"><util:font color="content.fg" size="post-reference">
<util:xlink aclass="content">
<util:href type="servlet"><%= view.getPageQID() %></util:href>
<util:text>[Permalink to this topic]</util:text>
</util:xlink>
&nbsp;&nbsp;
<util:xlink aclass="content">
<util:href type="servlet"><%= view.getPageQID() %>.<%= my_first %>-<%= my_last %></util:href>
<util:text>[Permalink to these posts]</util:text>
</util:xlink>
</util:font></td>
</tr>
<tr valign="bottom">
<td nowrap="nowrap" align="left">&nbsp;</td>
<td nowrap="nowrap" align="right" class="content"><util:font color="content.fg" size="content">
<util:comment>Lower navigation linkset</util:comment>
<a name="bottom">[</a>&nbsp;
<util:xlink aclass="content">
<util:href type="servlet">conf/posts.js.vs?<%= topic_locator %>&p1=0&p2=-1</util:href>
<util:text>View All</util:text>
</util:xlink>
<% if (my_first>0) { %>
&nbsp;|&nbsp;
<util:xlink aclass="content">
<util:href type="servlet">
conf/posts.js.vs?<%= topic_locator %>&p1=<%= Math.max(my_first - my_pagesize,0) %>&p2=<%= my_first - 1 - Math.min(my_first - my_pagesize,0) %>
</util:href>
<util:text>Scroll Up <%= my_pagesize %></util:text>
</util:xlink>
<% } // end if %>
<% if ((my_total_msg - (my_last + 1))>0) { %>
&nbsp;|&nbsp;
<util:xlink aclass="content">
<util:href type="servlet">
conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_last + my_pagesize,my_total_msg - 1) %>
</util:href>
<util:text>Scroll Down <%= my_pagesize %></util:text>
</util:xlink>
&nbsp;|&nbsp;
<util:xlink aclass="content">
<util:href type="servlet">
conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_total_msg - my_pagesize %>&p2=<%= my_total_msg - 1 %>
</util:href>
<util:text>Scroll To End</util:text>
</util:xlink>
<% } // end if %>
&nbsp;|&nbsp;
<a class="content" href="#top">Top</a>
&nbsp;]
</util:font></td>
</tr>
<% out.flush(); response.flushBuffer(); %>
<tr valign="bottom">
<td nowrap="nowrap" align="left" colspan="2" class="content">
<util:call_jsp name="conf/posts_usercontrols.jsp"/>
</td>
</tr>
</table>
<% out.flush(); response.flushBuffer(); %>
<%
final boolean flag1 = my_conf.canPostToConference();
final boolean flag2 = (my_topic.isFrozen() ? my_topic.canFreeze() : true);
final boolean flag3 = (my_topic.isArchived() ? my_topic.canArchive() : true);
if (flag1 && flag2 && flag3) {
%>
<hr /><span style="font-size: 14pt;"><util:font color="content.fg" size="subhead">
<b>Post Message in &quot;<%= my_topic.getName() %>&quot;:</b>
</util:font></span><br />
<post:box action="conf/post_message.js.vs" type="servlet">
<post:param name="cc"><%= my_comm.getCommunityID() %></post:param>
<post:param name="conf"><%= my_conf.getConfID() %></post:param>
<post:param name="top"><%= my_topicnum %></post:param>
<% if (view.canDoNextTopic()) { %>
<post:param name="next"><%= my_next %></post:param>
<% } // end if %>
<post:param name="sd"><%= my_total_msg %></post:param>
<post:pseud name="pseud"><%= my_conf.getDefaultPseud() %></post:pseud>
<post:attach name="attach"/>
<post:text name="pb"/>
<post:button id="preview"/><post:button id="post"/>
<% if (view.canDoNextTopic()) { %>
<post:button id="postnext"/>
<% } // end if %>
<post:button id="posttopics"/>
</post:box>
<%
} else if (my_conf.canPostToConference()) {
if (my_topic.isArchived()) {
%>
<div align="center" class="content"><util:font color="content.fg" size="content"><b>This is an
<i>Archived</i> Topic</b></util:font></div>
<% } else if (my_topic.isFrozen()) { %>
<div align="center" class="content"><util:font color="content.fg" size="content"><b>This is a
<i>Frozen</i> Topic</b></util:font></div>
<%
} // end if
} // end if
%>
<%= view.getBottomCustom() %>
<% out.flush(); response.flushBuffer(); %>
<%-- EOF --%>