MyBB Community Forums

Full Version: Adding my own Stats to Stats Cache
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I just told you how:

Tikitiki Wrote:Yes, it's in class_datacache. If you didn't include global.php/init.php you'll need to do something like this:

include "./path/to/forum/inc/class_datacache.php";
$cache = new dataCache();
Tikitiki Wrote:I just told you how:

Tikitiki Wrote:Yes, it's in class_datacache. If you didn't include global.php/init.php you'll need to do something like this:

include "./path/to/forum/inc/class_datacache.php";
$cache = new dataCache();

Pardon me Tikitiki, I forgot to tell you it wasn't the good thing yet...
I tried putting your code but, it seems that my stats aren't upload at all...

Here's my complete page code, if you see something strange, you would be very nice to tell me...

Thanks again !
Mensik

<?php

require("config.php");
require("forum/inc/functions_user.php");
require("forum/inc/functions.php");

include "forum/inc/class_datacache.php";
$cache = new dataCache(); 

mysql_connect("$hote","$user","$pwd");
mysql_select_db("$base");

include("header.php");
include("menu.php");
include("footer.php");

if(isset($_POST['pseudo']) AND isset($_POST['mdp']) AND isset($_POST['mdp_confirm']) AND isset($_POST['email']) AND isset($_POST['reglement']))
{
	$pseudo = htmlentities($_POST['pseudo']);
	$mdp = htmlentities($_POST['mdp']);
	$mdp_confirm = htmlentities($_POST['mdp_confirm']);
	$email = htmlentities($_POST['email']);
}
else
{
	$pseudo = '';
	$mdp = '';
	$mdp_confirm = '';
	$email = '';
}

$verif1 = mysql_query("SELECT * FROM membres WHERE pseudo = '".$pseudo."'");
$verification1 = mysql_num_rows($verif1);

$verif2 = mysql_query("SELECT * FROM membres WHERE email = '".$email."'");
$verification2 = mysql_num_rows($verif2);

$mdp_caract = strlen($mdp);

