Server Logo

Voting Leaderboard Setup Guide

If you have access to PHP hosting, you can utilize the Voting Leaderboard feature. This leaderboard is designed to work with the VotingPlugin.

Step 1: Enable the Leaderboard in Configuration

First, ensure that the Voting Leaderboard is enabled in your configuration file. Open the app.config.ts file and verify that you have the following line set to true:

useVotingLeaderboard: true,

Step 2: Upload the votes.php File

Next, copy the votes.php file from the votingplugin-api folder and upload it to your PHP hosting. You will need to fill in the database connection details in the votes.php file. Locate the following section in the file:

# Fill in the details for your database here.
$db_host = '';
# Default port is 3306
$db_port = 3306;
$db_name = '';
$db_user = '';
$db_password = '';

# Fill in this value only if you use it in the VotingPlugin config.
$db_tablePrefix = '';

// Fill in the address where you will host your website.
$corsAllowedOrigin = 'http://localhost:3000';

Make sure to provide the correct values for your database connection.

Step 3: Verify Database Connection

Ensure that the VotingPlugin is connected to the database correctly. You may want to test the database connection to confirm everything is set up properly.

Step 4: Set the Voting API URL

After successfully uploading and configuring the votes.php file, return to the app.config.ts file and set the votingApiUrl to point to your hosted votes.php file:

votingApiUrl: 'https://example.com/api/votes.php'

Replace https://example.com/api/votes.php with the actual URL where you uploaded the votes.php file.

Conclusion

With these steps completed, your Voting Leaderboard should be ready to go! If you encounter any issues or have questions, please reach out on our Discord server for support.