venice-main-classic/web/format/conf/posts.jsp
2002-01-07 07:42:05 +00:00

543 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@silcom.com>,
for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
Copyright (C) 2001 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.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 ALIGN=LEFT COLSPAN=2 CLASS="content">
<util:comment>Topic user controls section</util:comment>
<util:xlink>
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %></util:href>
<util:text><util:button id="topic_list"/></util:text>
</util:xlink>
&nbsp;
<% if (my_topic.isHidden()) { %>
<util:xlink>
<util:href type="servlet">conf/hide_topic.js.vs?<%= topic_locator %>&flag=0</util:href>
<util:text><util:button id="show_topic"/></util:text>
</util:xlink>
<% } else { %>
<util:xlink>
<util:href type="servlet">conf/hide_topic.js.vs?<%= topic_locator %>&flag=1</util:href>
<util:text><util:button id="hide_topic"/></util:text>
</util:xlink>
<% } // end if %>
&nbsp;
<% if (view.canDoNextTopic()) { %>
<util:xlink>
<util:href type="servlet">conf/posts.js.vs?<%= next_locator %>&rnm=1</util:href>
<util:text><util:button id="next_topic"/></util:text>
</util:xlink>
&nbsp;
<% if (my_unread>0) { %>
<util:xlink>
<util:href type="servlet">conf/posts.js.vs?<%= next_locator %>&rnm=1&<%= restorer %></util:href>
<util:text><util:button id="next_topic_keep"/></util:text>
</util:xlink>
&nbsp;
<%
} // end if
} // end if
%>
<util:xlink>
<util:href type="servlet">conf/find.js.vs?<%= topic_locator %></util:href>
<util:text><util:button id="find"/></util:text>
</util:xlink>
&nbsp;
<util:xlink>
<util:href type="servlet">conf/manage_topic.js.vs?<%= topic_locator %></util:href>
<util:text><util:button id="manage"/></util:text>
</util:xlink>
</TD>
</TR>
<% out.flush(); response.flushBuffer(); %>
<TR VALIGN=BOTTOM>
<TD>&nbsp;</TD>
<TD NOWRAP ALIGN=RIGHT CLASS="content">
<util:comment>Topic admin controls section</util:comment>
<% 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 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 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>
<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>
<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>
<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>
<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 HREF="#bottom">Bottom</A>
&nbsp;]
</util:font></TD>
</TR>
</TABLE>
<% out.flush(); response.flushBuffer(); %>
<util:comment>Begin Actual Messages</util:comment>
<%
Iterator it = view.getMessages().iterator();
String last_post = "shac=1&p1=" + String.valueOf(my_total_msg - 1);
boolean can_line = false;
while (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 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>
<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>
<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;
</util:font>
<%
if (view.getShowAdvanced() && (view.getMessages().size()==1)) {
if (msg.isHidden()) {
out.write("<B><EM>(Hidden)</EM></B>\n");
} // end if
if (view.showBozoFilteredIndicator(msg.getCreatorUID())) {
%>
<B><EM>(User filtered;
<util:xlink>
<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>)
</EM></B>
<%
} // end if
} // end if
if (!(view.bozoFilterUser(msg.getCreatorUID()))) {
%>
<BR>
<B><%= msg.getPseud() %></B>
(<EM>
<util:xlink target="_blank">
<util:href type="servlet">user/<%= poster %></util:href>
<util:text><%= poster %></util:text>
</util:xlink>,
<%= view.formatDate(msg.getPostDate()) %>
</EM>)
<% 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><EM><B>
(Scribbled by <%= view.getMessageBodyText(msg) %> on
<%= view.formatDate(msg.getScribbleDate()) %>)
</B></EM></TT></SPAN>
<% if (view.getPhotoDims()!=null) { %><BR CLEAR=LEFT><% } %><P>
<% } else if (view.bozoFilterUser(msg.getCreatorUID())) { %>
<SPAN CLASS="post"><TT><EM><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></EM></TT></SPAN><P>
<% } else if (msg.isHidden() && (!(view.getShowAdvanced()) || (view.getMessages().size()!=1))) { %>
<SPAN CLASS="post"><TT><EM><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></EM></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 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.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 while
%>
<util:comment>End Actual Messages</util:comment>
<TABLE BORDER=0 WIDTH="100%" CELLPADDING=0 CELLSPACING=0>
<TR VALIGN=BOTTOM>
<TD NOWRAP ALIGN=LEFT>&nbsp;</TD>
<TD 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>
<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>
<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>
<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>
<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 HREF="#top">Top</A>
&nbsp;]
</util:font></TD>
</TR>
<% out.flush(); response.flushBuffer(); %>
<TR VALIGN=BOTTOM>
<TD NOWRAP ALIGN=LEFT COLSPAN=2 CLASS="content">
<util:comment>Topic user controls section</util:comment>
<util:xlink>
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %></util:href>
<util:text><util:button id="topic_list"/></util:text>
</util:xlink>
&nbsp;
<% if (my_topic.isHidden()) { %>
<util:xlink>
<util:href type="servlet">conf/hide_topic.js.vs?<%= topic_locator %>&flag=0</util:href>
<util:text><util:button id="show_topic"/></util:text>
</util:xlink>
<% } else { %>
<util:xlink>
<util:href type="servlet">conf/hide_topic.js.vs?<%= topic_locator %>&flag=1</util:href>
<util:text><util:button id="hide_topic"/></util:text>
</util:xlink>
<% } // end if %>
&nbsp;
<% if (view.canDoNextTopic()) { %>
<util:xlink>
<util:href type="servlet">conf/posts.js.vs?<%= next_locator %>&rnm=1</util:href>
<util:text><util:button id="next_topic"/></util:text>
</util:xlink>
&nbsp;
<% if (my_unread>0) { %>
<util:xlink>
<util:href type="servlet">conf/posts.js.vs?<%= next_locator %>&rnm=1&<%= restorer %></util:href>
<util:text><util:button id="next_topic_keep"/></util:text>
</util:xlink>
&nbsp;
<%
} // end if
} // end if
%>
<util:xlink>
<util:href type="servlet">conf/find.js.vs?<%= topic_locator %></util:href>
<util:text><util:button id="find"/></util:text>
</util:xlink>
&nbsp;
<util:xlink>
<util:href type="servlet">conf/manage_topic.js.vs?<%= topic_locator %></util:href>
<util:text><util:button id="manage"/></util:text>
</util:xlink>
</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
<EM>Archived</EM> 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
<EM>Frozen</EM> Topic</B></util:font></DIV>
<%
} // end if
} // end if
%>
<%= view.getBottomCustom() %>
<% out.flush(); response.flushBuffer(); %>