Warning: session_start(): open(/var/lib/php/sessions/sess_0k750i0spgs1m6ndh8ioha2akn, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
static S text;
concept Text {
S conceptID;
S text;
S by;
}
p {
db();
load("text");
if (isMainProgram()) serveHttpAndOpenBrowser();
}
synchronized html {
S newText = params.get("text");
if (newText != null) {
text = newText;
save("text");
}
S user = cast call(getBot(#1007510), "conceptIDForCookie");
S msg = "";
if (nempty(params.get("publish"))) {
Text t = uniq_sync(Text, conceptID := aGlobalID(), text := text, by := user);
msg = "Published as: " + t.conceptID;
}
S list = p("Published texts: " + join(", ", collect(list(Text), 'conceptID)));
ret
(empty(msg) ? "" : p(msg))
+ list
+ p("You are: " + or2(user, "?"))
+ hpostform([[
]].replace("#TEXT#", htmlencode(text)),
onSubmit := "if (editor) text.value = editor.getValue(); return true;");
}