diff --git a/etc/erbo.dict b/etc/erbo.dict index c358a5c..b8ed5e2 100644 --- a/etc/erbo.dict +++ b/etc/erbo.dict @@ -1,4 +1,3 @@ - acmecity advogato ain't @@ -8,6 +7,7 @@ bajor bios boitano boromax +bungee can't cartman cdt @@ -25,7 +25,9 @@ dilithium docking doesn't don't +downtime edt +email eminds entil'zha eps diff --git a/src/com/silverwrist/venice/core/impl/TopicMessageUserContextImpl.java b/src/com/silverwrist/venice/core/impl/TopicMessageUserContextImpl.java index 88b50c6..65d06de 100644 --- a/src/com/silverwrist/venice/core/impl/TopicMessageUserContextImpl.java +++ b/src/com/silverwrist/venice/core/impl/TopicMessageUserContextImpl.java @@ -723,7 +723,7 @@ class TopicMessageUserContextImpl implements TopicMessageContext // lock the tables we reference stmt.executeUpdate("LOCK TABLES posts WRITE, postdata WRITE, postattach WRITE, postdogear WRITE, " - + "postpublish WRITE;"); + + "postpublish WRITE, topics WRITE;"); try { // first, make sure we have the right status for our post @@ -731,6 +731,13 @@ class TopicMessageUserContextImpl implements TopicMessageContext if (nuked) return; // nuking a nuked post is futile + // We need the post's topic ID and post number to renumber the topic afterwards, so grab 'em. + ResultSet rs = stmt.executeQuery("SELECT topicid, num FROM posts WHERE postid = " + postid + ";"); + if (!(rs.next())) + throw new InternalStateError("lost the post to be nuked after refresh?"); + int x_topic_id = rs.getInt(1); + int x_post_num = rs.getInt(2); + // Delete any and all references to this post! stmt.executeUpdate("DELETE FROM posts WHERE postid = " + postid + ";"); stmt.executeUpdate("DELETE FROM postdata WHERE postid = " + postid + ";"); @@ -739,6 +746,14 @@ class TopicMessageUserContextImpl implements TopicMessageContext if (stmt.executeUpdate("DELETE FROM postpublish WHERE postid = " + postid + ";")>0) engine.unpublish(postid); + // Phase 1 of renumber - Renumber all posts that had a number higher than the one + // we just blew to hell. + stmt.executeUpdate("UPDATE posts SET num = (num - 1) WHERE num > " + x_post_num + ";"); + + // Phase 2 of renumber - The topic now has one less post in it. Reflect that. + stmt.executeUpdate("UPDATE topics SET top_message = (top_message - 1) WHERE topicid = " + + x_topic_id + ";"); + // Update our internal variables. linecount = 0; creator_uid = -1; diff --git a/src/com/silverwrist/venice/core/impl/TopicUserContextImpl.java b/src/com/silverwrist/venice/core/impl/TopicUserContextImpl.java index f9f1601..d01b54e 100644 --- a/src/com/silverwrist/venice/core/impl/TopicUserContextImpl.java +++ b/src/com/silverwrist/venice/core/impl/TopicUserContextImpl.java @@ -78,7 +78,7 @@ class TopicUserContextImpl implements TopicContext this.lastupdate = lastupdate; this.name = name; this.hidden = hidden; - this.unread = unread; + this.unread = (unread<0 ? 0 : unread); } // end constructor @@ -151,6 +151,8 @@ class TopicUserContextImpl implements TopicContext lastupdate = SQLUtil.getFullDateTime(rs,8); hidden = rs.getBoolean(10); unread = rs.getInt(11); + if (unread<0) + unread = 0; } // end if else // this topic must have been deleted - fsck it diff --git a/src/com/silverwrist/venice/security/AuditRecord.java b/src/com/silverwrist/venice/security/AuditRecord.java index e24a855..293f1bf 100644 --- a/src/com/silverwrist/venice/security/AuditRecord.java +++ b/src/com/silverwrist/venice/security/AuditRecord.java @@ -64,6 +64,8 @@ public class AuditRecord implements AuditData String getUserName(int uid) throws SQLException, DataException { + if (uid==0) + return ""; // UID 0 = no user Integer uid_x = new Integer(uid); String rc = (String)(uname_cache.get(uid_x)); if (rc==null) diff --git a/web/format/base.jsp b/web/format/base.jsp index 5b76682..a9acac7 100644 --- a/web/format/base.jsp +++ b/web/format/base.jsp @@ -25,6 +25,10 @@ Variables.failIfNull(basedat); UserContext user = Variables.getUserContext(application,request,session); RenderData rdat = RenderConfig.createRenderData(application,request,response); + String header_font = rdat.getStdFontTag("white",3); + String stdfont = rdat.getStdFontTag(null,2); + String smallfont = rdat.getStdFontTag(null,1); + String partial_tgt, foo; %> @@ -34,102 +38,105 @@ - - <% if (rdat.useHTMLComments()) { %><% } %> - + + <% if (rdat.useHTMLComments()) { %><% } %> - + - <% if (rdat.useHTMLComments()) { %><% } %> - -
- - + <% if (rdat.useHTMLComments()) { %><% } %> +
- <% if (rdat.useHTMLComments()) { %><% } %> - <%= rdat.getSiteImageTag(2,2) %> -
+ + - + - -
+ <% if (rdat.useHTMLComments()) { %><% } %> + <%= rdat.getSiteImageTag(2,2) %> + <%= rdat.getStdFontTag("white",3) %> - <% if (rdat.useHTMLComments()) { %><% } %> - ">Front Page

