Problème notation étoiles sur mon site

Fermé
Deyan - Modifié par Deyan le 25/11/2011 à 00:08
 Deyan - 25 nov. 2011 à 00:11
Bonjour,

Je tiens à préciser que je suis novice.

Aujourd'hui, j'essaye de créer mon site perso mais je suis confronté à quelques petits soucis techniques :/

Je souhaiterais mettre des photos sur une page et que les visiteurs puissent voter avec un système étoilé. Pour cela j'ai trouvé un "kit" déjà tout réalisé et qui me paraissait très sympathique : http://masugadesign.com/software/unobt [...] r-rating-bar/
Ensuite j'ai suivi un mini tuto sur ce site là: http://astuces-webmaster.ch/tutos/ajax [...] ax-rating.php

Le 1er problème est que le script apparait bien sur ma page mais pas les étoiles.. Je peux cliquer au dessus de "1. Rating: 4.0/5 (0 votes cast) Thanks for voting!" mais aucune étoile apparait lors que les chemins des fichiers sources m'ont l'air bon

2ème problème, j'ai crée ma base de donnée, j'ai modifié le fichier _config-rating.php mais lorsque je vote, ce dernier ne s'enregistre pas dans ma table
J'ai récemment activé PDO, penseriez vous que le problème pourrait provenir de çà?

3, ce n'est pas un problème mais plutôt une question: Je comptais créer une table, par exemple "paysages" et ensuite y intégrer un système de notation pour chaque photo. Dois je créer une jointure entre la table "paysages" et la table "ratings" ou pas forcément? que me conseilleriez vous? Si ensuite je souhaite créer d'autre tables "animaux" "art"... dois je créer à nouveau une table ratings?

Excusez mon ignorance, je débute mais ça me passionne donc je veux vraiment pouvoir y arriver.

Voici le code HTML de la page index.php ou je souhaite mettre le système de notation avec étoile:
<?php require('_drawrating.php'); ?>
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr_FR" lang="fr_FR">
<head>
   <title>Accueil</title>
            <script type="text/javascript" src="style/js/jquery-1.6.2.min.js"></script>
            <script type="text/javascript" src="slider/jquery.nivo.slider.pack.js"></script>
            <script type="text/javascript" src="js/behavior.js"></script>
            <script type="text/javascript" src="js/rating.js"></script>
            <link rel="stylesheet" href="slider/nivo.css" type="text/css" media="screen" />
            <link rel="stylesheet" href="slider/style.css" type="text/css" media="screen" />
            <link rel="stylesheet" href="slider/default.css" type="text/css" media="screen" />
            <link rel="stylesheet" href="base.css"  type="text/css" />
<!-- Required CSS -->
</head>
<script type="text/javascript"> 
$(document).ready(function(){

	$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav
	
	$("ul.topnav li span").click(function() { //When trigger is clicked...
		
		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() { 
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});

});
$(window).load(function() {
        $('#slider').nivoSlider();
});
</script>
<body>
<div id="container">
    <div id="logo">
        <ul class="topnav">
            <li><a href="#"><strong>Accueil</strong></a></li>
            <li>
                ...// mon code HTML
</div>
   <div id="conteneur2">
   <?php echo rating_bar('1','5'); ?> // C'est ici que je compte tester si mon Star Rating system fonctionne
   </div>
   <div id="conteneur3">
   </div>
  


</body>
</html>
A voir également:

1 réponse

Mon code CSS pour le Star Rating system:

.ratingblock {
display:block;
border-bottom:1px solid #999;
padding-bottom:8px;
margin-bottom:8px;
}

.loading {
height: 30px;
background: url('../images/working.gif') 50% 50% no-repeat;
}

.unit-rating { /* the UL */
list-style:none;
margin: 0px;
padding:0px;
height: 30px;
position: relative;
background: url('../images/starrating.gif') top left repeat-x;
}

.unit-rating li{
text-indent: -90000px;
padding:0px;
margin:0px;
/*\*/
float: left;
/* */
}

.unit-rating li a {
outline: none;
display:block;
width:30px;
height: 30px;
text-decoration: none;
text-indent: -9000px;
z-index: 20;
position: absolute;
padding: 0px;
}

.unit-rating li a:hover{
background: url('../images/starrating.gif') left center;
z-index: 2;
left: 0px;
}

.unit-rating a.r1-unit{left: 0px;}
.unit-rating a.r1-unit:hover{width:30px;}
.unit-rating a.r2-unit{left:30px;}
.unit-rating a.r2-unit:hover{width: 60px;}
.unit-rating a.r3-unit{left: 60px;}
.unit-rating a.r3-unit:hover{width: 90px;}
.unit-rating a.r4-unit{left: 90px;}
.unit-rating a.r4-unit:hover{width: 120px;}
.unit-rating a.r5-unit{left: 120px;}
.unit-rating a.r5-unit:hover{width: 150px;}
.unit-rating a.r6-unit{left: 150px;}
.unit-rating a.r6-unit:hover{width: 180px;}
.unit-rating a.r7-unit{left: 180px;}
.unit-rating a.r7-unit:hover{width: 210px;}
.unit-rating a.r8-unit{left: 210px;}
.unit-rating a.r8-unit:hover{width: 240px;}
.unit-rating a.r9-unit{left: 240px;}
.unit-rating a.r9-unit:hover{width: 270px;}
.unit-rating a.r10-unit{left: 270px;}
.unit-rating a.r10-unit:hover{width: 300px;}

.unit-rating li.current-rating {
background: url('../images/starrating.gif') left bottom;
position: absolute;
height: 30px;
display: block;
text-indent: -9000px;
z-index: 1;
}

.voted {color:#999;}
.thanks {color:#36AA3D;}
.static {color:#5D3126;}

Mon fichier _config-rating.php

<?php
/*
Page: _config-rating.php


//Connect to your rating database
$rating_dbhost = 'localhost';
$rating_dbuser = 'root';
$rating_dbpass = 'root';
$rating_dbname = 'picturimini';
$rating_tableName = 'ratings';
$rating_path_db = ''; // the path to your db.php file (not used yet!)
$rating_path_rpc = ''; // the path to your rpc.php file (not used yet!)

?>


J'espère ne pas avoir été trop brouillon... Pour info je suis sur mac, je bosse avec Coda et MAMP et PDO est activé sur MAMP.
Je compte sur votre aide!!!!!! Merciiiiii
0