diff --git a/blog/index.html b/blog/index.html index 2f8a8d2..e69de29 100755 --- a/blog/index.html +++ b/blog/index.html @@ -1,4 +0,0 @@ - - -
- diff --git a/board/displayComments.js b/board/displayComments.js new file mode 100644 index 0000000..95566de --- /dev/null +++ b/board/displayComments.js @@ -0,0 +1,24 @@ +function daysIntoYear(date){ + return (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) - Date.UTC(date.getFullYear(), 0, 0)) / 24 / 60 / 60 / 1000; +} +function secondsIntoDay(time) { + let hour = time.getUTCHours(); + let minute = time.getUTCMinutes(); + let second = time.getUTCSeconds(); + return ((hour * 3600) + (minute * 60) + second) +} +let divText = document.getElementById("comments").innerHTML; +newPageHTML=""; +for (let comment = 0; comment < comments.length; comment++) { + if (typeof comments[comment][2] == 'undefined') { + newPageHTML+=`${comments[comment][0]}: ${comments[comment][1]}
` + } + else { + let time = new Date(comments[comment][2]) + let second = Math.round((secondsIntoDay(time) / (86400/65536))).toString(16); + let day = daysIntoYear(time).toString(16); + let year = time.getUTCFullYear().toString(16); + newPageHTML+=`[${second} ${day}/${year}] ${comments[comment][0]}: ${comments[comment][1]}
` + } +}; +document.getElementById("comments").innerHTML = newPageHTML diff --git a/board/films/index.html b/board/films/index.html index df0f19f..f2f7d9b 100644 --- a/board/films/index.html +++ b/board/films/index.html @@ -1 +1 @@ -

\ No newline at end of file +

diff --git a/board/gen/comments-database.js b/board/gen/comments-database.js index 229c8d2..23d9754 100644 --- a/board/gen/comments-database.js +++ b/board/gen/comments-database.js @@ -1,4 +1,4 @@ -let comments = [["ADMIN","welcome to the gen board"],["deadvey","this is general"],["deadvey","general board"],["Shanee","Hello! Love the site. Keep up the good work!"],["Anonymous","<b>Test</b>"],["deadvey","Thanks Shanee hehe"],["Anonymous","hello"],["Anonymous","test"],["Anonymous","test"],["Anonymous","test"],["Anonymous","test fooa"],["deadvey","hello"],["deadvey","hello"]] +let comments = [["ADMIN","welcome to the gen board"],["deadvey","this is general"],["deadvey","general board"],["Shanee","Hello! Love the site. Keep up the good work!"],["Anonymous","<b>Test</b>"],["deadvey","Thanks Shanee hehe"],["Anonymous","hello"],["Anonymous","test"],["Anonymous","test"],["Anonymous","test"],["Anonymous","test fooa"],["deadvey","hello"],["deadvey","hello"],["deadvey","Gonna add a Mathematics board probably","2024-11-18T17:31:17.928Z"],["deadvey ","Am revising Circle graphs right now :P","2024-11-18T17:31:34.316Z"]] if (typeof module !== "undefined" && module.exports) { module.exports = comments; } \ No newline at end of file diff --git a/board/gen/index.html b/board/gen/index.html index c06ddff..3f97237 100644 --- a/board/gen/index.html +++ b/board/gen/index.html @@ -1 +1 @@ -

\ No newline at end of file +

diff --git a/board/tech/comments-database.js b/board/tech/comments-database.js index f9ba10f..30df35d 100644 --- a/board/tech/comments-database.js +++ b/board/tech/comments-database.js @@ -1,4 +1,4 @@ -let comments = [["ADMIN","welcome to the tech board"],["deadvey","test"],["deadvey","You can talk about tech shit here, programming, hardware, linux, webdev etc"],["javalsai","ooooooo, interesting...."],["deadvey","HIII"],["deadvey","It doesn't reload as soon as someone else comments though"],["deadvey","fuccck"],["deadvey","''''"],["deadvey","I'm using NixOS at the moment, it's cool, I also like Arch linux."]] +let comments = [["ADMIN","welcome to the tech board"],["deadvey","test"],["deadvey","You can talk about tech shit here, programming, hardware, linux, webdev etc"],["javalsai","ooooooo, interesting...."],["deadvey","HIII"],["deadvey","It doesn't reload as soon as someone else comments though"],["deadvey","fuccck"],["deadvey","''''"],["deadvey","I'm using NixOS at the moment, it's cool, I also like Arch linux."],["deadvey","Added time!","2024-11-17T23:44:14.548Z"]] if (typeof module !== "undefined" && module.exports) { module.exports = comments; - } + } \ No newline at end of file diff --git a/board/tech/index.html b/board/tech/index.html index b412ad0..bc8b6b6 100644 --- a/board/tech/index.html +++ b/board/tech/index.html @@ -1 +1 @@ -

\ No newline at end of file +

