diff --git a/.gitignore b/.gitignore index ac4896f..ec542fe 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ variables.php admin/.htaccess admin/.htpasswd admin/logs_studs.txt +framanav + diff --git a/CHANGELOG b/CHANGELOG index e5d9916..a999e2e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,20 @@ Les dernières améliorations d'OpenSondage + Changelog des 22 et 23 juin (pyg@framasoft.net) + - très nombreuses modifications CSS + - ajout de buttons.css pour des boutons plus propres + - ajout de print.css pour une impression sans la classe "corps" + - refonte de la page d'accueil + - ajout de la framanav + - qq retouches dans les fichiers .po + - date de destruction passée de 2j à 30j + - ajout de l'adresse à transmettre + - ajout d'un bouton imprimer + - généralisation des stripslashes + - fix d'un bug sur une requete (suppression). Reste la seconde partie : https://github.com/leblanc-simon/OpenSondage/issues/8 + - modification du titre en image + - ajout de htmlspecialchars_decode avec param ENT_QUOTES pour l'envoi des emails + Changelog du 21 juin 2011 (pyg@framasoft.net) - très nombreuses modifications CSS - modification adminstuds.php : ajout de classes aux formulaires et ajout de stripslashes à l'affichage (TODO: à généraliser) diff --git a/admin/index.php b/admin/index.php index dc4a77e..2fc0d12 100644 --- a/admin/index.php +++ b/admin/index.php @@ -38,6 +38,7 @@ //========================================================================== + session_start(); include_once('../variables.php'); @@ -59,10 +60,12 @@ echo ''."\n"; echo ''."\n"; //Affichage des bandeaux et début du formulaire +framanav(); logo(); bandeau_tete(); bandeau_titre(_("Polls administrator")); sous_bandeau_admin(); +//print_r($_SESSION); $sondage=$connect->Execute("select * from sondage"); @@ -114,7 +117,7 @@ while($dsondage = $sondage->FetchNextObject(false)) { $user_studs=$connect->Execute( "select * from user_studs where id_sondage='$dsondage->id_sondage'"); $nbuser=$user_studs->RecordCount(); - echo ''.$dsondage->id_sondage.''.$dsondage->format.''.$dsondage->titre.''.$dsondage->nom_admin.''; + echo ''.$dsondage->id_sondage.''.$dsondage->format.''. stripslashes($dsondage->titre).''.stripslashes($dsondage->nom_admin).''; if (strtotime($dsondage->date_fin) > time()) { echo ''.date("d/m/y",strtotime($dsondage->date_fin)).''; @@ -124,7 +127,7 @@ while($dsondage = $sondage->FetchNextObject(false)) { echo''.$nbuser.''."\n"; echo ''. _("See the poll") .''."\n"; - echo ''. _("Change the poll") .''."\n"; + echo ''. _("Change the poll") .''."\n"; echo ''."\n"; echo ''."\n"; @@ -135,6 +138,7 @@ echo ''."\n"; echo''."\n"; // fin du formulaire et de la page web echo ''."\n"; +echo '
 
'; echo ''."\n"; echo ''."\n"; diff --git a/adminstuds.php b/adminstuds.php index 683ccb6..99833cf 100644 --- a/adminstuds.php +++ b/adminstuds.php @@ -78,10 +78,12 @@ if (preg_match(";[\w\d]{24};i", $numsondageadmin)) { if (!$sondage || $sondage->RecordCount() != 1){ print_header(false); echo ''."\n"; - + framanav(); logo(); bandeau_tete(); bandeau_titre(_("Error!")); + + echo '
'."\n"; print "

" . _("This poll doesn't exist !") . "



"."\n"; print "" . _("Back to the homepage of ") . " ".NOMAPPLICATION.". "."\n"; @@ -183,12 +185,17 @@ $dsondage=$sondage->FetchObject(false); if (isset($_POST["ajoutsujet"]) || isset($_POST["ajoutsujet_x"])) { print_header(true); echo ''."\n"; + framanav(); logo(); bandeau_tete(); bandeau_titre(_("Make your polls")); sous_bandeau(); //on recupere les données et les sujets du sondage + + echo '
'."\n"; + + echo '
'."\n"; echo '
'."\n"; @@ -258,6 +265,10 @@ if (isset($_POST["ajoutsujet"]) || isset($_POST["ajoutsujet_x"])) { echo '



'."\n"; echo '
'."\n"; + echo '
'."\n"; + echo '
 
