New5starRating Version 1.0
Developed by Joe Pieruccini
under Creative Commons Attribution-Noncommercial 2.5 Australia License
at www.maniacomputer.com
email : jp50@maniacomputer.com
Save it on your computer and then extract it with winrar or any compatible
software.
Upload the folder with the name of 5star_rating
in the root folder of your website.Pay attention
to upload only one folder,because sometimes, when extracting,winrar
creates a second folder and therefore it will be one 5star_rating folder
inside another one with the same name.
Grant write and read permissions to conf/config.php and you must have username,password to access MySql and database name
You must enable gd library on your PHP configuration file
or it won't work.
Open install_rating1 in your browser by typing
http://www.yourwebsitename/5star_rating/install/install_rating1.php and this page opens
Enter all the details you asked for, like username, password and follow
the instructions on the form, because you will be asked to enter a username
and password for accessing the admin control panel, don't forget these
credentials because you wont be able to retrieve them later.
Press enter and the installer will do the job like creating the
configuration file and the SQL tables.
Now to test it,type in your browser
http://www.yourwebsitename/5star_rating/rating.php
and
http://www.yourwebsitename/5star_rating/test_listing.php .If all
works fine, delete the
install_rating1.php file for security and also deny the write permission for
config.php.
To add the rating system to your webpages,copy and paste the
following line of code at the very top of the page:
<?php
ob_start();?>
and in where you
want the rating system in your page:
<?php include 'rating.php'; ?> Obviously
you have to pay attention at the relative path using the function include
,make sure it is pointing at the right path.
This is for the usage on a single webpage,to use the
rating system on a database driven site like a web directory or a Tutorials
site Have a look at the example test_listing.php
You've done the installation and tested it ? Well,now you can access the
Admin Control Panel by entering in the browser address bar
http://www.yourwebsitename/5star_rating/admin/control_panel.php and
now login with the username and password you provided during the
installation.
When logged in you'll have the following page:
where you can choose for a list of all rated items see screenshot
To change any of the configuration you've done at the installation you can open the config.php file or you can use the visual interface,see screenshot
Change settings
carefully reading the instructions and click change
This Rating System is based
on templates, therefore is very easy to customize the look of it by editing the
HTML part. For the existing templates,just open in your editor,display.tpl.php
for the banner 400x140,display_vert.tpl.php for the vertical banner 120x240 and
display_id.tpl.php for the example of usage with items from Database.The css
file conf/style.css apply to all templates. To create a new template just follow few easy steps:
Create
a new file and save it like newfilename.tpl.php
Do all the HTML coding and then put the PHP variables that hold the
result of the PHP code where you like them to be.Like in the figure below
Here the list of PHP variables used in the Templates
$date_added - for the date
the article was created.
$clic_count - The number of hits
$rating
- The current rating
$count_raters - Total votes or raters
$stars
- The number of stars
$msg
- The message to the visitors
$rating_img_path-The path to the chart image
After
that,you can either go to the Admin Control Panel/Setting Manager and change
the name of the template with the file you have just created. Other way,
open up conf/config.php and change manually the variable $file with the name
of your template.
If you like this script, please take a
second, Rate it