- Help |  - ">Find -

<%= header_font %> + <% if (rdat.useHTMLComments()) { %><% } %> + ">Front Page

+ Help |  + ">Find +

- <% if (rdat.useHTMLComments()) { %><% } %> - <%-- BEGIN TEMP - Banner Ad code --%> - Banner Ad - 468x60 - <%-- END TEMP - Banner Ad Code --%> -
-
+ <% if (rdat.useHTMLComments()) { %><% } %> + <%-- BEGIN TEMP - Banner Ad code --%> + Banner Ad - 468x60 + <%-- END TEMP - Banner Ad Code --%> +
- <%= rdat.getStdFontTag("white",3) %> +
<%= header_font %> <% if (user.isLoggedIn()) { %> You are logged in as <%= StringUtil.encodeHTML(user.getUserName()) %> <% if (basedat.displayLoginLinks()) { %> - <% String partial_tgt = "account?tgt=" + URLEncoder.encode(basedat.getLocation()) + "&cmd="; %> -  - ">Log Out -  | ">Profile + <% + partial_tgt = "account?tgt=" + URLEncoder.encode(basedat.getLocation()) + "&cmd="; + foo = rdat.getEncodedServletPath(partial_tgt + "L"); + %> +  - Log Out + <% foo = rdat.getEncodedServletPath(partial_tgt + "P"); %> +  | Profile <% } // end if %> <% } else { %> You are not logged in <% if (basedat.displayLoginLinks()) { %> - <% String partial_tgt = "account?tgt=" + URLEncoder.encode(basedat.getLocation()) + "&cmd="; %> -  - ">Log In -  | ">Create Account + <% + partial_tgt = "account?tgt=" + URLEncoder.encode(basedat.getLocation()) + "&cmd="; + foo = rdat.getEncodedServletPath(partial_tgt + "L"); + %> +  - Log In + <% foo = rdat.getEncodedServletPath(partial_tgt + "C"); %> +  | Create Account <% } // end if %> <% } // end if %> - -
- - - - - - - - - - -
- - <% if (rdat.useHTMLComments()) { %><% } %> - - - - - - <% if (rdat.useHTMLComments()) { %><% } %> - -
<%= rdat.getStdFontTag(null,2) %> - <% if (rdat.useHTMLComments()) { %><% } %> - <% basedat.renderMenu(session,out,rdat); %> -
 
<%= rdat.getStdFontTag(null,2) %> - <% if (rdat.useHTMLComments()) { %><% } %> - <% basedat.renderFixedMenu(out,rdat); %> -
-
- <% if (rdat.useHTMLComments()) { %><% } %> - <% basedat.renderContent(application,out,rdat); %> - <% if (rdat.useHTMLComments()) { %><% } %> -
  - <% if (rdat.useHTMLComments()) { %><% } %> -
- - - -
<%= rdat.getStdFontTag(null,1) %> - <%= rdat.getStockMessage("footer-text") %> - - " ALT="Powered by Venice" - WIDTH=140 HEIGHT=80 BORDER=0 HSPACE=0 VSPACE=0> -
-
-
+ <% if (rdat.useHTMLComments()) { %><% } %> + + + + + + + + + + + + + +
+ + <% if (rdat.useHTMLComments()) { %><% } %> + + + + + + <% if (rdat.useHTMLComments()) { %><% } %> + +
<%= stdfont %> + <% if (rdat.useHTMLComments()) { %><% } %> + <% basedat.renderMenu(session,out,rdat); %> +
 
<%= stdfont %> + <% if (rdat.useHTMLComments()) { %><% } %> + <% basedat.renderFixedMenu(out,rdat); %> +
+
+ <% if (rdat.useHTMLComments()) { %><% } %> + <% basedat.renderContent(application,out,rdat); %> + <% if (rdat.useHTMLComments()) { %><% } %> +
  + <% if (rdat.useHTMLComments()) { %><% } %> +
+ + + +
<%= smallfont %><%= rdat.getStockMessage("footer-text") %> + " ALT="Powered by Venice" + WIDTH=140 HEIGHT=80 BORDER=0 HSPACE=0 VSPACE=0> +
+
+