'; + + bandeau_pied(); echo''."\n"; @@ -291,10 +302,11 @@ if (isset($_POST["confirmesuppression"]) || isset($_POST["confirmesuppression_x" //affichage de l'ecran de confirmation de suppression de sondage print_header(); echo ''."\n"; + framanav(); logo(); bandeau_tete(); bandeau_titre(_("Make your polls")); - + echo '
'."\n"; print "

" . _("Your poll has been removed!") . "



"; print _("Back to the homepage of ") . " ".NOMAPPLICATION."."."\n"; @@ -342,10 +354,14 @@ if(isset($_POST['ajoutcomment']) || isset($_POST['ajoutcomment_x'])) { // DEBUT DE L'AFFICHAGE DE LA PAGE HTML print_header(true); echo ''."\n"; +framanav(); logo(); bandeau_tete(); bandeau_titre(_("Make your polls")); sous_bandeau(); + +echo '
'."\n"; + echo '
'."\n"; @@ -354,14 +370,14 @@ $titre=str_replace("\\","",$dsondage->titre); echo '

'.$titre.'

'."\n"; //affichage du nom de l'auteur du sondage -echo _("Initiator of the poll") .' : '.$dsondage->nom_admin.'
'."\n"; +echo _("Initiator of the poll") .' : '.stripslashes($dsondage->nom_admin).'
'."\n"; //affichage des commentaires du sondage if ($dsondage->commentaires){ echo '
'. _("Comments") .' :
'."\n"; $commentaires=$dsondage->commentaires; $commentaires=str_replace("\\","",$commentaires); - echo nl2br($commentaires); + echo stripslashes(nl2br($commentaires)); echo '
'."\n"; } echo '
'."\n"; @@ -698,6 +714,7 @@ if ($sondage !== false) { } else { print_header(false); echo ''."\n"; + framanav(); logo(); bandeau_tete(); bandeau_titre(_("Error!")); @@ -706,6 +723,8 @@ if ($sondage !== false) { print "" . _("Back to the homepage of ") . " ".NOMAPPLICATION.". "."\n"; echo '



'."\n"; echo '
'."\n"; + + bandeau_pied(); echo''."\n"; echo ''."\n"; @@ -871,7 +890,7 @@ if ($dsondage->format=="D"||$dsondage->format=="D+") { echo ''."\n"; for ($i = 0; isset($toutsujet[$i]); $i++) { - echo ''.$toutsujet[$i].''."\n"; + echo ''.stripslashes($toutsujet[$i]).''."\n"; } echo ''."\n"; @@ -891,7 +910,7 @@ while ($data = $user_studs->FetchNextObject(false)) { //affichage du nom $nombase=str_replace("°","'",$data->nom); - echo ''.$nombase.''."\n"; + echo ''.stripslashes($nombase).''."\n"; //si la ligne n'est pas a changer, on affiche les données if (!$testligneamodifier) { @@ -1152,7 +1171,7 @@ if ($comment_user->RecordCount() != 0) { $i = 0; while ( $dcomment=$comment_user->FetchNextObject(false)) { - print " $dcomment->usercomment : $dcomment->comment
"; + print " ". stripslashes($dcomment->usercomment) ." : ".stripslashes($dcomment->comment) ."
"; $i++; } @@ -1201,6 +1220,8 @@ echo '

'."\n"; //fin de la partie GESTION et beandeau de pied echo '

'."\n"; +echo '
'; +echo '
 
