Installation av AJAX ratingstar

Frågor kring MODdar (modifikationer) för phpBB 2.0.x.

Moderatorer: Moderatorgrupp, Supportgrupp

Användarens profilbild
Holger
Support - Ledare
Support - Ledare
Inlägg: 6554
Blev medlem: 2004-06-09 08:32
Svar: 1
Ort: Hannover/Tyskland
Kontakt:

Installation av AJAX ratingstar

Inlägg av Holger »

Inte direkt en modd, men jag läggar in det här eftersom jag vill ha in det i viewtopic

Installationsanvisningarna:
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)
Okej, nummer 1-4 är jag på det klara med tror jag.
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'); ?>
Dvs 5 stjärnor och ID.

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'); ?>
2) hur får jag in ekot i viewtopic_body.tpl?
Holger Gremminger
Ingen support via PM!
Användarens profilbild
Holger
Support - Ledare
Support - Ledare
Inlägg: 6554
Blev medlem: 2004-06-09 08:32
Svar: 1
Ort: Hannover/Tyskland
Kontakt:

Re: Installation av AJAX ratingstar

Inlägg av Holger »

Nobody? :(
Holger Gremminger
Ingen support via PM!
Skriv svar

Vilka är online

Användare som besöker denna kategori: 1 och 0 gäst