double Posted July 26, 2024 Share Posted July 26, 2024 I'm creating a star rating system for PW. I haven't found one. I would greatly appreciate your feedback. Star Rating Current Features: IP Checking: Prevents multiple votes from the same user. Displaying Stars and Rating Form: The star ratings are displayed on the pages with shortcode. Average Rating Calculation and Vote Counting: Calculates the average rating based on the votes. Known Bug: Currently the stars are not highlighted when a user hovers over them. Plans: Improved Styling: Enhance the visual appeal and user interface. AJAX Support and Feedback: Implement AJAX functionality to allow submiting ratings without page reload. Add a feature to provide users with immediate feedback after submitting their rating Structured Data Schema Support: The ratings are picked up by search engines for rich snippets, enhancing SEO and visibility. Cookie Checking: To further prevent multiple votes. Usage: The database table star_ratings is created during the installation. When you uninstall it drops the table. Add the following shortcode to the desired location within your template: <!--StarRatingForm--> StarRating.module.php 1 Link to comment Share on other sites More sharing options...
bernhard Posted July 26, 2024 Share Posted July 26, 2024 @double thx for sharing! Have you seen ? Link to comment Share on other sites More sharing options...
Jan Romero Posted July 26, 2024 Share Posted July 26, 2024 Neato ? You may want to turn this into a FieldtypeMulti to let PW take care of some of the database paperwork and get selector support for free. Link to comment Share on other sites More sharing options...
double Posted July 26, 2024 Author Share Posted July 26, 2024 (edited) AJAX Voting: You can now submit ratings without refreshing the page. Cookie Checking: It checks if a user has already voted by using cookies. Hover Effect: A hover effect has been added. If a user has already voted, the hover effect will be disabled for them. It needs some work b efore it’s ready for use on sites. Update: I've updated the code to store the average rating, vote count and rating sum in a separate table. Now it retrieves the data directly from this table instead of recalculating each time StarRating.module.php StarRating.module.php Edited July 27, 2024 by double Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now