if($verification1 == 1)
{
?>

<html>
<head>
<title>Historika</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css.css" type="text/css"><link rel="shortcut icon" href="favicon.ico">
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
<body bgcolor="#FFFFFF" text="#000000">
<div class="page" align="center"> 
  <h3 class="titre_page" align="center">Inscription</h3>
  <div class="contenu" align="center"> 
    <p align="center">Pour vous inscrire au site, et du fait m&ecirc;me, pouvoir 
      cr&eacute;er de nouveaux cours et articles, rien de plus facile, vous n'avez 
      qu'&agrave; remplir le formulaire ci-dessous !</p>
    <p align="center">&nbsp;</p>
    <font color="#FF0000">Pseudo utilis&eacute;... </font> 
    <form name="form1" method="post" action="">
      <table width="45%" border="0">
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Pseudonyme :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="pseudo">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Mot de Passe :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Confirmation :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp_confirm">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Email :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="email">
            </div>
          </td>
        </tr>
        <tr> 
          <td colspan="2"> 
            <div align="center"> 
              <p> 
                <input type="checkbox" name="reglement" value="checkbox">
                <br>
                <br>
                <u onClick="MM_openBrWindow('regles.php','R&egrave;glement','width=400,height=615')">J'acc&egrave;pte 
                le r&egrave;glement (Cliquez s.v.p)</u></p>
              <p> 
                <input type="submit" name="Submit" value="===&gt; S'inscrire &lt;===">
              </p>
            </div>
          </td>
        </tr>
      </table>
    </form>
    <p align="center">&nbsp;</p>
  </div>
</div>
</body>
</html>

<?php
}
elseif($verification2 ==1)
{
?>

<html>
<head>
<title>Historika</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css.css" type="text/css"><link rel="shortcut icon" href="favicon.ico">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="page">
  <h3 class="titre_page">Inscription</h3>
  <div class="contenu">
    <p>Pour vous inscrire au site, et du fait m&ecirc;me, pouvoir cr&eacute;er 
      de nouveaux cours et articles, rien de plus facile, vous n'avez qu'&agrave; 
      remplir le formulaire ci-dessous !</p>
    <p>&nbsp;</p>
    <font color="#FF0000">Adresse Email utilis&eacute;e... </font> 
    <form name="form1" method="post" action="">
      <table width="45%" border="0">
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Pseudonyme :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="pseudo">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Mot de Passe :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Confirmation :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp_confirm">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Email :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="email">
            </div>
          </td>
        </tr>
        <tr> 
          <td colspan="2"> 
            <div align="center"> 
              <p> 
                <input type="checkbox" name="reglement" value="checkbox">
                <br>
                <br>
                <u onClick="MM_openBrWindow('regles.php','R&egrave;glement','width=400,height=615')">J'acc&egrave;pte 
                le r&egrave;glement (Cliquez s.v.p)</u></p>
              <p> 
                <input type="submit" name="Submit" value="===&gt; S'inscrire &lt;===">
              </p>
            </div>
          </td>
        </tr>
      </table>
    </form>
    <p>&nbsp;</p>
  </div>
  </div>
</body>
</html>

<?php
}
elseif(empty($pseudo) OR empty($mdp) OR empty($mdp_confirm) OR empty($email))
{
?>

<html>
<head>
<title>Historika</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css.css" type="text/css"><link rel="shortcut icon" href="favicon.ico">
</head>

<body bgcolor="#FFFFFF" text="#000000">


<div class="page">
  <h3 class="titre_page">Inscription</h3>
  <div class="contenu">
    <p>Pour vous inscrire au site, et du fait m&ecirc;me, pouvoir cr&eacute;er 
      de nouveaux cours et articles, rien de plus facile, vous n'avez qu'&agrave; 
      remplir le formulaire ci-dessous !</p>
    <p>&nbsp;</p>
    <font color="#FF0000">Tous les champs sont obligatoires !</font> 
    <form name="form1" method="post" action="">
      <table width="45%" border="0">
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Pseudonyme :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="pseudo">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Mot de Passe :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Confirmation :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp_confirm">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Email :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="email">
            </div>
          </td>
        </tr>
        <tr> 
          <td colspan="2"> 
            <div align="center"> 
              <p> 
                <input type="checkbox" name="reglement" value="checkbox">
                <br>
                <br>
                <u onClick="MM_openBrWindow('regles.php','R&egrave;glement','width=400,height=615')">J'acc&egrave;pte 
                le r&egrave;glement (Cliquez s.v.p)</u></p>
              <p> 
                <input type="submit" name="Submit" value="===&gt; S'inscrire &lt;===">
              </p>
            </div>
          </td>
        </tr>
      </table>
    </form>
    <p>&nbsp;</p>
  </div>
  </div>
</body>
</html>

<?php
}
elseif($mdp != $mdp_confirm)
{
?>

<html>
<head>
<title>Historika</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css.css" type="text/css"><link rel="shortcut icon" href="favicon.ico">
</head>

<body bgcolor="#FFFFFF" text="#000000">


<div class="page">
  <h3 class="titre_page">Inscription</h3>
  <div class="contenu">
    <p>Pour vous inscrire au site, et du fait m&ecirc;me, pouvoir cr&eacute;er 
      de nouveaux cours et articles, rien de plus facile, vous n'avez qu'&agrave; 
      remplir le formulaire ci-dessous !</p>
    <p>&nbsp;</p>
    <font color="#FF0000">Les deux mots de passe entr&eacute;s sont diff&eacute;rents.</font> 
    <form name="form1" method="post" action="">
      <table width="45%" border="0">
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Pseudonyme :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="pseudo">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Mot de Passe :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Confirmation :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp_confirm">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Email :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="email">
            </div>
          </td>
        </tr>
        <tr> 
          <td colspan="2"> 
            <div align="center"> 
              <p> 
                <input type="checkbox" name="reglement" value="checkbox">
                <br>
                <br>
                <u onClick="MM_openBrWindow('regles.php','R&egrave;glement','width=400,height=615')">J'acc&egrave;pte 
                le r&egrave;glement (Cliquez s.v.p)</u></p>
              <p> 
                <input type="submit" name="Submit" value="===&gt; S'inscrire &lt;===">
              </p>
            </div>
          </td>
        </tr>
      </table>
    </form>
    <p>&nbsp;</p>
  </div>
  </div>
</body>
</html>

<?php
}
elseif($mdp_caract <6 OR $mdp_caract >30)
{
?>

<html>
<head>
<title>Historika</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css.css" type="text/css"><link rel="shortcut icon" href="favicon.ico">
</head>

<body bgcolor="#FFFFFF" text="#000000">


<div class="page">
  <h3 class="titre_page">Inscription</h3>
  <div class="contenu">
    <p>Pour vous inscrire au site, et du fait m&ecirc;me, pouvoir cr&eacute;er 
      de nouveaux cours et articles, rien de plus facile, vous n'avez qu'&agrave; 
      remplir le formulaire ci-dessous !</p>
    <p>&nbsp;</p>
    <font color="#FF0000">Le mot de passe doit contenir de 6 &agrave; 30 caract&egrave;res 
    maximum. </font> 
    <form name="form1" method="post" action="">
      <table width="45%" border="0">
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Pseudonyme :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="pseudo">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Mot de Passe :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Confirmation :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp_confirm">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Email :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="email">
            </div>
          </td>
        </tr>
        <tr> 
          <td colspan="2"> 
            <div align="center"> 
              <p> 
                <input type="checkbox" name="reglement" value="checkbox">
                <br>
                <br>
                <u onClick="MM_openBrWindow('regles.php','R&egrave;glement','width=400,height=615')">J'acc&egrave;pte 
                le r&egrave;glement (Cliquez s.v.p)</u></p>
              <p> 
                <input type="submit" name="Submit" value="===&gt; S'inscrire &lt;===">
              </p>
            </div>
          </td>
        </tr>
      </table>
    </form>
    <p>&nbsp;</p>
  </div>
  </div>
</body>
</html>

<?php
}
else
{
//Définition des variables pour le forum

$salt = generate_salt();
$pass = salt_password(md5($mdp), $salt);
$loginkey = generate_loginkey();
$regdate = time();
$ip = $_SERVER['REMOTE_ADDR'];
$avatar = "http://historika.biz.st/images/avatar_base.gif";

function updateStats()
{
		$cache->updateStats();
}

//Requêtes MySQL pour la BDD
mysql_query("INSERT INTO membres VALUES('', '$pseudo', '$mdp', '$email', 'Pas Spécifié', 'Pas Spécifié', 'Membre', 'oui', '0', '0', '$avatar')");
mysql_query("INSERT INTO mybb_users VALUES('', '$pseudo', '$pass', '$salt', '$loginkey', '$email', '0', '$avatar', '', '', '2', '2', '2', '', '$regdate', '$regdate', '$regdate', '0', '', '0', '', '', '', '', '', 'yes', 'no', 'no', 'no', 'yes', 'yes', 'yes', 'yes', 'linear', 'yes', 'yes', 'yes', 'yes', '0', '0', '0', '', '', '0', 'no', '', '', '0', 'no', '0', '0', '', '', '', '0', '0', '$ip', '', '0', '1', '0', '0', '0')");
?>

<html>
<head>
<title>Historika</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css.css" type="text/css"><link rel="shortcut icon" href="favicon.ico">
</head>

<body bgcolor="#FFFFFF" text="#000000">


<div class="page">
  <h3 class="titre_page">Inscription</h3>
  <div class="contenu"> 
    <p><font color="#00CC00">Inscription R&eacute;ussie !<br>
      <br>
      Redirection vers la page d'accueil dans 2 secondes.</font></p>
    </div>
  </div>
</body>
</html>

<SCRIPT LANGUAGE='JavaScript'>
<!--
function redirect()
{
window.location='accueil.php' // page ou vous voulez que l'internaute soit redirigé
}
setTimeout('redirect()',2000); // delai en millisecondes - soit ici 5 secondes.
-->
</SCRIPT>

<?php
}
mysql_close();
?>
I see that you've defined a function called updateStats(), but you don't actually call that function.
function updateStats()
{
        $cache->updateStats();
}

