Bonjour Devlop78,
Merci de me répondre!!! effectivement j'aurai sans l'ensemble c'est bien moins évident ...
Déjà, le kit complet de notation se trouve sur cette page.
Voici l'HTML index.php:
Code : Tout sélectionner
<?php require('_drawrating.php'); ?>
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr_FR" lang="fr_FR">
<head>
<title>Session 3D - 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>
...//code html des différents éléments
<div id="conteneur2">
<?php echo rating_bar('8','5'); ?>// voici LE test de notation par étoiles
</div>
<div id="conteneur3">
</div>
</body>
</html>
Voici mnt la page _config-rating.php (afin de se connecter sur ma database sachant aussi que PDO est activé sur MAMP ):
Code : Tout sélectionner
<?php
/*
Page: _config-rating.php
Created: Aug 2006
Last Mod: Mar 18 2007
Holds info for connecting to the db, and some other vars
---------------------------------------------------------
ryan masuga, masugadesign.com
[email protected]
Licensed under a Creative Commons Attribution 3.0 License.
http://creativecommons.org/licenses/by/3.0/
See readme.txt for full credit details.
--------------------------------------------------------- */
//Connect to your rating database
$rating_dbhost = 'localhost';
$rating_dbuser = 'root';
$rating_dbpass = 'root';
$rating_dbname = 'session3d';
$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!)
$rating_unitwidth = 30; // the width (in pixels) of each rating unit (star, etc.)
// if you changed your graphic to be 50 pixels wide, you should change the value above
$rating_conn = mysql_connect($rating_dbhost, $rating_dbuser, $rating_dbpass) or die ('Error connecting to mysql');
//mysql_select_db($rating_dbname);
?>
Puis ma configuration sur phpMyadmin:
-- phpMyAdmin SQL Dump
-- version 3.3.9.2
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Mar 06 Décembre 2011 à 11:24
-- Version du serveur: 5.5.9
-- Version de PHP: 5.3.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Base de données: `session3d`
--
-- --------------------------------------------------------
--
-- Structure de la table `ratings`
--
CREATE TABLE `ratings` (
`id` varchar(255) NOT NULL,
`total_votes` int(11) NOT NULL DEFAULT '0',
`total_value` int(11) NOT NULL DEFAULT '0',
`used_ips` longtext,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Contenu de la table `ratings`
--
INSERT INTO `ratings` VALUES('8', 0, 0, '');
Je pense ne rien avoir oublié...
Par ailleurs, j'avais une autre question mais avant cela je voulais déjà savoir pourquoi cela ne fonctionne pas :'(
Merci à vous
Bonjour Devlop78,
Merci de me répondre!!! effectivement j'aurai sans l'ensemble c'est bien moins évident ...
Déjà, le kit complet de notation se trouve sur cette page.
Voici l'HTML index.php:
[code]
<?php require('_drawrating.php'); ?>
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr_FR" lang="fr_FR">
<head>
<title>Session 3D - 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>
...//code html des différents éléments
<div id="conteneur2">
<?php echo rating_bar('8','5'); ?>// voici LE test de notation par étoiles
</div>
<div id="conteneur3">
</div>
</body>
</html>
[/code]
Voici mnt la page _config-rating.php (afin de se connecter sur ma database sachant aussi que PDO est activé sur MAMP ):
[code]
<?php
/*
Page: _config-rating.php
Created: Aug 2006
Last Mod: Mar 18 2007
Holds info for connecting to the db, and some other vars
---------------------------------------------------------
ryan masuga, masugadesign.com
[email protected] Licensed under a Creative Commons Attribution 3.0 License.
http://creativecommons.org/licenses/by/3.0/
See readme.txt for full credit details.
--------------------------------------------------------- */
//Connect to your rating database
$rating_dbhost = 'localhost';
$rating_dbuser = 'root';
$rating_dbpass = 'root';
$rating_dbname = 'session3d';
$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!)
$rating_unitwidth = 30; // the width (in pixels) of each rating unit (star, etc.)
// if you changed your graphic to be 50 pixels wide, you should change the value above
$rating_conn = mysql_connect($rating_dbhost, $rating_dbuser, $rating_dbpass) or die ('Error connecting to mysql');
//mysql_select_db($rating_dbname);
?>
[/code]
Puis ma configuration sur phpMyadmin:
[sql]
-- phpMyAdmin SQL Dump
-- version 3.3.9.2
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Mar 06 Décembre 2011 à 11:24
-- Version du serveur: 5.5.9
-- Version de PHP: 5.3.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Base de données: `session3d`
--
-- --------------------------------------------------------
--
-- Structure de la table `ratings`
--
CREATE TABLE `ratings` (
`id` varchar(255) NOT NULL,
`total_votes` int(11) NOT NULL DEFAULT '0',
`total_value` int(11) NOT NULL DEFAULT '0',
`used_ips` longtext,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Contenu de la table `ratings`
--
INSERT INTO `ratings` VALUES('8', 0, 0, '');
[/sql]
Je pense ne rien avoir oublié...
Par ailleurs, j'avais une autre question mais avant cela je voulais déjà savoir pourquoi cela ne fonctionne pas :'(
Merci à vous