Remove need for a DB

This commit is contained in:
Aurelien Labate 2019-12-27 04:46:25 +01:00
parent 0125dc9008
commit b4610e97e4
49 changed files with 149 additions and 6785 deletions

View File

@ -1,41 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Compte à rebours :)</title>
<script src="jquery.js"></script>
</head>
<body style="background-color: violet;">
<div style="color: pink; font-size: 50px;"></div>
<SCRIPT LANGUAGE="JavaScript">
setInterval(function() {
Maintenant = new Date;
TempMaintenant = Maintenant.getTime();
Future = new Date(2013, 6, 10);
TempFuture = Future.getTime();
DiffSec = Math.floor((TempFuture-TempMaintenant)/1000);
DiffMin = Math.floor(DiffSec/60);
Diffheure = Math.floor(DiffMin/60);
DiffJour = Math.floor(Diffheure/24);
while (DiffMin>=60)
{
DiffMin = DiffMin-60;
}
while (Diffheure>=24)
{
Diffheure = Diffheure-24;
}
while (DiffSec>=60)
{
DiffSec = DiffSec-60;
}
$('div').replaceWith('<div style="color: pink; font-size: 50px;">Lyon : ' + DiffJour + ' jour(s), ' + Diffheure + ' heure(s), ' + DiffMin + ' minute(s) et ' + DiffSec + ' seconde(s)</div>');
}, 10);
</SCRIPT>
</body>
</html>

View File

@ -1,3 +1,6 @@
<?php
require_once('config.php');
?>
<!DOCTYPE html>
<html id="top">
<head>
@ -21,6 +24,7 @@
<br /><br /><br /><h2>Evènements :</h2>
<div class="paragraphes">
<ul>
<li>27/12/19 : Suppression des fonctionnalités non utilisé pour alléger le cout de maintenance.</li>
<li>20/04/13 : Mise en ligne du site.</li>
<li>9/05/13 : Correction des problèmes de position du curseur dans l'onglet principal.</li>
<li>20/05/13 : Ajout de la coloration syntaxique pour le debuggage.</li>
@ -29,7 +33,6 @@
</div>
</article>
</div>
<?php include "pub.php" ?>
</div>
</body>
<?php include("bas_de_page.php"); ?>

View File

@ -1,9 +1,14 @@
<?php
require_once('config.php');
?>
<!DOCTYPE html>
<html id="top">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<link rel="stylesheet" type="text/css" href="aide.css" />
<script src="compil1.js"></script>
<script src="compil2.js"></script>
<script src="execution.js"></script>
<script src="jquery.js"></script>
<script src="menus.js"></script>
@ -38,7 +43,7 @@
<div class="exemples_code">
<div class="code_algo"><b>Saisir A</b></div><span class="type_algo"><strong>Algorithme</strong></span><div class="code_casio"><b>? &rarr; A</b></div><span class="type_casio"><strong>Casio</strong></span><div class="code_ti"><b>Input A</b></div><span class="type_ti"><strong>TI</strong></span>
<div class="resultats_code"><p class="resultats_title">Exécution :</p><div class="resultats_content">
<input onkeypress='if(event.keyCode == 13) lire("a", 1, 0, 1);' autofocus size='7' maxlength='10' id='lire' placeholder='A =' required rows='1' cols='5'>
<input onkeypress='if(event.keyCode == 13) lire("a", 1, 0, 1);' autofocus size='7' maxlength='10' id='lire1' placeholder='A =' required rows='1' cols='5'>
</div>
</div>
</div>

View File

@ -1,52 +0,0 @@
<?php
include('config.php');
include_once 'mail.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - Publier un algorithme</title>
</head>
<body>
<div id="content">
<?php include("menu.php");?>
<div id="contenu">
<?php
$prog = str_replace('@', ';', $_COOKIE["algo"]);
$prog = str_replace('¤', '+', $prog);
if(isset($_POST['titre'], $_POST['auteur'], $_POST['mail'], $_POST['description']) && $_POST['titre'] != "" && $_POST['auteur'] != "" && $_POST['mail'] != "" && $_POST['description'] != "")
{
$titre = str_replace('\\', '', $_POST['titre']);
$auteur = str_replace('\\', '', $_POST['auteur']);
$mail = str_replace('\\', '', $_POST['mail']);
$description = str_replace('\\', '', $_POST['description']);
$prog = str_replace('\\', '', $prog);
mysql_query("INSERT INTO exemples_en_attente(titre, auteur, mail, description, programme) VALUES('".$titre."', '".$auteur."', '".$mail."', '".$description."', '".$prog."')");
$id = mysql_insert_id();
$message = "<b>".$titre."</b><br /><br /><i>".$auteur."<br />".$mail."</i><br /><br />".$description."<br /><br />".$prog."<br /><br /><center><a href='".$base_url."/publier_admin.php?id=".$id."'>>>> Publier <<<</a></center>";
send_mail("bruno-godefroy@sfr.fr", 'Nouvel exemple : '.$titre, $message);
echo "<div class='message'>Votre algorithme a été soumis. Vous recevrez une réponse par mail prochainement.<br /><br />Merci de votre participation.</div>";
}
else
{
if($_POST['code'] == '')
echo "<div class='message'>Votre algorithme comporte des erreurs.<br />Corrigez les avant de le publier.</div>";
else
echo "<div class='message'>Une erreur s'est produite lors de la soumission de l'algorithme.</div>";
}
?>
</div>
</div>
<?php include("bas_de_page.php"); ?>
</body>
</html>

View File

@ -1,86 +0,0 @@
<?php
include('config.php');
include_once 'mail.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<script src="jquery.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - Publier un algorithme</title>
</head>
<body>
<div id="content">
<?php include("menu.php");?>
<div id="contenu">
<?php
if(isset($_POST['titre'], $_POST['auteur'], $_POST['mail'], $_POST['description'], $_POST['code']) && $_POST['titre'] != "" && $_POST['auteur'] != "" && $_POST['mail'] != "" && $_POST['description'] != "" && $_POST['code'] != "" && $_POST['mdp'] == "studio3607")
{
if(mysql_query("INSERT INTO exemples(titre, auteur, mail, description, programme) VALUES('".$_POST['titre']."', '".$_POST['auteur']."', '".$_POST['mail']."', '".$_POST['description']."', '".$_POST['code']."')"))
{
echo "<div class='message'>Algorithme soumis avec succès !</div>";
$message = "
Vous avez posté récemment l'algorithme \"".$_POST['titre']."\" sur <a href='" . $base_url . "'>Festiv'Algo</a>.<br />
Félicitations, celui-ci vient d'être publié dans <a href='" . $base_url . "/exemples.php'>les exemples</a>.<br /><br />
Nous avons besoin de vos contributions. N'hésitez donc pas à publier de nouveaux algorithmes.<br />
Au plaisir de vous revoir sur <a href='" . $base_url . "'>Festiv'Algo</a> !<br /><br />
<i>Il s'agit d'un mail automatique. Merci de ne pas y répondre.</i>
";
send_mail($_POST['mail'], "Publication d'un algorithme sur Festiv'Algo", $message);
mysql_query('delete from exemples_en_attente where id = "'.$_GET['id'].'"');
}
else
echo "<div class='message'>Erreur php.</div>";
}
else
{
if(isset($_GET['id'], $_GET['case']) && $_POST['mdp'] == "studio3607")
{
$req = mysql_fetch_array(mysql_query('select titre, auteur, mail, description, programme from exemples_en_attente where id = "'.$_GET['id'].'"'));
if($_GET['case'] == 1)
{
$raisons = "
<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- votre algorithme a été jugé sans intêret<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- votre algorithme contient de la publicité ou un contenu choquant<br /></b>
";
}
else
{
$raisons = "
<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- votre algorithme existe déjà dans les exemples<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- vous avez déjà soumis cet algorithme<br /></b>
";
}
$message = "
Vous avez posté récemment l'algorithme \"".$req['titre']."\" sur <a href='" . $base_url . "'>Festiv'Algo</a>. Nous vous remercions pour cette initiative.<br /><br />
Cependant, celui-ci n'a pas été publié pour l'une des raisons suivantes :<br />"
.$raisons.
"<br />Merci de prendre en compte ces remarques pour vos futures publications.<br />
Au plaisir de vous revoir sur <a href='" . $base_url . "'>Festiv'Algo</a> !<br /><br />
<i>Il s'agit d'un mail automatique. Merci de ne pas y répondre.</i>
";
send_mail($req['mail'], "Publication d'un algorithme sur Festiv'Algo", $message);
mysql_query('delete from exemples_en_attente where id = "'.$_GET['id'].'"');
echo "<div class='message'>Email envoyé !</div>";
}
else
echo "<div class='message'>Erreur.</div>";
}
?>
</div>
</div>
<?php include("bas_de_page.php"); ?>
</body>
</html>

View File

@ -8,7 +8,7 @@
<td><a class="mathematiques_magiques" href="http://therese.eveilleau.pagesperso-orange.fr" target="_blank"><img src="Images/mathematiques_magiques.png" alt="" title="Mathématiques magiques, ludiques et dynamiques pour l'école Primaire et le Secondaire" /><div class="nom_part">Maths Magiques</div></a></td>
</tr>
</table>
<p id="auteur"><mark>Festiv'Algo</mark> <!--&copy; créé par <strong>Nitrosax</strong> -->- 2013 | <a class="lien" href="contact.php">Nous contacter</a></p>
<p id="auteur"><mark>Festiv'Algo</mark> <!--&copy; créé par <strong>Nitrosax</strong> -->- 2013</p>
<p id="credits_images">Crédits images : <a class="lien" href="http://www.siteduzero.com" target=_blank>Site du Zéro</a></p>
</footer>
<script>

View File

@ -1,70 +0,0 @@
<?php
//Fonction permettant de convertir du bbcode en du html
function bbcode_to_html($text)
{
$text = nl2br(htmlentities($text, ENT_QUOTES, 'UTF-8'));
$in = array(
'#\[b\](.*)\[/b\]#Usi',
'#\[i\](.*)\[/i\]#Usi',
'#\[u\](.*)\[/u\]#Usi',
'#\[s\](.*)\[/s\]#Usi',
'#\[img\](.*)\[/img\]#Usi',
'#\[url\]((ht|f)tps?\:\/\/(.*))\[/url\]#Usi',
'#\[url=((ht|f)tps?\:\/\/(.*))\](.*)\[/url\]#Usi',
'#\[left\](.*)\[/left\]#Usi',
'#\[center\](.*)\[/center\]#Usi',
'#\[right\](.*)\[/right\]#Usi'
);
$out = array(
'<strong>$1</strong>',
'<em>$1</em>',
'<span style="text-decoration:underline;">$1</span>',
'<span style="text-decoration:line-through;">$1</span>',
'<img src="$1" alt="Image" />',
'<a href="$1">$1</a>',
'<a href="$1">$4</a>',
'<div style="text-align:left;">$1</div>',
'<div style="text-align:center;">$1</div>',
'<div style="text-align:right;">$1</div>'
);
$count = count($in)-1;
for($i=0;$i<=$count;$i++)
{
$text = preg_replace($in[$i],$out[$i],$text);
}
return $text;
}
//Fonction permettant de convertir du html en du bbcode
function html_to_bbcode($text)
{
$text = str_replace('<br />','',$text);
$in = array(
'#<strong>(.*)</strong>#Usi',
'#<em>(.*)</em>#Usi',
'#<span style="text-decoration:underline;">(.*)</span>#Usi',
'#<span style="text-decoration:line-through;">(.*)</span>#Usi',
'#<img src="(.*)" alt="Image" />#Usi',
'#<a href="(.*)">(.*)</a>#Usi',
'#<div style="text-align:left;">(.*)</div>#Usi',
'#<div style="text-align:center;">(.*)</div>#Usi',
'#<div style="text-align:right;">(.*)</div>#Usi'
);
$out = array(
'[b]$1[/b]',
'[i]$1[/i]',
'[u]$1[/u]',
'[s]$1[/s]',
'[img]$1[/img]',
'[url=$1]$2[/url]',
'[left]$1[/left]',
'[center]$1[/center]',
'[right]$1[/right]'
);
$count = count($in)-1;
for($i=0;$i<=$count;$i++)
{
$text = preg_replace($in[$i],$out[$i],$text);
}
return $text;
}
?>

View File