'; bandeau_pied_mobile(); echo ''."\n"; echo ''."\n"; diff --git a/bandeaux.php b/bandeaux.php index f759a84..ca4e19f 100644 --- a/bandeaux.php +++ b/bandeaux.php @@ -40,6 +40,17 @@ // pour get_server_name() include_once('fonctions.php'); +function framanav() +{ + if (file_exists($_SERVER['DOCUMENT_ROOT']."/framanav/nav.inc.html")) { + echo "\n".' '."\n";; + echo ''."\n"; + include_once($_SERVER['DOCUMENT_ROOT']."/framanav/nav.inc.html"); + echo ' '."\n"; + } +} + + //le logo function logo () { @@ -52,7 +63,7 @@ function logo () #le bandeau principal function bandeau_tete() { - echo ''."\n"; + echo '
'.NOMAPPLICATION.'
'."\n"; } @@ -95,13 +106,13 @@ function sous_bandeau() function sous_bandeau_admin() { echo '
' . - ''. _("Home") .''; + ''. _("Home") .''; if(is_readable('logs_studs.txt')) { - echo ''. _("Logs") .''; + echo ''. _("Logs") .''; } - echo ''. _("Cleaning") .'' . + echo ''. _("Cleaning") .'' . '' . liste_lang() . ''. '
'."\n"; diff --git a/choix_autre.php b/choix_autre.php index 9a787d0..93a8e85 100644 --- a/choix_autre.php +++ b/choix_autre.php @@ -56,6 +56,7 @@ if (issetAndNoEmpty('titre', $_SESSION) === false || issetAndNoEmpty('nom', $_SE echo ''."\n"; echo ''."\n"; echo ''."\n"; + framanav(); logo(); bandeau_tete(); bandeau_titre(_("Error!")); @@ -137,6 +138,7 @@ if (issetAndNoEmpty('titre', $_SESSION) === false || issetAndNoEmpty('nom', $_SE print_header(); echo ''."\n"; + framanav(); echo '
'."\n"; logo(); diff --git a/choix_date.php b/choix_date.php index 307fa2d..b58e4ca 100644 --- a/choix_date.php +++ b/choix_date.php @@ -57,6 +57,7 @@ if (!issetAndNoEmpty('nom', $_SESSION) && !issetAndNoEmpty('adresse', $_SESSION) echo ''."\n"; echo ''."\n"; echo ''."\n"; + framanav(); logo(); bandeau_tete(); bandeau_titre(_("Error!")); diff --git a/contacts.php b/contacts.php index e163b34..a7b1842 100644 --- a/contacts.php +++ b/contacts.php @@ -97,6 +97,8 @@ if ((isset($_POST['envoiquestion']) || isset($_POST['envoiquestion_x'])) && isse echo ''."\n"; echo ''."\n"; echo ''."\n"; + +framanav(); //debut du formulaire echo ''."\n"; diff --git a/creation_sondage.php b/creation_sondage.php index 8e0c863..2ab07e8 100644 --- a/creation_sondage.php +++ b/creation_sondage.php @@ -108,7 +108,7 @@ function ajouter_sondage() $message = _("This is the message you have to send to the people you want to poll. \nNow, you have to send this message to everyone you want to poll."); $message .= "\n\n"; - $message .= stripslashes($_SESSION["nom"])." " . _("hast just created a poll called") . " : \"".stripslashes($_SESSION["titre"])."\".\n"; + $message .= stripslashes(htmlspecialchars_decode($_SESSION["nom"],ENT_QUOTES))." " . _("hast just created a poll called") . " : \"".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES))."\".\n"; $message .= _("Thanks for filling the poll at the link above") . " :\n\n%s\n\n" . _("Thanks for your confidence") . ",\n".NOMAPPLICATION; $message_admin = _("This message should NOT be sended to the polled people. It is private for the poll's creator.\n\nYou can now modify it at the link above"); @@ -118,8 +118,8 @@ function ajouter_sondage() $message_admin = sprintf($message_admin, getUrlSondage($sondage_admin, true)); if (validateEmail($_SESSION['adresse'])) { - mail ("$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("For sending to the polled users") . "] " . _("Poll") . " : ".stripslashes($_SESSION["titre"]), $message_admin, $headers); - mail ("$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("Author's message") . "] " . _("Poll") . " : ".stripslashes($_SESSION["titre"]), $message, $headers); + mail ("$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("For sending to the polled users") . "] " . _("Poll") . " : ".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES)), $message_admin, $headers); + mail ("$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("Author's message") . "] " . _("Poll") . " : ".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES)), $message, $headers); } $date=date('H:i:s d/m/Y:'); diff --git a/favicon.ico b/favicon.ico index 551344a..ded9585 100644 Binary files a/favicon.ico and b/favicon.ico differ diff --git a/images/logo-framadate.png b/images/logo-framadate.png new file mode 100644 index 0000000..bc5af6f Binary files /dev/null and b/images/logo-framadate.png differ diff --git a/images/logo-framadate.xcf b/images/logo-framadate.xcf new file mode 100644 index 0000000..871886e Binary files /dev/null and b/images/logo-framadate.xcf differ diff --git a/index.php b/index.php index cb986cb..adb6a6e 100644 --- a/index.php +++ b/index.php @@ -56,6 +56,8 @@ echo ''."\n"; echo ''."\n"; echo ''."\n"; +framanav(); + //debut du formulaire echo ''."\n"; diff --git a/infos_sondage.php b/infos_sondage.php index ba506d5..9c56dea 100644 --- a/infos_sondage.php +++ b/infos_sondage.php @@ -147,6 +147,8 @@ if (issetAndNoEmpty("poursuivre")){ //affichage de la page print_header(true); echo ''."\n"; +framanav(); + //affichage des bandeaux de tete logo(); bandeau_tete(); diff --git a/scripts/nettoyage_sondage.php b/scripts/nettoyage_sondage.php index 280ac7f..b905c5f 100644 --- a/scripts/nettoyage_sondage.php +++ b/scripts/nettoyage_sondage.php @@ -49,10 +49,13 @@ $sondage=$connect->Execute("select * from sondage"); while ($dsondage=$sondage->FetchNextObject(false)) { if ($date_courante > strtotime($dsondage->date_fin)) { //destruction des données dans la base - $connect->Execute('DELETE FROM sondage LEFT INNER JOIN sujet_studs ON sujet_studs.id_sondage = sondage.id_sondage '. + + $req = 'DELETE FROM sondage LEFT INNER JOIN sujet_studs ON sujet_studs.id_sondage = sondage.id_sondage '. 'LEFT INNER JOIN user_studs ON user_studs.id_sondage = sondage.id_sondage ' . 'LEFT INNER JOIN comments ON comments.id_sondage = sondage.id_sondage ' . - "WHERE id_sondage = '$dsondage->id_sondage' "); + "WHERE id_sondage = '$dsondage->id_sondage'; "; + echo $req; + $connect->Execute($req); // ecriture des traces dans le fichier de logs error_log($date . " SUPPRESSION: $dsondage->id_sondage\t$dsondage->format\t$dsondage->nom_admin\t$dsondage->mail_admin\n", '../admin/logs_studs.txt'); } diff --git a/studs.php b/studs.php index 27a80fb..a62e3d5 100644 --- a/studs.php +++ b/studs.php @@ -173,8 +173,8 @@ if (!is_error(NO_POLL) && (isset($_POST["boutonp"]) || isset($_POST["boutonp_x"] if ($dsondage->mailsonde || /* compatibility for non boolean DB */ $dsondage->mailsonde=="yes" || $dsondage->mailsonde=="true") { $headers="From: ".NOMAPPLICATION." <".ADRESSEMAILADMIN.">\r\nContent-Type: text/plain; charset=\"UTF-8\"\nContent-Transfer-Encoding: 8bit"; mail ("$dsondage->mail_admin", - "[".NOMAPPLICATION."] "._("Poll's participation")." : $dsondage->titre", - "\"$nom\" ". + "[".NOMAPPLICATION."] "._("Poll's participation")." : ".htmlspecialchars_decode($dsondage->titre, ENT_QUOTES).",". + htmlspecialchars_decode("\"$nom\" ",ENT_QUOTES). _("has filled a line.\nYou can find your poll at the link") . " :\n\n". getUrlSondage($numsondage)." \n\n" . _("Thanks for your confidence.") . "\n". NOMAPPLICATION, @@ -188,6 +188,7 @@ if (!is_error(NO_POLL) && (isset($_POST["boutonp"]) || isset($_POST["boutonp_x"] print_header(true, $dsondage->titre); echo ''."\n"; +framanav(); logo(); bandeau_tete(); bandeau_titre(_("Make your polls")); diff --git a/style.css b/style.css index b5e1b3f..77f07b4 100644 --- a/style.css +++ b/style.css @@ -82,11 +82,12 @@ div.bandeau{ font-size:42px; font-family:arial; padding:8px; - height:50px; + height:40px; position:static; top:6px; left:6px; right:6px; + padding-top:35px; } @@ -102,6 +103,7 @@ div.logo{ margin-left: 0; margin-right:0; margin-bottom:auto; + padding-top: 30px; } /*Sous bandeau avec bouton de navigation*/ div.bandeautitre{ @@ -201,7 +203,7 @@ div.bandeaupiedmobile{ */ span.sousbandeaulangue { margin-left:6px; - margin-right:20px; + margin-right:90px; float:right; } @@ -231,8 +233,7 @@ span.sousbandeaulangue { div.corps table{ - font-size:12px; - font-weight:bold; + font-size:12px; } div.corpscentre{ font-size:12px; @@ -556,7 +557,9 @@ li.error { .index_date .opacity, .index_sondage .opacity { opacity: 0.6; } - +.button img { + vertical-align: middle; +} .index_date img:hover, .index_sondage img:hover { opacity: 1; cursor: pointer;