From f73585ff0394d5f8732b3b403bcebfd89c906a94 Mon Sep 17 00:00:00 2001 From: echicken <> Date: Mon, 30 Sep 2013 19:07:42 +0000 Subject: [PATCH] Use format() for less shitty assembly of output. Include modopts appendURL value in URL to async script (derp.) --- web/root/ecwebv3/pages/002-forum.ssjs | 38 +++++++++++++-------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/web/root/ecwebv3/pages/002-forum.ssjs b/web/root/ecwebv3/pages/002-forum.ssjs index e00faabe11..be9e59df41 100644 --- a/web/root/ecwebv3/pages/002-forum.ssjs +++ b/web/root/ecwebv3/pages/002-forum.ssjs @@ -18,28 +18,26 @@ if(typeof http_request.query.board != "undefined") { if(typeof http_request.query.sub != "undefined" && http_request.query.sub != 'mail') { print("<script type='text/javascript'>"); print( - "loadThreads('http://" - + http_request.host - + ":" - + webIni.HTTPPort - + "/forum-async.ssjs', '" - + http_request.query.sub - + "', " - + ((http_request.query.hasOwnProperty('thread'))?false:true) - + ");" + format( + "loadThreads('http://%s:%s%s/forum-async.ssjs', '%s', %s);", + http_request.host, + webIni.HTTPPort, + webIni.appendURL, + http_request.query.sub, + (typeof http_request.query.thread == "undefined") ? true : false + ) ); if(typeof http_request.query.thread != "undefined") { - print("loadThread('http://" - + http_request.host - + ":" - + webIni.HTTPPort - + "/forum-async.ssjs', '" - + http_request.query.sub - + "', '" - + http_request.query.thread - + "', " - + false - + ");" + print( + format( + "loadThread('http://%s:%s%s/forum-async.ssjs', '%s', '%s', %s);", + http_request.host, + webIni.HTTPPort, + webIni.appendURL, + http_request.query.sub, + http_request.query.thread, + false + ) ); } print("</script>"); -- GitLab