2005-11-25 jrandom
* Further Syndie UI cleanups * Logging cleanup * Fixed link to fproxy.tino.i2p (thanks zzz!)
This commit is contained in:
@ -114,6 +114,28 @@ public class ThreadedHTMLRenderer extends HTMLRenderer {
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public static String getViewPostLink(String uri, BlogURI post, User user, boolean isPermalink,
|
||||
String offset, String tags, String author) {
|
||||
StringBuffer buf = new StringBuffer(64);
|
||||
buf.append(uri);
|
||||
buf.append('?').append(PARAM_VISIBLE).append('=');
|
||||
buf.append(post.getKeyHash().toBase64()).append('/');
|
||||
buf.append(post.getEntryId()).append('&');
|
||||
buf.append(PARAM_VIEW_POST).append('=');
|
||||
buf.append(post.getKeyHash().toBase64()).append('/');
|
||||
buf.append(post.getEntryId()).append('&');
|
||||
|
||||
if (!isPermalink) {
|
||||
if (!empty(offset))
|
||||
buf.append(PARAM_OFFSET).append('=').append(offset).append('&');
|
||||
if (!empty(tags))
|
||||
buf.append(PARAM_TAGS).append('=').append(tags).append('&');
|
||||
if (!empty(author))
|
||||
buf.append(PARAM_AUTHOR).append('=').append(author).append('&');
|
||||
}
|
||||
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
private static final boolean empty(String val) { return (val == null) || (val.trim().length() <= 0); }
|
||||
|
||||
|
@ -800,6 +800,12 @@ public abstract class BaseServlet extends HttpServlet {
|
||||
req.getParameter(ThreadedHTMLRenderer.PARAM_TAGS),
|
||||
req.getParameter(ThreadedHTMLRenderer.PARAM_AUTHOR));
|
||||
}
|
||||
protected String getViewPostLink(HttpServletRequest req, BlogURI post, User user) {
|
||||
return ThreadedHTMLRenderer.getViewPostLink(req.getRequestURI(), post, user, false,
|
||||
req.getParameter(ThreadedHTMLRenderer.PARAM_OFFSET),
|
||||
req.getParameter(ThreadedHTMLRenderer.PARAM_TAGS),
|
||||
req.getParameter(ThreadedHTMLRenderer.PARAM_AUTHOR));
|
||||
}
|
||||
protected String getViewThreadLink(HttpServletRequest req, ThreadNode node, User user) {
|
||||
return getViewThreadLink(req.getRequestURI(), node, user,
|
||||
req.getParameter(ThreadedHTMLRenderer.PARAM_OFFSET),
|
||||
@ -926,9 +932,6 @@ public abstract class BaseServlet extends HttpServlet {
|
||||
" text-align: left;\n" +
|
||||
" align: left;\n" +
|
||||
"}\n" +
|
||||
".threadRight {\n" +
|
||||
" text-align: right;\n" +
|
||||
"}\n" +
|
||||
".threadNav {\n" +
|
||||
" background-color: #BBBBBB;\n" +
|
||||
"}\n" +
|
||||
@ -942,6 +945,16 @@ public abstract class BaseServlet extends HttpServlet {
|
||||
" margin: 0 5px 0 0;\n" +
|
||||
" display: inline;\n" +
|
||||
"}\n" +
|
||||
".threadInfoLeft {\n" +
|
||||
" float: left;\n" +
|
||||
" margin: 5px 0px 0 0;\n" +
|
||||
" display: inline;\n" +
|
||||
"}\n" +
|
||||
".threadInfoRight {\n" +
|
||||
" float: right;\n" +
|
||||
" margin: 0 5px 0 0;\n" +
|
||||
" display: inline;\n" +
|
||||
"}\n" +
|
||||
".postMeta {\n" +
|
||||
" background-color: #BBBBFF;\n" +
|
||||
"}\n" +
|
||||
|
@ -173,9 +173,11 @@ public class ViewThreadedServlet extends BaseServlet {
|
||||
else
|
||||
out.write("<tr class=\"threadOdd\">\n");
|
||||
|
||||
out.write("<td class=\"threadFlag\">");
|
||||
out.write("<td class=\"thread\" colspan=\"3\">");
|
||||
out.write("<span class=\"threadInfoLeft\">");
|
||||
//out.write("<td class=\"threadFlag\">");
|
||||
out.write(getFlagHTML(user, node));
|
||||
out.write("</td>\n<td class=\"threadLeft\">\n");
|
||||
//out.write("</td>\n<td class=\"threadLeft\" colspan=\"2\">\n");
|
||||
for (int i = 0; i < depth; i++)
|
||||
out.write("<img src=\"images/threadIndent.png\" alt=\"\" border=\"0\" />");
|
||||
|
||||
@ -250,7 +252,7 @@ public class ViewThreadedServlet extends BaseServlet {
|
||||
out.write(getViewPostLink(req, node, user, false));
|
||||
out.write("\" title=\"View post\">");
|
||||
long dayBegin = BlogManager.instance().getDayBegin();
|
||||
long postId = node.getMostRecentPostDate();
|
||||
long postId = node.getEntry().getEntryId();
|
||||
if (postId >= dayBegin) {
|
||||
out.write("<b>today</b>");
|
||||
} else if (postId >= dayBegin - 24*60*60*1000) {
|
||||
@ -270,16 +272,33 @@ public class ViewThreadedServlet extends BaseServlet {
|
||||
if (subject == null)
|
||||
subject = "";
|
||||
out.write(trim(subject, 40));
|
||||
out.write("</a>\n</td><td class=\"threadRight\">\n");
|
||||
//out.write("</a>\n</td><td class=\"threadRight\">\n");
|
||||
out.write("</a></span><span class=\"threadInfoRight\">");
|
||||
if (childCount > 0) {
|
||||
out.write(" <a href=\"");
|
||||
out.write(getViewPostLink(req, new BlogURI(node.getMostRecentPostAuthor(), node.getMostRecentPostDate()), user));
|
||||
out.write("\" title=\"View the most recent post\">latest - ");
|
||||
|
||||
postId = node.getMostRecentPostDate();
|
||||
if (postId >= dayBegin) {
|
||||
out.write("<b>today</b>");
|
||||
} else if (postId >= dayBegin - 24*60*60*1000) {
|
||||
out.write("<b>yesterday</b>");
|
||||
} else {
|
||||
int daysAgo = (int)((dayBegin - postId + 24*60*60*1000-1)/(24*60*60*1000));
|
||||
out.write(daysAgo + " days ago");
|
||||
}
|
||||
|
||||
out.write("</a>\n");
|
||||
out.write(" <a href=\"");
|
||||
out.write(getViewThreadLink(req, node, user));
|
||||
out.write("\" title=\"View all posts in the thread\">view thread</a>\n");
|
||||
out.write("\" title=\"View all posts in the thread\">full thread</a>\n");
|
||||
} else {
|
||||
out.write("<a href=\"");
|
||||
out.write(getViewPostLink(req, node, user, false));
|
||||
out.write("\" title=\"View the post\">view post</a>\n");
|
||||
}
|
||||
out.write("</span>");
|
||||
out.write("</td></tr>\n");
|
||||
|
||||
boolean rendered = true;
|
||||
|
@ -1,4 +1,9 @@
|
||||
$Id: history.txt,v 1.328 2005/11/24 03:45:57 jrandom Exp $
|
||||
$Id: history.txt,v 1.329 2005/11/25 06:06:03 jrandom Exp $
|
||||
|
||||
2005-11-25 jrandom
|
||||
* Further Syndie UI cleanups
|
||||
* Logging cleanup
|
||||
* Fixed link to fproxy.tino.i2p (thanks zzz!)
|
||||
|
||||
2005-11-25 jrandom
|
||||
* Don't publish stats for periods we haven't reached yet (thanks zzz!)
|
||||
|
@ -17,7 +17,7 @@ you can:</p>
|
||||
<li><a href="http://search.i2p/">search.i2p</a>: an anonymously hosted search engine of eepsites</li>
|
||||
<li><a href="http://ugha.i2p/">ugha.i2p</a>: ugha's eepsite, a wiki that anyone can edit, and lots of links</li>
|
||||
<li><a href="http://dev.i2p/">dev.i2p</a>: a secure and anonymous connection to <a href="http://dev.i2p.net/">dev.i2p.net</a></li>
|
||||
<li>Freenet proxies: <a href="http://fproxy.i2p/">fproxy.i2p</a> and <a href="fproxy.tino.i2p">fproxy.tino.i2p</a></li>
|
||||
<li>Freenet proxies: <a href="http://fproxy.i2p/">fproxy.i2p</a> and <a href="http://fproxy.tino.i2p">fproxy.tino.i2p</a></li>
|
||||
</ul>
|
||||
There are many more eepsites - just follow the links from the ones you see,
|
||||
bookmark your favorites, and visit them often!</li>
|
||||
|
@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
||||
*
|
||||
*/
|
||||
public class RouterVersion {
|
||||
public final static String ID = "$Revision: 1.296 $ $Date: 2005/11/24 03:45:56 $";
|
||||
public final static String ID = "$Revision: 1.297 $ $Date: 2005/11/25 06:06:02 $";
|
||||
public final static String VERSION = "0.6.1.5";
|
||||
public final static long BUILD = 7;
|
||||
public final static long BUILD = 8;
|
||||
public static void main(String args[]) {
|
||||
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
|
||||
System.out.println("Router ID: " + RouterVersion.ID);
|
||||
|
@ -53,11 +53,7 @@ public class InboundMessageState {
|
||||
public boolean receiveFragment(UDPPacketReader.DataReader data, int dataFragment) {
|
||||
int fragmentNum = data.readMessageFragmentNum(dataFragment);
|
||||
if ( (fragmentNum < 0) || (fragmentNum > _fragments.length)) {
|
||||
StringBuffer buf = new StringBuffer(1024);
|
||||
buf.append("Invalid fragment ").append(fragmentNum);
|
||||
buf.append(": ").append(data);
|
||||
//data.toRawString(buf);
|
||||
_log.error(buf.toString());
|
||||
_log.error("Invalid fragment " + fragmentNum + "/" + _fragments.length);
|
||||
return false;
|
||||
}
|
||||
if (_fragments[fragmentNum] == null) {
|
||||
@ -77,10 +73,7 @@ public class InboundMessageState {
|
||||
+ ", isLast=" + isLast
|
||||
+ ", data=" + Base64.encode(message.getData(), 0, size));
|
||||
} catch (ArrayIndexOutOfBoundsException aioobe) {
|
||||
StringBuffer buf = new StringBuffer(1024);
|
||||
buf.append("Corrupt SSU fragment ").append(fragmentNum);
|
||||
buf.append(": ").append(data);
|
||||
_log.error(buf.toString(), aioobe);
|
||||
_log.error("Corrupt SSU fragment " + fragmentNum, aioobe);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user