inherit
114253
0
Sept 23, 2024 7:58:54 GMT -8
Teg
Can't Wait for V6
3,157
November 2007
teg
|
Post by Teg on Sept 17, 2024 1:26:33 GMT -8
I am testing out the Group Points Plugin on a test forum locate here: IzzyTest. So far, most of it works correctly. But, there are some issues and I need some help fixing them. I have NOT touched any of the actual code in components. The plugin is buildable, so it can be edited to fix the problems, I'm just not familiar enough to do so myself and I'm looking for someone to do it. Problems I Need Help WithThe mini - profile area displays as follows: Where it should just display House Points: total (as the user has 40 points), it displays null and shows the updates by a staff member, which it's not supposed to do. Same thing with the homework points. Furthermore, the Homework Points has some really long number that makes zero sense. I'm having similar issues with the members page: While the house points section did display properly, the homework points do not. In addition to the problems, I'd also like the option to combine the total of house points and homework points as homework points count towards a user's house points for what I'm trying to do. If anyone is willing to fix the errors in this plugin and add the modification above, I'd greatly appreciate it.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Sept 18, 2024 10:27:21 GMT -8
I am testing out the Group Points Plugin on a test forum locate here: IzzyTest. So far, most of it works correctly. But, there are some issues and I need some help fixing them. I have NOT touched any of the actual code in components. The plugin is buildable, so it can be edited to fix the problems, I'm just not familiar enough to do so myself and I'm looking for someone to do it. Problems I Need Help WithThe mini - profile area displays as follows: Where it should just display House Points: total (as the user has 40 points), it displays null and shows the updates by a staff member, which it's not supposed to do. Same thing with the homework points. Furthermore, the Homework Points has some really long number that makes zero sense. I'm having similar issues with the members page: While the house points section did display properly, the homework points do not. In addition to the problems, I'd also like the option to combine the total of house points and homework points as homework points count towards a user's house points for what I'm trying to do. If anyone is willing to fix the errors in this plugin and add the modification above, I'd greatly appreciate it. I am a bit hesitant to weigh in here since the plugin author openly admits the plugin is incomplete I designed this plugin with the promise of payment upon completion, however I received no payment, so I haven't worked on developing further. Before the plugin was removed/disabled/permission-restricted from the test site, I had worked out how to remove the edit logs from the output. This could be a can of worms given the state of the coding (unoptimized and unfinished first draft), but here are the edits to remove the edit log information:
There are also doubles because the mini-profile has <div class="house_points_small"></div> so the plugin adds the regular points display to mini-profile and then again within that div.house_points_small. Also those long numbers are timestamps of when the log entry was created they are not points.
|
|
inherit
114253
0
Sept 23, 2024 7:58:54 GMT -8
Teg
Can't Wait for V6
3,157
November 2007
teg
|
Post by Teg on Sept 19, 2024 20:22:30 GMT -8
Hi ChrisI will test that out and see what it does. However, I don't have the funds to purchase additional keys to have this plus the monetary system on a forum. I did however, manage to create a custom page, viewable only to to staff on my actual forum where I'm trying to utilize a points system. On this page, the staff member fills out a form. The number that is populated by submitting the forum is added to group totals. I recorded a video to show what I mean. There is no sound, just follow the pointer. This is the script I wrote: <script> document.addEventListener('DOMContentLoaded', function() { // Load existing entries from localStorage when the page loads loadEntries();
document.getElementById('house-points-form').addEventListener('submit', function(event) { event.preventDefault();
// Get form values const username = document.getElementById('username').value; const houseName = document.getElementById('house-name').value; const housePoints = parseInt(document.getElementById('house-points').value, 10); // Ensure it's an integer const reason = document.getElementById('reason').value; const staffMember = document.getElementById('staff-member').value; const date = document.getElementById('date').value;
// Make sure all fields are filled if (!username || !houseName || isNaN(housePoints) || !reason || !staffMember || !date) { alert('Please fill all fields.'); return; }
// Create entry object const entry = { username, houseName, housePoints, reason, staffMember, date };
// Save the entry to localStorage saveEntry(entry);
// Append the new entry to the entries container addEntryToDOM(entry);
// Update house points totals updateTotals();
// Reset the form document.getElementById('house-points-form').reset(); }); });
function saveEntry(entry) { let entries = JSON.parse(localStorage.getItem('housePointsEntries')) || []; entries.push(entry); localStorage.setItem('housePointsEntries', JSON.stringify(entries)); }
function loadEntries() { const entries = JSON.parse(localStorage.getItem('housePointsEntries')) || []; entries.forEach(entry => { addEntryToDOM(entry); }); updateTotals(); }
function addEntryToDOM(entry) { const entryDiv = document.createElement('div'); entryDiv.className = 'entry'; entryDiv.innerHTML = ` <strong>${entry.username} | ${entry.housePoints} Points | ${entry.houseName}</strong><br> ${entry.reason}<br> Awarded by: ${entry.staffMember} on ${entry.date}<br> <button class="delete-btn">Delete</button> `;
// Append the entry to the container const entriesContainer = document.getElementById('entries-container'); entriesContainer.appendChild(entryDiv);
// Add event listener for the delete button entryDiv.querySelector('.delete-btn').addEventListener('click', function() { deleteEntry(entry, entryDiv); }); }
function deleteEntry(entryToDelete, entryDiv) { // Remove the entry from localStorage let entries = JSON.parse(localStorage.getItem('housePointsEntries')) || []; entries = entries.filter(entry => { return !(entry.username === entryToDelete.username && entry.houseName === entryToDelete.houseName && entry.housePoints === entryToDelete.housePoints && entry.reason === entryToDelete.reason && entry.staffMember === entryToDelete.staffMember && entry.date === entryToDelete.date); }); localStorage.setItem('housePointsEntries', JSON.stringify(entries));
// Remove the entry from the DOM entryDiv.remove();
// Update the totals after deletion updateTotals(); }
function updateTotals() { // Initialize totals for each house let ravenclawTotal = 0; let gryffindorTotal = 0; let slytherinTotal = 0; let hufflepuffTotal = 0;
// Get all entries from localStorage const entries = JSON.parse(localStorage.getItem('housePointsEntries')) || [];
// Calculate totals for each house entries.forEach(entry => { if (entry.houseName === 'Ravenclaw') { ravenclawTotal += entry.housePoints; } else if (entry.houseName === 'Gryffindor') { gryffindorTotal += entry.housePoints; } else if (entry.houseName === 'Slytherin') { slytherinTotal += entry.housePoints; } else if (entry.houseName === 'Hufflepuff') { hufflepuffTotal += entry.housePoints; } });
// Update the totals in the DOM document.getElementById('ravenclaw-total').textContent = `${ravenclawTotal}`; document.getElementById('gryffindor-total').textContent = `${gryffindorTotal}`; document.getElementById('slytherin-total').textContent = `${slytherinTotal}`; document.getElementById('hufflepuff-total').textContent = `${hufflepuffTotal}`; } </script>
As you can see in the video, it does populate and unpopulated. I feel like it would be much easier to do this as a plugin that allows staff to modify a user's profile, send notifications, and the lines about points, but requiring super keys, 2 specifically for something like this just isn't in the cards for me. If you can think of a better or easier way to do this, please let me know. I don't have experience with the plugin system. I've tried to build a few simple ones and I can never get them to work.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Sept 19, 2024 20:53:45 GMT -8
The problem with localStorage is that it is local: person A will see it since it is saved on their computer, but person B and C won't have access to stuff saved on person A's computer. The data has to be in the cloud for A, B, and C to access the same shared data, which is what a plugin key brings to the table.
You could probably switch from localStorage to a free tier cloud storage such as jsonbin.io (up to 10,000 requests). Other free API storage is available (Google them), so shop around to see if you can find better than 10,000 requests.
|
|
inherit
114253
0
Sept 23, 2024 7:58:54 GMT -8
Teg
Can't Wait for V6
3,157
November 2007
teg
|
Post by Teg on Sept 19, 2024 20:55:25 GMT -8
Thank you for the the information, Chris. I really appreciate it. Is there a way to make the plugin like this, without the use of 2 super keys to do it?
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Sept 19, 2024 20:58:52 GMT -8
You would need to have some cloud storage, whether it be keys or some other storage API
|
|
inherit
114253
0
Sept 23, 2024 7:58:54 GMT -8
Teg
Can't Wait for V6
3,157
November 2007
teg
|
Post by Teg on Sept 19, 2024 21:01:28 GMT -8
I own a domain name and hosting, would something like that work?
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Sept 19, 2024 22:41:08 GMT -8
|
|
inherit
114253
0
Sept 23, 2024 7:58:54 GMT -8
Teg
Can't Wait for V6
3,157
November 2007
teg
|
Post by Teg on Sept 19, 2024 23:55:30 GMT -8
I know about purchasing keys, I just can’t afford to do that right now. Hence I was trying to find a work around. Not to mention, I don’t know enough about the plugin system to turn it into a plugin to begin with on my own.
|
|