inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Jan 4, 2016 3:25:34 GMT -8
I've read that (just) - its still making no sense @_@ I'm starting to think I'm too stupid to take any of this in no matter how much I try proboards.dialog("pmrpopup", {title:"Update Your Inbox?", dialogClass:'no-close', modal: true, width: 300, height:180, resizable: false, autoOpen: true, closeOnEscape: false, buttons : [{text: "Open Inbox ", click: function() { $(this).dialog('close') //Save key here }}, {text: "Cancel", click: function() { $(this).dialog('close') } }] }); That might be able to help. I took it from pm read receipt and i havent tested if it works because i cut things out
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Jan 4, 2016 14:22:08 GMT -8
I've read that (just) - its still making no sense @_@ I'm starting to think I'm too stupid to take any of this in no matter how much I try //Monetary Birthday by Loki
var birthdayPay = pb.plugin.get('monetary_birthday'); var dateServer = new Date (pb.data('serverDate')); var BirthdayKey = pb.plugin.key('birthday_money'); var birthDay = parseInt(pb.data('user').birthday.day); var birthMonth= parseInt(pb.data('user').birthday.month); var birthYear = parseInt(pb.data('user').birthday.year); var birthdayPayType = birthdayPay.settings.currency_type //Add this to your settings. This will be used as the currency name. This is for people who say pounds, points, dollars etc. instead of "money" var birthdayKeyData = BirthdayKey.get(pb.data('user').id) //should be a year value as integer
function birthdayEvalDate() {if(birthdayKeyData==undefined)//not awarded yet {return true} if((dateServer.getFullYear()-birthdayKeyData)>1)//if it's been over a year fix {return true} if((dateServer.getFullYear()!=birthdayKeyData)//if it's a new year { if(birthMonth<(dateServer.getMonth()+1)); //January is 0. check if the month is after birth month {return true} if(birthMonth==(dateServer.getMonth()+1)); //if same month if(birthDay<=dateServer.getDate())//if birthday or after {return true} } return false //if conditions not met }
//P3. If money hasn't already been given, give money.(check) if(birthdayEvalDate())//award if key is not set or it's after birthday { proboards.dialog("monetary_birthday_popup", {title:"A Present For Your Birthday", dialogClass:'no-close', modal: false, width: 300, height:180, resizable: false, autoOpen: true, closeOnEscape: false, buttons : [{text: "Open Gift", click: function() {
$(this).dialog('close') pb.loading(true)//loading screen (unneeded) BirthdayKey.set({ object_id: pb.data('user').id, value: parseInt(dateServer.getFullYear()), success: function() { // code to be executed once the key has been successfully set pb.loading(false) monetary.data(yootil.user.id()).increase.money(parseFloat( birthdayPay.settings.pay) ); pb.window.alert("Enjoy your "+birthdayPay.settings.pay+" "+birthdayPayType+"!"); //Tell them what they were given }, error: function(error) { pb.loading(false) console.log("Error Code-"+error.code+" "+error.reason+" with the Monetary Birthday Plugin.") }});
}}, {text: "Ignore", click: function() { $(this).dialog('close') } }] }); } Hopefully that helps you out. I haven't tested anything but all of the logic should be there. I made plenty of notes and you will have to add currency_type to your plugin user interface
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Jan 5, 2016 5:01:14 GMT -8
You try it out?
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jan 5, 2016 9:48:59 GMT -8
Yep - I've got an unexpected token error { on line 17/18
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Jan 5, 2016 12:04:38 GMT -8
Yep - I've got an unexpected token error { on line 17/18 Usually means theres an extra bracket or quote or brace somewhere Wanna let me look at an exported pbp?
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jan 5, 2016 12:59:43 GMT -8
I'll go through myself first xD
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jan 7, 2016 1:44:53 GMT -8
Okay I worked through code, fixed as many bugs as possible that dreamweaver was erroring about. Fixing dreamweaver errors got it to just give gifts all the time so started plan B. Just respace things. Edit: This version gives me a syntax error: unexpected end of input
//Monetary Birthday by Loki
var birthdayPay = pb.plugin.get('monetary_birthday');
var dateServer = new Date (pb.data('serverDate'));
var BirthdayKey = pb.plugin.key('birthday_money');
var birthDay = parseInt(pb.data('user').birthday.day);
var birthMonth= parseInt(pb.data('user').birthday.month);
var birthYear = parseInt(pb.data('user').birthday.year);
var birthdayPayType = birthdayPay.settings.currency_type; //Add this to your settings. This will be used as the currency name. This is for people who say pounds, points, dollars etc. instead of "money"
var birthdayKeyData = BirthdayKey.get(pb.data('user').id); //should be a year value as integer
function birthdayEvalDate(){
if(birthdayKeyData==undefined){
//not awarded yet
return true
}
if((dateServer.getFullYear()-birthdayKeyData)>1){
//if it's been over a year fix
return true
}
if((dateServer.getFullYear()!=birthdayKeyData))//if it's a new year
{
if(birthMonth<(dateServer.getMonth()+1)); {
//January is 0. check if the month is after birth month
return true}
if(birthMonth==(dateServer.getMonth()+1)); {
//if same month
if(birthDay<=dateServer.getDate()){
//if birthday or after
return true
}
}
return false //if conditions not met
}
//P3. If money hasn't already been given, give money.(check)
if(birthdayEvalDate())//award if key is not set or it's after birthday
{
proboards.dialog("monetary_birthday_popup", {title:"A Present For Your Birthday", dialogClass:'no-close', modal: false, width: 300, height:180, resizable: false, autoOpen: true, closeOnEscape: false, buttons : [{text: "Open Gift", click: function() {
$(this).dialog('close')
pb.loading(true)//loading screen (unneeded)
BirthdayKey.set({ object_id: pb.data('user').id, value: parseInt(dateServer.getFullYear()),
success: function() { // code to be executed once the key has been successfully set
pb.loading(false)
monetary.data(yootil.user.id()).increase.money(parseFloat( birthdayPay.settings.pay) );
pb.window.alert("Enjoy your "+birthdayPay.settings.pay+" "+birthdayPayType+"!"); //Tell them what they were given
},
error: function(error) {
pb.loading(false)
console.log("Error Code-"+error.code+" "+error.reason+" with the Monetary Birthday Plugin.")
}});
}},
{text: "Ignore", click: function() {
$(this).dialog('close')
} }] });
}
What does unexpected end of input mean XD
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Jan 7, 2016 10:21:54 GMT -8
Okay I worked through code, fixed as many bugs as possible that dreamweaver was erroring about. Fixing dreamweaver errors got it to just give gifts all the time so started plan B. Just respace things. Edit: This version gives me a syntax error: unexpected end of input //Monetary Birthday by Loki
var birthdayPay = pb.plugin.get('monetary_birthday');
var dateServer = new Date (pb.data('serverDate'));
var BirthdayKey = pb.plugin.key('birthday_money');
var birthDay = parseInt(pb.data('user').birthday.day);
var birthMonth= parseInt(pb.data('user').birthday.month);
var birthYear = parseInt(pb.data('user').birthday.year);
var birthdayPayType = birthdayPay.settings.currency_type; //Add this to your settings. This will be used as the currency name. This is for people who say pounds, points, dollars etc. instead of "money"
var birthdayKeyData = BirthdayKey.get(pb.data('user').id); //should be a year value as integer
function birthdayEvalDate(){
if(birthdayKeyData==undefined){
//not awarded yet
return true
}
if((dateServer.getFullYear()-birthdayKeyData)>1){
//if it's been over a year fix
return true
}
if((dateServer.getFullYear()!=birthdayKeyData))//if it's a new year
{
if(birthMonth<(dateServer.getMonth()+1)); {
//January is 0. check if the month is after birth month
return true}
if(birthMonth==(dateServer.getMonth()+1)); {
//if same month
if(birthDay<=dateServer.getDate()){
//if birthday or after
return true
}
}
return false //if conditions not met
}
//P3. If money hasn't already been given, give money.(check)
if(birthdayEvalDate())//award if key is not set or it's after birthday
{
proboards.dialog("monetary_birthday_popup", {title:"A Present For Your Birthday", dialogClass:'no-close', modal: false, width: 300, height:180, resizable: false, autoOpen: true, closeOnEscape: false, buttons : [{text: "Open Gift", click: function() {
$(this).dialog('close')
pb.loading(true)//loading screen (unneeded)
BirthdayKey.set({ object_id: pb.data('user').id, value: parseInt(dateServer.getFullYear()),
success: function() { // code to be executed once the key has been successfully set
pb.loading(false)
monetary.data(yootil.user.id()).increase.money(parseFloat( birthdayPay.settings.pay) );
pb.window.alert("Enjoy your "+birthdayPay.settings.pay+" "+birthdayPayType+"!"); //Tell them what they were given
},
error: function(error) {
pb.loading(false)
console.log("Error Code-"+error.code+" "+error.reason+" with the Monetary Birthday Plugin.")
}});
}},
{text: "Ignore", click: function() {
$(this).dialog('close')
} }] });
}
What does unexpected end of input mean XD At times like these I paste the code into notepad ++ select javascript as the language and it helps me sort out where the brackets are missing or added too many as I previously described was the problem. return false //if conditions not met } } //Add Bracket here//P3. If money hasn't already been given, give money.(check) if(birthdayEvalDate())//award if key is not set or it's after birthday {
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jan 7, 2016 10:34:25 GMT -8
TY!
So syntax error: unexpected end of input is javascripts way of saying "hey you took one too many { or }'s out"?
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Jan 7, 2016 10:38:37 GMT -8
TY! So syntax error: unexpected end of input is javascripts way of saying "hey you took one too many { or }'s out"? Either that or its talking about any of the symbols that need opening and closing such as ' " [ ] { } ( )
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jan 7, 2016 11:39:38 GMT -8
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Jan 7, 2016 12:00:50 GMT -8
Can't wait to see your finished product.
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jan 7, 2016 12:01:53 GMT -8
Now trying to work out why its back to 'not checking birth date' and just evaluating to "award birthday money" again xD This could take some time
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Jan 7, 2016 13:12:01 GMT -8
Now trying to work out why its back to 'not checking birth date' and just evaluating to "award birthday money" again xD This could take some time did you make sure your profile is not a guest also make sure that you have it set up to display birthday on profile for the logged in user all cases must be tested Also it's set to just evaluate "award birthday money" when the key hasn't been set. This will make sure that any birthdays from the previous year will be awarded. If you want it to just award from henceforth you will have to think of some type of logic to predict that
|
|