*) cleaned up code for better readability in Netbeans (tabs -> spaces)\n*) no functional changes

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4282 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
low012 17 years ago
parent a52681dd49
commit 5aa8d72502

@ -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);

@ -110,8 +110,9 @@ public class BlogComments {
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 {
StrAuthor = de.anomic.yacy.yacyCore.seedDB.mySeed().get("Name", "anonymous");
}
@ -140,7 +141,6 @@ public class BlogComments {
Date date = null;
//set name for new entry or date for old entry
String StrSubject = post.get("subject", "");
byte[] subject;
try {
@ -250,8 +250,9 @@ public class BlogComments {
String pageid;
blogBoardComments.CommentEntry entry;
boolean xml = false;
if(post.containsKey("xml"))
if(post.containsKey("xml")) {
xml = true;
}
int count = 0; //counts how many entries are shown to the user
int start = post.getInt("start",0); //indicates from where entries should be shown
int num = post.getInt("num",20); //indicates how many entries should be shown
@ -357,6 +358,5 @@ public class BlogComments {
} catch (Exception e) {
yacyCore.log.logWarning("message: message forwarding via email failed. ",e);
}
}
}

Loading…
Cancel
Save