Skip to content
JavaScript PHP CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
images
lib
.gitignore
.gitmodules
LICENSE.txt
README.md
authinfo.php.example
index.php
ratings.css
ratings.js
ratings.sql

README.md

PHP Ratings Plugin

This plugin allows visitors to rate things on your site.

A demo is available at http://musiclifephilosophy.com/codes/ratings-demo/

See also: https://github.com/xinxinw1/ratings-demo

Installation

You need a server that has php, mysql and git.

Using submodules

  1. $ git submodule add https://github.com/xinxinw1/ratings.git lib/ratings
  2. $ git submodule update --init --recursive

Without submodules

  1. $ git clone --recursive https://github.com/xinxinw1/ratings.git lib/ratings

More steps

  1. Create a ratings table in MySQL based on lib/ratings/ratings.sql

  2. Create a ratings user in MySQL with database-specific SELECT,INSERT,UPDATE,DELETE privileges on the ratings table.

  3. Copy authinfo.php.example to authinfo.php and change the info to fit your system.

  4. Add the following to your php file:

    <iframe width="170" height="65" style="border: 0; display: block;"
    src="lib/ratings/?id=<?php echo rawurlencode($id) ?>"></iframe>
  5. Change $id from the previous step to whatever variable holds the id for the current ratings object. (Note that id can have letters and special characters as well)

  6. Run your php file.

License

This program is dedicated to the public domain using the Creative Commons CC0. See LICENSE.txt for details.

You can’t perform that action at this time.