Installationsanvisningarna:
Okej, nummer 1-4 är jag på det klara med tror jag.INSTALLATION:
=============================================================================
1. Make your table for the ratings in your db (you should be able to copy
and paste the following SQL)
=============================================================================
CREATE TABLE `ratings` (
`id` varchar(11) NOT NULL,
`total_votes` int(11) NOT NULL default 0,
`total_value` int(11) NOT NULL default 0,
`used_ips` longtext,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=3;
=============================================================================
2. Enter your specific info into _config-rating.php
=============================================================================
$dbhost = 'localhost';
$dbuser = '###';
$dbpass = '###';
$dbname = '###';
$tableName = 'ratings';
$rating_unitwidth = 30;
=============================================================================
3. Enter this line at the top of any page where you want
to have rating bars.
=============================================================================
<?php require('_drawrating.php'); ?>
=============================================================================
4. Point to the right Javascript and CSS files (you need
behavior.js, rating.js, and rating.css)
=============================================================================
<script type="text/javascript" language="javascript" src="js/behavior.js"></script>
<script type="text/javascript" language="javascript" src="js/rating.js"></script>
<link rel="stylesheet" type="text/css" href="css/rating.css" />
Remember to make sure to fix paths for the images as well. I kept behavior.js separate
from rating.js, because you can use it for other things!
=============================================================================
5. Drop the function wherever you want a rating bar to appear
=============================================================================
NOTE: As of version 1.2.1, use the echo statement! Also, if you use the static
parameter, you should always specify the 2nd parameter (number of units), even if
it is blank (which will default to 10 units)
<?php echo rating_bar('8'); ?> - 10 stars (default), ID of 8
<?php echo rating_bar('8xxa','5'); ?> - 5 stars, ID of 8xxa
<?php echo rating_bar('9a','5','static'); ?> - 5 stars, ID of 9a, static (non votable)
<?php echo rating_bar('9b',''); ?> - 10 stars, ID of 9b
<?php echo rating_bar('9c','8','static'); ?> - 8 stars, ID of 9c, static (non votable)
Nummer tre bör jag kunna lägga till i includes/page_header.php?
Nummer 4 i overall_header.tpl?
Till output vill jag använda
Kod: Markera allt
<?php echo rating_bar('8xxa','5'); ?>
Två frågor:
1) jag bör väl kunna använda ett dynamiskt ID, dvs inläggets p-värde?
Alltså ur detta {postrow.U_MINI_POST}
Kod: Markera allt
<?php echo rating_bar('{p-värdet}','5'); ?>