added "sticky" topic facility to cause topics to always float at the top of

the topic list when it's set
This commit is contained in:
Eric J. Bowersox
2004-07-11 08:08:27 +00:00
parent f0bf5e31ee
commit 477aac51f0
26 changed files with 1061 additions and 809 deletions

View File

@@ -9,9 +9,9 @@
The Original Code is the Venice Web Communities System.
The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
The Initial Developer of the Original Code is Eric J. Bowersox <erbo@ricochet.com>,
for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
Copyright (C) 2001-02 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
Contributor(s):
--%>
@@ -45,6 +45,12 @@
<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()) { %>
@@ -55,19 +61,35 @@
</util:header>
<%= view.getTopCustom() %>
<TABLE BORDER=0 WIDTH="100%" CELLPADDING=0 CELLSPACING=0>
<TR VALIGN=BOTTOM>
<TD NOWRAP ALIGN=LEFT COLSPAN=2 CLASS="content">
<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>
</td>
</tr>
<% out.flush(); response.flushBuffer(); %>
<TR VALIGN=BOTTOM>
<TD>&nbsp;</TD>
<TD NOWRAP ALIGN=RIGHT CLASS="content">
<tr valign="bottom">
<td>&nbsp;</td>
<td nowrap="nowrap" align="right" class="content">
<util:comment>Topic admin controls section</util:comment>
<% if (my_topic.canFreeze()) { %>
<% 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>
@@ -106,25 +128,25 @@
<util:text><util:button id="delete_topic"/></util:text>
</util:xlink>
<% } // end if %>
</TD>
</TR>
</td>
</tr>
<% out.flush(); response.flushBuffer(); %>
<TR VALIGN=BOTTOM>
<TD NOWRAP ALIGN=LEFT CLASS="content">
<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: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">
</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;
<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>
@@ -157,12 +179,12 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
</util:xlink>
<% } // end if %>
&nbsp;|&nbsp;
<A HREF="#bottom">Bottom</A>
<a 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:font></td>
</tr>
<tr valign="middle">
<td align="center" colspan="2"><util:font color="content.fg" size="post-reference">
<util:xlink>
<util:href type="servlet"><%= view.getPageQID() %></util:href>
<util:text>[Permalink to this topic]</util:text>
@@ -172,27 +194,27 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
<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>
</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()) {
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");
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">
<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">
<%
@@ -222,32 +244,32 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
<%
if (view.getShowAdvanced() && (view.getMessages().size()==1)) {
if (msg.isHidden()) {
out.write("<B><EM>(Hidden)</EM></B>\n");
out.write("<b><i>(Hidden)</i></b>\n");
} // end if
if (view.showBozoFilteredIndicator(msg.getCreatorUID())) {
%>
<B><EM>(User filtered;
<b><i>(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>
</i></b>
<%
} // end if
} // end if
if (!(view.bozoFilterUser(msg.getCreatorUID()))) {
%>
<BR>
<B><%= msg.getPseud() %></B>
(<EM>
<br />
<b><%= msg.getPseud() %></b>
(<i>
<util:xlink target="_blank">
<util:href type="servlet">user/<%= poster %></util:href>
<util:text><%= poster %></util:text>
</util:xlink>,
<%= view.formatDate(msg.getPostDate()) %>
</EM>)
</i>)
<% if (msg.hasAttachment()) { %>
<util:xlink>
<% if (view.displayAttachmentInNewWindow(msg)) { %>
@@ -272,15 +294,15 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
} // end if
%>
</util:font>
<P>
<p />
<% if (msg.isScribbled()) { %>
<SPAN CLASS="post"><TT><EM><B>
<span class="post"><tt><i><b>
(Scribbled by <%= view.getMessageBodyText(msg) %> on
<%= view.formatDate(msg.getScribbleDate()) %>)
</B></EM></TT></SPAN>
<% if (view.getPhotoDims()!=null) { %><BR CLEAR=LEFT><% } %><P>
</b></i></tt></SPAN>
<% if (view.getPhotoDims()!=null) { %><br clear="left" /><% } %><p />
<% } else if (view.bozoFilterUser(msg.getCreatorUID())) { %>
<SPAN CLASS="post"><TT><EM><B>
<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() %>
@@ -290,9 +312,9 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
<%= msg.getNumLines() %> <% if (msg.getNumLines()==1) { %>Line<% } else { %>Lines<% } %>)
</util:text>
</util:xlink>
</B></EM></TT></SPAN><P>
</b></i></tt></span><p />
<% } else if (msg.isHidden() && (!(view.getShowAdvanced()) || (view.getMessages().size()!=1))) { %>
<SPAN CLASS="post"><TT><EM><B>
<span class="post"><tt><i><b>
<util:xlink>
<util:href type="servlet">
conf/posts.js.vs?<%= topic_locator %>&shac=1&p1=<%= msg.getPostNumber() %>
@@ -302,16 +324,16 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
<%= 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>
</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>
<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">
</td><td nowrap="nowrap" align="right" class="content">
<%
if (!(msg.isScribbled())) {
if (msg.canHide()) {
@@ -322,14 +344,14 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
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>
</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>
</util:xlink><p />
<%
} // end if
} // end if (can hide)
@@ -340,7 +362,7 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
conf/scribble_message.js.vs?<%= topic_locator %>&msg=<%= msg.getPostNumber() %>
</util:href>
<util:text><util:button id="scribble"/></util:text>
</util:xlink><P>
</util:xlink><p />
<%
} // end if (can scribble)
} // end if (not already scribbled)
@@ -351,7 +373,7 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
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>
</util:xlink><p />
<%
} // end if (can bozo filter)
if (msg.canNuke()) {
@@ -361,7 +383,7 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
conf/nuke_message.js.vs?<%= topic_locator %>&msg=<%= msg.getPostNumber() %>
</util:href>
<util:text><util:button id="nuke"/></util:text>
</util:xlink><P>
</util:xlink><p />
<%
} // end if (can nuke)
if (msg.canMove() && (my_topic.getTotalMessages()>1)) {
@@ -371,7 +393,7 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
conf/move_message.js.vs?<%= topic_locator %>&msg=<%= msg.getPostNumber() %>
</util:href>
<util:text><util:button id="move"/></util:text>
</util:xlink><P>
</util:xlink><p />
<%
} // end if (can move)
if (msg.canPublish()) {
@@ -381,21 +403,21 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
conf/publish_message.js.vs?<%= topic_locator %>&msg=<%= msg.getPostNumber() %>
</util:href>
<util:text><util:button id="publish"/></util:text>
</util:xlink><P>
</util:xlink><p />
<% } // end if (can publish) %>
</TD></TR></TABLE><BR>
</td></tr></table><br />
<%
} // end if (showing advanced controls)
can_line = true;
out.flush();
response.flushBuffer();
} // end while
} // 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">
<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>
<util:href type="servlet"><%= view.getPageQID() %></util:href>
<util:text>[Permalink to this topic]</util:text>
@@ -405,13 +427,13 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
<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 ALIGN=LEFT>&nbsp;</TD>
<TD NOWRAP ALIGN=RIGHT CLASS="content"><util:font color="content.fg" size="content">
</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;
<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>
@@ -442,18 +464,18 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
</util:xlink>
<% } // end if %>
&nbsp;|&nbsp;
<A HREF="#top">Top</A>
<a href="#top">Top</a>
&nbsp;]
</util:font></TD>
</TR>
</util:font></td>
</tr>
<% out.flush(); response.flushBuffer(); %>
<TR VALIGN=BOTTOM>
<TD NOWRAP ALIGN=LEFT COLSPAN=2 CLASS="content">
<tr valign="bottom">
<td nowrap="nowrap" align="left" colspan="2" class="content">
<util:call_jsp name="conf/posts_usercontrols.jsp"/>
</TD>
</TR>
</TABLE>
</td>
</tr>
</table>
<% out.flush(); response.flushBuffer(); %>
<%
@@ -462,9 +484,9 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
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>
<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>
@@ -486,15 +508,15 @@ conf/posts.js.vs?<%= topic_locator %>&p1=<%= my_last + 1 %>&p2=<%= Math.min(my_l
} 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>
<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
<EM>Frozen</EM> Topic</B></util:font></DIV>
<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 --%>