Why don't you just use...

$cache->updateStats();

Instead of making a useless wrapper function for it? Wink
And the reason the wrapper function didn't work was because you didn't make $cache global in the function
Hello,

I changed my old code for the code line you gave me, but...

Fatal error: Call to a member function simple_select() on a non-object in /home/historik/public_html/forum/inc/class_datacache.php on line 304
Err, just include init.php and all should work much easier.
you need a

function updateStats()
{
       global $cache;
       $cache->updateStats();
}


add the global is what Tikitiki means
Thanks for your answer.
My problem's still there...

Here's my whole code :

<?php

require("config.php");
require("forum/inc/functions_user.php");
require("forum/inc/functions.php");

define('IN_MYBB', 1);
include "forum/inc/init.php";
include "forum/inc/class_datacache.php";
$cache = new dataCache(); 

mysql_connect("$hote","$user","$pwd");
mysql_select_db("$base");

include("header.php");
include("menu.php");
include("footer.php");

if(isset($_POST['pseudo']) AND isset($_POST['mdp']) AND isset($_POST['mdp_confirm']) AND isset($_POST['email']) AND isset($_POST['reglement']))
{
	$pseudo = htmlentities($_POST['pseudo']);
	$mdp = htmlentities($_POST['mdp']);
	$mdp_confirm = htmlentities($_POST['mdp_confirm']);
	$email = htmlentities($_POST['email']);
}
else
{
	$pseudo = '';
	$mdp = '';
	$mdp_confirm = '';
	$email = '';
}

