diff --git a/calendar.html b/calendar.html
index 7e0e172..b53541a 100644
--- a/calendar.html
+++ b/calendar.html
@@ -6,7 +6,7 @@
-
+
@@ -370,6 +370,8 @@
calSpacing.cellSpacing = 1;
calSpacing.cellPadding = 1;
}
+
+ document.getElementById('calHeader').style.display = "block";
}
@@ -389,42 +391,58 @@
//Get serverId
const id = window.localStorage.getItem('Id').toString();
- var xhr2 = new XMLHttpRequest();
- xhr2.open('get', 'http://www.selmerbot.com/getCal/', true);
- xhr2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
+ //Check if the user has premium
+ var xhrverify = new XMLHttpRequest();
+ xhrverify.open('post', 'http://www.selmerbot.com/verifypremium/', true);
+ xhrverify.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
//Use the guild Id as the userId
- xhr2.setRequestHeader('userId', id);
+ xhrverify.setRequestHeader('userId', id);
+ xhrverify.onloadend = (e) => {
+ if (xhrverify.response == "Unauthorized") {
+ document.getElementById("unauth").style.display = "block";
+ return;
+ }
- xhr2.onloadend = (e) => {
- const calList = new Map();
+ var xhr2 = new XMLHttpRequest();
+ xhr2.open('get', 'http://www.selmerbot.com/getCal/', true);
+ xhr2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
- const res = JSON.parse(xhr2.response);
- const times = res[0];
- const monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
- document.getElementById('monthName').innerText = `Editing Reminders for the Month of ${monthNames[(new Date()).getMonth()]}`;
+ //Use the guild Id as the userId
+ xhr2.setRequestHeader('userId', id);
- times.forEach((time, ind) => {
- const fullDate = new Date(Number(time));
- const month = fullDate.getMonth();
- const day = fullDate.getDate();
+ xhr2.onloadend = (e) => {
+ const calList = new Map();
- //Make sure it's the right month (old ones should be removed, this is just a catch)
- if (month == (new Date()).getMonth()) {
- if (calList.has(day)) {
- var temp = calList.get(day);
- temp.push(res[1][ind]);
- calList.set(day, temp);
- } else {
- calList.set(day, [res[1][ind]]);
+ const res = JSON.parse(xhr2.response);
+ const times = res[0];
+ const monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
+ document.getElementById('monthName').innerText = `Editing Reminders for the Month of ${monthNames[(new Date()).getMonth()]}`;
+
+ times.forEach((time, ind) => {
+ const fullDate = new Date(Number(time));
+ const month = fullDate.getMonth();
+ const day = fullDate.getDate();
+
+ //Make sure it's the right month (old ones should be removed, this is just a catch)
+ if (month == (new Date()).getMonth()) {
+ if (calList.has(day)) {
+ var temp = calList.get(day);
+ temp.push(res[1][ind]);
+ calList.set(day, temp);
+ } else {
+ calList.set(day, [res[1][ind]]);
+ }
}
- }
- });
+ });
- calSetup(calList);
+ calSetup(calList);
+ }
+
+ xhr2.send();
}
- xhr2.send();
+ xhrverify.send();
}
@@ -473,8 +491,14 @@
+
+
You have to be a premium subscriber to use this feature!
+
vvv GET PREMIUM NOW vvv
+
+
+
-
+