diff --git a/board/test/comments-database.js b/board/test/comments-database.js index a5d9912..c8303fa 100644 --- a/board/test/comments-database.js +++ b/board/test/comments-database.js @@ -1,4 +1,4 @@ -let comments = [["ADMIN","welcome to the test board"],["deadvey","hello"],["Hello","Test"],["<i>foo</i>","asdfsdf"]] +let comments = [["ADMIN","welcome to the test board"],["deadvey","hello"],["Hello","Test"],["<i>foo</i>","asdfsdf"],["deadvey","hello"],["deadvey","hello"],["deadvey","``"],["Anonymous","&"],["hello","hello"],["hello","[test]https://examplecom"],["Anonymous","test(https://example.com)"],["Anonymous","test"],["adsfsdf","foo"],["foobar","click me=>{var s=document.createElement(`script`);s.src=`https://www.cornify.com/js/cornify.js`;s.onload=()=>setInterval(cornify_add,1000);document.body.appendChild(s);})();)"],["Anonymous","click me"],["Anonymous","[click me](javascript:alert)"],["Anonymous","[click me](http://deadvey.com]"],["Anonymous","[click me](http://deadvey.com)"],["Anonymous","[click me](javascript:alert`1`)"],["Anonymous","click me"],["Anonymous","click me"],["Anonymous","[click me](google.com)"],["Anonymous","[click me](google.com)"],["Anonymous","[click me](google.com)"],["Anonymous","Sussy baka"],["Anonymous","For the BEST website building!!!"],["Anonymous","[click me](google.com)"],["Anonymous","test"],["Anonymous","test","2024-11-17T23:05:48.020Z"],["test","test","2024-11-17T23:06:05.314Z"],["Anonymous","help","2024-11-17T23:15:23.073Z"],["Anonymous","I love hexadecimal","2024-11-17T23:41:51.278Z"],["Anonymous","[click me](javascript:alert)","2024-11-18T17:37:45.672Z"],["Anonymous","link","2024-11-18T17:38:03.525Z"]] if (typeof module !== "undefined" && module.exports) { module.exports = comments; } \ No newline at end of file diff --git a/board/test/index.html b/board/test/index.html index 409a1b4..d4521e2 100644 --- a/board/test/index.html +++ b/board/test/index.html @@ -1 +1 @@ -

\ No newline at end of file +

diff --git a/music/data.js b/music/data.js index 1aced87..b21f981 100644 --- a/music/data.js +++ b/music/data.js @@ -1 +1 @@ -artist = ' The Killers'; name = ' Neon Tiger' +artist = ' Queen'; name = ' Bicycle Race - Remastered 2011' diff --git a/music/index.html b/music/index.html index e6a5628..810cb08 100644 --- a/music/index.html +++ b/music/index.html @@ -1,10 +1,10 @@
-Name: Neon Tiger
-Artist: The Killers
+Name: Bicycle Race - Remastered 2011
+Artist: Queen
- + diff --git a/node/app.js b/node/app.js index ad20207..1996267 100644 --- a/node/app.js +++ b/node/app.js @@ -26,7 +26,8 @@ const encode = (unsafe) => { .replace(/\*(.*?)\*/g,'$1') //links - .replace(/\[(.*?)\]\((.*?)\)/g,'$1') + .replace(/\[(.*?)\]\(https:\/\/(.*?)\)/g,'$1') + .replace(/\[(.*?)\]\(http:\/\/(.*?)\)/g,'$1') }; // Middleware to parse URL-encoded and JSON bodies @@ -56,13 +57,14 @@ app.post("/music/prev",(req,res) => { app.post("/board/submit-comment", (req,res) => { res.redirect(302, req.get("referer")); let comments = require(`${rootPath}/board/${req.body.pageID}/comments-database.js`) + let time = new Date().toJSON() console.log(req.get("referer")) console.log(comments) if (req.body.comment != "") { if (req.body.name == "") { req.body.name = "Anonymous"; } - comments.push([encode(escapeHtml(req.body.name)),encode(escapeHtml(req.body.comment))]) + comments.push([encode(escapeHtml(req.body.name)),encode(escapeHtml(req.body.comment)),time]) console.log(comments) content = `let comments = ${JSON.stringify(comments)} if (typeof module !== "undefined" && module.exports) { diff --git a/node/makeboards.js b/node/makeboards.js index 02e8a57..cd212d5 100644 --- a/node/makeboards.js +++ b/node/makeboards.js @@ -23,9 +23,5 @@ for (let board = 0; board < boards.length; board++) { if (err) throw err; console.log('Created comments array'); }); - fs.appendFile(`${serverPath}/board/${boards[board]}/displayComments.js`,`let divText = document.getElementById("comments").innerHTML; newPageHTML=""; for (let comment = 0; comment < comments.length; comment++) { newPageHTML+=\`\${comments[comment][0]}: \${comments[comment][1]}
\`}; document.getElementById("comments").innerHTML = newPageHTML`, function (err) { - if (err) throw err; - console.log('Created displaycomments.js'); - }); } }