Skip to content

Commit

Permalink
bbCode
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@344 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
allo committed Jun 29, 2005
1 parent 82d78fd commit 63f9570
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
19 changes: 9 additions & 10 deletions htroot/EditProfile_p.java
Expand Up @@ -54,7 +54,6 @@
import de.anomic.http.httpHeader;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.tools.unHtml;

public class EditProfile_p {

Expand Down Expand Up @@ -84,17 +83,17 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve

profile.setProperty("comment", (String)post.get("comment"));
}
prop.put("name", (new unHtml(profile.getProperty("name", ""))).un());
prop.put("nickname", (new unHtml(profile.getProperty("nickname", ""))).un());
prop.put("homepage", (new unHtml(profile.getProperty("homepage", ""))).un());
prop.put("email", (new unHtml(profile.getProperty("email", ""))).un());
prop.put("name", profile.getProperty("name", ""));
prop.put("nickname", profile.getProperty("nickname", ""));
prop.put("homepage", profile.getProperty("homepage", ""));
prop.put("email", profile.getProperty("email", ""));

prop.put("icq", (new unHtml(profile.getProperty("icq", ""))).un());
prop.put("jabber", (new unHtml(profile.getProperty("jabber", ""))).un());
prop.put("yahoo", (new unHtml(profile.getProperty("yahoo", ""))).un());
prop.put("msn", (new unHtml(profile.getProperty("msn", ""))).un());
prop.put("icq", profile.getProperty("icq", ""));
prop.put("jabber", profile.getProperty("jabber", ""));
prop.put("yahoo", profile.getProperty("yahoo", ""));
prop.put("msn", profile.getProperty("msn", ""));

prop.put("comment", (new unHtml(profile.getProperty("comment", ""))).un());
prop.put("comment", profile.getProperty("comment", ""));

FileOutputStream fileOut = null;
try{
Expand Down
9 changes: 5 additions & 4 deletions htroot/Messages_p.java
Expand Up @@ -56,7 +56,7 @@
import de.anomic.server.serverFileUtils;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.tools.unHtml;
import de.anomic.tools.bbCode;

public class Messages_p {

Expand All @@ -69,6 +69,7 @@ public static String dateString(Date date) {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
serverObjects prop = new serverObjects();
bbCode bb = new bbCode();

String action = ((post == null) ? "list" : post.get("action", "list"));
String messages = "";
Expand Down Expand Up @@ -101,7 +102,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
messages += "<td>" + dateString(message.date()) + "</td>";
messages += "<td>" + message.author() + "</td>";
messages += "<td>" + message.recipient() + "</td>";
messages += "<td>" + (new unHtml(message.subject())).un() + "</td>";
messages += "<td>" + bb.bb(message.subject()) + "</td>";
messages += "<td>" +
"<a href=\"Messages_p.html?action=view&object=" + key + "\">view</a>&nbsp;/&nbsp;" +
"<a href=\"MessageSend_p.html?hash=" + message.authorHash() + "&subject=Re: " + message.subject() + "\">reply</a>&nbsp;/&nbsp;" +
Expand All @@ -122,8 +123,8 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
messages += "<tr><td class=\"MenuHeader\">From:</td><td class=\"MessageBackground\">" + message.author() + "</td></tr>";
messages += "<tr><td class=\"MenuHeader\">To:</td><td class=\"MessageBackground\">" + message.recipient() + "</td></tr>";
messages += "<tr><td class=\"MenuHeader\">Send Date:</td><td class=\"MessageBackground\">" + dateString(message.date()) + "</td></tr>";
messages += "<tr><td class=\"MenuHeader\">Subject:</td><td class=\"MessageBackground\">" + (new unHtml(message.subject())).un() + "</td></tr>";
messages += "<tr><td class=\"MessageBackground\" colspan=\"2\">" + (new unHtml(new String(message.message()))).un() + "</td></tr>";
messages += "<tr><td class=\"MenuHeader\">Subject:</td><td class=\"MessageBackground\">" + bb.bb(message.subject()) + "</td></tr>";
messages += "<tr><td class=\"MessageBackground\" colspan=\"2\">" + bb.bb(new String(message.message())) + "</td></tr>";
messages += "<tr><td class=\"MenuHeader\">Action:</td>" +
"<td class=\"MessageBackground\">" +
"<a href=\"Messages_p.html\">inbox</a>&nbsp;/&nbsp;" +
Expand Down
5 changes: 3 additions & 2 deletions htroot/ViewProfile.java
Expand Up @@ -57,14 +57,15 @@
import de.anomic.yacy.yacyClient;
import de.anomic.yacy.yacyCore;
import de.anomic.yacy.yacySeed;
import de.anomic.tools.unHtml;
import de.anomic.tools.bbCode;

public class ViewProfile {

public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
//listManager.switchboard = (plasmaSwitchboard) env;
serverObjects prop = new serverObjects();
plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
bbCode bb = new bbCode();

if ((post != null) && (post.containsKey("hash")) && (yacyCore.seedDB != null)) { //no nullpointer error..
yacySeed seed = yacyCore.seedDB.getConnected((String)post.get("hash"));
Expand Down Expand Up @@ -105,7 +106,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
while (i.hasNext()) {
entry = (Map.Entry) i.next();
String key=(String)entry.getKey();
String value=(new unHtml(((String)entry.getValue()).replaceAll("\r","").replaceAll("\\\\n","\n"))).un();
String value=bb.bb( ((String)entry.getValue()).replaceAll("\r","").replaceAll("\\\\n","\n") );
//all known Keys which should be set as they are
if(knownKeys.contains(key)){
prop.put("success_"+key, 1);
Expand Down

0 comments on commit 63f9570

Please sign in to comment.