Aeon
New Member
Posts: 46
inherit
aeonofeternity@gmail.com
196622
0
Mar 26, 2023 22:20:33 GMT -8
Aeon
46
July 2013
eon
|
Post by Aeon on Mar 30, 2015 19:16:31 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓The numbers entered are actually 3-18 when a person is first added, and the numbers are modified as the user buys rank ups for their characters. It's based off of D&D's d20 stat system, where the starting values are gained by rolling 4d6 dice (4 six sided dice) and ignoring the lowest value (so 1x3 for the minimum, and 6x3 for the maximum). The final max of 46 is the maximum number a character could have if they started with 18 and put all their stat increases into that stat (28 in total). The character ranks are done through the character application in a thread rather than the profile itself. For the array to properly call the numbers I had to input the values that 0-2 would have as well so I didn't need to have another line of code to subtract anything from the stat values.
|
|
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 Mar 30, 2015 19:31:45 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓The numbers entered are actually 3-18 when a person is first added, and the numbers are modified as the user buys rank ups for their characters. It's based off of D&D's d20 stat system, where the starting values are gained by rolling 4d6 dice (4 six sided dice) and ignoring the lowest value (so 1x3 for the minimum, and 6x3 for the maximum). The final max of 46 is the maximum number a character could have if they started with 18 and put all their stat increases into that stat (28 in total). The character ranks are done through the character application in a thread rather than the profile itself. For the array to properly call the numbers I had to input the values that 0-2 would have as well so I didn't need to have another line of code to subtract anything from the stat values. I see. I suppose you are using vdice plugin for your forum then? Or are only Dungeon Masters doing dice rolling?
|
|
Aeon
New Member
Posts: 46
inherit
aeonofeternity@gmail.com
196622
0
Mar 26, 2023 22:20:33 GMT -8
Aeon
46
July 2013
eon
|
Post by Aeon on Mar 30, 2015 19:39:29 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓We're using vdice yes, but staff are the only ones who will roll the stat numbers (users choose which stats get which of the 6 numbers rolled). Users also have the option of running a thread like a D&D session so the vdice are needed for that as well.
|
|
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 Mar 30, 2015 19:45:59 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓We're using vdice yes, but staff are the only ones who will roll the stat numbers (users choose which stats get which of the 6 numbers rolled). Users also have the option of running a thread like a D&D session so the vdice are needed for that as well. I don't know if you have tables where you have to turn number rolls to text, but if you do you could check out my plugin, the vdice replacer so that you don't have to keep looking back and forth converting numbers to text. Also are you going to submit a working copy to the plugins section for other users?
|
|
Aeon
New Member
Posts: 46
inherit
aeonofeternity@gmail.com
196622
0
Mar 26, 2023 22:20:33 GMT -8
Aeon
46
July 2013
eon
|
Post by Aeon on Mar 30, 2015 19:56:48 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓With a bit of tweaking I might. I already put a note in the description about the help you gave me with the coding. And as far as tables go, there is a table to show all the stat modifiers for the stats, but part of the plugin is to display the modifier after the stat value within brackets. For D&D rolls themselves you're just comparing numbers (like a d20 roll compared to an opponents armor class, higher number wins).
|
|
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 Mar 30, 2015 22:12:47 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓With a bit of tweaking I might. I already put a note in the description about the help you gave me with the coding. And as far as tables go, there is a table to show all the stat modifiers for the stats, but part of the plugin is to display the modifier after the stat value within brackets. For D&D rolls themselves you're just comparing numbers (like a d20 roll compared to an opponents armor class, higher number wins). Sounds great. I'm glad you have what you need.
|
|
Aeon
New Member
Posts: 46
inherit
aeonofeternity@gmail.com
196622
0
Mar 26, 2023 22:20:33 GMT -8
Aeon
46
July 2013
eon
|
Post by Aeon on Mar 31, 2015 12:34:58 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓I've ran into an unexpected glitch with the code. It only displays stats for the first miniprofile in a thread, even if the same user posts more than once.
|
|
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 Mar 31, 2015 12:58:39 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓I've ran into an unexpected glitch with the code. It only displays stats for the first miniprofile in a thread, even if the same user posts more than once. yeah that is to be expected. I was thinking of the profile page in general would be where it is displayed. The miniprofile is a little different. There are two ways to do it from this point. The one that would be easiest is loop through the div's you make. Take the user id from the href tag of the user name in the .mini-profile and then run your stat loading code for each post, loading the correct user data Also ignoring guest posts and accounts you haven't set up
|
|
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 Mar 31, 2015 13:02:11 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓I've ran into an unexpected glitch with the code. It only displays stats for the first miniprofile in a thread, even if the same user posts more than once. the other would be by putting code in your template and putting the user id variable in there. So that you could loop through and populate it from that user id
|
|
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 Mar 31, 2015 13:10:06 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓I've ran into an unexpected glitch with the code. It only displays stats for the first miniprofile in a thread, even if the same user posts more than once. var aeonarrayid = new Array()
for(c=0;c<$('td>div.mini-profile>a.user-link').length;c++)
{
aeonarrayid[c]=parseInt($($('div.mini-profile').find('a')[c]).attr('href').replace('/user/',''))
}
alert(aeonarrayid) This will get the id (as an integer) of each post moving downwards, not including guest posts ( which could throw it off) So you would loop through the div's you have and append the information based on the aeonarrayid compared to your plugin settings Of course this also gets tagged names in posts and this code isn't a final draft by any means So maybe it would be easier to just go into the mini-profile template and encase the user id variable in a div you can look at when you loop through posts
|
|
Aeon
New Member
Posts: 46
inherit
aeonofeternity@gmail.com
196622
0
Mar 26, 2023 22:20:33 GMT -8
Aeon
46
July 2013
eon
|
Post by Aeon on Mar 31, 2015 18:34:22 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓So basically an if statement around the user id variable to filter out unaccepted characters and guests with an id on the div that the code looks for? (Sorry my brain's a bit fuzzy right now due to some drama earlier today (and if I had access to the coding for the monetary system plugin I could just look at that and see how it was done in there to display for each user)) Though wouldn't the code stating to look in a td with the class/id of miniprofile in what you posted keep it from registering tags in posts? Thinking about it, wouldn't a loop to check each miniprofile against the different membergroups be easier than making a new array with an alert?
|
|
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 Mar 31, 2015 20:02:23 GMT -8
Peters mini profile code from his github repository github.com/PopThosePringles/ProBoards-Monetary-System/blob/365d734eca74a903534cd10f4c1bda34c9d5daa2/money.jsshow_in_mini_profile: function(){
var minis = $("div.mini-profile");
if(minis && minis.length){
if(minis.find("div.info span[class*=pd_money_]").length){
return;
}
this.refresh_user_data_table();
var self = this;
var money_text = (this.settings.show_money_text_mini)? this.settings.money_text : "";
var money_symbol = (this.settings.show_money_symbol_mini)? this.settings.money_symbol : "";
var bank_text = (this.bank.settings.text.bank)? this.bank.settings.text.bank : "";
var donations_received_text = (this.donation.settings.text.donations)? this.donation.settings.text.donations : "";
var donations_sent_text = (this.donation.settings.text.donations)? this.donation.settings.text.donations : "";
if(money_text.toString().length){
money_text += this.settings.money_separator;
}
if(bank_text.toString().length){
bank_text += " Balance" + this.settings.money_separator;
}
if(donations_sent_text.toString().length){
donations_sent_text += " Sent" + this.settings.money_separator;
}
if(donations_received_text.toString().length){
donations_received_text += " Received" + this.settings.money_separator;
}
var show_bank_balance = false;
if(self.bank.settings.enabled && self.bank.settings.show_bank_mini_profile){
if((self.bank.settings.show_bank_staff_only && yootil.user.is_staff()) || !self.bank.settings.show_bank_staff_only){
show_bank_balance = true;
}
}
minis.each(function(){
var user_link = $(this).find("a.user-link[href*='user']:first");
if(user_link && user_link.length){
var user_id_match = user_link.attr("href").match(/\/user\/(\d+)\/?/i);
if(user_id_match && user_id_match.length == 2){
var user_id = parseInt(user_id_match[1]);
if(!user_id){
return;
}
var money = self.data(user_id).get.money(true);
var user_bank_money = self.data(user_id).get.bank(true);
var user_donations_sent = self.data(user_id).get.total_sent_donations(true);
var user_donations_received = self.data(user_id).get.total_received_donations(true);
var using_custom = false;
using_custom = (self.custom_money_tpl($(this), money, "", money_text, money_symbol, user_id, self))? true : using_custom;
using_custom = (self.custom_bank_tpl($(this), user_bank_money, "", bank_text, show_bank_balance, money_symbol, user_id, self))? true : using_custom;
using_custom = (self.custom_donations_sent_tpl($(this), user_donations_sent, donations_sent_text, money_symbol, user_id, self))? true : using_custom;
using_custom = (self.custom_donations_received_tpl($(this), user_donations_received, donations_received_text, money_symbol, user_id, self))? true : using_custom;
if(!using_custom){
var info = $(this).find("div.info");
if(info && info.length){
var div = info.get(0);
var str = "";
str += "<span class=\"pd_money_text_" + user_id + "\">" + money_text + "</span>";
str += "<span class=\"pd_money_symbol_" + user_id + "\">" + money_symbol + "</span>";
str += "<span class=\"pd_money_amount_" + user_id + "\">" + yootil.html_encode(money) + "</span><br />";
if(show_bank_balance){
str += "<span class=\"pd_bank_text_" + user_id + "\">" + bank_text + "</span>";
str += "<span class=\"pd_bank_symbol_" + user_id + "\">" + money_symbol + "</span>";
str += "<span class=\"pd_bank_amount_" + user_id + "\">" + yootil.html_encode(user_bank_money) + "</span><br />";
}
if(self.donation.settings.enabled){
if(self.donation.settings.show_total_sent_mini_profile){
str += "<span class=\"pd_donations_sent_text_" + user_id + "\">" + donations_sent_text + "</span>";
str += "<span class=\"pd_donations_sent_symbol_" + user_id + "\">" + money_symbol + "</span>";
str += "<span class=\"pd_donations_sent_amount_" + user_id + "\">" + yootil.html_encode(user_donations_sent) + "</span><br />";
}
if(self.donation.settings.show_total_received_mini_profile){
str += "<span class=\"pd_donations_received_text_" + user_id + "\">" + donations_received_text + "</span>";
str += "<span class=\"pd_donations_received_symbol_" + user_id + "\">" + money_symbol + "</span>";
str += "<span class=\"pd_donations_received_amount_" + user_id + "\">" + yootil.html_encode(user_donations_received) + "</span><br />";
}
}
$(div).prepend(str);
}
}
}
}
});
}
},
|
|
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 Mar 31, 2015 20:07:10 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓So basically an if statement around the user id variable to filter out unaccepted characters and guests with an id on the div that the code looks for? (Sorry my brain's a bit fuzzy right now due to some drama earlier today (and if I had access to the coding for the monetary system plugin I could just look at that and see how it was done in there to display for each user)) Though wouldn't the code stating to look in a td with the class/id of miniprofile in what you posted keep it from registering tags in posts? Thinking about it, wouldn't a loop to check each miniprofile against the different membergroups be easier than making a new array with an alert? So basically what I'm doing but more specific with extra checks and a regex This is most of it. However I'm just pasting the important parts in non-working order var minis = $("div.mini-profile"); minis.each(function(){ var user_link = $(this).find("a.user-link[href*='user']:first"); if(user_link && user_link.length){ var user_id_match = user_link.attr("href").match(/\/user\/(\d+)\/?/i); if(user_id_match && user_id_match.length == 2){ var user_id = parseInt(user_id_match[1]); if(!user_id){ return; }
So you could try working with his code. I doubt he will mind. Figuring he's made a library called yootil for developers and kitchen sink. The alert that I had was to test the validity of my code and was no means meant to stay there. You can't have it check against the member groups because then you cant load the individuals data. Unless it's the same for everyone.
|
|
Aeon
New Member
Posts: 46
inherit
aeonofeternity@gmail.com
196622
0
Mar 26, 2023 22:20:33 GMT -8
Aeon
46
July 2013
eon
|
Post by Aeon on Mar 31, 2015 22:02:02 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓Yeah, I found the code a few hours ago and tried using the bits of it for showing the miniprofile but I can't figure out how to get it to work and every time I insert it the entire code stops working.
|
|
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 Mar 31, 2015 22:16:26 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓Yeah, I found the code a few hours ago and tried using the bits of it for showing the miniprofile but I can't figure out how to get it to work and every time I insert it the entire code stops working. Are you using firefox or google chrome debugger to tell you what line it stops working on and why?
|
|