$verif1 = mysql_query("SELECT * FROM membres WHERE pseudo = '".$pseudo."'");
$verification1 = mysql_num_rows($verif1);

$verif2 = mysql_query("SELECT * FROM membres WHERE email = '".$email."'");
$verification2 = mysql_num_rows($verif2);

$mdp_caract = strlen($mdp);

if($verification1 == 1)
{
?>

<html>
<head>
<title>Historika</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css.css" type="text/css"><link rel="shortcut icon" href="favicon.ico">
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
<body bgcolor="#FFFFFF" text="#000000">
<div class="page" align="center"> 
  <h3 class="titre_page" align="center">Inscription</h3>
  <div class="contenu" align="center"> 
    <p align="center">Pour vous inscrire au site, et du fait m&ecirc;me, pouvoir 
      cr&eacute;er de nouveaux cours et articles, rien de plus facile, vous n'avez 
      qu'&agrave; remplir le formulaire ci-dessous !</p>
    <p align="center">&nbsp;</p>
    <font color="#FF0000">Pseudo utilis&eacute;... </font> 
    <form name="form1" method="post" action="">
      <table width="45%" border="0">
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Pseudonyme :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="pseudo">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Mot de Passe :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Confirmation :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp_confirm">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Email :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="email">
            </div>
          </td>
        </tr>
        <tr> 
          <td colspan="2"> 
            <div align="center"> 
              <p> 
                <input type="checkbox" name="reglement" value="checkbox">
                <br>
                <br>
                <u onClick="MM_openBrWindow('regles.php','R&egrave;glement','width=400,height=615')">J'acc&egrave;pte 
                le r&egrave;glement (Cliquez s.v.p)</u></p>
              <p> 
                <input type="submit" name="Submit" value="===&gt; S'inscrire &lt;===">
              </p>
            </div>
          </td>
        </tr>
      </table>
    </form>
    <p align="center">&nbsp;</p>
  </div>
</div>
</body>
</html>

<?php
}
elseif($verification2 ==1)
{
?>

<html>
<head>
<title>Historika</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css.css" type="text/css"><link rel="shortcut icon" href="favicon.ico">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="page">
  <h3 class="titre_page">Inscription</h3>
  <div class="contenu">
    <p>Pour vous inscrire au site, et du fait m&ecirc;me, pouvoir cr&eacute;er 
      de nouveaux cours et articles, rien de plus facile, vous n'avez qu'&agrave; 
      remplir le formulaire ci-dessous !</p>
    <p>&nbsp;</p>
    <font color="#FF0000">Adresse Email utilis&eacute;e... </font> 
    <form name="form1" method="post" action="">
      <table width="45%" border="0">
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Pseudonyme :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="pseudo">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Mot de Passe :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Confirmation :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp_confirm">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Email :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="email">
            </div>
          </td>
        </tr>
        <tr> 
          <td colspan="2"> 
            <div align="center"> 
              <p> 
                <input type="checkbox" name="reglement" value="checkbox">
                <br>
                <br>
                <u onClick="MM_openBrWindow('regles.php','R&egrave;glement','width=400,height=615')">J'acc&egrave;pte 
                le r&egrave;glement (Cliquez s.v.p)</u></p>
              <p> 
                <input type="submit" name="Submit" value="===&gt; S'inscrire &lt;===">
              </p>
            </div>
          </td>
        </tr>
      </table>
    </form>
    <p>&nbsp;</p>
  </div>
  </div>
</body>
</html>

<?php
}
elseif(empty($pseudo) OR empty($mdp) OR empty($mdp_confirm) OR empty($email))
{
?>

<html>
<head>
<title>Historika</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css.css" type="text/css"><link rel="shortcut icon" href="favicon.ico">
</head>

<body bgcolor="#FFFFFF" text="#000000">


<div class="page">
  <h3 class="titre_page">Inscription</h3>
  <div class="contenu">
    <p>Pour vous inscrire au site, et du fait m&ecirc;me, pouvoir cr&eacute;er 
      de nouveaux cours et articles, rien de plus facile, vous n'avez qu'&agrave; 
      remplir le formulaire ci-dessous !</p>
    <p>&nbsp;</p>
    <font color="#FF0000">Tous les champs sont obligatoires !</font> 
    <form name="form1" method="post" action="">
      <table width="45%" border="0">
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Pseudonyme :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="pseudo">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Mot de Passe :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Confirmation :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp_confirm">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Email :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="email">
            </div>
          </td>
        </tr>
        <tr> 
          <td colspan="2"> 
            <div align="center"> 
              <p> 
                <input type="checkbox" name="reglement" value="checkbox">
                <br>
                <br>
                <u onClick="MM_openBrWindow('regles.php','R&egrave;glement','width=400,height=615')">J'acc&egrave;pte 
                le r&egrave;glement (Cliquez s.v.p)</u></p>
              <p> 
                <input type="submit" name="Submit" value="===&gt; S'inscrire &lt;===">
              </p>
            </div>
          </td>
        </tr>
      </table>
    </form>
    <p>&nbsp;</p>
  </div>
  </div>
</body>
</html>

<?php
}
elseif($mdp != $mdp_confirm)
{
?>

<html>
<head>
<title>Historika</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css.css" type="text/css"><link rel="shortcut icon" href="favicon.ico">
</head>

<body bgcolor="#FFFFFF" text="#000000">


<div class="page">
  <h3 class="titre_page">Inscription</h3>
  <div class="contenu">
    <p>Pour vous inscrire au site, et du fait m&ecirc;me, pouvoir cr&eacute;er 
      de nouveaux cours et articles, rien de plus facile, vous n'avez qu'&agrave; 
      remplir le formulaire ci-dessous !</p>
    <p>&nbsp;</p>
    <font color="#FF0000">Les deux mots de passe entr&eacute;s sont diff&eacute;rents.</font> 
    <form name="form1" method="post" action="">
      <table width="45%" border="0">
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Pseudonyme :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="pseudo">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Mot de Passe :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Confirmation :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp_confirm">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Email :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="email">
            </div>
          </td>
        </tr>
        <tr> 
          <td colspan="2"> 
            <div align="center"> 
              <p> 
                <input type="checkbox" name="reglement" value="checkbox">
                <br>
                <br>
                <u onClick="MM_openBrWindow('regles.php','R&egrave;glement','width=400,height=615')">J'acc&egrave;pte 
                le r&egrave;glement (Cliquez s.v.p)</u></p>
              <p> 
                <input type="submit" name="Submit" value="===&gt; S'inscrire &lt;===">
              </p>
            </div>
          </td>
        </tr>
      </table>
    </form>
    <p>&nbsp;</p>
  </div>
  </div>
</body>
</html>

<?php
}
elseif($mdp_caract <6 OR $mdp_caract >30)
{
?>

<html>
<head>
<title>Historika</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css.css" type="text/css"><link rel="shortcut icon" href="favicon.ico">
</head>

<body bgcolor="#FFFFFF" text="#000000">


<div class="page">
  <h3 class="titre_page">Inscription</h3>
  <div class="contenu">
    <p>Pour vous inscrire au site, et du fait m&ecirc;me, pouvoir cr&eacute;er 
      de nouveaux cours et articles, rien de plus facile, vous n'avez qu'&agrave; 
      remplir le formulaire ci-dessous !</p>
    <p>&nbsp;</p>
    <font color="#FF0000">Le mot de passe doit contenir de 6 &agrave; 30 caract&egrave;res 
    maximum. </font> 
    <form name="form1" method="post" action="">
      <table width="45%" border="0">
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Pseudonyme :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="pseudo">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Mot de Passe :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Confirmation :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="password" name="mdp_confirm">
            </div>
          </td>
        </tr>
        <tr> 
          <td width="55%"> 
            <div align="center"><font color="#FFFFCC"><b>Email :</b></font></div>
          </td>
          <td width="45%"> 
            <div align="center"> 
              <input type="text" name="email">
            </div>
          </td>
        </tr>
        <tr> 
          <td colspan="2"> 
            <div align="center"> 
              <p> 
                <input type="checkbox" name="reglement" value="checkbox">
                <br>
                <br>
                <u onClick="MM_openBrWindow('regles.php','R&egrave;glement','width=400,height=615')">J'acc&egrave;pte 
                le r&egrave;glement (Cliquez s.v.p)</u></p>
              <p> 
                <input type="submit" name="Submit" value="===&gt; S'inscrire &lt;===">
              </p>
            </div>
          </td>
        </tr>
      </table>
    </form>
    <p>&nbsp;</p>
  </div>
  </div>
</body>
</html>

<?php
}
else
{
//Définition des variables pour le forum

$salt = generate_salt();
$pass = salt_password(md5($mdp), $salt);
$loginkey = generate_loginkey();
$regdate = time();
$ip = $_SERVER['REMOTE_ADDR'];
$avatar = "http://historika.biz.st/images/avatar_base.gif";

function updateStats()
{
       global $cache;
       $cache->updateStats();
}

//Requêtes MySQL pour la BDD
mysql_query("INSERT INTO membres VALUES('', '$pseudo', '$mdp', '$email', 'Pas Spécifié', 'Pas Spécifié', 'Membre', 'oui', '0', '0', '$avatar')");
mysql_query("INSERT INTO mybb_users VALUES('', '$pseudo', '$pass', '$salt', '$loginkey', '$email', '0', '$avatar', '', '', '2', '2', '2', '', '$regdate', '$regdate', '$regdate', '0', '', '0', '', '', '', '', '', 'yes', 'no', 'no', 'no', 'yes', 'yes', 'yes', 'yes', 'linear', 'yes', 'yes', 'yes', 'yes', '0', '0', '0', '', '', '0', 'no', '', '', '0', 'no', '0', '0', '', '', '', '0', '0', '$ip', '', '0', '1', '0', '0', '0')");
?>

<html>
<head>
<title>Historika</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css.css" type="text/css"><link rel="shortcut icon" href="favicon.ico">
</head>

<body bgcolor="#FFFFFF" text="#000000">


<div class="page">
  <h3 class="titre_page">Inscription</h3>
  <div class="contenu"> 
    <p><font color="#00CC00">Inscription R&eacute;ussie !<br>
      <br>
      Redirection vers la page d'accueil dans 2 secondes.</font></p>
    </div>
  </div>
</body>
</html>

<SCRIPT LANGUAGE='JavaScript'>
<!--
function redirect()
{
window.location='accueil.php' // page ou vous voulez que l'internaute soit redirigé
}
setTimeout('redirect()',2000); // delai en millisecondes - soit ici 5 secondes.
-->
</SCRIPT>

<?php
}
mysql_close();
?>

I'm really sorry to bother you that much...Sad
Mensik

EDIT: I forgot to put the error message...
Fatal error: Cannot redeclare class datacache in /home/historik/public_html/forum/inc/class_datacache.php on line 13
include "forum/inc/init.php";
include "forum/inc/class_datacache.php";
it is enough to have
include "forum/inc/init.php";

regards
zaher1988 Wrote:
include "forum/inc/init.php";
include "forum/inc/class_datacache.php";
it is enough to have
include "forum/inc/init.php";

regards

Thanks for your answer, but that's not working yet...

Take a lot at this : http://historika.biz.st/forum/memberlist.php
And at the bottom of this : http://historika.biz.st/forum/index.php
Plus this : http://historika.biz.st/forum/stats.php

Sad
Pages: 1 2 3