Warning: session_start(): open(/var/lib/php/sessions/sess_t8cjn6tcsc2uff9mjmq1gq4503, 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
!752
static int maxQuestionLength = 500;
static int maxAnswerLength = 200;
static S html(S subUri, Map params) {
L history = cast get(getMainBot(), "history");
new StringBuffer buf;
buf.append(pageNav(params, litstringlist(), l(history), "n"));
pcall {
int x = 0;
print("l(history)=" + l(history) + ", x=" + x);
int n;
if (!empty(params.get("n")))
n = parseInt(params.get("n"));
else
n = max(0, l(history)-1)/100*100;
for (int i = min(n+100, l(history))-1; i >= n; i--) {
O dialog = history.get(i);
S q = shorten(getString(dialog, "question"), maxQuestionLength);
S a = shorten(getString(dialog, "answer"), maxAnswerLength);
S user = or(getString(dialog, "user"), "User");
buf.append(htag("li", htmlencode(user) + ": " + htmlencode(q) + "", "class", "splash-li") + "\n");
buf.append(htag("li", system() + ": " + htmlencode(a) + "", "class", "splash-li") + "\n");
}
}
ret htag("p", "n=" + l(history)) + htag("ul", buf);
}