summaryrefslogtreecommitdiff
path: root/src/pages/guestbook.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/guestbook.php')
-rw-r--r--src/pages/guestbook.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/pages/guestbook.php b/src/pages/guestbook.php
new file mode 100644
index 0000000..f84b92d
--- /dev/null
+++ b/src/pages/guestbook.php
@@ -0,0 +1,58 @@
+<param:title>Guestbook</param:title>
+<param:active-link>guestbook</param:active-link>
+
+<div id="guestbook_frame"></div>
+
+<div id="guestbook"></div>
+
+<script type="text/javascript" src="/static/jquery-1.12.4.min.js"></script>
+<script>
+function htmlentities(str) {
+ return str.replace(/&/g, "&amp;")
+ .replace(/</g, "&lt;")
+ .replace(/>/g, "&gt;")
+ .replace(/"/g, "&quot;")
+ .replace(/'/g, "&#039;");
+}
+
+function nl2br(str, xhtml) {
+ if (typeof xhtml === "undefined") xhtml = true;
+ return str.replace(/\n/g, "<br" + (xhtml ? " /" : "") + ">");
+}
+
+$(function() {
+ $("#guestbook_frame").append(
+ $("<iframe></iframe>")
+ .attr("id", "gbframe")
+ .attr("frameborder", "0")
+ .attr("src", "//guestbook.hozyro.jkohl.link/?__e=1&__p[ok_target]=_top&__p[ok_url]=" + encodeURIComponent(location.href))
+ );
+})
+
+function _gbcb(data) {
+ $.each(data.entries, function(i, entry) {
+ $("<div></div>")
+ .addClass("guestbook-entry")
+ .append(
+ $("<div></div>")
+ .addClass("guestbook-header")
+ .append(
+ $("<strong></strong>")
+ .addClass("guestbook-author-name")
+ .text(entry.author.name),
+ " ",
+ $("<span></span>")
+ .addClass("guestbook-author-email")
+ .text("(" + entry.author.email + ")")
+ ),
+ $("<div></div>")
+ .addClass("guestbook-date")
+ .text(entry.published),
+ $("<div></div>")
+ .addClass("guestbook-content")
+ .html(nl2br(htmlentities(entry.content)))
+ ).appendTo("#guestbook")
+ })
+}
+</script>
+<script type="text/javascript" src="//guestbook.hozyro.jkohl.link/?__m=ajax&amp;__r=jsonp&amp;__c=_gbcb"></script>