Add vote placeholders #54
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
β Verified Placeholders
These placeholders have been tested and return correct data from the database:
π General Vote Info
%azlink_vote_total_sites%β Total number of configured vote sites.%azlink_vote_total_available%β Number of vote sites available to the player (Falseif none).π³οΈ Vote Site Specific (by Site ID)
%azlink_vote_{ID}_available%β Whether the player can vote on the site (True/False).%azlink_vote_site_{ID}_name%β Name of the vote site.%azlink_vote_site_{ID}_available%β Availability of the site.%azlink_vote_site_{ID}_url%β Vote site URL.π Vote Rankings
%azlink_vote_position%β Current player position in the monthly ranking.%azlink_vote_name_{POSITION}%β Name of the player in the Xth position.%azlink_vote_count_position_{POSITION}%β Vote count of the player in the Xth position.%azlink_vote_position_user_{PSEUDO}%β Position of a player by username.%azlink_vote_user_{USER_ID}%β Position of a player by user ID.%azlink_vote_position_{POSITION}%β (FIXED): Now correctly returns the vote count at position X instead of just returning X.The following placeholders are not yet working correctly:
%azlink_vote_{ID}_cooldown%%azlink_vote_site_{ID}_cooldown%Problem:
These currently return a static value or something similar to
%available%, instead of returning the real-time cooldown left based on the vote delay andlast_vote.Suggested fix:
Update the logic to calculate and return either:
"Cooldown 1h 24m 20s"(if still in cooldown)True(if vote is available again)This would make them much more useful for players and frontend integrations.
π§ Notes
Tests were conducted on a fresh Azuriom test setup, using direct vote data and verified through SQL queries.
Let me know if you'd like SQL query examples or additional screenshots!