Annonce

Faites la différence entre le service WordPress.com et l'application libre WordPress.

Mettez-vous à jour ! WordPress 3.3.2 est disponible en français.

Annonce 1 : Le Codex en français a besoin de vous pour avancer !
Annonce 2 : Avant de poster, n'oubliez pas de faire une petite recherche et de lire les règles de ce forum.
Annonce 3 : Lisez notre blog, il regorge de bonnes informations.
Annonce 4 : Rejoignez-nous sur Facebook, Google + et sur Twitter

#1 05-02-2012 18:18:06

gwenm
Passionné WP
Lieu: Aiffres
Date d'inscription: 27-04-2009
Messages: 779
Site web

Installation de kk Star Ratings

Bonjour, j' aimerais installer kk Star Ratings, mais je ne comprend pas la chose suivante, la traduction est pas très compréhensible et je ne sais pas vraiment ou placer les scripts:

Get top rated posts as array of objects:
<?php if(function_exists('kk_star_ratings_get')) : $top_rated_posts = kk_star_ratings_get($total,$cat_id); endif; ?>
Where $total is the limit (int) and $cat_id is the id of the category which is optional
$top_rated_posts will contain an array of objects, each containing an ID, title and ratings.
Example Usage:

                     foreach($top_rated_posts as $post)
                     {
                         // You get $post->ID, $post->ratings and $post->post_title
                         // Do anything with it like get_post($post->ID)
                         // ...
                         // The following will display the Post ID, Title and Ratings for each.
                         echo "Post ID: ".$post->ID." | Title: ".$post->post_title." | Ratings: ".$post->ratings.'<br />';
                     }


Tant qu'un humain n'a pas aimé un animal, une partie de son âme reste endormie.
Avec ACTU Animaux et Clicanimaux sauvez des animaux en quelques clics !

En faire plus :
Devenez concerné:Usine à chiots, Lutter contre la Vivisection.

Hors ligne

 

#2 19-05-2012 12:35:05

gwenm
Passionné WP
Lieu: Aiffres
Date d'inscription: 27-04-2009
Messages: 779
Site web

Re: Installation de kk Star Ratings

Salut, j'ai finalement utilisé les options, et ca affiche tout simplement. Par contre j' aimerais une aide concernant la traduction de :

Code: html

Get top rated posts as array of objects:
<?php if(function_exists('kk_star_ratings_get')) : $top_rated_posts = kk_star_ratings_get($total); endif; ?>
Where $total is the limit (int)
$top_rated_posts will contain an array of objects, each containing an ID and ratings.
Example Usage:

                     foreach($top_rated_posts as $post)
                     {
                         // you get $post->ID and $post->ratings
                         // Do anything with it like get_post($post->ID)
                         // ...
                     }

Traduction:

Code: html

Obtenez meilleurs messages noté que tableau d'objets:
<? php if (function_exists ('kk_star_ratings_get')): $ = top_rated_posts kk_star_ratings_get ($ total); endif;>
Où $ au total est la limite (int)
$ de top_rated_posts contiendra un tableau d'objets contenant chacun une pièce d'identité et les cotes.
Exemple d'utilisation:

Est ce que ca veut dire qu' on peut attribuer une note principale à tous les articles, ou pas du tout?


Tant qu'un humain n'a pas aimé un animal, une partie de son âme reste endormie.
Avec ACTU Animaux et Clicanimaux sauvez des animaux en quelques clics !

En faire plus :
Devenez concerné:Usine à chiots, Lutter contre la Vivisection.

Hors ligne

 

Pied de page des forums

Propulsé par PunBB 1.2.23
© Copyright 2005-2006 WordPress France

[ Generated in 4.491 seconds, 9 queries executed ]