|
|
|
@ -71,7 +71,7 @@ public class Blog {
|
|
|
|
|
private static final String DEFAULT_PAGE = "blog_default";
|
|
|
|
|
|
|
|
|
|
private static SimpleDateFormat SimpleFormatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
|
|
|
|
// TODO: make userdefined date/time-strings (localisation)
|
|
|
|
|
// TODO: make userdefined date/time-strings (localisation)
|
|
|
|
|
|
|
|
|
|
public static String dateString(Date date) {
|
|
|
|
|
return SimpleFormatter.format(date);
|
|
|
|
@ -124,9 +124,9 @@ public class Blog {
|
|
|
|
|
StrAuthor = switchboard.blogDB.guessAuthor(ip);
|
|
|
|
|
|
|
|
|
|
if (StrAuthor == null || StrAuthor.length() == 0) {
|
|
|
|
|
if (de.anomic.yacy.yacyCore.seedDB.mySeed() == null)
|
|
|
|
|
if (de.anomic.yacy.yacyCore.seedDB.mySeed() == null) {
|
|
|
|
|
StrAuthor = "anonymous";
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
StrAuthor = de.anomic.yacy.yacyCore.seedDB.mySeed().get("Name", "anonymous");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -149,8 +149,9 @@ public class Blog {
|
|
|
|
|
pagename = DEFAULT_PAGE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (post.containsKey("discard"))
|
|
|
|
|
if (post.containsKey("discard")) {
|
|
|
|
|
pagename = DEFAULT_PAGE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (post.containsKey("submit") && (hasRights)) {
|
|
|
|
|
// store a new/edited blog-entry
|
|
|
|
@ -165,9 +166,9 @@ public class Blog {
|
|
|
|
|
ArrayList comments = null;
|
|
|
|
|
|
|
|
|
|
//set name for new entry or date for old entry
|
|
|
|
|
if(pagename.equals(DEFAULT_PAGE))
|
|
|
|
|
if(pagename.equals(DEFAULT_PAGE)) {
|
|
|
|
|
pagename = String.valueOf(System.currentTimeMillis());
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
page = switchboard.blogDB.read(pagename);
|
|
|
|
|
comments = page.comments();
|
|
|
|
|
date = page.date();
|
|
|
|
@ -225,7 +226,9 @@ public class Blog {
|
|
|
|
|
prop.putWiki("mode_page", post.get("content", ""));
|
|
|
|
|
prop.putHTML("mode_page-code", post.get("content", ""), xml);
|
|
|
|
|
}
|
|
|
|
|
else prop.put("mode", "3"); //access denied (no rights)
|
|
|
|
|
else {
|
|
|
|
|
prop.put("mode", "3"); //access denied (no rights)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(post.get("delete", "").equals("try")) {
|
|
|
|
|
if(hasRights) {
|
|
|
|
@ -286,7 +289,8 @@ public class Blog {
|
|
|
|
|
int start,
|
|
|
|
|
int num,
|
|
|
|
|
final boolean hasRights,
|
|
|
|
|
final boolean xml) {
|
|
|
|
|
final boolean xml)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
final Iterator i = switchboard.blogDB.keys(false);
|
|
|
|
|
String pageid;
|
|
|
|
@ -323,8 +327,8 @@ public class Blog {
|
|
|
|
|
final String address,
|
|
|
|
|
final int number,
|
|
|
|
|
final boolean hasRights,
|
|
|
|
|
final boolean xml) {
|
|
|
|
|
|
|
|
|
|
final boolean xml)
|
|
|
|
|
{
|
|
|
|
|
// subject
|
|
|
|
|
try {
|
|
|
|
|
prop.putHTML("mode_entries_" + number + "_subject", new String(entry.subject(),"UTF-8"), xml);
|
|
|
|
|