@ -1,407 +0,0 @@
<?php
/*~ class.pop3.php
.---------------------------------------------------------------------------.
| Software: PHPMailer - PHP email class |
| Version: 5.1 |
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
| Info: http://phpmailer.sourceforge.net |
| Support: http://sourceforge.net/projects/phpmailer/ |
| ------------------------------------------------------------------------- |
| Admin: Andy Prevost (project admininistrator) |
| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net |
| Founder: Brent R. Matzelle (original founder) |
| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. |
| Copyright (c) 2001-2003, Brent R. Matzelle |
| ------------------------------------------------------------------------- |
| License: Distributed under the Lesser General Public License (LGPL) |
| http://www.gnu.org/copyleft/lesser.html |
| This program is distributed in the hope that it will be useful - WITHOUT |
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| FITNESS FOR A PARTICULAR PURPOSE. |
| ------------------------------------------------------------------------- |
| We offer a number of paid services (www.codeworxtech.com): |
| - Web Hosting on highly optimized fast and secure servers |
| - Technology Consulting |
| - Oursourcing (highly qualified programmers and graphic designers) |
'---------------------------------------------------------------------------'
*/
/**
* PHPMailer - PHP POP Before SMTP Authentication Class
* NOTE: Designed for use with PHP version 5 and up
* @package PHPMailer
* @author Andy Prevost
* @author Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
* @version $Id: class.pop3.php 444 2009-05-05 11:22:26Z coolbru $
*/
/**
* POP Before SMTP Authentication Class
* Version 5.0.0
*
* Author: Richard Davey (rich@corephp.co.uk)
* Modifications: Andy Prevost
* License: LGPL, see PHPMailer License
*
* Specifically for PHPMailer to allow POP before SMTP authentication.
* Does not yet work with APOP - if you have an APOP account, contact Richard Davey
* and we can test changes to this script.
*
* This class is based on the structure of the SMTP class originally authored by Chris Ryan
*
* This class is rfc 1939 compliant and implements all the commands
* required for POP3 connection, authentication and disconnection.
*
* @package PHPMailer
* @author Richard Davey
*/
class POP3 {
/**
* Default POP3 port
* @var int
*/
public $POP3_PORT = 110;
/**
* Default Timeout
* @var int
*/
public $POP3_TIMEOUT = 30;
/**
* POP3 Carriage Return + Line Feed
* @var string
*/
public $CRLF = "\r\n";
/**
* Displaying Debug warnings? (0 = now, 1+ = yes)
* @var int
*/
public $do_debug = 2;
/**
* POP3 Mail Server
* @var string
*/
public $host;
/**
* POP3 Port
* @var int
*/
public $port;
/**
* POP3 Timeout Value
* @var int
*/
public $tval;
/**
* POP3 Username
* @var string
*/
public $username;
/**
* POP3 Password
* @var string
*/
public $password;
/////////////////////////////////////////////////
// PROPERTIES, PRIVATE AND PROTECTED
/////////////////////////////////////////////////
private $pop_conn;
private $connected;
private $error; // Error log array
/**
* Constructor, sets the initial values
* @access public
* @return POP3
*/
public function __construct() {
$this->pop_conn = 0;
$this->connected = false;
$this->error = null;
}
/**
* Combination of public events - connect, login, disconnect
* @access public
* @param string $host
* @param integer $port
* @param integer $tval
* @param string $username
* @param string $password
*/
public function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) {
$this->host = $host;
// If no port value is passed, retrieve it
if ($port == false) {
$this->port = $this->POP3_PORT;
} else {
$this->port = $port;
}
// If no port value is passed, retrieve it
if ($tval == false) {
$this->tval = $this->POP3_TIMEOUT;
} else {
$this->tval = $tval;
}
$this->do_debug = $debug_level;
$this->username = $username;
$this->password = $password;
// Refresh the error log
$this->error = null;
// Connect
$result = $this->Connect($this->host, $this->port, $this->tval);
if ($result) {
$login_result = $this->Login($this->username, $this->password);
if ($login_result) {
$this->Disconnect();
return true;
}
}
// We need to disconnect regardless if the login succeeded
$this->Disconnect();
return false;
}
/**
* Connect to the POP3 server
* @access public
* @param string $host
* @param integer $port
* @param integer $tval
* @return boolean
*/
public function Connect ($host, $port = false, $tval = 30) {
// Are we already connected?
if ($this->connected) {
return true;
}
/*
On Windows this will raise a PHP Warning error if the hostname doesn't exist.
Rather than supress it with @fsockopen, let's capture it cleanly instead
*/
set_error_handler(array(&$this, 'catchWarning'));
// Connect to the POP3 server
$this->pop_conn = fsockopen($host, // POP3 Host
$port, // Port #
$errno, // Error Number
$errstr, // Error Message
$tval); // Timeout (seconds)
// Restore the error handler
restore_error_handler();
// Does the Error Log now contain anything?
if ($this->error && $this->do_debug >= 1) {
$this->displayErrors();
}
// Did we connect?
if ($this->pop_conn == false) {
// It would appear not...
$this->error = array(
'error' => "Failed to connect to server $host on port $port",
'errno' => $errno,
'errstr' => $errstr
);
if ($this->do_debug >= 1) {
$this->displayErrors();
}
return false;
}
// Increase the stream time-out
// Check for PHP 4.3.0 or later
if (version_compare(phpversion(), '5.0.0', 'ge')) {
stream_set_timeout($this->pop_conn, $tval, 0);
} else {
// Does not work on Windows
if (substr(PHP_OS, 0, 3) !== 'WIN') {
socket_set_timeout($this->pop_conn, $tval, 0);
}
}
// Get the POP3 server response
$pop3_response = $this->getResponse();
// Check for the +OK
if ($this->checkResponse($pop3_response)) {
// The connection is established and the POP3 server is talking
$this->connected = true;
return true;
}
}
/**
* Login to the POP3 server (does not support APOP yet)
* @access public
* @param string $username
* @param string $password
* @return boolean
*/
public function Login ($username = '', $password = '') {
if ($this->connected == false) {
$this->error = 'Not connected to POP3 server';
if ($this->do_debug >= 1) {
$this->displayErrors();
}
}
if (empty($username)) {
$username = $this->username;
}
if (empty($password)) {
$password = $this->password;
}
$pop_username = "USER $username" . $this->CRLF;
$pop_password = "PASS $password" . $this->CRLF;
// Send the Username
$this->sendString($pop_username);
$pop3_response = $this->getResponse();
if ($this->checkResponse($pop3_response)) {
// Send the Password
$this->sendString($pop_password);
$pop3_response = $this->getResponse();
if ($this->checkResponse($pop3_response)) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* Disconnect from the POP3 server
* @access public
*/
public function Disconnect () {
$this->sendString('QUIT');
fclose($this->pop_conn);
}
/////////////////////////////////////////////////
// Private Methods
/////////////////////////////////////////////////
/**
* Get the socket response back.
* $size is the maximum number of bytes to retrieve
* @access private
* @param integer $size
* @return string
*/
private function getResponse ($size = 128) {
$pop3_response = fgets($this->pop_conn, $size);
return $pop3_response;
}
/**
* Send a string down the open socket connection to the POP3 server
* @access private
* @param string $string
* @return integer
*/
private function sendString ($string) {
$bytes_sent = fwrite($this->pop_conn, $string, strlen($string));
return $bytes_sent;
}
/**
* Checks the POP3 server response for +OK or -ERR
* @access private
* @param string $string
* @return boolean
*/
private function checkResponse ($string) {
if (substr($string, 0, 3) !== '+OK') {
$this->error = array(
'error' => "Server reported an error: $string",
'errno' => 0,
'errstr' => ''
);
if ($this->do_debug >= 1) {
$this->displayErrors();
}
return false;
} else {
return true;
}
}
/**
* If debug is enabled, display the error message array
* @access private
*/
private function displayErrors () {
echo '<pre>';
foreach ($this->error as $single_error) {
print_r($single_error);
}
echo '</pre>';
}
/**
* Takes over from PHP for the socket warning handler
* @access private
* @param integer $errno
* @param string $errstr
* @param string $errfile
* @param integer $errline
*/
private function catchWarning ($errno, $errstr, $errfile, $errline) {
$this->error[] = array(
'error' => "Connecting to the POP3 server raised a PHP warning: ",
'errno' => $errno,
'errstr' => $errstr
);
}
// End of class
}
?>

View File

@ -1,814 +0,0 @@
<?php
/*~ class.smtp.php
.---------------------------------------------------------------------------.
| Software: PHPMailer - PHP email class |
| Version: 5.1 |
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
| Info: http://phpmailer.sourceforge.net |
| Support: http://sourceforge.net/projects/phpmailer/ |
| ------------------------------------------------------------------------- |
| Admin: Andy Prevost (project admininistrator) |
| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net |
| Founder: Brent R. Matzelle (original founder) |
| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. |
| Copyright (c) 2001-2003, Brent R. Matzelle |
| ------------------------------------------------------------------------- |
| License: Distributed under the Lesser General Public License (LGPL) |
| http://www.gnu.org/copyleft/lesser.html |
| This program is distributed in the hope that it will be useful - WITHOUT |
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| FITNESS FOR A PARTICULAR PURPOSE. |
| ------------------------------------------------------------------------- |
| We offer a number of paid services (www.codeworxtech.com): |
| - Web Hosting on highly optimized fast and secure servers |
| - Technology Consulting |
| - Oursourcing (highly qualified programmers and graphic designers) |
'---------------------------------------------------------------------------'
*/
/**
* PHPMailer - PHP SMTP email transport class
* NOTE: Designed for use with PHP version 5 and up
* @package PHPMailer
* @author Andy Prevost
* @author Marcus Bointon
* @copyright 2004 - 2008 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
* @version $Id: class.smtp.php 444 2009-05-05 11:22:26Z coolbru $
*/
/**
* SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
* commands except TURN which will always return a not implemented
* error. SMTP also provides some utility methods for sending mail
* to an SMTP server.
* original author: Chris Ryan
*/
class SMTP {
/**
* SMTP server port
* @var int
*/
public $SMTP_PORT = 25;
/**
* SMTP reply line ending
* @var string
*/
public $CRLF = "\r\n";
/**
* Sets whether debugging is turned on
* @var bool
*/
public $do_debug; // the level of debug to perform
/**
* Sets VERP use on/off (default is off)
* @var bool
*/
public $do_verp = false;
/////////////////////////////////////////////////
// PROPERTIES, PRIVATE AND PROTECTED
/////////////////////////////////////////////////
private $smtp_conn; // the socket to the server
private $error; // error if any on the last call
private $helo_rply; // the reply the server sent to us for HELO
/**
* Initialize the class so that the data is in a known state.
* @access public
* @return void
*/
public function __construct() {
$this->smtp_conn = 0;
$this->error = null;
$this->helo_rply = null;
$this->do_debug = 0;
}
/////////////////////////////////////////////////
// CONNECTION FUNCTIONS
/////////////////////////////////////////////////
/**
* Connect to the server specified on the port specified.
* If the port is not specified use the default SMTP_PORT.
* If tval is specified then a connection will try and be
* established with the server for that number of seconds.
* If tval is not specified the default is 30 seconds to
* try on the connection.
*
* SMTP CODE SUCCESS: 220
* SMTP CODE FAILURE: 421
* @access public
* @return bool
*/
public function Connect($host, $port = 0, $tval = 30) {
// set the error val to null so there is no confusion
$this->error = null;
// make sure we are __not__ connected
if($this->connected()) {
// already connected, generate error
$this->error = array("error" => "Already connected to a server");
return false;
}
if(empty($port)) {
$port = $this->SMTP_PORT;
}
// connect to the smtp server
$this->smtp_conn = @fsockopen($host, // the host of the server
$port, // the port to use
$errno, // error number if any
$errstr, // error message if any
$tval); // give up after ? secs
// verify we connected properly
if(empty($this->smtp_conn)) {
$this->error = array("error" => "Failed to connect to server",
"errno" => $errno,
"errstr" => $errstr);
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '<br />';
}
return false;
}
// SMTP server can take longer to respond, give longer timeout for first read
// Windows does not have support for this timeout function
if(substr(PHP_OS, 0, 3) != "WIN")
socket_set_timeout($this->smtp_conn, $tval, 0);
// get any announcement
$announce = $this->get_lines();
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '<br />';
}
return true;
}
/**
* Initiate a TLS communication with the server.
*
* SMTP CODE 220 Ready to start TLS
* SMTP CODE 501 Syntax error (no parameters allowed)
* SMTP CODE 454 TLS not available due to temporary reason
* @access public
* @return bool success
*/
public function StartTLS() {
$this->error = null; # to avoid confusion
if(!$this->connected()) {
$this->error = array("error" => "Called StartTLS() without being connected");
return false;
}
fputs($this->smtp_conn,"STARTTLS" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 220) {
$this->error =
array("error" => "STARTTLS not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
// Begin encrypted connection
if(!stream_socket_enable_crypto($this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
return false;
}
return true;
}
/**
* Performs SMTP authentication. Must be run after running the
* Hello() method. Returns true if successfully authenticated.
* @access public
* @return bool
*/
public function Authenticate($username, $password) {
// Start authentication
fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($code != 334) {
$this->error =
array("error" => "AUTH not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
// Send encoded username
fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($code != 334) {
$this->error =
array("error" => "Username not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
// Send encoded password
fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($code != 235) {
$this->error =
array("error" => "Password not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* Returns true if connected to a server otherwise false
* @access public
* @return bool
*/
public function Connected() {
if(!empty($this->smtp_conn)) {
$sock_status = socket_get_status($this->smtp_conn);
if($sock_status["eof"]) {
// the socket is valid but we are not connected
if($this->do_debug >= 1) {
echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected";
}
$this->Close();
return false;
}
return true; // everything looks good
}
return false;
}
/**
* Closes the socket and cleans up the state of the class.
* It is not considered good to use this function without
* first trying to use QUIT.
* @access public
* @return void
*/
public function Close() {
$this->error = null; // so there is no confusion
$this->helo_rply = null;
if(!empty($this->smtp_conn)) {
// close the connection and cleanup
fclose($this->smtp_conn);
$this->smtp_conn = 0;
}
}
/////////////////////////////////////////////////
// SMTP COMMANDS
/////////////////////////////////////////////////
/**
* Issues a data command and sends the msg_data to the server
* finializing the mail transaction. $msg_data is the message
* that is to be send with the headers. Each header needs to be
* on a single line followed by a <CRLF> with the message headers
* and the message body being seperated by and additional <CRLF>.
*
* Implements rfc 821: DATA <CRLF>
*
* SMTP CODE INTERMEDIATE: 354
* [data]
* <CRLF>.<CRLF>
* SMTP CODE SUCCESS: 250
* SMTP CODE FAILURE: 552,554,451,452
* SMTP CODE FAILURE: 451,554
* SMTP CODE ERROR : 500,501,503,421
* @access public
* @return bool
*/
public function Data($msg_data) {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Data() without being connected");
return false;
}
fputs($this->smtp_conn,"DATA" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 354) {
$this->error =
array("error" => "DATA command not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
/* the server is ready to accept data!
* according to rfc 821 we should not send more than 1000
* including the CRLF
* characters on a single line so we will break the data up
* into lines by \r and/or \n then if needed we will break
* each of those into smaller lines to fit within the limit.
* in addition we will be looking for lines that start with
* a period '.' and append and additional period '.' to that
* line. NOTE: this does not count towards limit.
*/
// normalize the line breaks so we know the explode works
$msg_data = str_replace("\r\n","\n",$msg_data);
$msg_data = str_replace("\r","\n",$msg_data);
$lines = explode("\n",$msg_data);
/* we need to find a good way to determine is headers are
* in the msg_data or if it is a straight msg body
* currently I am assuming rfc 822 definitions of msg headers
* and if the first field of the first line (':' sperated)
* does not contain a space then it _should_ be a header
* and we can process all lines before a blank "" line as
* headers.
*/
$field = substr($lines[0],0,strpos($lines[0],":"));
$in_headers = false;
if(!empty($field) && !strstr($field," ")) {
$in_headers = true;
}
$max_line_length = 998; // used below; set here for ease in change
while(list(,$line) = @each($lines)) {
$lines_out = null;
if($line == "" && $in_headers) {
$in_headers = false;
}
// ok we need to break this line up into several smaller lines
while(strlen($line) > $max_line_length) {
$pos = strrpos(substr($line,0,$max_line_length)," ");
// Patch to fix DOS attack
if(!$pos) {
$pos = $max_line_length - 1;
$lines_out[] = substr($line,0,$pos);
$line = substr($line,$pos);
} else {
$lines_out[] = substr($line,0,$pos);
$line = substr($line,$pos + 1);
}
/* if processing headers add a LWSP-char to the front of new line
* rfc 822 on long msg headers
*/
if($in_headers) {
$line = "\t" . $line;
}
}
$lines_out[] = $line;
// send the lines to the server
while(list(,$line_out) = @each($lines_out)) {
if(strlen($line_out) > 0)
{
if(substr($line_out, 0, 1) == ".") {
$line_out = "." . $line_out;
}
}
fputs($this->smtp_conn,$line_out . $this->CRLF);
}
}
// message data has been sent
fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 250) {
$this->error =
array("error" => "DATA not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* Sends the HELO command to the smtp server.
* This makes sure that we and the server are in
* the same known state.
*
* Implements from rfc 821: HELO <SP> <domain> <CRLF>
*
* SMTP CODE SUCCESS: 250
* SMTP CODE ERROR : 500, 501, 504, 421
* @access public
* @return bool
*/
public function Hello($host = '') {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Hello() without being connected");
return false;
}
// if hostname for HELO was not specified send default
if(empty($host)) {
// determine appropriate default to send to server
$host = "localhost";
}
// Send extended hello first (RFC 2821)
if(!$this->SendHello("EHLO", $host)) {
if(!$this->SendHello("HELO", $host)) {
return false;
}
}
return true;
}
/**
* Sends a HELO/EHLO command.
* @access private
* @return bool
*/
private function SendHello($hello, $host) {
fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />';
}
if($code != 250) {
$this->error =
array("error" => $hello . " not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
$this->helo_rply = $rply;
return true;
}
/**
* Starts a mail transaction from the email address specified in
* $from. Returns true if successful or false otherwise. If True
* the mail transaction is started and then one or more Recipient
* commands may be called followed by a Data command.
*
* Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
*
* SMTP CODE SUCCESS: 250
* SMTP CODE SUCCESS: 552,451,452
* SMTP CODE SUCCESS: 500,501,421
* @access public
* @return bool
*/
public function Mail($from) {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Mail() without being connected");
return false;
}
$useVerp = ($this->do_verp ? "XVERP" : "");
fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 250) {
$this->error =
array("error" => "MAIL not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* Sends the quit command to the server and then closes the socket
* if there is no error or the $close_on_error argument is true.
*
* Implements from rfc 821: QUIT <CRLF>
*
* SMTP CODE SUCCESS: 221
* SMTP CODE ERROR : 500
* @access public
* @return bool
*/
public function Quit($close_on_error = true) {
$this->error = null; // so there is no confusion
if(!$this->connected()) {
$this->error = array(
"error" => "Called Quit() without being connected");
return false;
}
// send the quit command to the server
fputs($this->smtp_conn,"quit" . $this->CRLF);
// get any good-bye messages
$byemsg = $this->get_lines();
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '<br />';
}
$rval = true;
$e = null;
$code = substr($byemsg,0,3);
if($code != 221) {
// use e as a tmp var cause Close will overwrite $this->error
$e = array("error" => "SMTP server rejected quit command",
"smtp_code" => $code,
"smtp_rply" => substr($byemsg,4));
$rval = false;
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '<br />';
}
}
if(empty($e) || $close_on_error) {
$this->Close();
}
return $rval;
}
/**
* Sends the command RCPT to the SMTP server with the TO: argument of $to.
* Returns true if the recipient was accepted false if it was rejected.
*
* Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
*
* SMTP CODE SUCCESS: 250,251
* SMTP CODE FAILURE: 550,551,552,553,450,451,452
* SMTP CODE ERROR : 500,501,503,421
* @access public
* @return bool
*/
public function Recipient($to) {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Recipient() without being connected");
return false;
}
fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 250 && $code != 251) {
$this->error =
array("error" => "RCPT not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* Sends the RSET command to abort and transaction that is
* currently in progress. Returns true if successful false
* otherwise.
*
* Implements rfc 821: RSET <CRLF>
*
* SMTP CODE SUCCESS: 250
* SMTP CODE ERROR : 500,501,504,421
* @access public
* @return bool
*/
public function Reset() {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Reset() without being connected");
return false;
}
fputs($this->smtp_conn,"RSET" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 250) {
$this->error =
array("error" => "RSET failed",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* Starts a mail transaction from the email address specified in
* $from. Returns true if successful or false otherwise. If True
* the mail transaction is started and then one or more Recipient
* commands may be called followed by a Data command. This command
* will send the message to the users terminal if they are logged
* in and send them an email.
*
* Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
*
* SMTP CODE SUCCESS: 250
* SMTP CODE SUCCESS: 552,451,452
* SMTP CODE SUCCESS: 500,501,502,421
* @access public
* @return bool
*/
public function SendAndMail($from) {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called SendAndMail() without being connected");
return false;
}
fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 250) {
$this->error =
array("error" => "SAML not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* This is an optional command for SMTP that this class does not
* support. This method is here to make the RFC821 Definition
* complete for this class and __may__ be implimented in the future
*
* Implements from rfc 821: TURN <CRLF>
*
* SMTP CODE SUCCESS: 250
* SMTP CODE FAILURE: 502
* SMTP CODE ERROR : 500, 503
* @access public
* @return bool
*/
public function Turn() {
$this->error = array("error" => "This method, TURN, of the SMTP ".
"is not implemented");
if($this->do_debug >= 1) {
echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />';
}
return false;
}
/**
* Get the current error
* @access public
* @return array
*/
public function getError() {
return $this->error;
}
/////////////////////////////////////////////////
// INTERNAL FUNCTIONS
/////////////////////////////////////////////////
/**
* Read in as many lines as possible
* either before eof or socket timeout occurs on the operation.
* With SMTP we can tell if we have more lines to read if the
* 4th character is '-' symbol. If it is a space then we don't
* need to read anything else.
* @access private
* @return string
*/
private function get_lines() {
$data = "";
while($str = @fgets($this->smtp_conn,515)) {
if($this->do_debug >= 4) {
echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '<br />';
echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '<br />';
}
$data .= $str;
if($this->do_debug >= 4) {
echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '<br />';
}
// if 4th character is a space, we are done reading, break the loop
if(substr($str,3,1) == " ") { break; }
}
return $data;
}
}
?>

View File

@ -5,21 +5,6 @@ Veuillez modifier les variables ci-dessous pour que la
bdd puisse fonctionner correctement.
******************************************************/
//On se connecte a la base de donnee
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
];
try {
$pdo = new PDO('mysql:host=mariadb-festivalgo;dbname=festivalgo', 'festivalgo', 'example', $options);
} catch (\PDOException $e) {
throw new \PDOException($e->getMessage(), (int)$e->getCode());
}
//Nom dutilisateur de ladministrateur
$admin='Nitrosax';
/******************************************************
----------------Configuration Optionelle---------------
******************************************************/

View File

@ -1,39 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<link rel="stylesheet" type="text/css" href="exemples.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<script type="text/javascript" src="functions.js"></script>
<script type="text/javascript" src="publier.js"></script>
<script src="jquery.js"></script>
<script type="text/javascript" src="jquery.cleditor.min.js"></script>
<script type="text/javascript" src="jquery.cleditor.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - Contact</title>
</head>
<body>
<div id="content">
<?php include("menu.php");?>
<div id="contenu">
<article>
<form action="message_envoye.php" method="post">
<h4 class="publier_titres" for="title">Nom</h4>
<input type="text" name="nom" id="nom" style="display: block; margin-left: 198px;" />
<h4 class="publier_titres" for="title">E-mail</h4>
<input type="text" name="mail" id="mail" style="display: block; margin-left: 198px;" />
<h4 class="publier_titres" for="title">Objet</h4>
<input type="text" name="objet" id="objet" style="display: block; margin-left: 198px;" />
<h4 class="publier_titres" for="title">Message</h4>
<textarea name="message" id="message" cols="70" rows="6" style="resize: none;"></textarea><br /><br />
<input id="submit" type="submit" value="Envoyer" />
</form>
</article>
</div>
</div>
<?php include("bas_de_page.php"); ?>
</body>
</html>

View File

@ -1,123 +0,0 @@
-- --------------------------------------------------------
--
-- Structure de la table `categories`
--
CREATE TABLE `categories` (
`id` smallint(6) NOT NULL,
`name` varchar(256) NOT NULL,
`description` text NOT NULL,
`position` smallint(6) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `exemples`
--
CREATE TABLE `exemples` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`titre` varchar(256) NOT NULL,
`auteur` varchar(256) NOT NULL,
`mail` varchar(256) NOT NULL,
`description` longtext NOT NULL,
`programme` longtext NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `exemples_en_attente`
--
CREATE TABLE `exemples_en_attente` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`titre` varchar(256) NOT NULL,
`auteur` varchar(256) NOT NULL,
`mail` varchar(256) NOT NULL,
`description` longtext NOT NULL,
`programme` longtext NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `pm`
--
CREATE TABLE `pm` (
`id` bigint(20) NOT NULL,
`id2` int(11) NOT NULL,
`title` varchar(256) NOT NULL,
`user1` bigint(20) NOT NULL,
`user2` bigint(20) NOT NULL,
`message` text NOT NULL,
`timestamp` int(10) NOT NULL,
`user1read` varchar(3) NOT NULL,
`user2read` varchar(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `topics`
--
CREATE TABLE `topics` (
`parent` smallint(6) NOT NULL,
`id` int(11) NOT NULL,
`id2` int(11) NOT NULL,
`title` varchar(256) NOT NULL,
`message` longtext NOT NULL,
`authorid` int(11) NOT NULL,
`timestamp` int(11) NOT NULL,
`timestamp2` int(11) NOT NULL,
PRIMARY KEY (`id`,`id2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `users`
--
CREATE TABLE `users` (
`id` bigint(20) NOT NULL,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`avatar` text NOT NULL,
`signup_date` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -1,84 +0,0 @@
<?php
//Cette page permet de supprimer une catégorie
include('config.php');
if(isset($_GET['id']))
{
$id = intval($_GET['id']);
$dn1 = mysql_fetch_array(mysql_query('select count(id) as nb1, name, position from categories where id="'.$id.'" group by id'));
if($dn1['nb1']>0)
{
if(isset($_SESSION['username']) and $_SESSION['username']==$admin)
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<title>Supprimer une catégorie - <?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?> - forum</title>
</head>
<body>
<div class="header">
<a href="<?php echo $url_home; ?>"><img src="<?php echo $design; ?>/Images/logo.png" alt="forum" /></a>
</div>
<div class="content">
<?php
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; <?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?> &gt; Supprimer la catégorie
</div>
<div class="box_right">
<a href="list_pm.php">Vos messages (<?php echo $nb_new_pm; ?>)</a> - <a href="profile.php?id=<?php echo $_SESSION['userid']; ?>"><?php echo htmlentities($_SESSION['username'], ENT_QUOTES, 'UTF-8'); ?></a> (<a href="login.php">Déconnexion</a>)
</div>
<div class="clean"></div>
</div>
<?php
if(isset($_POST['confirm']))
{
if(mysql_query('delete from categories where id="'.$id.'"') and mysql_query('delete from topics where parent="'.$id.'"') and mysql_query('update categories set position=position-1 where position>"'.$dn1['position'].'"'))
{
?>
<div class="message">La catégorie et ses sujets a bien été supprimée.<br />
<a href="<?php echo $url_home; ?>">Retourner à l'index du forum</a></div>
<?php
}
else
{
echo 'Une erreur s\'est produite lors de la suppresssion de la catégorie et de ses sujets.';
}
}
else
{
?>
<form action="delete_category.php?id=<?php echo $id; ?>" method="post">
Êtes-vous sûr de vouloir supprimer cette catégorie et l'ensemble de ses sujets?
<input type="hidden" name="confirm" value="true" />
<input type="submit" value="Oui" /> <input type="button" value="Non" onclick="javascript:history.go(-1);" />
</form>
<?php
}
?>
</div>
<div class="foot"><a href="http://www.supportduweb.com/scripts_tutoriaux-code-source-89-simple-php-forum-script-forum-en-php-facile-simple-script-code-telecharger-forum-php-gratuit-mysql.html">Simple PHP forum Script</a> - <a href="http://www.supportduweb.com/">Support du Web</a></div>
</body>
</html>
<?php
}
else
{
echo '<h2>Vous devez être connecté en tant qu\'administrateur pour accéder à cette page: <a href="login.php">Connexion</a> - <a href="signup.php">Inscription</a></h2>';
}
}
else
{
echo '<h2>La catégorie que vous désirez supprimer n\'existe pas.</h2>';
}
}
else
{
echo '<h2>L\'identifiant de la catégorie à supprimer n\'est pas défini</h2>';
}
?>

View File

@ -1,91 +0,0 @@
<?php
//Cette page permet de supprimer un sujet
include('config.php');
if(isset($_GET['id']))
{
$id = intval($_GET['id']);
if(isset($_SESSION['username']))
{
$dn1 = mysql_fetch_array(mysql_query('select count(t.id) as nb1, t.title, t.parent, c.name from topics as t, categories as c where t.id="'.$id.'" and t.id2=1 and c.id=t.parent group by t.id'));
if($dn1['nb1']>0)
{
if($_SESSION['username']==$admin)
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<title>Supprimer un sujet - <?php echo htmlentities($dn1['title'], ENT_QUOTES, 'UTF-8'); ?> - <?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?> - forum</title>
</head>
<body>
<div class="header">
<a href="<?php echo $url_home; ?>"><img src="<?php echo $design; ?>/Images/logo.png" alt="forum" /></a>
</div>
<div class="content">
<?php
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; <a href="list_topics.php?parent=<?php echo $dn1['parent']; ?>"><?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?></a> &gt; <a href="read_topic.php?id=<?php echo $id; ?>"><?php echo htmlentities($dn1['title'], ENT_QUOTES, 'UTF-8'); ?></a> &gt; Supprimer le sujet
</div>
<div class="box_right">
<a href="list_pm.php">Vos messages (<?php echo $nb_new_pm; ?>)</a> - <a href="profile.php?id=<?php echo $_SESSION['userid']; ?>"><?php echo htmlentities($_SESSION['username'], ENT_QUOTES, 'UTF-8'); ?></a> (<a href="login.php">Déconnexion</a>)
</div>
<div class="clean"></div>
</div>
<?php
if(isset($_POST['confirm']))
{
if(mysql_query('delete from topics where id="'.$id.'"'))
{
?>
<div class="message">Le sujet a bien été supprimé.<br />
<a href="list_topics.php?parent=<?php echo $dn1['parent']; ?>">Retourner au sujet</a></div>
<?php
}
else
{
echo 'Une erreur s\'est produite lors de la suppression du sujet.';
}
}
else
{
?>
<form action="delete_topic.php?id=<?php echo $id; ?>" method="post">
Êtes-vous sûr de vouloir supprimer ce sujet?
<input type="hidden" name="confirm" value="true" />
<input type="submit" value="Oui" /> <input type="button" value="Non" onclick="javascript:history.go(-1);" />
</form>
<?php
}
?>
</div>
<div class="foot"><a href="http://www.supportduweb.com/scripts_tutoriaux-code-source-89-simple-php-forum-script-forum-en-php-facile-simple-script-code-telecharger-forum-php-gratuit-mysql.html">Simple PHP forum Script</a> - <a href="http://www.supportduweb.com/">Support du Web</a></div>
</body>
</html>
<?php
}
else
{
echo '<h2>Vous n\'avez pas le droit de supprimer ce sujet.</h2>';
}
}
else
{
echo '<h2>Le sujet que vous désirez supprimer n\'existe pas.</h2>';
}
}
else
{
echo '<h2>Vous devez être connecté en tant qu\'administrateur pour accéder à cette page: <a href="login.php">Connexion</a> - <a href="signup.php">Inscription</a></h2>';
}
}
else
{
echo '<h2>Un identifiant du sujet que vous désirez supprimer n\'est pas défini.</h2>';
}
?>

View File

@ -1,94 +0,0 @@
<?php
//Cette page permet de modifier une categorie
include('config.php');
if(isset($_GET['id']))
{
$id = intval($_GET['id']);
$dn1 = mysql_fetch_array(mysql_query('select count(id) as nb1, name, description from categories where id="'.$id.'" group by id'));
if($dn1['nb1']>0)
{
if(isset($_SESSION['username']) and $_SESSION['username']==$admin)
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<title>Modifier une catégorie - <?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?> - forum</title>
</head>
<body>
<div class="header">
<a href="<?php echo $url_home; ?>"><img src="<?php echo $design; ?>/Images/logo.png" alt="forum" /></a>
</div>
<div class="content">
<?php
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; <?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?> &gt; Modifier la catégorie
</div>
<div class="box_right">
<a href="list_pm.php">Vos messages (<?php echo $nb_new_pm; ?>)</a> - <a href="profile.php?id=<?php echo $_SESSION['userid']; ?>"><?php echo htmlentities($_SESSION['username'], ENT_QUOTES, 'UTF-8'); ?></a> (<a href="login.php">Déconnexion</a>)
</div>
<div class="clean"></div>
</div>
<?php
if(isset($_POST['name'], $_POST['description']) and $_POST['name']!='')
{
$name = $_POST['name'];
$description = $_POST['description'];
if(get_magic_quotes_gpc())
{
$name = stripslashes($name);
$description = stripslashes($description);
}
$name = mysql_real_escape_string($name);
$description = mysql_real_escape_string($description);
if(mysql_query('update categories set name="'.$name.'", description="'.$description.'" where id="'.$id.'"'))
{
?>
<div class="message">La catégorie a bien été modifiée.<br />
<a href="<?php echo $url_home; ?>">Retourner à l'index du forum</a></div>
<?php
}
else
{
echo 'Une erreur s\'est produite lors de la modification de la catégorie.';
}
}
else
{
?>
<form action="edit_category.php?id=<?php echo $id; ?>" method="post">
<label for="name">Nom</label><input type="text" name="name" id="name" value="<?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?>" /><br />
<label for="description">Description</label>(html accepté)<br />
<textarea name="description" id="description" cols="70" rows="6"><?php echo htmlentities($dn1['description'], ENT_QUOTES, 'UTF-8'); ?></textarea><br />
<input type="submit" value="Modifier" />
</form>
<?php
}
?>
</div>
<div class="foot"><a href="http://www.supportduweb.com/scripts_tutoriaux-code-source-89-simple-php-forum-script-forum-en-php-facile-simple-script-code-telecharger-forum-php-gratuit-mysql.html">Simple PHP forum Script</a> - <a href="http://www.supportduweb.com/">Support du Web</a></div>
</body>
</html>
<?php
}
else
{
echo '<h2>Vous devez être connecté en tant qu\'administrateur pour accéder à cette page: <a href="login.php">Connexion</a> - <a href="signup.php">Inscription</a></h2>';
}
}
else
{
echo '<h2>La catégorie que vous désirez modifier n\'existe pas.</h2>';
}
}
else
{
echo '<h2>L\'identifiant de la catégorie à modifier n\'est pas défini</h2>';
}
?>

View File

@ -1,156 +0,0 @@
<?php
//Cette page permet de modifer un message
include('config.php');
if(isset($_GET['id'], $_GET['id2']))
{
$id = intval($_GET['id']);
$id2 = intval($_GET['id2']);
if(isset($_SESSION['username']))
{
$dn1 = mysql_fetch_array(mysql_query('select count(t.id) as nb1, t.authorid, t2.title, t.message, t.parent, c.name from topics as t, topics as t2, categories as c where t.id="'.$id.'" and t.id2="'.$id2.'" and t2.id="'.$id.'" and t2.id2=1 and c.id=t.parent group by t.id'));
if($dn1['nb1']>0)
{
if($_SESSION['userid']==$dn1['authorid'] or $_SESSION['username']==$admin)
{
include('bbcode_function.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - Editer un message</title>
<script type="text/javascript" src="functions.js"></script>
</head>
<body>
<div id="content">
<?php include("menu.php"); ?>
<div class="content">
<?php
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; <a href="list_topics.php?parent=<?php echo $dn1['parent']; ?>"><?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?></a> &gt; <a href="read_topic.php?id=<?php echo $id; ?>"><?php echo htmlentities($dn1['title'], ENT_QUOTES, 'UTF-8'); ?></a> &gt; Modifier
</div>
<div class="box_right">
<a href="list_pm.php">Vos messages (<?php echo $nb_new_pm; ?>)</a> - <a href="profile.php?id=<?php echo $_SESSION['userid']; ?>"><?php echo htmlentities($_SESSION['username'], ENT_QUOTES, 'UTF-8'); ?></a> (<a href="login.php">Déconnexion</a>)
</div>
<div class="clean"></div>
</div>
<?php
if(isset($_POST['message']) and $_POST['message']!='')
{
if($id2==1)
{
if($_SESSION['username']==$admin and isset($_POST['title']) and $_POST['title']!='')
{
$title = $_POST['title'];
if(get_magic_quotes_gpc())
{
$title = stripslashes($title);
}
$title = mysql_real_escape_string($dn1['title']);
}
else
{
$title = mysql_real_escape_string($dn1['title']);
}
}
else
{
$title = '';
}
$message = $_POST['message'];
if(get_magic_quotes_gpc())
{
$message = stripslashes($message);
}
$message = mysql_real_escape_string(bbcode_to_html($message));
if(mysql_query('update topics set title="'.$title.'", message="'.$message.'" where id="'.$id.'" and id2="'.$id2.'"'))
{
?>
<div class="message">Le message a bien &eacute;t&eacute; modifi&eacute;.<br />
<a href="read_topic.php?id=<?php echo $id; ?>">Retourner au sujet</a></div>
<?php
}
else
{
echo 'Une erreur s\'est produite lors de la modification du message.';
}
}
else
{
?>
<form action="edit_message.php?id=<?php echo $id; ?>&id2=<?php echo $id2; ?>" method="post">
<?php
if($_SESSION['username']==$admin and $id2==1)
{
?>
<label for="title">Titre</label><input type="text" name="title" id="title" value="<?php echo htmlentities($dn1['title'], ENT_QUOTES, 'UTF-8'); ?>" />
<?php
}
?>
<label for="message">Message</label><br />
<div class="message_buttons">
<input type="button" value="Gras" onclick="javascript:insert('[b]', '[/b]', 'message');" /><!--
--><input type="button" value="Italique" onclick="javascript:insert('[i]', '[/i]', 'message');" /><!--
--><input type="button" value="Souligne" onclick="javascript:insert('[u]', '[/u]', 'message');" /><!--
--><input type="button" value="Image" onclick="javascript:insert('[img]', '[/img]', 'message');" /><!--
--><input type="button" value="Lien" onclick="javascript:insert('[url]', '[/url]', 'message');" /><!--
--><input type="button" value="Gauche" onclick="javascript:insert('[left]', '[/left]', 'message');" /><!--
--><input type="button" value="Centre" onclick="javascript:insert('[center]', '[/center]', 'message');" /><!--
--><input type="button" value="Droite" onclick="javascript:insert('[right]', '[/right]', 'message');" />
</div>
<textarea name="message" id="message" cols="70" rows="6"><?php echo html_to_bbcode($dn1['message']); ?></textarea><br />
<input type="submit" value="Envoyer" />
</form>
<?php
}
?>
</div>
</span>
</span>
</div>
</body>
<?php include("bas_de_page.php"); ?>
</html>
<?php
}
else
{
echo '<h2>Vous n\'avez pas le droit de modifier ce message.</h2>';
}
}
else
{
echo '<h2>Le message que vous désirez modifier n\'existe pas.</h2>';
}
}
else
{
?>
<h2>Vous devez être connecté pour accéder à cette page:</h2>
<div class="box_login">
<form action="login.php" method="post">
<label for="username">Nom d'utilisateur</label><input type="text" name="username" id="username" /><br />
<label for="password">Mot de passe</label><input type="password" name="password" id="password" /><br />
<label for="memorize">Se souvenir</label><input type="checkbox" name="memorize" id="memorize" value="yes" />
<div class="center">
<input type="submit" value="Login" /> <input type="button" onclick="javascript:document.location='signup.php';" value="S'inscrire" />
</div>
</form>
</div>
<?php
}
}
else
{
echo '<h2>Un identifiant du message que vous désirez modifier n\'est pas défini.</h2>';
}
?>

View File

@ -1,163 +0,0 @@
<?php
//Cette page permet aux utilisateurs de modifier leur profil
include('config.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<title>Modifier ses informations personnelles</title>
</head>
<body>
<div class="header">
<a href="<?php echo $url_home; ?>"><img src="<?php echo $design; ?>/Images/logo.png" alt="Espace Membre" /></a>
</div>
<div class="content">
<?php
if(isset($_SESSION['username']))
{
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; Modifier ses informations personnelles
</div>
<div class="box_right">
<a href="list_pm.php">Vos messages (<?php echo $nb_new_pm; ?>)</a> - <a href="profile.php?id=<?php echo $_SESSION['userid']; ?>"><?php echo htmlentities($_SESSION['username'], ENT_QUOTES, 'UTF-8'); ?></a> (<a href="login.php">Déconnexion</a>)
</div>
<div class="clean"></div>
</div>
<?php
if(isset($_POST['username'], $_POST['password'], $_POST['passverif'], $_POST['email'], $_POST['avatar']))
{
if(get_magic_quotes_gpc())
{
$_POST['username'] = stripslashes($_POST['username']);
$_POST['password'] = stripslashes($_POST['password']);
$_POST['passverif'] = stripslashes($_POST['passverif']);
$_POST['email'] = stripslashes($_POST['email']);
$_POST['avatar'] = stripslashes($_POST['avatar']);
}
if($_POST['password']==$_POST['passverif'])
{
if(strlen($_POST['password'])>=6)
{
if(preg_match('#^(([a-z0-9!\#$%&\\\'*+/=?^_`{|}~-]+\.?)*[a-z0-9!\#$%&\\\'*+/=?^_`{|}~-]+)@(([a-z0-9-_]+\.?)*[a-z0-9-_]+)\.[a-z]{2,}$#i',$_POST['email']))
{
$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string($_POST['password']);
$email = mysql_real_escape_string($_POST['email']);
$avatar = mysql_real_escape_string($_POST['avatar']);
$dn = mysql_fetch_array(mysql_query('select count(*) as nb from users where username="'.$username.'"'));
if($dn['nb']==0 or $_POST['username']==$_SESSION['username'])
{
if(mysql_query('update users set username="'.$username.'", password="'.$password.'", email="'.$email.'", avatar="'.$avatar.'" where id="'.mysql_real_escape_string($_SESSION['userid']).'"'))
{
$form = false;
unset($_SESSION['username'], $_SESSION['userid']);
?>
<div class="message">Vos informations ont bien &eacute;t&eacute; modifif&eacute;e. Vous devez vous reconnecter.<br />
<a href="login.php">Se connecter</a></div>
<?php
}
else
{
$form = true;
$message = 'Une erreur est survenue lors des modifications.';
}
}
else
{
$form = true;
$message = 'Un autre utilisateur utilise d&eacute;j&agrave; le nom d\'utilisateur que vous d&eacute;sirez utiliser.';
}
}
else
{
$form = true;
$message = 'L\'email que vous avez entr&eacute; n\'est pas valide.';
}
}
else
{
$form = true;
$message = 'Le mot de passe que vous avez entr&eacute; contien moins de 6 caract&egrave;res.';
}
}
else
{
$form = true;
$message = 'Les mot de passe que vous avez entr&eacute; ne sont pas identiques.';
}
}
else
{
$form = true;
}
if($form)
{
if(isset($message))
{
echo '<strong>'.$message.'</strong>';
}
if(isset($_POST['username'],$_POST['password'],$_POST['email']))
{
$username = htmlentities($_POST['username'], ENT_QUOTES, 'UTF-8');
if($_POST['password']==$_POST['passverif'])
{
$password = htmlentities($_POST['password'], ENT_QUOTES, 'UTF-8');
}
else
{
$password = '';
}
$email = htmlentities($_POST['email'], ENT_QUOTES, 'UTF-8');
$avatar = htmlentities($_POST['avatar'], ENT_QUOTES, 'UTF-8');
}
else
{
$dnn = mysql_fetch_array(mysql_query('select username,password,email,avatar from users where username="'.$_SESSION['username'].'"'));
$username = htmlentities($dnn['username'], ENT_QUOTES, 'UTF-8');
$password = htmlentities($dnn['password'], ENT_QUOTES, 'UTF-8');
$email = htmlentities($dnn['email'], ENT_QUOTES, 'UTF-8');
$avatar = htmlentities($dnn['avatar'], ENT_QUOTES, 'UTF-8');
}
?>
<form action="edit_profile.php" method="post">
Vous pouvez modifier vos informations:<br />
<div class="center">
<label for="username">Nom d'utilisateur</label><input type="text" name="username" id="username" value="<?php echo $username; ?>" /><br />
<label for="password">Mot de passe<span class="small">(6 caract&egrave;res min.)</span></label><input type="password" name="password" id="password" value="<?php echo $password; ?>" /><br />
<label for="passverif">Mot de passe<span class="small">(v&eacute;rification)</span></label><input type="password" name="passverif" id="passverif" value="<?php echo $password; ?>" /><br />
<label for="email">Email</label><input type="text" name="email" id="email" value="<?php echo $email; ?>" /><br />
<label for="avatar">Image perso<span class="small">(facultatif)</span></label><input type="text" name="avatar" id="avatar" value="<?php echo $avatar; ?>" /><br />
<input type="submit" value="Envoyer" />
</div>
</form>
<?php
}
}
else
{
?>
<div class="message">Pour acc&eacute;der &agrave; cette page, vous devez &ecirc;tre connect&eacute;.</div>
<div class="box_login">
<form action="login.php" method="post">
<label for="username">Nom d'utilisateur</label><input type="text" name="username" id="username" /><br />
<label for="password">Mot de passe</label><input type="password" name="password" id="password" /><br />
<label for="memorize">Se souvenir</label><input type="checkbox" name="memorize" id="memorize" value="yes" />
<div class="center">
<input type="submit" value="Login" /> <input type="button" onclick="javascript:document.location='signup.php';" value="S'inscrire" />
</div>
</form>
</div>
<?php
}
?>
</div>
<div class="foot"><a href="http://www.supportduweb.com/scripts_tutoriaux-code-source-89-simple-php-forum-script-forum-en-php-facile-simple-script-code-telecharger-forum-php-gratuit-mysql.html">Simple PHP forum Script</a> - <a href="http://www.supportduweb.com/">Support du Web</a></div>
</body>
</html>

View File

@ -1,5 +1,128 @@
<?php
include('config.php');
$db_examples = [
[
'titre' => 'Algorithme d\'Euclide',
'auteur' => 'Nitrosax',
'description' => 'Calcule le Plus Grand Commun Diviseur entre deux nombres entiers.',
'programme' => '<div>Lire A</div>
<div>Lire B</div>
<div>Tant_que B 0</div>
<div>R Prend_la_valeur B * Partie_d&eacute;cimale(A/B)</div>
<div>A Prend_la_valeur B</div>
<div>B prend_la_valeur R</div>
<div>Fin_Tant_que</div>
<div>Afficher "PGCD :"</div>
<div>Afficher A</div>'
],
[
'titre' => 'Plus ou moins',
'auteur' => 'Paul',
'description' => 'Petit jeu où il faut deviner un nombre.',
'programme' => '<div>Afficher "Nombre maximal ?"</div>
<div>Lire A</div>
<div>A Prend_la_valeur Partie_entière (Hasard (a))</div>
<div>B Prend_la_valeur -1</div>
<div>Tant_que B A</div>
<div>Lire B</div>
<div>Si B = A</div>
<div>Alors Afficher "Well done"</div>
<div>Sinon Si B A</div>
<div>Alors Afficher " +"</div>
<div>Sinon Afficher "-"</div>
<div>Fin_si</div>
<div>Fin_si</div>
<div>Fin_Tant_que</div>',
],
[
'titre' => 'Suite de Syracuse',
'auteur' => 'Nitrosax',
'description' => 'Affiche les termes de la suite de Syracuse en fonction du nombre de départ choisi par l\'utilisateur.',
'programme' => '<div>Lire A</div>
<div>Tant_que A &gt; 1</div>
<div>Si Partie_d&eacute;cimale (A/2) = 0</div>
<div>Alors A Prend_la_valeur A/2</div>
<div>Sinon A Prend_la_valeur 3*A+1</div>
<div>Fin_si</div>
<div>Afficher A</div>
<div>Fin_Tant_que</div>
<div>Afficher A</div>',
],
[
'titre' => 'Suite de Fibonacci',
'auteur' => 'Dark-Storm',
'description' => 'Cet algorithme calcule les N premiers termes de la suite de Fibonacci. N est rentré par l\'utilisateur.
La suite de Fibonacci sert à déterminer une approximation du nombre d\'Or en divisant un terme par le terme précédent.',
'programme' => '<div>A Prend_la_valeur 0</div>
<div>B Prend_la_valeur 1</div>
<div>C Prend_la_valeur 0</div>
<div>Lire N</div>
<div>Pour D Allant_de 1 à N</div>
<div>C Prend_la_valeur A+B</div>
<div>A Prend_la_valeur B</div>
<div>B Prend_la_valeur C</div>
<div>Afficher C</div>
<div>Fin_Pour</div>',
],
[
'titre' => 'Suite géométrique',
'auteur' => 'domPayeur',
'description' => 'Une toute petite contribution pour essayer Festiv\'Algo.
Le programme génère les termes u_1, u_2 ... u_n d\'une suite géométrique avec un rappel de cours.',
'programme' => '<div>Afficher " Programme suite géométrique"</div>
<div>Afficher " Un+1=q* Un"</div>
<div>Afficher " Un=Uo*q^n"</div>
<div>Afficher " ce programme calcule Un quand Uo et q sont connus "</div>
<div>Afficher "Saisir N"</div>
<div>Lire N</div>
<div>Afficher "Saisir Uo"</div>
<div>Lire U</div>
<div>Afficher "Saisir Q"</div>
<div>Lire Q</div>
<div>Pour I Allant_de 1 à n</div>
<div>U Prend_la_valeur u*q</div>
<div>Afficher "U="</div>
<div>Afficher U</div>
<div>Fin_Pour</div>',
], [
'titre' => 'Méthode de Monte Carlo ',
'auteur' => 'domPayeur',
'description' => 'Le hasard et la loi des grands nombres (ou stabilisation de la fréquence) pour déterminer une valeur approchée de PI.
Le principe:
Un point est généré de manière aléatoire dans un carré de côté 1.
On calcule la distance séparant ce point de l\'un des sommets du carré.
Si cette distance est inférieure à 1, le point est alors à l\'intérieur du quart de disque de rayon 1 ayant pour centre ce sommet.
L\'aire du quart de disque est Pi/4 et la fréquence d\'apparition du point dans ce quart de disque se stabilise pour un grand nombre de lancers autour de la valeur théorique qui est la probabilité de cet événement: ici le rapport aire du quart de disque / aire du carré soit ( Pi/4)/1 donc Pi/4; il ne reste plus qu\'à multiplier par 4 pour obtenir une valeur approchée de Pi.',
'programme' => '<div>Afficher "Méthode de Monte-Carlo"</div>
<div>Afficher "Valeur approchée de pi"</div>
<div>Afficher "Grâce au rand !"</div>
<div>D Prend_la_valeur 0</div>
<div>Pour I Allant_de 1 à 10000</div>
<div>X Prend_la_valeur Hasard (1)</div>
<div>Y Prend_la_valeur Hasard (1)</div>
<div>L Prend_la_valeur X*X+Y*Y</div>
<div>Si (L < 1)</div>
<div>Alors D Prend_la_valeur D+1</div>
<div>Fin_si</div>
<div>V Prend_la_valeur 4*D/I</div>
<div>Afficher V</div>
<div>Fin_Pour</div>
<div>Fin_programme</div>',
],
[
'titre' => 'R.O.C. du Bac S',
'auteur' => 'Nitrosax',
'description' => 'Une restitution organisée de connaissance que les candidats du Bac S doivent connaître par coeur. Elle permet de montrer que pour tout nombre A rentré par l\'utilisateur, il existe un rang N tel que Un > A. L\'exemple utilise la suite : Un = 3^N.',
'programme' => '<div>Lire A</div>
<div>N Prend_la_valeur 0</div>
<div>Tant_que 3^n A</div>
<div>N Prend_la_valeur N+1</div>
<div>Fin_Tant_que</div>
<div>Afficher N</div>'
]
];
?>
<!DOCTYPE html>
<html>
@ -21,8 +144,7 @@ include('config.php');
<?php include("menu.php");?>
<div id="contenu">
<?php
$stmt = $pdo->query('select id, titre, auteur, description from exemples ORDER BY titre ASC');
while ($dnn = $stmt->fetch())
foreach ($db_examples as $key => $dnn)
{
?>
<article>
@ -30,7 +152,10 @@ include('config.php');
<h2 class="titre"><?php echo htmlentities($dnn['titre'], ENT_QUOTES, 'UTF-8'); ?></h2>
<h4>Auteur :</h4><p class="auteur"><?php echo htmlentities($dnn['auteur'], ENT_QUOTES, 'UTF-8'); ?></p>
<h4>Description :</h4><p class="description"><?php echo htmlentities($dnn['description'], ENT_QUOTES, 'UTF-8'); ?></p><br />
<a href="<?= $base_url ?>/index.php" id="<?php echo 'algo'.$dnn['id'];?>" class="tester"><img alt="Tester cet algorithme" title="Tester cet algorithme" src="Images/tester.png" style="border: 0px;"/></a>
<form method="POST" action="<?= $base_url ?>/index.php">
<textarea style="display:none;" name="programme"><?= $dnn['programme'] ?></textarea>
<input type="image" src="Images/tester.png" border="0" alt="Submit" />
</form>
</div>
</article>
<?php
@ -38,9 +163,6 @@ include('config.php');
?>
<aside>
<p id="annonces" style="top: 281px; height: 634px; width: 162px;">Annonces</p>
<div id="pub3">
<script for=window language="JScript" src='http://www.pubdirecte.com/script/banniere.php?id=73442&ref=43885'></script>
</div>
</aside>
</div>
</div>

121
forum.php
View File

@ -1,121 +0,0 @@
<?php
//Cette page permet dafficher la liste des categories
include('config.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - forum</title>
<meta name="keywords" content="festivalgo, algobox, forum, aide, algorithme, algorithmique, problème, problème algorithme, programmation, Casio, TI, HP, apprendre, bac, mathématiques, ROC, nouveaux programmes, réformes" />
<meta name="description" content="Posez toutes vos questions sur des algorithmes sur ce forum. Résolvez vos problèmes d'algorithmique. Inscription rapide et gratuite." />
</head>
<body>
<div id="content">
<?php include("menu.php"); ?>
<div class="content">
<?php
if(isset($_SESSION['username']))
{
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_right">
<a href="list_pm.php">Vos messages&nbsp;(<?php echo $nb_new_pm; ?>)</a> - <a href="profile.php?id=<?php echo $_SESSION['userid']; ?>"></a> <a href="login.php">Déconnexion</a>
</div>
<div class="clean"></div>
</div>
<?php
}
else
{
?>
<?php
if(isset($_SESSION['username']) and $_SESSION['username']==$admin)
{
?>
<a href="new_category.php" class="button">Nouvelle Catégorie</a>
<?php
}
if(!isset($_SESSION['username']))
{
?>
<div class="box_login">
<form action="login.php" method="post">
<label for="username">Nom d'utilisateur</label><input type="text" name="username" class="champs" id="username" /><br />
<label for="password">Mot de passe</label><input type="password" name="password" class="champs" id="password" /><br />
<label id="se_souvenir" for="memorize">Se souvenir</label><input class="champs" type="checkbox" name="memorize" id="memorize" value="yes" />
<div class="center">
<input type="button" onclick="javascript:document.location='signup.php';" value="S'inscrire" /> <input type="submit" value="Login" />
</div>
</form>
</div>
<?php
}
?>
<?php
}
if(isset($_SESSION['username']) and $_SESSION['username']==$admin)
{
?>
<a href="new_category.php" class="button">Nouvelle Catégorie</a>
<?php
}
?>
<table class="categories_table">
<tr>
<th class="forum_cat">Catégorie</th>
<th class="forum_ntop">Sujets</th>
<th class="forum_nrep">Réponses</th>
<?php
if(isset($_SESSION['username']) and $_SESSION['username']==$admin)
{
?>
<th class="forum_act">Action</th>
<?php
}
?>
</tr>
<?php
$dn1 = mysql_query('select c.id, c.name, c.description, c.position, (select count(t.id) from topics as t where t.parent=c.id and t.id2=1) as topics, (select count(t2.id) from topics as t2 where t2.parent=c.id and t2.id2!=1) as replies from categories as c group by c.id order by c.position asc');
$nb_cats = mysql_num_rows($dn1);
while($dnn1 = mysql_fetch_array($dn1))
{
?>
<tr>
<td class="forum_cat"><a href="list_topics.php?parent=<?php echo $dnn1['id']; ?>" class="title"><?php echo htmlentities($dnn1['name'], ENT_QUOTES, 'UTF-8'); ?></a>
<div class="description"><?php echo $dnn1['description']; ?></div></td>
<td><?php echo $dnn1['topics']; ?></td>
<td><?php echo $dnn1['replies']; ?></td>
<?php
if(isset($_SESSION['username']) and $_SESSION['username']==$admin)
{
?>
<td><a href="delete_category.php?id=<?php echo $dnn1['id']; ?>"><img src="<?php echo $design; ?>/Images/delete.png" alt="Delete" /></a>
<?php if($dnn1['position']>1){ ?><a href="move_category.php?action=up&id=<?php echo $dnn1['id']; ?>"><img src="<?php echo $design; ?>/Images/up.png" alt="Faire Monter" /></a><?php } ?>
<?php if($dnn1['position']<$nb_cats){ ?><a href="move_category.php?action=down&id=<?php echo $dnn1['id']; ?>"><img src="<?php echo $design; ?>/Images/down.png" alt="Faire Descendre" /></a><?php } ?>
<a href="edit_category.php?id=<?php echo $dnn1['id']; ?>"><img src="<?php echo $design; ?>/Images/edit.png" alt="Edit" /></a></td>
<?php
}
?>
</tr>
<?php
}
?>
</table>
</div>
<?php include "pub.php" ?>
</div>
</body>
<?php include("bas_de_page.php"); ?>
</html>

19
ie8.php
View File

@ -1,19 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<link rel="stylesheet" type="text/css" href="exemples.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<script src="jquery.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - Navigateur obsolète</title>
</head>
<body>
Votre navigateur est obsolète et est incapable d'afficher correctement ce site (comme une majorité de sites).<br />
Pour accéder à cette page, merci de le mettre à jour <a class="lien" href="http://www.internetexplorer.fr/" target="_blank">ici</a>.<br /><br />
contact@festivalgo.fr
</body>
</html>

View File

@ -1,21 +1,11 @@
<?php
include('config.php');
/*
if(isset($_COOKIE["exemple"]) && $_COOKIE["exemple"] != "init")
require_once('config.php');
if(isset($_POST["programme"]))
{
$dn = mysql_query('select programme from exemples where id="'.$_COOKIE['exemple'].'"');
$dnn = mysql_fetch_array($dn);
if($dnn['programme'] != "")
{
$content = str_replace("+", "@" , $dnn['programme']);
//$content = htmlentities($content, ENT_QUOTES, 'UTF-8');
$content = utf8_decode($content);
setcookie('last_algo', $content, (time() + 30*24*60*60));
setcookie('last_language', '1', (time() + 30*24*60*60));
}
setcookie('last_algo', '', time() - 3600, $base_url);
setcookie('algorithme', '', time() - 3600, $base_url);
setcookie('algo', '', time() - 3600, $base_url);
}
*/
?>
<!DOCTYPE html>
@ -89,25 +79,10 @@
<form name="code"><textarea cols="41" rows="22" name="Saisie" id="saisie" spellcheck="false" method="post" action="<?= $base_url ?>">
<?php
if(isset($_COOKIE["exemple"]) && $_COOKIE["exemple"] != "init")
if(isset($_POST["programme"]))
{
$dn = mysql_query('select programme from exemples where id="'.$_COOKIE['exemple'].'"');
$dnn = mysql_fetch_array($dn);
if($dnn['programme'] != "")
echo $dnn['programme'];
}/*
else
{
if(isset($_COOKIE["last_algo"], $_COOKIE["last_language"]) && $_COOKIE["last_language"] > 0 && $_COOKIE["last_language"] < 4)
{
$code = str_replace('\\', "", $_COOKIE["last_algo"]);
$code = str_replace('@', ";", $code);
echo $code;
}
else
echo "<div>Afficher \"Hello World !\"</div>";
}*/
echo $_POST["programme"];
}
?>
</textarea></form>
<section id="debug">
@ -173,7 +148,6 @@
<p class="vars" id="var_z"></p>
</div>
<a href="publier.php" id="publier"><img style="border: 0px;" alt="Publier cet algorithme" title="Publier cet algorithme dans les exemples" src="Images/publier.png"/></a>
<img id="disable" src="Images/disable.png"/>
</article>
</div>

View File

@ -1,15 +1,3 @@
<?php
//Cette page permet d'initialiser le site en verifiant par exemple si le membre est connecté
session_start();
header('Content-type: text/html;charset=UTF-8');
if(!isset($_SESSION['username']) and isset($_COOKIE['username'], $_COOKIE['password']))
{
$cnn = mysql_query('select password,id from users where username="'.mysql_real_escape_string($_COOKIE['username']).'"');
$dn_cnn = mysql_fetch_array($cnn);
if(sha1($dn_cnn['password'])==$_COOKIE['password'] and mysql_num_rows($cnn)>0)
{
$_SESSION['username'] = $_COOKIE['username'];
$_SESSION['userid'] = $dn_cnn['id'];
}
}
?>

View File

@ -1 +0,0 @@
<a href='https://orderng02.ikoula.com/cp'>Lien</a>

View File

@ -1,123 +0,0 @@
<?php
//Cette page permet d'afficher la liste des messages personnels d'un membre
include('config.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - Messages Personnels</title>
</head>
<body>
<div id="content">
<?php include("menu.php"); ?>
<div class="content">
<?php
if(isset($_SESSION['username']))
{
$req1 = mysql_query('select m1.id, m1.title, m1.timestamp, count(m2.id) as reps, users.id as userid, users.username from pm as m1, pm as m2,users where ((m1.user1="'.$_SESSION['userid'].'" and m1.user1read="no" and users.id=m1.user2) or (m1.user2="'.$_SESSION['userid'].'" and m1.user2read="no" and users.id=m1.user1)) and m1.id2="1" and m2.id=m1.id group by m1.id order by m1.id desc');
$req2 = mysql_query('select m1.id, m1.title, m1.timestamp, count(m2.id) as reps, users.id as userid, users.username from pm as m1, pm as m2,users where ((m1.user1="'.$_SESSION['userid'].'" and m1.user1read="yes" and users.id=m1.user2) or (m1.user2="'.$_SESSION['userid'].'" and m1.user2read="yes" and users.id=m1.user1)) and m1.id2="1" and m2.id=m1.id group by m1.id order by m1.id desc');
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; Messages Personnels
</div>
<div class="box_right">
<a href="list_pm.php">Vos messages (<?php echo $nb_new_pm; ?>)</a> - <a href="login.php">Déconnexion</a>
</div>
<div class="clean"></div>
</div>
<a href="new_pm.php" class="button">Nouveau message priv&eacute;</a><br />
<h3>Messages non-lus(<?php echo intval(mysql_num_rows($req1)); ?>):</h3>
<table class="list_pm">
<tr>
<th class="title_cell">Titre</th>
<th>Réponses</th>
<th>Expéditeur</th>
<th>Date d'envoi</th>
</tr>
<?php
while($dn1 = mysql_fetch_array($req1))
{
?>
<tr>
<td class="left"><a href="read_pm.php?id=<?php echo $dn1['id']; ?>"><?php echo htmlentities($dn1['title'], ENT_QUOTES, 'UTF-8'); ?></a></td>
<td><?php echo $dn1['reps']-1; ?></td>
<td><a href="profile.php?id=<?php echo $dn1['userid']; ?>"><?php echo htmlentities($dn1['username'], ENT_QUOTES, 'UTF-8'); ?></a></td>
<td><?php echo date('d/m/Y H:i:s' ,$dn1['timestamp']); ?></td>
</tr>
<?php
}
if(intval(mysql_num_rows($req1))==0)
{
?>
<tr>
<td colspan="4" class="center">Vous n'avez aucun message non-lu.</td>
</tr>
<?php
}
?>
</table>
<br />
<h3>Messages lus(<?php echo intval(mysql_num_rows($req2)); ?>):</h3>
<table class="list_pm">
<tr>
<th class="title_cell">Titre</th>
<th>Réponses</th>
<th>Expéditeur</th>
<th>Date d'envoi</th>
</tr>
<?php
while($dn2 = mysql_fetch_array($req2))
{
?>
<tr>
<td class="left"><a href="read_pm.php?id=<?php echo $dn2['id']; ?>"><?php echo htmlentities($dn2['title'], ENT_QUOTES, 'UTF-8'); ?></a></td>
<td><?php echo $dn2['reps']-1; ?></td>
<td><a href="profile.php?id=<?php echo $dn2['userid']; ?>"><?php echo htmlentities($dn2['username'], ENT_QUOTES, 'UTF-8'); ?></a></td>
<td><?php echo date('d/m/Y H:i:s' ,$dn2['timestamp']); ?></td>
</tr>
<?php
}
if(intval(mysql_num_rows($req2))==0)
{
?>
<tr>
<td colspan="4" class="center">Vous n'avez aucun message lu.</td>
</tr>
<?php
}
?>
</table>
<?php
}
else
{
?>
Vous devez &ecirc;tre connect&eacute; pour acc&eacute;der &agrave; cette page.
<div class="box_login">
<form action="login.php" method="post">
<label for="username">Nom d'utilisateur</label><input type="text" name="username" id="username" /><br />
<label for="password">Mot de passe</label><input type="password" name="password" id="password" /><br />
<label for="memorize">Se souvenir</label><input type="checkbox" name="memorize" id="memorize" value="yes" />
<div class="center">
<input type="submit" value="Login" /> <input type="button" onclick="javascript:document.location='signup.php';" value="S'inscrire" />
</div>
</form>
</div>
<?php
}
?>
</div>
</body>
</div>
<?php include("bas_de_page.php"); ?>
</html>

View File

@ -1,127 +0,0 @@
<?php
//Cette page permet d'afficher la liste des sujets d'une categorie de forum
include('config.php');
if(isset($_GET['parent']))
{
$id = intval($_GET['parent']);
$dn1 = mysql_fetch_array(mysql_query('select count(c.id) as nb1, c.name,count(t.id) as topics from categories as c left join topics as t on t.parent="'.$id.'" where c.id="'.$id.'" group by c.id'));
if($dn1['nb1']>0)
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - <?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?></title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
</head>
<body>
<div id="content">
<?php include("menu.php"); ?>
<div class="content">
<?php
if(isset($_SESSION['username']))
{
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; <a href="list_topics.php?parent=<?php echo $id; ?>"><?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?></a>
</div>
<div class="box_right">
<a href="list_pm.php">Vos messages (<?php echo $nb_new_pm; ?>)</a> - <a href="forum.php">Déconnexion</a>
</div>
<div class="clean"></div>
</div>
<?php
}
else
{
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; <a href="list_topics.php?parent=<?php echo $id; ?>"><?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?></a>
</div>
<div class="box_right">
<a href="signup.php">Inscription</a> - <a href="forum.php">Connexion</a>
</div>
<div class="clean"></div>
</div>
<?php
}
if(isset($_SESSION['username']))
{
?>
<a href="new_topic.php?parent=<?php echo $id; ?>" class="button" style="margin-bottom: 15px;">Nouveau Sujet</a>
<?php
}
$dn2 = mysql_query('select t.id, t.title, t.authorid, u.username as author, count(r.id) as replies from topics as t left join topics as r on r.parent="'.$id.'" and r.id=t.id and r.id2!=1 left join users as u on u.id=t.authorid where t.parent="'.$id.'" and t.id2=1 group by t.id order by t.timestamp2 desc');
if(mysql_num_rows($dn2)>0)
{
?>
<table class="topics_table">
<tr>
<th class="forum_tops">Sujet</th>
<th class="forum_auth">Auteur</th>
<th class="forum_nrep">Réponses</th>
<?php
if(isset($_SESSION['username']) and $_SESSION['username']==$admin)
{
?>
<th class="forum_act">Action</th>
<?php
}
?>
</tr>
<?php
while($dnn2 = mysql_fetch_array($dn2))
{
?>
<tr>
<td class="forum_tops"><a href="read_topic.php?id=<?php echo $dnn2['id']; ?>"><?php echo htmlentities($dnn2['title'], ENT_QUOTES, 'UTF-8'); ?></a></td>
<td><a href="profile.php?id=<?php echo $dnn2['authorid']; ?>"><?php echo htmlentities($dnn2['author'], ENT_QUOTES, 'UTF-8'); ?></a></td>
<td><?php echo $dnn2['replies']; ?></td>
<?php
if(isset($_SESSION['username']) and $_SESSION['username']==$admin)
{
?>
<td><a href="delete_topic.php?id=<?php echo $dnn2['id']; ?>"><img src="<?php echo $design; ?>/Images/delete.png" alt="Delete" /></a></td>
<?php
}
?>
</tr>
<?php
}
?>
</table>
<?php
}
else
{
?>
<div class="message">Cette catégorie ne contient aucun sujet.</div>
<?php
}
?>
</div>
</div>
</body>
<?php include("bas_de_page.php"); ?>
</html>
<?php
}
else
{
echo '<h2>La catégorie que vous désirez visiter n\'existe pas.</h2>';
}
}
else
{
echo '<h2>L\'identifiant de la catégorie que vous désirez visiter n\'est pas défini.</h2>';
}
?>

View File

@ -1,61 +0,0 @@
<?php
//Cette page permet aux utilisateurs de se connecter ou de se deconnecter
include('config.php');
if(isset($_SESSION['username']))
{
unset($_SESSION['username'], $_SESSION['userid']);
setcookie('username', '', time()-100);
setcookie('password', '', time()-100);
}
else
{
$ousername = '';
if(isset($_POST['username'], $_POST['password']))
{
if(get_magic_quotes_gpc())
{
$ousername = stripslashes($_POST['username']);
$username = mysql_real_escape_string(stripslashes($_POST['username']));
$password = stripslashes($_POST['password']);
}
else
{
$username = mysql_real_escape_string($_POST['username']);
$password = $_POST['password'];
}
$req = mysql_query('select password,id from users where username="'.$username.'"');
$dn = mysql_fetch_array($req);
if($dn['password']==$password and mysql_num_rows($req)>0)
{
$form = false;
$_SESSION['username'] = $_POST['username'];
$_SESSION['userid'] = $dn['id'];
if(isset($_POST['memorize']) and $_POST['memorize']=='yes')
{
$one_year = time()+(60*60*24*365);
setcookie('username', $_POST['username'], $one_year);
setcookie('password', sha1($password), $one_year);
}
}
else
{
$form = true;
}
}
else
{
$form = true;
}
if($form)
{
if(isset($message))
{
echo '<div class="message">'.$message.'</div>';
}
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
}
}
echo '<script language="Javascript">document.location.replace("forum.php");</script>';
?>

2343
mail.php

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,3 @@
<!--[if lt IE 9]>
<?php echo '<script language="Javascript">document.location.replace("ie8.php");</script>'; ?>
<![endif]-->
<span id="menus">
<header>
<link rel="stylesheet" href="menu.css" />
@ -18,8 +15,7 @@
<p id="navigation"><img src="Images/Navigation.png"/></p>
<h1><a href="<?= $base_url ?>"><p class="Ecriture_onglet" id="Ecriture_onglet1">Programmation</p></a></h1>
<h1><a href="exemples.php"><p class="Ecriture_onglet" id="Ecriture_onglet2">Exemples</p></a></h1>
<h1><a href="forum.php"><p class="Ecriture_onglet" id="Ecriture_onglet3">Forum</p></a></h1>
<h1><a href="aide.php#top"><p class="Ecriture_onglet" id="Ecriture_onglet4">Aide</p></a></h1>
<h1><a href="a_propos.php"><p class="Ecriture_onglet" id="Ecriture_onglet5">A propos</p></a></h1>
<h1><a href="aide.php#top"><p class="Ecriture_onglet" id="Ecriture_onglet3">Aide</p></a></h1>
<h1><a href="a_propos.php"><p class="Ecriture_onglet" id="Ecriture_onglet4">A propos</p></a></h1>
</nav>
<span/>

View File

@ -1,36 +0,0 @@
<?php
include('config.php');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<script src="jquery.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - Contact</title>
</head>
<body>
<div id="content">
<?php include("menu.php");?>
<div id="contenu">
<?php
if(isset($_POST['nom'], $_POST['mail'], $_POST['objet'], $_POST['message']) && $_POST['nom'] != "" && $_POST['mail'] != "" && $_POST['objet'] != "" && $_POST['message'] != "")
{
mail('contact@festivalgo.fr', $_POST['objet']." - ".$_POST['nom'], $_POST['nom']."\n".$_POST['mail']."\n\n".$_POST['message']."\n\n".$_POST['description']."\n\n".$_POST['code']."\n\n>>> https://vmheb49238.ikoula.com:8443/smb/email-address/list# <<<");
echo "<div class='message'>Votre Message à été envoyé.<br />Vous recevrez une réponse par mail.</div>";
}
else
{
echo "<div class='message'>Vous n'avez pas rempli tous les champs du formulaire.</div>";
}
?>
</div>
</div>
<?php include("bas_de_page.php"); ?>
</body>
</html>

View File

@ -1,64 +0,0 @@
<?php
//Cette page permet de modifier l'ordre des categories
include('config.php');
if(isset($_GET['id'], $_GET['action']) and ($_GET['action']=='up' or $_GET['action']=='down'))
{
$id = intval($_GET['id']);
$action = $_GET['action'];
$dn1 = mysql_fetch_array(mysql_query('select count(c.id) as nb1, c.position, count(c2.id) as nb2 from categories as c, categories as c2 where c.id="'.$id.'" group by c.id'));
if($dn1['nb1']>0)
{
if(isset($_SESSION['username']) and $_SESSION['username']==$admin)
{
if($action=='up')
{
if($dn1['position']>1)
{
if(mysql_query('update categories as c, categories as c2 set c.position=c.position-1, c2.position=c2.position+1 where c.id="'.$id.'" and c2.position=c.position-1'))
{
header('Location: '.$url_home);
}
else
{
echo 'Une erreur s\'est produite lors du déplacement de la catégorie.';
}
}
else
{
echo '<h2>L\'action que vous désirez effectuer est impossible.</h2>';
}
}
else
{
if($dn1['position']<$dn1['nb2'])
{
if(mysql_query('update categories as c, categories as c2 set c.position=c.position+1, c2.position=c2.position-1 where c.id="'.$id.'" and c2.position=c.position+1'))
{
header('Location: '.$url_home);
}
else
{
echo 'Une erreur s\'est produite lors du déplacement de la catégorie.';
}
}
else
{
echo '<h2>L\'action que vous désirez effectuer est impossible.</h2>';
}
}
}
else
{
echo '<h2>Vous devez être connecté en tant qu\'administrateur pour accéder à cette page: <a href="login.php">Connexion</a> - <a href="signup.php">Inscription</a></h2>';
}
}
else
{
echo '<h2>La catégorie que vous désirez déplacer n\'existe pas.</h2>';
}
}
else
{
echo '<h2>L\'identifiant de la catégorie ou la direction du déplacement ne sont pas définis.</h2>';
}
?>

View File

@ -1,78 +0,0 @@
<?php
//Cette page permet d'ajouter une categorie
include('config.php');
if(isset($_SESSION['username']) and $_SESSION['username']==$admin)
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<title>Nouvelle catégorie - forum</title>
</head>
<body>
<div class="header">
<a href="<?php echo $url_home; ?>"><img src="<?php echo $design; ?>/Images/logo.png" alt="forum" /></a>
</div>
<div class="content">
<?php
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; Nouvelle catégorie
</div>
<div class="box_right">
<a href="list_pm.php">Vos messages (<?php echo $nb_new_pm; ?>)</a> - <a href="profile.php?id=<?php echo $_SESSION['userid']; ?>"><?php echo htmlentities($_SESSION['username'], ENT_QUOTES, 'UTF-8'); ?></a> (<a href="login.php">Déconnexion</a>)
</div>
<div class="clean"></div>
</div>
<?php
if(isset($_POST['name'], $_POST['description']) and $_POST['name']!='')
{
$name = $_POST['name'];
$description = $_POST['description'];
if(get_magic_quotes_gpc())
{
$name = stripslashes($name);
$description = stripslashes($description);
}
$name = mysql_real_escape_string($name);
$description = mysql_real_escape_string($description);
if(mysql_query('insert into categories (id, name, description, position) select ifnull(max(id), 0)+1, "'.$name.'", "'.$description.'", count(id)+1 from categories'))
{
?>
<div class="message">La catégorie a bien été créée.<br />
<a href="<?php echo $url_home; ?>">Retourner à l'index du forum</a></div>
<?php
}
else
{
echo 'Une erreur s\'est produite lors de la création de la catégorie.';
}
}
else
{
?>
<form action="new_category.php" method="post">
<label for="name">Nom</label><input type="text" name="name" id="name" /><br />
<label for="description">Description</label>(html accepté)<br />
<textarea name="description" id="description" cols="70" rows="6"></textarea><br />
<input type="submit" value="Créer" />
</form>
<?php
}
?>
</div>
<div class="foot"><a href="http://www.supportduweb.com/scripts_tutoriaux-code-source-89-simple-php-forum-script-forum-en-php-facile-simple-script-code-telecharger-forum-php-gratuit-mysql.html">Simple PHP forum Script</a> - <a href="http://www.supportduweb.com/">Support du Web</a></div>
</body>
</html>
<?php
}
else
{
echo '<h2>Vous devez être connecté en tant qu\'administrateur pour accéder à cette page: <a href="login.php">Connexion</a> - <a href="signup.php">Inscription</a></h2>';
}
?>

View File

@ -1,135 +0,0 @@
<?php
//Cette page permet d'envoyer un message privé
include('config.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - Nouveau Message Personnel</title>
</head>
<body>
<div id="content" style="height = 500px">
<?php include("menu.php"); ?>
<?php
if(isset($_SESSION['username']))
{
$form = true;
$otitle = '';
$orecip = '';
$omessage = '';
if(isset($_POST['title'], $_POST['recip'], $_POST['message']))
{
$otitle = $_POST['title'];
$orecip = $_POST['recip'];
$omessage = $_POST['message'];
//On enleve lechappement si get_magic_quotes_gpc est active
if(get_magic_quotes_gpc())
{
$otitle = stripslashes($otitle);
$orecip = stripslashes($orecip);
$omessage = stripslashes($omessage);
}
if($_POST['title']!='' and $_POST['recip']!='' and $_POST['message']!='')
{
$title = mysql_real_escape_string($otitle);
$recip = mysql_real_escape_string($orecip);
$message = mysql_real_escape_string(nl2br(htmlentities($omessage, ENT_QUOTES, 'UTF-8')));
$dn1 = mysql_fetch_array(mysql_query('select count(id) as recip, id as recipid, (select count(*) from pm) as npm from users where username="'.$recip.'"'));
if($dn1['recip']==1)
{
if($dn1['recipid']!=$_SESSION['userid'])
{
$id = $dn1['npm']+1;
if(mysql_query('insert into pm (id, id2, title, user1, user2, message, timestamp, user1read, user2read)values("'.$id.'", "1", "'.$title.'", "'.$_SESSION['userid'].'", "'.$dn1['recipid'].'", "'.$message.'", "'.time().'", "yes", "no")'))
{
?>
<div class="message">Le message a bien &eacute;t&eacute; envoy&eacute;.<br />
<a href="list_pm.php">Liste de mes messages priv&eacute;s</a></div>
<?php
$form = false;
}
else
{
$error = 'Une erreur s\'est produite lors de l\'envoi du message.';
}
}
else
{
$error = 'Vous ne pouvez pas envoyer un message &agrave; vous m&ecirc;me.';
}
}
else
{
$error = 'Le destinataire de votre message n\'existe pas.';
}
}
else
{
$error = 'Un des champs n\'est pas rempli.';
}
}
elseif(isset($_GET['recip']))
{
$orecip = $_GET['recip'];
}
if($form)
{
if(isset($error))
{
echo '<div class="message">'.$error.'</div>';
}
?>
<div class="content">
<?php
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; <a href="list_pm.php">Messages Personnels</a> &gt; Nouveau Message
</div>
<div class="box_right">
<a href="list_pm.php">Vos messages (<?php echo $nb_new_pm; ?>)</a> - <a href="login.php">Déconnexion</a>
</div>
<div class="clean"></div>
</div>
<h1>Nouveau message priv&eacute;</h1><br /><br /><br />
<form action="new_pm.php" method="post" style="text-align: left; margin-left: 170px;">
<label for="title">Titre</label><input type="text" value="<?php echo htmlentities($otitle, ENT_QUOTES, 'UTF-8'); ?>" id="title" name="title" /><br />
<label for="recip">Destinataire<span class="small">(Nom d'utilisateur)</span></label><input type="text" value="<?php echo htmlentities($orecip, ENT_QUOTES, 'UTF-8'); ?>" id="recip" name="recip" /><br />
<label for="message">Message</label><textarea cols="60" rows="6" id="message" name="message"><?php echo htmlentities($omessage, ENT_QUOTES, 'UTF-8'); ?></textarea><br />
<input type="submit" value="Envoyer" style="margin-left: 170px;"/>
</form>
</div>
<?php
}
}
else
{
?>
<div class="message">Vous devez &ecirc;tre connect&eacute; pour acc&eacute;der &agrave; cette page.</div>
<div class="box_login">
<form action="login.php" method="post">
<label for="username">Nom d'utilisateur</label><input type="text" name="username" id="username" /><br />
<label for="password">Mot de passe</label><input type="password" name="password" id="password" /><br />
<label for="memorize">Se souvenir</label><input type="checkbox" name="memorize" id="memorize" value="yes" />
<div class="center">
<input type="submit" value="Login" /> <input type="button" onclick="javascript:document.location='signup.php';" value="S'inscrire" />
</div>
</form>
</div>
<?php
}
?>
</span>
</span>
</div>
</body>
<?php include("bas_de_page.php"); ?>
</html>

View File

@ -1,130 +0,0 @@
<?php
//Cette page permet de répondre à un sujet
include('config.php');
include_once 'mail.php';
if(isset($_GET['id']))
{
$id = intval($_GET['id']);
if(isset($_SESSION['username']))
{
$dn1 = mysql_fetch_array(mysql_query('select count(t.id) as nb1, t.title, t.parent, c.name from topics as t, categories as c where t.id="'.$id.'" and t.id2=1 and c.id=t.parent group by t.id'));
if($dn1['nb1']>0)
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - <?php echo htmlentities($dn1['title'], ENT_QUOTES, 'UTF-8'); ?></title>
<script type="text/javascript" src="functions.js"></script>
</head>
<body>
<div id="content">
<?php include("menu.php"); ?>
<div class="content">
<?php
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; <a href="list_topics.php?parent=<?php echo $dn1['parent']; ?>"><?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?></a> &gt; <a href="read_topic.php?id=<?php echo $id; ?>"><?php echo htmlentities($dn1['title'], ENT_QUOTES, 'UTF-8'); ?></a> &gt; Répondre
</div>
<div class="box_right">
<a href="list_pm.php">Vos messages (<?php echo $nb_new_pm; ?>)</a> - <a href="login.php">Déconnexion</a>
</div>
<div class="clean"></div>
</div>
<?php
if(isset($_POST['message']) and $_POST['message']!='')
{
include('bbcode_function.php');
$message = $_POST['message'];
if(get_magic_quotes_gpc())
{
$message = stripslashes($message);
}
$message = mysql_real_escape_string(bbcode_to_html($message));
$time1 = time();
if(mysql_query('insert into topics (parent, id, id2, title, message, authorid, timestamp, timestamp2) select "'.$dn1['parent'].'", "'.$id.'", max(id2)+1, "", "'.$message.'", "'.$_SESSION['userid'].'", "'.$time1.'", "'.time().'" from topics where id="'.$id.'"') and mysql_query('update topics set timestamp2="'.time().'" where id="'.$id.'" and id2=1'))
{
$req = mysql_fetch_array(mysql_query('select username from users where id = '.$_SESSION['userid']));
$req2 = mysql_fetch_array(mysql_query('select id from topics where timestamp = '.$time1));
$message =
$req['username']." a posté un nouveau message sur le forum<br /><br /><i>"
.$_POST['message']."</i><br /><br />
<center><b><a href='".$base_url."/read_topic.php?id=".$req2['id']."'>>>> lien <<<</a></b></center>
";
send_mail("bruno-godefroy@sfr.fr", "Nouveau message sur Festiv'Algo", $message);
?>
<div class="message">Le message a bien &eacute;t&eacute; envoy&eacute;.<br />
<a href="read_topic.php?id=<?php echo $id; ?>">Retourner au sujet</a></div>
<?php
}
else
{
echo 'Une erreur s\'est produite lors de l\'envoi du message.';
}
}
else
{
?>
<form action="new_reply.php?id=<?php echo $id; ?>" method="post">
<div class="message_buttons">
<input type="button" value="Gras" onclick="javascript:insert('[b]', '[/b]', 'message');" /><!--
--><input type="button" value="Italique" onclick="javascript:insert('[i]', '[/i]', 'message');" /><!--
--><input type="button" value="Souligne" onclick="javascript:insert('[u]', '[/u]', 'message');" /><!--
--><input type="button" value="Gauche" onclick="javascript:insert('[left]', '[/left]', 'message');" /><!--
--><input type="button" value="Centre" onclick="javascript:insert('[center]', '[/center]', 'message');" /><!--
--><input type="button" value="Droite" onclick="javascript:insert('[right]', '[/right]', 'message');" />
</div>
<textarea name="message" id="message" cols="70" rows="6"></textarea><br />
<input type="submit" value="Envoyer" />
</form>
<?php
}
?>
</div>
</span>
</span>
</div>
</body>
<?php include("bas_de_page.php"); ?>
</html>
<?php
}
else
{
echo '<h2>Le sujet auquel vous désirez répondre n\'existe pas.</h2>';
}
}
else
{
?>
<h2>Vous devez être connecté pour accéder à cette page:</h2>
<div class="box_login">
<form action="login.php" method="post">
<label for="username">Nom d'utilisateur</label><input type="text" name="username" id="username" /><br />
<label for="password">Mot de passe</label><input type="password" name="password" id="password" /><br />
<label for="memorize">Se souvenir</label><input type="checkbox" name="memorize" id="memorize" value="yes" />
<div class="center">
<input type="submit" value="Login" /> <input type="button" onclick="javascript:document.location='signup.php';" value="S'inscrire" />
</div>
</form>
</div>
<?php
}
}
else
{
echo '<h2>L\'identifiant du sujet auquel vous désirez répondre n\'est pas défini.</h2>';
}
?>

View File

@ -1,119 +0,0 @@
<?php
//Cette page permet d'ajouter un sujet
include('config.php');
include_once 'mail.php';
if(isset($_GET['parent']))
{
$id = intval($_GET['parent']);
if(isset($_SESSION['username']))
{
$dn1 = mysql_fetch_array(mysql_query('select count(c.id) as nb1, c.name from categories as c where c.id="'.$id.'"'));
if($dn1['nb1']>0)
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - Nouveau Sujet</title>
<script type="text/javascript" src="functions.js"></script>
</head>
<body>
<div id="content">
<?php include("menu.php"); ?>
<div class="content">
<?php
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; <a href="list_topics.php?parent=<?php echo $id; ?>"><?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?></a> &gt; Nouveau Sujet
</div>
<div class="box_right">
<a href="list_pm.php">Vos messages (<?php echo $nb_new_pm; ?>)</a> - <a href="login.php">Déconnexion</a>
</div>
<div class="clean"></div>
</div>
<?php
if(isset($_POST['message'], $_POST['title']) and $_POST['message']!='' and $_POST['title']!='')
{
include('bbcode_function.php');
$title = $_POST['title'];
$message = $_POST['message'];
if(get_magic_quotes_gpc())
{
$title = stripslashes($title);
$message = stripslashes($message);
}
$title = mysql_real_escape_string($title);
$message = mysql_real_escape_string(bbcode_to_html($message));
$time1 = time();
if(mysql_query('insert into topics (parent, id, id2, title, message, authorid, timestamp, timestamp2) select "'.$id.'", ifnull(max(id), 0)+1, "1", "'.$title.'", "'.$message.'", "'.$_SESSION['userid'].'", "'.$time1.'", "'.time().'" from topics'))
{
$req = mysql_fetch_array(mysql_query('select username from users where id = '.$_SESSION['userid']));
$req2 = mysql_fetch_array(mysql_query('select id from topics where timestamp = '.$time1));
$message = "
Un nouveau topic a été créé sur le forum : \"".$_POST['title']."\" de ".$req['username'].".<br /><br /><i>"
.$_POST['message']."</i><br /><br />
<center><b><a href='".$base_url."/read_topic.php?id=".$req2['id']."'>>>> lien <<<</a></b></center>
";
send_mail("bruno-godefroy@sfr.fr", "Nouveau topic sur Festiv'Algo", $message);
?>
<div class="message">Le sujet a bien &eacute;t&eacute; créé.<br />
<a href="list_topics.php?parent=<?php echo $id; ?>">Retourner au forum</a></div>
<?php
}
else
{
echo 'Une erreur s\'est produite lors de la création du sujet.';
}
}
else
{
?>
<form action="new_topic.php?parent=<?php echo $id; ?>" method="post">
<label style="width: 60px;" for="title">Titre</label><input type="text" name="title" id="title" /><br /><br />
<div class="message_buttons">
<input type="button" value="Gras" onclick="javascript:insert('[b]', '[/b]', 'message');" /><!--
--><input type="button" value="Italique" onclick="javascript:insert('[i]', '[/i]', 'message');" /><!--
--><input type="button" value="Souligne" onclick="javascript:insert('[u]', '[/u]', 'message');" /><!--
--><input type="button" value="Image" onclick="javascript:insert('[img]', '[/img]', 'message');" /><!--
--><input type="button" value="Lien" onclick="javascript:insert('[url]', '[/url]', 'message');" /><!--
--><input type="button" value="Gauche" onclick="javascript:insert('[left]', '[/left]', 'message');" /><!--
--><input type="button" value="Centre" onclick="javascript:insert('[center]', '[/center]', 'message');" /><!--
--><input type="button" value="Droite" onclick="javascript:insert('[right]', '[/right]', 'message');" />
</div>
<textarea name="message" id="message" cols="70" rows="6" style="resize: none;"></textarea><br />
<input type="submit" value="Envoyer" />
</form>
<?php
}
?>
</div>
</div>
</body>
<?php include("bas_de_page.php"); ?>
</html>
<?php
}
else
{
echo '<h2>La catégorie dans laquelle vous désirez ajouter un sujet n\'existe pas.</h2>';
}
}
}
else
{
echo '<h2>L\'identifiant dans laquelle vous désirez ajouter un sujet n\'est pas défini.</h2>';
}
?>

View File

@ -1,114 +0,0 @@
<?php
//Cette page permet d'afficher le profil d'un membre
include('config.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - Profil</title>
</head>
<body>
<div id="content">
<?php include("menu.php"); ?>
<div class="content">
<?php
if(isset($_SESSION['username']))
{
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; <a href="users.php">Liste des utilisateurs</a> &gt; Profil
</div>
<div class="box_right">
<a href="list_pm.php">Vos messages (<?php echo $nb_new_pm; ?>)</a> - <a href="login.php">Déconnexion</a>
</div>
<div class="clean"></div>
</div>
<?php
}
else
{
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; <a href="users.php">Liste des utilisateurs</a> &gt; Profil
</div>
<div class="box_right">
<a href="signup.php">Inscription</a> - <a href="login.php">Connexion</a>
</div>
<div class="clean"></div>
</div>
<?php
}
if(isset($_GET['id']))
{
$id = intval($_GET['id']);
$dn = mysql_query('select username, level, avatar, signup_date from users where id="'.$id.'"');
if(mysql_num_rows($dn)>0)
{
$dnn = mysql_fetch_array($dn);
?>
<table style="width:500px;">
<tr>
<td>
</td>
<td class="left"><h1><?php echo htmlentities($dnn['username'], ENT_QUOTES, 'UTF-8'); ?></h1><br />
Statut : <?php
switch($dnn['level'])
{
case 1:
echo "Nouveau";
break;
case 2:
echo "Membre";
break;
case 3:
echo "Vétéran";
break;
case 4:
echo "Modérateur";
break;
case 5:
echo "Administrateur";
break;
case 6:
echo "Game-master";
break;
}
?><br />
Date d'inscription : <?php echo date('d/m/Y',$dnn['signup_date']); ?></td>
</tr>
</table>
<?php
if(isset($_SESSION['username']) and $_SESSION['username']!=$dnn['username'])
{
?>
<br /><a href="new_pm.php?recip=<?php echo urlencode($dnn['username']); ?>" class="big">Envoyer un MP à "<?php echo htmlentities($dnn['username'], ENT_QUOTES, 'UTF-8'); ?>"</a>
<?php
}
}
else
{
echo 'Cet utilisateur n\'existe pas.';
}
}
else
{
echo 'L\'identifiant de l\'utilisateur n\'est pas d&eacute;fini.';
}
?>
</div>
</body>
</div>
<?php include("bas_de_page.php"); ?>
</html>

View File

@ -1,3 +0,0 @@
<div class="pub4">
<script for=window language="JScript" src="https://www.pubdirecte.com/script/banniere.php?id=73608&ref=43885"></script>
</div>

View File

@ -1,81 +0,0 @@
$(document).ready(function() {
var texte = readCookie("algorithme");
if(texte == "failed")
document.location.href="algo_soumis.php";
while(texte.indexOf("@") != -1)
texte = texte.replace("@",";");
var balises = [
"<font", "</font",
"<p", "</p",
"<a", "</a",
"<b", "</b",
"<i", "</i",
"<u", "</u",
"<br ",
"<div ",
"<span ",
];
while(texte.indexOf("&nbsp;") != -1)
texte = texte.replace("&nbsp;","");
for(var k = 0; k < 15; k++)
{
while(texte.indexOf(balises[k]) != -1)
{
var start, end;
start = texte.indexOf(balises[k], 0);
end = texte.indexOf(">", start);
if(start != -1 && end != -1)
{
if(k < 13)
texte = texte.substring(0, start) + texte.substring(end + 1, texte.length);
else
texte = texte.substring(0, start) + balises[k].substring(0, balises[k].length - 1) + ">" + texte.substring(end + 1, texte.length);
}
}
}
while(texte.indexOf("<span>") != -1)
texte = texte.replace("<span>","<div>");
while(texte.indexOf("</span>") != -1)
texte = texte.replace("</span>","</div>");
$('#code').replaceWith("<div id='code'>" + texte + "</div>");
while(texte.indexOf(";") != -1)
texte = texte.replace(";","@");
while(texte.indexOf("+") != -1)
texte = texte.replace("+","¤");
createCookie("algo",texte,1);
});
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value;
}

View File

@ -1,53 +0,0 @@
<?php
include('config.php');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<link rel="stylesheet" type="text/css" href="exemples.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<script type="text/javascript" src="functions.js"></script>
<script type="text/javascript" src="publier.js"></script>
<script src="jquery.js"></script>
<script type="text/javascript" src="jquery.cleditor.min.js"></script>
<script type="text/javascript" src="jquery.cleditor.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - Publier un algorithme</title>
</head>
<body>
<div id="content">
<?php include("menu.php");?>
<div id="contenu">
<article>
<form action="algo_soumis.php" method="post">
<h4 class="publier_titres" for="title">Auteur</h4>
<input type="text" name="auteur" id="auteur" style="display: block; margin-left: 198px;" /><br />
<h4 class="publier_titres" for="title">E-mail</h4>
<input type="text" name="mail" id="mail" style="display: block; margin-left: 198px;" /><br />
<h4 class="publier_titres" for="title">Titre</h4>
<input type="text" name="titre" id="titre" style="display: block; margin-left: 198px;" /><br /><br />
<h4 class="publier_titres" for="title">Description</h4>
<textarea name="description" id="description" cols="70" rows="6" style="resize: none;"></textarea><br /><br />
<h4 class="publier_titres" for="title">Algorithme</h4>
<div id="code"></div><br /><br /><br />
<div id="avertissement">
En soumettant ainsi un algorithme, vous vous engagez à :
<ul>
<li>Avoir vérifié que celui-ci n'existe pas déjà dans les exemples</li>
<li>Posséder les droits sur cet algorithme</li>
<li>Avoir vérifié que cet algorithme fonctionne parfaitement</li>
<li>Ne divulguer aucune publicité ou contenu choquant.</li>
</ul>
</div><br /><br />
<input id="submit" type="submit" value="Soumettre" />
</form>
</article>
</div>
</div>
<?php include("bas_de_page.php"); ?>
</body>
</html>

View File

@ -1,9 +0,0 @@
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value;
}

View File

@ -1,54 +0,0 @@
<?php
include('config.php');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<link rel="stylesheet" type="text/css" href="exemples.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<script type="text/javascript" src="functions.js"></script>
<script type="text/javascript" src="publier_admin.js"></script>
<script type="text/javascript" src="jquery.cleditor.min.js"></script>
<script type="text/javascript" src="jquery.cleditor.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - Publier un algorithme</title>
</head>
<body>
<div id="content">
<?php include("menu.php");
$req = mysql_fetch_array(mysql_query('select titre, auteur, mail, description, programme from exemples_en_attente where id = "'.$_GET['id'].'"'));
echo "<script>createCookie('last_algo','".$req['programme']."',30); createCookie('last_language',1,30);</script>";
?>
<div id="contenu">
<article>
<form action="algo_soumis_admin.php?id=<?php echo $_GET['id'] ?>" method="post">
<h4 class="publier_titres" for="title">Auteur</h4>
<input value="<?php echo $req['auteur'] ?>" type="text" name="auteur" id="auteur" style="display: block; margin-left: 198px;" /><br />
<h4 class="publier_titres" for="title">E-mail</h4>
<input value="<?php echo $req['mail'] ?>" type="text" name="mail" id="mail" style="display: block; margin-left: 198px;" /><br />
<h4 class="publier_titres" for="title">Titre</h4>
<input value="<?php echo $req['titre'] ?>" type="text" name="titre" id="titre" style="display: block; margin-left: 198px;" /><br /><br />
<h4 class="publier_titres" for="title">Description</h4>
<textarea name="description" id="description" cols="70" rows="6" style="resize: none;"><?php echo $req['description'] ?></textarea><br /><br />
<h4 class="publier_titres" for="title">Algorithme</h4>
<textarea name="code" id="code" cols="70" rows="6" style="margin-left: -160px;"><?php echo $req['programme'] ?></textarea><br />
<br /><div style='text-align: left; margin-left: 198px;'><div>
<?php echo $req['programme']; ?>
</div></div><br />
<center><a style="font-size: 20px; color: red;" href="<?= $base_url ?>" target="_blank">>>> Tester <<<</a></center><br />
<h4 class="publier_titres" for="title">Mot de passe</h4>
<input type="password" name="mdp" id="mdp" style="display: block; margin-left: 198px;" /><br /><br />
<u><a style="margin-left: -534px; font-size: 12px; color: blue;" href="<?= $base_url ?>/refus_publication.php?id=<?php echo $_GET['id'] ?>&case=1">Contenu inintéressant</a><br />
<a style="margin-left: -587px; font-size: 12px; color: blue;" href="<?= $base_url ?>/refus_publication.php?id=<?php echo $_GET['id'] ?>&case=2">Existe déjà</a></u><br /><br />
<center><input id="submit" type="submit" value="Soumettre" /></center>
</form>
</article>
</div>
</div>
<?php include("bas_de_page.php"); ?>
</body>
</html>

View File

@ -1,175 +0,0 @@
<?php
//Cette page permet de lire un message prive
include('config.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - Lecture d'un MP</title>
</head>
<body>
<div id="content" style="height = 500px">
<?php include("menu.php"); ?>
<?php
if(isset($_SESSION['username']))
{
if(isset($_GET['id']))
{
$id = intval($_GET['id']);
$req1 = mysql_query('select title, user1, user2 from pm where id="'.$id.'" and id2="1"');
$dn1 = mysql_fetch_array($req1);
if(mysql_num_rows($req1)==1)
{
if($dn1['user1']==$_SESSION['userid'] or $dn1['user2']==$_SESSION['userid'])
{
if($dn1['user1']==$_SESSION['userid'])
{
mysql_query('update pm set user1read="yes" where id="'.$id.'" and id2="1"');
$user_partic = 2;
}
else
{
mysql_query('update pm set user2read="yes" where id="'.$id.'" and id2="1"');
$user_partic = 1;
}
$req2 = mysql_query('select pm.timestamp, pm.message, users.id as userid, users.username, users.avatar from pm, users where pm.id="'.$id.'" and users.id=pm.user1 order by pm.id2');
if(isset($_POST['message']) and $_POST['message']!='')
{
$message = $_POST['message'];
//On enleve lechappement si get_magic_quotes_gpc est active
if(get_magic_quotes_gpc())
{
$message = stripslashes($message);
}
//On echape le message pour pouvoir le mettre dans une requette SQL
$message = mysql_real_escape_string(nl2br(htmlentities($message, ENT_QUOTES, 'UTF-8')));
//On envoi la reponse et le statut de la discution passe a non-lu pour lautre utilisateur
if(mysql_query('insert into pm (id, id2, title, user1, user2, message, timestamp, user1read, user2read)values("'.$id.'", "'.(intval(mysql_num_rows($req2))+1).'", "", "'.$_SESSION['userid'].'", "", "'.$message.'", "'.time().'", "", "")') and mysql_query('update pm set user'.$user_partic.'read="yes" where id="'.$id.'" and id2="1"'))
{
?>
<div class="message">Votre message a bien &eacute;t&eacute; envoy&eacute;.<br />
<a href="read_pm.php?id=<?php echo $id; ?>">Retour &agrave; la discussion</a></div>
<?php
}
else
{
?>
<div class="message">Une erreur c'est produite lors de l'envoi du message.<br />
<a href="read_pm.php?id=<?php echo $id; ?>">Retour &agrave; la discussion</a></div>
<?php
}
}
else
{
//On affiche la liste des messages
?>
<div class="content">
<?php
if(isset($_SESSION['username']))
{
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; <a href="list_pm.php">Messages Personnels</a> &gt; Lecture
</div>
<div class="box_right">
<a href="list_pm.php">Vos messages (<?php echo $nb_new_pm; ?>)</a> - <a href="login.php">Déconnexion</a>
</div>
<div class="clean"></div>
</div>
<?php
}
else
{
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; <a href="list_pm.php">Messages Personnels</a> &gt; Lecture
</div>
<div class="box_right">
<a href="signup.php">Inscription</a> - <a href="login.php">Connexion</a>
</div>
<div class="clean"></div>
</div>
<?php
}
?>
<h1><?php echo $dn1['title']; ?></h1>
<table class="messages_table">
<tr>
<th class="author">Utilisateur</th>
<th>Message</th>
</tr>
<?php
while($dn2 = mysql_fetch_array($req2))
{
?>
<tr>
<td class="author center"><?php
if($dn2['avatar']!='')
{
echo '<img src="'.htmlentities($dn2['avatar']).'" alt="Image Perso" style="max-width:100px;max-height:100px;" />';
}
?><br /><a href="profile.php?id=<?php echo $dn2['userid']; ?>"><?php echo $dn2['username']; ?></a></td>
<td class="left"><div class="date"><?php echo date('d/m/Y H:i:s' ,$dn2['timestamp']); ?></div>
<?php echo $dn2['message']; ?></td>
</tr>
<?php
}
?>
</table><br />
<h2>R&eacute;pondre</h2>
<div class="center">
<form action="read_pm.php?id=<?php echo $id; ?>" method="post">
<textarea cols="80" rows="6" name="message" id="message" style="resize: none;"></textarea><br />
<input type="submit" value="Envoyer" />
</form>
</div>
</div>
<?php
}
}
else
{
echo '<div class="message">Vous n\'avez pas le droit d\'acc&eacute;der &agrave; cette page.</div>';
}
}
else
{
echo '<div class="message">Ce message n\'existe pas.</div>';
}
}
else
{
echo '<div class="message">L\'identifiant du message n\'est pas d&eacute;fini.</div>';
}
}
else
{
?>
<div class="message">Vous devez &ecirc;tre connect&eacute; pour acc&eacute;der &agrave; cette page:</div>
<div class="box_login">
<form action="login.php" method="post">
<label for="username">Nom d'utilisateur</label><input type="text" name="username" id="username" /><br />
<label for="password">Mot de passe</label><input type="password" name="password" id="password" /><br />
<label for="memorize">Se souvenir</label><input type="checkbox" name="memorize" id="memorize" value="yes" />
<div class="center">
<input type="submit" value="Login" /> <input type="button" onclick="javascript:document.location='signup.php';" value="S'inscrire" />
</div>
</form>
</div>
<?php
}
?>
</div>
</body>
<?php include("bas_de_page.php"); ?>
</html>

View File

@ -1,112 +0,0 @@
<?php
//Cette page permet d'afficher le contenu d'un sujet
include('config.php');
if(isset($_GET['id']))
{
$id = intval($_GET['id']);
$dn1 = mysql_fetch_array(mysql_query('select count(t.id) as nb1, t.title, t.parent, count(t2.id) as nb2, c.name from topics as t, topics as t2, categories as c where t.id="'.$id.'" and t.id2=1 and t2.id="'.$id.'" and c.id=t.parent group by t.id'));
if($dn1['nb1']>0)
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title><?php echo htmlentities($dn1['title'], ENT_QUOTES, 'UTF-8'); ?> - <?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?> - forum</title>
</head>
<body>
<div id="content">
<?php include("menu.php"); ?>
<div class="content">
<?php
if(isset($_SESSION['username']))
{
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; <a href="list_topics.php?parent=<?php echo $dn1['parent']; ?>"><?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?></a> &gt; <a href="read_topic.php?id=<?php echo $id; ?>"><?php echo htmlentities($dn1['title'], ENT_QUOTES, 'UTF-8'); ?></a> &gt; Lecture
</div>
<div class="box_right">
<a href="list_pm.php">Vos messages (<?php echo $nb_new_pm; ?>)</a> - <a href="login.php">Déconnexion</a>
</div>
<div class="clean"></div>
</div>
<?php
}
else
{
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; <a href="list_topics.php?parent=<?php echo $dn1['parent']; ?>"><?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?></a> &gt; <a href="read_topic.php?id=<?php echo $id; ?>"><?php echo htmlentities($dn1['title'], ENT_QUOTES, 'UTF-8'); ?></a> &gt; Lecture
</div>
<div class="box_right">
<a href="signup.php">Inscription</a> - <a href="login.php">Connexion</a>
</div>
<div class="clean"></div>
</div>
<?php
}
?>
<h1><?php echo $dn1['title']; ?></h1><br /><br />
<?php
$dn2 = mysql_query('select t.id2, t.authorid, t.message, t.timestamp, u.username as author, u.avatar from topics as t, users as u where t.id="'.$id.'" and u.id=t.authorid order by t.timestamp asc');
?>
<table class="messages_table">
<tr>
<th class="author">Auteur</th>
<th>Message</th>
</tr>
<?php
while($dnn2 = mysql_fetch_array($dn2))
{
?>
<tr>
<td class="author center"><?php
if($dnn2['avatar']!='')
{
echo '<img src="'.htmlentities($dnn2['avatar']).'" alt="Image Perso" style="max-width:100px;max-height:100px;" />';
}
?><br /><a href="profile.php?id=<?php echo $dnn2['authorid']; ?>"><?php echo $dnn2['author']; ?></a></td>
<td class="left"><?php if(isset($_SESSION['username']) and ($_SESSION['username']==$dnn2['author'] or $_SESSION['username']==$admin)){ ?><div class="edit"><a href="edit_message.php?id=<?php echo $id; ?>&id2=<?php echo $dnn2['id2']; ?>"><img style="margin-left: 470px;" src="<?php echo $design; ?>/Images/edit.png" alt="Modifier" /></a></div><?php } ?><div class="date"><?php echo date('d/m/Y H:i:s' ,$dnn2['timestamp']); ?></div>
<div class="clean"></div>
<?php echo $dnn2['message']; ?></td>
</tr>
<?php
}
?>
</table>
<?php
if(isset($_SESSION['username']))
{
?>
<a href="new_reply.php?id=<?php echo $id; ?>" class="button">Répondre</a>
<?php
}
?>
</div>
<?php include "pub.php" ?>
</div>
</body>
<?php include("bas_de_page.php"); ?>
</html>
<?php
}
else
{
echo '<h2>La catégorie que vous désirez visiter n\'existe pas.</h2>';
}
}
else
{
echo '<h2>L\'identifiant de la catégorie que vous désirez visiter n\'est pas défini.</h2>';
}
?>

View File

@ -1,3 +0,0 @@
Access to this directory is available only to you.
The directory cannot be accessed via any web or system services, so you can
store any private information here.

View File

@ -1,277 +0,0 @@
<?php
/*
* This is a PHP library that handles calling reCAPTCHA.
* - Documentation and latest version
* http://recaptcha.net/plugins/php/
* - Get a reCAPTCHA API Key
* https://www.google.com/recaptcha/admin/create
* - Discussion group
* http://groups.google.com/group/recaptcha
*
* Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net
* AUTHORS:
* Mike Crawford
* Ben Maurer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* The reCAPTCHA server URL's
*/
define("RECAPTCHA_API_SERVER", "http://www.google.com/recaptcha/api");
define("RECAPTCHA_API_SECURE_SERVER", "https://www.google.com/recaptcha/api");
define("RECAPTCHA_VERIFY_SERVER", "www.google.com");
/**
* Encodes the given data into a query string format
* @param $data - array of string elements to be encoded
* @return string - encoded request
*/
function _recaptcha_qsencode ($data) {
$req = "";
foreach ( $data as $key => $value )
$req .= $key . '=' . urlencode( stripslashes($value) ) . '&';
// Cut the last '&'
$req=substr($req,0,strlen($req)-1);
return $req;
}
/**
* Submits an HTTP POST to a reCAPTCHA server
* @param string $host
* @param string $path
* @param array $data
* @param int port
* @return array response
*/
function _recaptcha_http_post($host, $path, $data, $port = 80) {
$req = _recaptcha_qsencode ($data);
$http_request = "POST $path HTTP/1.0\r\n";
$http_request .= "Host: $host\r\n";
$http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
$http_request .= "Content-Length: " . strlen($req) . "\r\n";
$http_request .= "User-Agent: reCAPTCHA/PHP\r\n";
$http_request .= "\r\n";
$http_request .= $req;
$response = '';
if( false == ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) {
die ('Could not open socket');
}
fwrite($fs, $http_request);
while ( !feof($fs) )
$response .= fgets($fs, 1160); // One TCP-IP packet
fclose($fs);
$response = explode("\r\n\r\n", $response, 2);
return $response;
}
/**
* Gets the challenge HTML (javascript and non-javascript version).
* This is called from the browser, and the resulting reCAPTCHA HTML widget
* is embedded within the HTML form it was called from.
* @param string $pubkey A public key for reCAPTCHA
* @param string $error The error given by reCAPTCHA (optional, default is null)
* @param boolean $use_ssl Should the request be made over ssl? (optional, default is false)
* @return string - The HTML to be embedded in the user's form.
*/
function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false)
{
if ($pubkey == null || $pubkey == '') {
die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
}
if ($use_ssl) {
$server = RECAPTCHA_API_SECURE_SERVER;
} else {
$server = RECAPTCHA_API_SERVER;
}
$errorpart = "";
if ($error) {
$errorpart = "&amp;error=" . $error;
}
return '<script type="text/javascript" src="'. $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
<noscript>
<iframe src="'. $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
</noscript>';
}
/**
* A ReCaptchaResponse is returned from recaptcha_check_answer()
*/
class ReCaptchaResponse {
var $is_valid;
var $error;
}
/**
* Calls an HTTP POST function to verify if the user's guess was correct
* @param string $privkey
* @param string $remoteip
* @param string $challenge
* @param string $response
* @param array $extra_params an array of extra variables to post to the server
* @return ReCaptchaResponse
*/
function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $extra_params = array())
{
if ($privkey == null || $privkey == '') {
die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
}
if ($remoteip == null || $remoteip == '') {
die ("For security reasons, you must pass the remote ip to reCAPTCHA");
}
//discard spam submissions
if ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) {
$recaptcha_response = new ReCaptchaResponse();
$recaptcha_response->is_valid = false;
$recaptcha_response->error = 'incorrect-captcha-sol';
return $recaptcha_response;
}
$response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify",
array (
'privatekey' => $privkey,
'remoteip' => $remoteip,
'challenge' => $challenge,
'response' => $response
) + $extra_params
);
$answers = explode ("\n", $response [1]);
$recaptcha_response = new ReCaptchaResponse();
if (trim ($answers [0]) == 'true') {
$recaptcha_response->is_valid = true;
}
else {
$recaptcha_response->is_valid = false;
$recaptcha_response->error = $answers [1];
}
return $recaptcha_response;
}
/**
* gets a URL where the user can sign up for reCAPTCHA. If your application
* has a configuration page where you enter a key, you should provide a link
* using this function.
* @param string $domain The domain where the page is hosted
* @param string $appname The name of your application
*/
function recaptcha_get_signup_url ($domain = null, $appname = null) {
return "https://www.google.com/recaptcha/admin/create?" . _recaptcha_qsencode (array ('domains' => $domain, 'app' => $appname));
}
function _recaptcha_aes_pad($val) {
$block_size = 16;
$numpad = $block_size - (strlen ($val) % $block_size);
return str_pad($val, strlen ($val) + $numpad, chr($numpad));
}
/* Mailhide related code */
function _recaptcha_aes_encrypt($val,$ky) {
if (! function_exists ("mcrypt_encrypt")) {
die ("To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.");
}
$mode=MCRYPT_MODE_CBC;
$enc=MCRYPT_RIJNDAEL_128;
$val=_recaptcha_aes_pad($val);
return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
}
function _recaptcha_mailhide_urlbase64 ($x) {
return strtr(base64_encode ($x), '+/', '-_');
}
/* gets the reCAPTCHA Mailhide url for a given email, public key and private key */
function recaptcha_mailhide_url($pubkey, $privkey, $email) {
if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) {
die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " .
"you can do so at <a href='http://www.google.com/recaptcha/mailhide/apikey'>http://www.google.com/recaptcha/mailhide/apikey</a>");
}
$ky = pack('H*', $privkey);
$cryptmail = _recaptcha_aes_encrypt ($email, $ky);
return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail);
}
/**
* gets the parts of the email to expose to the user.
* eg, given johndoe@example,com return ["john", "example.com"].
* the email is then displayed as john...@example.com
*/
function _recaptcha_mailhide_email_parts ($email) {
$arr = preg_split("/@/", $email );
if (strlen ($arr[0]) <= 4) {
$arr[0] = substr ($arr[0], 0, 1);
} else if (strlen ($arr[0]) <= 6) {
$arr[0] = substr ($arr[0], 0, 3);
} else {
$arr[0] = substr ($arr[0], 0, 4);
}
return $arr;
}
/**
* Gets html to display an email address given a public an private key.
* to get a key, go to:
*
* http://www.google.com/recaptcha/mailhide/apikey
*/
function recaptcha_mailhide_html($pubkey, $privkey, $email) {
$emailparts = _recaptcha_mailhide_email_parts ($email);
$url = recaptcha_mailhide_url ($pubkey, $privkey, $email);
return htmlentities($emailparts[0]) . "<a href='" . htmlentities ($url) .
"' onclick=\"window.open('" . htmlentities ($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities ($emailparts [1]);
}
?>

View File

@ -1,3 +0,0 @@
<form action="algo_soumis_admin.php?id=<?php echo $_GET['id'] ?>&case=<?php echo $_GET['case'] ?>" method="post">
Mot de passe <input type="password" name="mdp" id="mdp" /><input id="submit" type="submit" value="Valider" />
</form>

Binary file not shown.

View File

@ -1,6 +0,0 @@
<html>
<head>
<title>Untitled</title>
</head>
<body><div><span style="font-size: 9pt;">@font-face {</span></div><div>font-family: 'titre';</div><div>src: url('./KITCHENPOLICE.TTF');</div><div>}</div><div><br></div></body>
</html>

View File

@ -1,144 +0,0 @@
<?php
//Cette page permet aux utilisateurs de s'inscrire
include('config.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - Inscription</title>
</head>
<body>
<div id="content">
<?php include("menu.php"); ?>
<?php
if(isset($_POST['username'], $_POST['password'], $_POST['passverif'], $_POST['email']) and $_POST['username']!='')
{
require_once('recaptchalib.php');
$privatekey = "6LeGoPgSAAAAAO_tUiza5OeW3R6JiPB5nrQzeKt4";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
$form = true;
$message = 'Votre réponse au test anti-spam est incorrecte.';
} else {
// Your code here to handle a successful verification
//On enleve lechappement si get_magic_quotes_gpc est active
if(get_magic_quotes_gpc())
{
$_POST['username'] = stripslashes($_POST['username']);
$_POST['password'] = stripslashes($_POST['password']);
$_POST['passverif'] = stripslashes($_POST['passverif']);
$_POST['email'] = stripslashes($_POST['email']);
}
if($_POST['password']==$_POST['passverif'])
{
if(strlen($_POST['password'])>=6)
{
if(preg_match('#^(([a-z0-9!\#$%&\\\'*+/=?^_`{|}~-]+\.?)*[a-z0-9!\#$%&\\\'*+/=?^_`{|}~-]+)@(([a-z0-9-_]+\.?)*[a-z0-9-_]+)\.[a-z]{2,}$#i',$_POST['email']))
{
$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string($_POST['password']);
$email = mysql_real_escape_string($_POST['email']);
$dn = mysql_num_rows(mysql_query('select id from users where username="'.$username.'"'));
if($dn==0)
{
$dn2 = mysql_num_rows(mysql_query('select id from users'));
$id = $dn2+1;
//On enregistre les informations dans la base de donnee
if(mysql_query('insert into users(id, username, password, email, signup_date) values ('.$id.', "'.$username.'", "'.$password.'", "'.$email.'", "'.time().'")'))
{
$form = false;
//echo '<script language="Javascript">document.location.replace("forum.php");</script>';
echo '<div class="message">Inscription effectuée avec succès !<br />Vous pouvez désormais vous connecter sur le forum</div>';
}
else
{
$form = true;
$message = 'Une erreur est survenue lors de l\'inscription.';
}
}
else
{
$form = true;
$message = 'Un autre utilisateur utilise déjà ce nom.';
}
}
else
{
$form = true;
$message = 'L\'adresse mail que vous avez entrée n\'est pas valide.';
}
}
else
{
$form = true;
$message = 'Votre mot de passe contient moins de 6 caractères.';
}
}
else
{
$form = true;
$message = 'Vos mots de passe ne sont pas identiques.';
}
}
}
else
{
$form = true;
}
if($form)
{
if(isset($message))
{
echo '<div class="message">'.$message.'</div>';
}
//On affiche le formulaire
?>
<div class="content">
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; Inscription
</div>
<div class="box_right">
<a href="signup.php">Inscription</a> - <a href="login.php">Connexion</a>
</div>
<div class="clean"></div>
</div>
<form action="signup.php" method="post">
<p style="text-align: left; margin-left: 15px; margin-bottom: 50px;">Festiv'Algo est un site entièrement gratuit et sécurisé.<br />Il ne divulguera pas votre adresse mail et vos données personnelles.</p>
<div class="center">
<label for="username">Nom d'utilisateur</label><input type="text" name="username" value="<?php if(isset($_POST['username'])){echo htmlentities($_POST['username'], ENT_QUOTES, 'UTF-8');} ?>" /><br />
<label for="password">Mot de passe&nbsp;<span class="small">(6 caract&egrave;res min.)</span></label><input type="password" name="password" /><br />
<label for="passverif">Mot de passe&nbsp;<span class="small">(v&eacute;rification)</span></label><input type="password" name="passverif" /><br />
<label for="email">Email</label><input type="text" name="email" value="<?php if(isset($_POST['email'])){echo htmlentities($_POST['email'], ENT_QUOTES, 'UTF-8');} ?>" /><br />
<!--<label for="avatar">Image perso<span class="small">(facultatif)</span></label><input type="text" name="avatar" value="<?php if(isset($_POST['avatar'])){echo htmlentities($_POST['avatar'], ENT_QUOTES, 'UTF-8');} ?>" /><br />-->
<br />
<?php
require_once('recaptchalib.php');
$publickey = "6LeGoPgSAAAAADfNngmfplGzBlV7ZiCQm7gxnPfD"; // you got this from the signup page
echo "<div id='capcha'>".recaptcha_get_html($publickey)."</div>";
?>
<br /><input type="submit" value="Envoyer" />
</div>
</form>
</div>
<?php
}
?>
</div>
</body>
<?php include("bas_de_page.php"); ?>
</html>

View File

@ -1,98 +0,0 @@
<?php
//Cette page affiche la liste des utilisateurs inscrits
include('config.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script src="jquery.js"></script>
<script src="menus.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="Images/favicon_ie.ico">
<title>Festiv'Algo - Liste des membres</title>
</head>
<body>
<div id="content">
<?php include("menu.php"); ?>
<div class="content">
<?php
if(isset($_SESSION['username']))
{
$nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; Liste des utilisateurs
</div>
<div class="box_right">
<a href="list_pm.php">Vos messages (<?php echo $nb_new_pm; ?>)</a> - <a href="login.php">Déconnexion</a>
</div>
<div class="clean"></div>
</div>
<?php
}
else
{
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">Index du forum</a> &gt; Liste des utilisateurs
</div>
<div class="box_right">
<a href="signup.php">Inscription</a> - <a href="login.php">Connexion</a>
</div>
<div class="clean"></div>
</div>
<?php
}
?>
<table>
<tr>
<th>Nom d'utilisateur</th>
<th>Statut</th>
</tr>
<?php
//On recupere les identifiants, les pseudos et les emails des utilisateurs
$req = mysql_query('select id, username, level from users ORDER BY username ASC');
while($dnn = mysql_fetch_array($req))
{
?>
<tr>
<td class="left" style="text-align: center"><a href="profile.php?id=<?php echo $dnn['id']; ?>"><?php echo htmlentities($dnn['username'], ENT_QUOTES, 'UTF-8'); ?></a></td>
<td class="left" style="text-align: center"><?php
switch($dnn['level'])
{
case 1:
echo "Nouveau";
break;
case 2:
echo "Membre";
break;
case 3:
echo "Vétéran";
break;
case 4:
echo "Modérateur";
break;
case 5:
echo "Administrateur";
break;
case 6:
echo "Webmaster";
break;
}
?></td>
</tr>
<?php
}
?>
</table>
</div>
</div>
</body>
<?php include("bas_de_page.php"); ?>
</html>