• ModSenior

    @giulio3x said:

    mi piacerebbe diventare bravo come te;)

    questa è la pagina della registrazione:
    [php]<?php
    require_once "includes/config.php";
    require_once "includes/mysql_connect.php";
    require_once "includes/getsett.php";
    require_once "includes/funzioni.php";
    require_once "includes/funzioni_testi.php";
    if(trim($arr_impostazioni['lingua'])=="" || !is_dir("lang/".$arr_impostazioni['lingua'])){ $arr_impostazioni['lingua']="ita"; }
    require_once "lang/".$arr_impostazioni['lingua']."/registrazione.php";
    if(user_esistente=="si"){
    if(my_bannato=="si"){
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td class="testo12">".sei_bannato.".<br /><br />
    <a href="mailto:".$arr_impostazioni['mailsito']."">".contatta_admin.".</td>
    </tr>
    </table>";
    }else{
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td class="testo12">".err_loggato.".</td>
    </tr>
    </table>";
    }
    }else{
    $step=(ereg("[1-4]",$_GET['step'])) ? (int)$_GET['step'] : (int)$_POST['step'];
    if($step==2){ //STEP 2 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo1);
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if($step==3){ //STEP 3 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo2);
    $_POST['newmail']=togli_char_spec($_POST['newmail']);
    $_POST['newuser']=togli_char_spec($_POST['newuser']);
    require_once "header.php";
    if(!checkmail($_POST['newmail'])){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_mail."!</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else{
    $q_useresiste=quera("SELECT nome,mail FROM ".$tblprefix."users WHERE nome='".mysql_escape_string($_POST['newuser'])."' OR mail='".mysql_escape_string($_POST['newmail'])."' LIMIT 1");
    if(mysql_num_rows($q_useresiste)>0){
    $arr_useresistente=mysql_fetch_assoc($q_useresiste);
    if($_POST['newuser']==$arr_useresistente['nome']){ $stringa_esiste.="? username<br />"; }
    if($_POST['newmail']==$arr_useresistente['mail']){ $stringa_esiste.="? e-mail<br />"; }
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_dati_usati.":<br />
    $stringa_esiste</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if(!isset($_POST['newuser']) || trim($_POST['newuser'])=="" || !isset($_POST['newpsw']) || trim($_POST['newpsw'])==""){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_campi."!</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if(trim($_POST['newpsw'])!=trim($_POST['newcpsw'])){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_psw."!</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if(strlen(trim($_POST['newuser']))>20 || strlen(trim($_POST['newmail']))>40 || strlen(trim($_POST['newpsw']))>20){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_lunghezza.".</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else{
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" enctype="multipart/form-data" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".profilo.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".luogo.":</span></div></td>
    <td width="65%" class="tabstat"><input name="luogo" type="text" id="luogo" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".homepage.":</div>
    </td>
    <td class="tabstat"><input name="sito" type="text" id="sito" size="45" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">MSN:</div></td>
    <td class="tabstat"><input name="msn" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">ICQ:</div></td>
    <td class="tabstat"><input name="icq" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">AIM:</div></td>
    <td class="tabstat"><input name="aim" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">Yahoo:</div></td>
    <td class="tabstat"><input name="yahoo" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">Skype:</div></td>
    <td class="tabstat"><input name="skype" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".nascita.":</div></td>
    <td class="tabstat"><span class="testo11">".giorno.":
    <select name="nascitagiorno"> ".select_giorni('')."</select>
    ".mese.": <select name="nascitamese">".select_mesi('')."</select>
    ".anno.":
    <select name="nascitaanno"> ".select_anni('')."</select></span></td>
    </tr>
    <tr>
    <td valign="top" class="tabstat"><div align="right" class="testo12">".firma.":<br /><span class="testo10">(".firma_max.": ".$arr_impostazioni['maxfirma'].")</span></div></td>
    <td class="tabstat"><textarea name="firma" cols="40" rows="5" id="firma" onKeyDown="if(this.value.length>".$arr_impostazioni['maxfirma'].")this.value=this.value.substr(0,".$arr_impostazioni['maxfirma'].")"></textarea></td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="4" />
    <input name="newuser" type="hidden" value="".$_POST['newuser']."" />
    <input name="newpsw" type="hidden" value="".$_POST['newpsw']."" />
    <input name="newmail" type="hidden" value="".$_POST['newmail']."" />
    <input type="submit" class="pulsinvia" value="".prosegui_form."" />
    </div></td>
    </tr>
    </form>
    </table>";
    }
    }
    }else if($step==4){ //STEP 4 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo3);
    $_POST['newmail']=togli_char_spec($_POST['newmail']);
    $_POST['newuser']=togli_char_spec($_POST['newuser']);
    $_POST['firma']=togli_char_spec($_POST['firma']);
    $_POST['luogo']=togli_char_spec($_POST['luogo']);
    $_POST['sito']=togli_char_spec($_POST['sito']);
    $_POST['msn']=togli_char_spec($_POST['msn']);
    $_POST['icq']=togli_char_spec($_POST['icq']);
    $_POST['aim']=togli_char_spec($_POST['aim']);
    $_POST['yahoo']=togli_char_spec($_POST['yahoo']);
    $_POST['skype']=togli_char_spec($_POST['skype']);

    if(trim($_POST['firma'])!=""){
    $firma=mysql_escape_string($_POST['firma']);
    }
    $codice = md5(microtime());
    quera("INSERT INTO ".$tblprefix."users (nome,psw,ip,mail,attivazione,firma,datareg,nascita_g,nascita_m,nascita_a,luogo,sito,msn,icq,aim,yahoo,skype)
    VALUES ('".mysql_escape_string($_POST['newuser'])."','".md5($_POST['newpsw'])."','".$_SERVER['REMOTE_ADDR']."','".mysql_escape_string($_POST['newmail'])."','$codice','$firma','".time()."','".$_POST['nascitagiorno']."','".$_POST['nascitamese']."','".$_POST['nascitaanno']."','".mysql_escape_string($_POST['luogo'])."','".mysql_escape_string($_POST['sito'])."','".mysql_escape_string($_POST['msn'])."','".mysql_escape_string($_POST['icq'])."','".mysql_escape_string($_POST['aim'])."','".mysql_escape_string($_POST['yahoo'])."','".mysql_escape_string($_POST['skype'])."')");
    quera("UPDATE ".$tblprefix."stats SET tot_users=tot_users+1, ultimo_userid='".mysql_insert_id()."'");
    setcookie("denome",$_POST['newuser'],time()+(86400365),"/");
    setcookie("depsw",md5($_POST['newpsw']),time()+(86400
    365),"/");
    $corpo=mail_benvenuto." ".$_POST['newuser'].",\n\n".mail_reg_completata."!\n\n
    ".mail_staff."! :)\n\n\n".$arr_impostazioni['urlforum'];
    mandamail($_POST['newmail'],$arr_impostazioni['titoloforum']." - ".mail_oggetto."!",$corpo);
    define('in_reg_step4','si');
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td width="100%" class="tabstat"><span class="testo12">".mail_benvenuto." <strong>".$_POST['newuser']."</strong>, ".mail_reg_completata."!<br />
    <br />
    ".ora_puoi.".<br />
    ".puoi_modificare.".</span> <img src="img/empty.gif" border="0" onload="concalma('index.php','4000');" /></td>
    </tr>
    </table>";
    }else{ //STEP 1 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo4);
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td class="tabstat"><div class="testo12"><strong>".regolamento.":</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">1) ".regola1.".<br /><br />
    2) ".regola2.".<br /><br />
    3) ".regola3.".<br /><br />
    4) ".regola4.".<br /><br />
    5) ".regola5.".<br /><br />
    6) ".regola6.".<br /><br />
    7) ".regola7.".</span></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="center" class="testo12">
    <input name="prosegui" type="button" class="pulsinvia" onClick="window.location='registrazione.php?step=2'" value=" ".accetto_form." " />
    </div></td>
    </tr>
    </table>";
    }
    }
    if($_GET['debug']=="y"){ debugging(); }
    require_once "copy.php";
    ?>[/php]

    non è difficile, un pò di buona volontà si impara tutto 😉

    mi posti il file includes/funzioni.php
    che già manda l'email alla registrazione, vediamo come aggiungere il link 😉


  • User Attivo

    @Thedarkita said:

    non è difficile, un pò di buona volontà si impara tutto 😉

    mi posti il file includes/funzioni.php
    che già manda l'email alla registrazione, vediamo come aggiungere il link 😉

    ah dimenticavo quando uno si registra egli diviene subito loggato cosa non bella come fare per evitare subito l'essere loggati? magari riprova di nuovo a registrarti così vedi

    questo è funzioni.php
    w.w.w.globalmeteo.altervista.org/funzioni.txt


  • ModSenior

    Metti cosi il file register cosi non dovrebbe loggarsi automaticamente...
    [php]
    <?php
    require_once "includes/config.php";
    require_once "includes/mysql_connect.php";
    require_once "includes/getsett.php";
    require_once "includes/funzioni.php";
    require_once "includes/funzioni_testi.php";
    if(trim($arr_impostazioni['lingua'])=="" || !is_dir("lang/".$arr_impostazioni['lingua'])){ $arr_impostazioni['lingua']="ita"; }
    require_once "lang/".$arr_impostazioni['lingua']."/registrazione.php";
    if(user_esistente=="si"){
    if(my_bannato=="si"){
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td class="testo12">".sei_bannato.".<br /><br />
    <a href="mailto:".$arr_impostazioni['mailsito']."">".contatta_admin.".</td>
    </tr>
    </table>";
    }else{
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td class="testo12">".err_loggato.".</td>
    </tr>
    </table>";
    }
    }else{
    $step=(ereg("[1-4]",$_GET['step'])) ? (int)$_GET['step'] : (int)$_POST['step'];
    if($step==2){ //STEP 2 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo1);
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if($step==3){ //STEP 3 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo2);
    $_POST['newmail']=togli_char_spec($_POST['newmail']);
    $_POST['newuser']=togli_char_spec($_POST['newuser']);
    require_once "header.php";
    if(!checkmail($_POST['newmail'])){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_mail."!</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else{
    $q_useresiste=quera("SELECT nome,mail FROM ".$tblprefix."users WHERE nome='".mysql_escape_string($_POST['newuser'])."' OR mail='".mysql_escape_string($_POST['newmail'])."' LIMIT 1");
    if(mysql_num_rows($q_useresiste)>0){
    $arr_useresistente=mysql_fetch_assoc($q_useresiste);
    if($_POST['newuser']==$arr_useresistente['nome']){ $stringa_esiste.="• username<br />"; }
    if($_POST['newmail']==$arr_useresistente['mail']){ $stringa_esiste.="• e-mail<br />"; }
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_dati_usati.":<br />
    $stringa_esiste</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if(!isset($_POST['newuser']) || trim($_POST['newuser'])=="" || !isset($_POST['newpsw']) || trim($_POST['newpsw'])==""){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_campi."!</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if(trim($_POST['newpsw'])!=trim($_POST['newcpsw'])){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_psw."!</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if(strlen(trim($_POST['newuser']))>20 || strlen(trim($_POST['newmail']))>40 || strlen(trim($_POST['newpsw']))>20){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_lunghezza.".</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else{
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" enctype="multipart/form-data" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".profilo.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".luogo.":</span></div></td>
    <td width="65%" class="tabstat"><input name="luogo" type="text" id="luogo" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".homepage.":</div>
    </td>
    <td class="tabstat"><input name="sito" type="text" id="sito" size="45" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">MSN:</div></td>
    <td class="tabstat"><input name="msn" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">ICQ:</div></td>
    <td class="tabstat"><input name="icq" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">AIM:</div></td>
    <td class="tabstat"><input name="aim" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">Yahoo:</div></td>
    <td class="tabstat"><input name="yahoo" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">Skype:</div></td>
    <td class="tabstat"><input name="skype" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".nascita.":</div></td>
    <td class="tabstat"><span class="testo11">".giorno.":
    <select name="nascitagiorno"> ".select_giorni('')."</select>
    ".mese.": <select name="nascitamese">".select_mesi('')."</select>
    ".anno.":
    <select name="nascitaanno"> ".select_anni('')."</select></span></td>
    </tr>
    <tr>
    <td valign="top" class="tabstat"><div align="right" class="testo12">".firma.":<br /><span class="testo10">(".firma_max.": ".$arr_impostazioni['maxfirma'].")</span></div></td>
    <td class="tabstat"><textarea name="firma" cols="40" rows="5" id="firma" onKeyDown="if(this.value.length>".$arr_impostazioni['maxfirma'].")this.value=this.value.substr(0,".$arr_impostazioni['maxfirma'].")"></textarea></td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="4" />
    <input name="newuser" type="hidden" value="".$_POST['newuser']."" />
    <input name="newpsw" type="hidden" value="".$_POST['newpsw']."" />
    <input name="newmail" type="hidden" value="".$_POST['newmail']."" />
    <input type="submit" class="pulsinvia" value="".prosegui_form."" />
    </div></td>
    </tr>
    </form>
    </table>";
    }
    }
    }else if($step==4){ //STEP 4 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo3);
    $_POST['newmail']=togli_char_spec($_POST['newmail']);
    $_POST['newuser']=togli_char_spec($_POST['newuser']);
    $_POST['firma']=togli_char_spec($_POST['firma']);
    $_POST['luogo']=togli_char_spec($_POST['luogo']);
    $_POST['sito']=togli_char_spec($_POST['sito']);
    $_POST['msn']=togli_char_spec($_POST['msn']);
    $_POST['icq']=togli_char_spec($_POST['icq']);
    $_POST['aim']=togli_char_spec($_POST['aim']);
    $_POST['yahoo']=togli_char_spec($_POST['yahoo']);
    $_POST['skype']=togli_char_spec($_POST['skype']);

    if(trim($_POST['firma'])!=""){
    $firma=mysql_escape_string($_POST['firma']);
    }
    $codice = md5(microtime());
    quera("INSERT INTO ".$tblprefix."users (nome,psw,ip,mail,attivazione,firma,datareg,nascita_g,nascita_m,nascita_a,luogo,sito,msn,icq,aim,yahoo,skype)
    VALUES ('".mysql_escape_string($_POST['newuser'])."','".md5($_POST['newpsw'])."','".$_SERVER['REMOTE_ADDR']."','".mysql_escape_string($_POST['newmail'])."','$codice','$firma','".time()."','".$_POST['nascitagiorno']."','".$_POST['nascitamese']."','".$_POST['nascitaanno']."','".mysql_escape_string($_POST['luogo'])."','".mysql_escape_string($_POST['sito'])."','".mysql_escape_string($_POST['msn'])."','".mysql_escape_string($_POST['icq'])."','".mysql_escape_string($_POST['aim'])."','".mysql_escape_string($_POST['yahoo'])."','".mysql_escape_string($_POST['skype'])."')");
    quera("UPDATE ".$tblprefix."stats SET tot_users=tot_users+1, ultimo_userid='".mysql_insert_id()."'");
    $corpo=mail_benvenuto." ".$_POST['newuser'].",\n\n".mail_reg_completata."!\n\n
    ".mail_staff."! :)\n\n\n".$arr_impostazioni['urlforum'];
    mandamail($_POST['newmail'],$arr_impostazioni['titoloforum']." - ".mail_oggetto."!",$corpo);
    define('in_reg_step4','si');
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td width="100%" class="tabstat"><span class="testo12">".mail_benvenuto." <strong>".$_POST['newuser']."</strong>, ".mail_reg_completata."!<br />
    <br />
    ".ora_puoi.".<br />
    ".puoi_modificare.".</span> <img src="img/empty.gif" border="0" onload="concalma('index.php','4000');" /></td>
    </tr>
    </table>";
    }else{ //STEP 1 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo4);
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td class="tabstat"><div class="testo12"><strong>".regolamento.":</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">1) ".regola1.".<br /><br />
    2) ".regola2.".<br /><br />
    3) ".regola3.".<br /><br />
    4) ".regola4.".<br /><br />
    5) ".regola5.".<br /><br />
    6) ".regola6.".<br /><br />
    7) ".regola7.".</span></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="center" class="testo12">
    <input name="prosegui" type="button" class="pulsinvia" onClick="window.location='registrazione.php?step=2'" value=" ".accetto_form." " />
    </div></td>
    </tr>
    </table>";
    }
    }
    if($_GET['debug']=="y"){ debugging(); }
    require_once "copy.php";
    ?>
    [/php]


  • User Attivo

    si adesso non si è più subito loggati


  • ModSenior

    Metti questo come file register e vedi se arriva il link di attivazione nell'email
    [php]
    <?php
    require_once "includes/config.php";
    require_once "includes/mysql_connect.php";
    require_once "includes/getsett.php";
    require_once "includes/funzioni.php";
    require_once "includes/funzioni_testi.php";
    if(trim($arr_impostazioni['lingua'])=="" || !is_dir("lang/".$arr_impostazioni['lingua'])){ $arr_impostazioni['lingua']="ita"; }
    require_once "lang/".$arr_impostazioni['lingua']."/registrazione.php";
    if(user_esistente=="si"){
    if(my_bannato=="si"){
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td class="testo12">".sei_bannato.".<br /><br />
    <a href="mailto:".$arr_impostazioni['mailsito']."">".contatta_admin.".</td>
    </tr>
    </table>";
    }else{
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td class="testo12">".err_loggato.".</td>
    </tr>
    </table>";
    }
    }else{
    $step=(ereg("[1-4]",$_GET['step'])) ? (int)$_GET['step'] : (int)$_POST['step'];
    if($step==2){ //STEP 2 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo1);
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if($step==3){ //STEP 3 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo2);
    $_POST['newmail']=togli_char_spec($_POST['newmail']);
    $_POST['newuser']=togli_char_spec($_POST['newuser']);
    require_once "header.php";
    if(!checkmail($_POST['newmail'])){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_mail."!</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else{
    $q_useresiste=quera("SELECT nome,mail FROM ".$tblprefix."users WHERE nome='".mysql_escape_string($_POST['newuser'])."' OR mail='".mysql_escape_string($_POST['newmail'])."' LIMIT 1");
    if(mysql_num_rows($q_useresiste)>0){
    $arr_useresistente=mysql_fetch_assoc($q_useresiste);
    if($_POST['newuser']==$arr_useresistente['nome']){ $stringa_esiste.="? username<br />"; }
    if($_POST['newmail']==$arr_useresistente['mail']){ $stringa_esiste.="? e-mail<br />"; }
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_dati_usati.":<br />
    $stringa_esiste</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if(!isset($_POST['newuser']) || trim($_POST['newuser'])=="" || !isset($_POST['newpsw']) || trim($_POST['newpsw'])==""){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_campi."!</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if(trim($_POST['newpsw'])!=trim($_POST['newcpsw'])){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_psw."!</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if(strlen(trim($_POST['newuser']))>20 || strlen(trim($_POST['newmail']))>40 || strlen(trim($_POST['newpsw']))>20){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_lunghezza.".</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else{
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" enctype="multipart/form-data" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".profilo.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".luogo.":</span></div></td>
    <td width="65%" class="tabstat"><input name="luogo" type="text" id="luogo" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".homepage.":</div>
    </td>
    <td class="tabstat"><input name="sito" type="text" id="sito" size="45" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">MSN:</div></td>
    <td class="tabstat"><input name="msn" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">ICQ:</div></td>
    <td class="tabstat"><input name="icq" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">AIM:</div></td>
    <td class="tabstat"><input name="aim" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">Yahoo:</div></td>
    <td class="tabstat"><input name="yahoo" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">Skype:</div></td>
    <td class="tabstat"><input name="skype" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".nascita.":</div></td>
    <td class="tabstat"><span class="testo11">".giorno.":
    <select name="nascitagiorno"> ".select_giorni('')."</select>
    ".mese.": <select name="nascitamese">".select_mesi('')."</select>
    ".anno.":
    <select name="nascitaanno"> ".select_anni('')."</select></span></td>
    </tr>
    <tr>
    <td valign="top" class="tabstat"><div align="right" class="testo12">".firma.":<br /><span class="testo10">(".firma_max.": ".$arr_impostazioni['maxfirma'].")</span></div></td>
    <td class="tabstat"><textarea name="firma" cols="40" rows="5" id="firma" onKeyDown="if(this.value.length>".$arr_impostazioni['maxfirma'].")this.value=this.value.substr(0,".$arr_impostazioni['maxfirma'].")"></textarea></td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="4" />
    <input name="newuser" type="hidden" value="".$_POST['newuser']."" />
    <input name="newpsw" type="hidden" value="".$_POST['newpsw']."" />
    <input name="newmail" type="hidden" value="".$_POST['newmail']."" />
    <input type="submit" class="pulsinvia" value="".prosegui_form."" />
    </div></td>
    </tr>
    </form>
    </table>";
    }
    }
    }else if($step==4){ //STEP 4 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo3);
    $_POST['newmail']=togli_char_spec($_POST['newmail']);
    $_POST['newuser']=togli_char_spec($_POST['newuser']);
    $_POST['firma']=togli_char_spec($_POST['firma']);
    $_POST['luogo']=togli_char_spec($_POST['luogo']);
    $_POST['sito']=togli_char_spec($_POST['sito']);
    $_POST['msn']=togli_char_spec($_POST['msn']);
    $_POST['icq']=togli_char_spec($_POST['icq']);
    $_POST['aim']=togli_char_spec($_POST['aim']);
    $_POST['yahoo']=togli_char_spec($_POST['yahoo']);
    $_POST['skype']=togli_char_spec($_POST['skype']);

    if(trim($_POST['firma'])!=""){
    $firma=mysql_escape_string($_POST['firma']);
    }
    $codice = md5(microtime());
    quera("INSERT INTO ".$tblprefix."users (nome,psw,ip,mail,attivazione,firma,datareg,nascita_g,nascita_m,nascita_a,luogo,sito,msn,icq,aim,yahoo,skype)
    VALUES ('".mysql_escape_string($_POST['newuser'])."','".md5($_POST['newpsw'])."','".$_SERVER['REMOTE_ADDR']."','".mysql_escape_string($_POST['newmail'])."','$codice','$firma','".time()."','".$_POST['nascitagiorno']."','".$_POST['nascitamese']."','".$_POST['nascitaanno']."','".mysql_escape_string($_POST['luogo'])."','".mysql_escape_string($_POST['sito'])."','".mysql_escape_string($_POST['msn'])."','".mysql_escape_string($_POST['icq'])."','".mysql_escape_string($_POST['aim'])."','".mysql_escape_string($_POST['yahoo'])."','".mysql_escape_string($_POST['skype'])."')");
    quera("UPDATE ".$tblprefix."stats SET tot_users=tot_users+1, ultimo_userid='".mysql_insert_id()."'");
    $link = 'http://'.$_SERVER['SERVER_NAME'].'/forum/attiva.php?act='.$codice;
    $corpo=mail_benvenuto." ".$_POST['newuser'].",\n\n".'Per attivare il tuo account devi visitare il seguente link: <a href="'.$link.'">'.$link.'</a>'.mail_reg_completata."!\n\n
    ".mail_staff."! :)\n\n\n".$arr_impostazioni['urlforum'];
    mandamail($_POST['newmail'],$arr_impostazioni['titoloforum']." - ".mail_oggetto."!",$corpo);
    define('in_reg_step4','si');
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td width="100%" class="tabstat"><span class="testo12">".mail_benvenuto." <strong>".$_POST['newuser']."</strong>, ".mail_reg_completata."!<br />
    <br />
    ".ora_puoi.".<br />
    ".puoi_modificare.".</span> <img src="img/empty.gif" border="0" onload="concalma('index.php','4000');" /></td>
    </tr>
    </table>";
    }else{ //STEP 1 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo4);
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td class="tabstat"><div class="testo12"><strong>".regolamento.":</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">1) ".regola1.".<br /><br />
    2) ".regola2.".<br /><br />
    3) ".regola3.".<br /><br />
    4) ".regola4.".<br /><br />
    5) ".regola5.".<br /><br />
    6) ".regola6.".<br /><br />
    7) ".regola7.".</span></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="center" class="testo12">
    <input name="prosegui" type="button" class="pulsinvia" onClick="window.location='registrazione.php?step=2'" value=" ".accetto_form." " />
    </div></td>
    </tr>
    </table>";
    }
    }
    if($_GET['debug']=="y"){ debugging(); }
    require_once "copy.php";
    ?>
    [/php]


  • User Attivo

    si arriva con anche il link;), è un po confusionata dove bisogna agire per scriverla meglio?


  • ModSenior

    Il problema è quello... non sò dove si trovano le costanti...
    forse sono qua:
    lang/it/registrazione.php
    vedi se li c'è il testo dei messaggi e te li personalizzi come vuoi...


  • User Attivo

    @Thedarkita said:

    Il problema è quello... non sò dove si trovano le costanti...
    forse sono qua:
    lang/it/registrazione.php
    vedi se li c'è il testo dei messaggi e te li personalizzi come vuoi...

    esatto questa volta però c'ero arrivato prima di te e l'avevo già fatto!

    adesso cosa bisogna fare creare una cartella in ftp con il nome attiva?


  • ModSenior

    crea un file attiva.php
    [php]
    <?php
    require_once "includes/config.php";
    require_once "includes/mysql_connect.php";
    require_once "includes/getsett.php";
    require_once "includes/funzioni.php";
    require_once "includes/funzioni_testi.php";

    $act = (isset($_GET['act'])) ? $_GET['act'] : '';
    if (!get_magic_quotes_gpc())
    $act = addslashes($act);

    if(strlen($act) != 32)
    die('Link non valido<br><a href="/forum/">Vai al forum</a>');
    $q = quera("SELECT * FROM ".$tblprefix."users WHERE attivazione = '$act' LIMIT 1)
    ;
    if(mysql_num_rows($q) == 0)
    {
    echo 'Link non valido<br><a href="/forum/">Vai al forum</a>';
    }
    else
    {
    quera("UPDATE ".$tblprefix."users SET attivazione = '1' WHERE attivazione = '$act' LIMIT 1)
    ;
    echo 'Account Attivato<br><a href="/forum/">Vai al forum</a>';
    }
    [/php]

    vedi se funziona... ho meso dei semplci imessaggi se vuoi possiam ofare che sempre nella home del froum mostri un errore, oppure i fai la grafica tu separata... come preferisci...

    intanto testa se funziona 😉


  • User Attivo

    mi dà errore:

    Parse error: syntax error, unexpected T_STRING in /membri/globalmeteo/forum/attiva.php on line 22


  • ModSenior

    [php]
    <?php
    require_once "includes/config.php";
    require_once "includes/mysql_connect.php";
    require_once "includes/getsett.php";
    require_once "includes/funzioni.php";
    require_once "includes/funzioni_testi.php";

    $act = (isset($_GET['act'])) ? $_GET['act'] : '';
    if (!get_magic_quotes_gpc())
    $act = addslashes($act);

    if(strlen($act) != 32)
    die('Link non valido<br><a href="/forum/">Vai al forum</a>');
    $q = quera("SELECT * FROM ".$tblprefix."users WHERE attivazione = '$act' LIMIT 1")
    ;
    if(mysql_num_rows($q) == 0)
    {
    echo 'Link non valido<br><a href="/forum/">Vai al forum</a>';
    }
    else
    {
    quera("UPDATE ".$tblprefix."users SET attivazione = '1' WHERE attivazione = '$act' LIMIT 1")
    ;
    echo 'Account Attivato<br><a href="/forum/">Vai al forum</a>';
    }
    ?>
    [/php]


  • User Attivo

    funziona! si vede che sei un grande nel php!:D;):surprised:


  • User Attivo

    adesso viene una parte difficile per me, riuscire a cancellare tutti gli utenti di prova senza cancellare tutto nel database :mmm:⭕x


  • ModSenior

    😉

    adesso rimane un unico problema legato alla sicurezza, perchè il forum usa i cookie volendo si potrebbe scavalcare il login, e quindi postare con un account inattivo manomettendo i cookie...

    modifica cosi il file includes/getsett.php:
    [php]
    <?php
    require_once "config.php";
    require_once "mysql_connect.php";
    require_once "funzioni.php";

    Versione deForum

    define('versione_deForum','2.0.4');
    define('versione_code','204');

    ----------------

    /////// Recupera le info dell'utente ///////
    if(isset($_COOKIE['denome']) && isset($_COOKIE['depsw']) && strlen($_COOKIE['depsw'])==32){
    $q_esisteuser=quera("SELECT id,mail,livello,bannato,firma,ultima_visita,notifica,attivazione FROM ".$tblprefix."users WHERE nome='".$_COOKIE['denome']."' AND psw='".$_COOKIE['depsw']."' LIMIT 1");
    if(mysql_num_rows($q_esisteuser)==1){
    define("user_esistente","si");
    $arr_info_user=mysql_fetch_assoc($q_esisteuser);
    define('my_id',$arr_info_user['id']);
    define('my_name',$_COOKIE['denome']);
    define('my_email',$arr_info_user['mail']);
    define('my_level',$arr_info_user['livello']);
    define('my_firma',$arr_info_user['firma']);
    define('my_ultima_visita',$arr_info_user['ultima_visita']);
    define('my_default_notifica',$arr_info_user['notifica']);
    if($arr_info_user['bannato']=="1"){
    define("my_bannato","si");
    }
    if($arr_info_user['attivazione'] != '1'
    die('Attiva l'account');
    }else{
    define("user_esistente","no");
    }
    }else{
    define("user_esistente","no");
    }
    ///////------------------------------///////

    $q_impostazioni=quera("SELECT * FROM ".$tblprefix."impostazioni");
    $arr_impostazioni=mysql_fetch_assoc($q_impostazioni);

    $estens=explode(",",str_replace(" ","",$arr_impostazioni['estensioniallegati']));

    if($arr_impostazioni['offline']=="1" && my_level!="2"){
    die ("<!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"><title>".$arr_impostazioni['titoloforum']."</title>
    <link href="css/".$arr_impostazioni['stilecss']."" rel="stylesheet" type="text/css" />
    </head>
    <body><p class="testo13" align="center"><br /><br />
    ".nl2br($arr_impostazioni['messaggio_offline']).".<br /><br />
    <strong>".$arr_impostazioni['titoloforum']."</strong></p>
    </body></html>");
    }

    if($arr_impostazioni['setlivelli']=="1"){
    $q_livelli_utenti=quera("SELECT * FROM ".$tblprefix."livelli ORDER BY nposts");
    if(mysql_num_rows($q_livelli_utenti)>=1){
    unset($arr_nomi_livelli,$arr_img_livelli,$arr_nposts_livelli);
    while($arr_livelli_utenti=mysql_fetch_assoc($q_livelli_utenti)){
    $arr_nomi_livelli[]=$arr_livelli_utenti['nome'];
    $arr_img_livelli[]=$arr_livelli_utenti['immagine'];
    $arr_nposts_livelli[]=$arr_livelli_utenti['nposts'];
    }
    }
    }
    ?>
    [/php]

    con questo dovremmo aver finito 😄


  • ModSenior

    Per azzerarlo oltre la tabella con gli utenti, mi apre ci fosse una tabella che teneva conto delle statistiche, secondo me ti conviene cancellare l'intero database ripetere l'installazione coi file modificati, ed aggiungere il campo attivazione nella tabella. Cosi stai sicuro che non ci sia qualche sbaglio e hai il database bello pulito 😄


  • User Attivo

    mah non so se mi conviene dove dovrei agire senno?


  • ModSenior

    dal phpmyadmin devi svuotare la tabella utenti
    dopo in una tabella che non mi ricordo qual'è se non sbaglio, veniva incrementato il numero di utenti registrati, e quindi dovresti ridurre il valore...
    se ha generato altro su altre tabelle non ci ho fatto caso...


  • User Attivo

    @Thedarkita said:

    dal phpmyadmin devi svuotare la tabella utenti
    dopo in una tabella che non mi ricordo qual'è se non sbaglio, veniva incrementato il numero di utenti registrati, e quindi dovresti ridurre il valore...
    se ha generato altro su altre tabelle non ci ho fatto caso...

    proverò a reinstallare tutto allora sperando di riuscire di nuovo a creare la tabella attivazione...

    senti una cosa, vorrei ora fare una cosa l'ultima...

    gli utenti online compaiono sono sulle statistiche come faccio io a mettere come anche in qusto forum giorgitave la scritta online e offline sotto magari al nick di ogni messaggio dell'utente? su che file devo agire?


  • ModSenior

    beh intanto bisogna vedere se il froum memorizza la data dell'ultima pagina vista... e poi bisogna agire sul file che mostra i topic...


  • User Attivo

    @Thedarkita said:

    beh intanto bisogna vedere se il froum memorizza la data dell'ultima pagina vista... e poi bisogna agire sul file che mostra i topic...

    cioè questo file intendi?
    [PHP]<?php
    require_once "includes/config.php";
    require_once "includes/mysql_connect.php";
    require_once "includes/getsett.php";
    require_once "includes/funzioni.php";
    require_once "includes/funzioni_paginazione.php";
    require_once "includes/funzioni_testi.php";
    if(trim($arr_impostazioni['lingua'])=="" || !is_dir("lang/".$arr_impostazioni['lingua'])){ $arr_impostazioni['lingua']="ita"; }
    require_once "lang/".$arr_impostazioni['lingua']."/viewtopic.php";
    $topicid=(ereg("[0-9]",$GET['topicid'])) ? $GET['topicid'] : $POST['topicid'];
    if(!ereg("[0-9]",$GET['pag']) || $GET['pag']<1){ $pag=1; }else{ $pag=$GET['pag']; }
    if(!ereg("[0-9]",$topicid)){
    require_once "header.php";
    errore_generale('','',no_topic_spec,false);
    }else{
    $q_infotopic=quera("SELECT t.*,
    u.nome,u.livello,u.bannato,u.mail,u.firma,u.avatar,u.nposts,u.datareg,u.luogo,u.sito,u.notifica_pvt,u.msn,u.icq,u.aim,u.yahoo,u.skype,
    s.nome AS nomestanza,s.cat,s.privato,s.chiuso AS stanzachiusa,s.post_anonimo,s.counter,s.psw,
    COUNT(DISTINCT p.id) AS numrisp,
    c.nome AS nomecat,c.privato AS catprivata,
    a.nome AS nomeallegato, a.nomereale AS nomeallegator,
    COUNT(DISTINCT moo.id) AS num_modifiche, mo.id AS idmodifica, mo.userid AS idautoremodifica, mo.ultima,
    um.nome AS autoremodifica
    FROM ".$tblprefix."topics AS t
    LEFT JOIN ".$tblprefix."users AS u ON t.userid=u.id
    LEFT JOIN ".$tblprefix."stanze AS s ON t.stanzaid=s.id
    LEFT JOIN ".$tblprefix."posts AS p ON t.id=p.topicid
    LEFT JOIN ".$tblprefix."categorie AS c ON s.cat=c.id
    LEFT JOIN ".$tblprefix."allegati AS a ON t.id=a.topicid
    LEFT JOIN ".$tblprefix."modifiche AS mo ON t.id_ultima_mod=mo.id
    LEFT JOIN ".$tblprefix."modifiche AS moo ON t.id=moo.topicid
    LEFT JOIN ".$tblprefix."users AS um ON mo.userid=um.id
    WHERE t.id='$topicid' GROUP BY t.id ORDER BY mo.id DESC LIMIT 1");
    if(mysql_num_rows($q_infotopic)!=1){
    require_once "header.php";
    errore_generale('','',no_topic,false);
    }else{
    $arr_topic=mysql_fetch_assoc($q_infotopic);
    $nometopic=$arr_topic['oggetto'];
    $t_data=return_data($arr_topic['tdata'],true,false);
    $t_pin=$arr_topic['pin'];
    $t_poll=$arr_topic['poll'];
    $t_chiuso=$arr_topic['chiuso'];
    $creatore=$arr_topic['nome'];
    $idcreatore=$arr_topic['userid'];
    $mailcreatore=$arr_topic['mail'];
    $t_testo=$arr_topic['testo'];
    $t_ip=$arr_topic['ip'];
    $totrisposte=$arr_topic['numrisp'];
    $idstanza=$arr_topic['stanzaid'];
    $nomestanza=$arr_topic['nomestanza'];
    $t_nomeallegato=$arr_topic['nomeallegato'];
    $t_nome_veroallegato=$arr_topic['nomeallegator'];
    if(($arr_topic['privato']=="1" || $arr_topic['catprivata']=="1") && (my_level=="0" || user_esistente!="si" || my_bannato=="si")){
    require_once "header.php";
    errore_generale('','',no_topic,false);
    }else{
    if($arr_topic['psw']!="" && (!isset($COOKIE['psw'.$idstanza]) || md5($arr_topic['psw']."
    $idstanza")!=$COOKIE['psw'.$idstanza])){ // Password
    header("Location: forum.php?id=$idstanza&topicid=$topicid");
    exit();
    }
    define('titolo_pagina',' - '.$nometopic);
    require_once "header.php";
    quera("UPDATE ".$tblprefix."topics SET nvisite=nvisite+1 WHERE id='$topicid' LIMIT 1");
    quera("UPDATE ".$tblprefix."sottoscrizioni SET notificato='0' WHERE topicid='$topicid' AND userid='".my_id."' LIMIT 1");
    #- Controllo x mod e admin -#
    if($t_pin=="0"){ $pinnare="<a href="topicadmin.php?act=pin&topicid=$topicid">".admin_pinna."</a>"; }else{ $pinnare="<a href="topicadmin.php?act=unpin&topicid=$topicid">".admin_depinna."</a>"; }
    if($t_chiuso=="0"){ $chiudere="<a href="topicadmin.php?act=close&topicid=$topicid">".admin_chiudi."</a>"; }else{ $chiudere="<a href="topicadmin.php?act=open&topicid=$topicid">".admin_apri."</a>"; }
    if(my_level=="2"){ //amministratore
    $controllo="<table bgcolor="#993300" width="880" border="0" align="center" cellpadding="3" cellspacing="2" class="tabcat">
    <tr><td class="tabadmin"><span class="testo11">$pinnare | $chiudere | <a onClick="return conferma();" href="topicadmin.php?act=deltopic&topicid=$topicid">".admin_cancella."</a> | <a href="topicadmin.php?act=sposta&topicid=$topicid">".admin_sposta."</a> | <a href="topicadmin.php?act=modtitolo&topicid=$topicid">".admin_mod_tit."</a></span></td></tr>
    </table>";
    }else if(my_level=="1"){ //moderatore
    $q_permoderatore=quera("SELECT COUNT() FROM ".$tblprefix."moderatori WHERE stanzaid='$idstanza' AND userid='".my_id."'");
    $moderatore_valido=mysql_result($q_permoderatore,0);
    if($moderatore_valido>0){
    $controllo="<table bgcolor="#993300" width="880" border="0" align="center" cellpadding="3" cellspacing="2" class="tabcat">
    <tr><td class="tabadmin"><span class="testo11">$pinnare | $chiudere | <a href="topicadmin.php?act=sposta&topicid=$topicid">".admin_sposta."</a> | <a href="topicadmin.php?act=modtitolo&topicid=$topicid">".admin_mod_tit."</a></span></td></tr>
    </table>";
    }else{
    $controllo="";
    }
    }else{
    $controllo="";
    }
    #- ----------------------- -#
    $arr_info_autore['ip']=$t_ip;
    if($t_chiuso=="0"){ $tastoquota="<a href="reply.php?act=quota&topicid=$topicid&pag=$pag">".quota."</a>"; $tastoreply="<a href="reply.php?topicid=$topicid&pag=$pag">".rispondi."</a> |"; $tastoreplyfondo="<a href="reply.php?topicid=$topicid&pag=$pag">".rispondi."</a>"; }else{ $tastoquota=""; $tastoreply=""; $tastoreplyfondo=topic_chiuso; }
    if($t_poll=="1"){ $nometopic="</strong>".sondaggio.": <strong>".$nometopic; }
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr class="tabcat">
    <td class="testo11"><strong><a href="index.php">Home</a> » <a href="forum.php?id=$idstanza">$nomestanza</a> » <a href="viewtopic.php?topicid=$topicid">$nometopic</a></strong>".paginazione_posts($totrisposte,$arr_impostazioni['postsperpagina'],4,"viewtopic.php?topicid=$topicid",pagine)."</td>
    <td class="testo11"><div align="right" class="testo12"><b>$tastoreplyfondo</b> | <a href="sottoscrizioni.php?pag=topics&act=new&topicid=$topicid">".sottoscrivi."</a></div></td>
    </tr>
    </table>$controllo";
    #- Barra controlli topic -#
    if(my_level!="0" || ($idcreatore==my_id && user_esistente=="si" && my_bannato!="si")){
    $link_modifica=" | <a href="edit.php?topicid=$topicid&pag=$pag">".modifica."</a>";
    }
    if(user_esistente=="si" && my_bannato!="si"){
    $link_segnala=" | <a href="segnala.php?topicid=$topicid">".segnala_post."</a>";
    }
    #- --------------------- -#
    if($idcreatore>0){
    $arr_info_autore['userid']=$idcreatore;
    $arr_info_autore['nome']=$arr_topic['nome'];
    $arr_info_autore['avatar']=$arr_topic['avatar'];
    $arr_info_autore['livello']=$arr_topic['livello'];
    $arr_info_autore['nposts']=$arr_topic['nposts'];
    $arr_info_autore['datareg']=return_data($arr_topic['datareg'],false,false);
    if($arr_topic['firma']!=""){ $c_firma="
    _______________________________<br />\n".formatta_testo_post($arr_topic['firma']); }else{ $c_firma=""; }
    $arr_info_autore['luogo']=$arr_topic['luogo'];
    $arr_info_autore['sito']=$arr_topic['sito'];
    $arr_info_autore['msn']=$arr_topic['msn'];
    $arr_info_autore['icq']=$arr_topic['icq'];
    $arr_info_autore['aim']=$arr_topic['aim'];
    $arr_info_autore['yahoo']=$arr_topic['yahoo'];
    $arr_info_autore['skype']=$arr_topic['skype'];
    $colonnaautore=colonna_autore(false,$arr_info_autore);
    }else{ // autore anonimo
    $colonnaautore=colonna_autore(true,$arr_info_autore);
    }
    if($pag==1){ // Controllo la pagina corrente (visualizzo il primo topic solo nella prima pagina)
    if($t_poll=="1"){
    define("incluso","si");
    require_once "viewpoll.php"; // Sondaggio
    }else{
    if(trim($t_nomeallegato)!=""){
    $bloccoallegato="<br /><br />
    <div class="allegato"><img src="img/allegato.gif" width="6" height="11" border="0" title="$t_nomeallegato" alt="$t_nomeallegato" /> ".allegato.": <a href="allegati/$t_nome_veroallegato" title="$t_nomeallegato">$t_nomeallegato</a></div>";
    }
    #- Applico le varie funzioni sul testo -#
    $t_testo=formatta_testo_post($t_testo);
    if($arr_impostazioni['setcensura']=="1"){
    $t_testo=censura($t_testo);
    }
    if(isset($highlight) && trim($highlight)!=""){
    $t_testo=higlighting($t_testo);
    }
    #- ----------------------------------- -#
    #- Traccia modifiche -#
    if($arr_impostazioni['tracciamodifiche']=="1"){
    if($arr_topic['num_modifiche']>0){
    $gruppotracciamod="<hr>\n<span class="tracciamodifiche">".messaggio_mod." ".$arr_topic['num_modifiche']." ".mod_volte_e_da." <a href="users.php?id=".$arr_topic['idautoremodifica']."">".$arr_topic['autoremodifica']."</a>, ".return_data($arr_topic['ultima'],true,false);
    if(my_level=="1" || my_level=="2"){
    $gruppotracciamod.=" - <a href="modifiche.php?topicid=$topicid" target="_blank">".vedi_modifiche."</a>";
    }
    $gruppotracciamod.="</span>";
    }
    }
    #- ----------------- -#
    echo "<table width="880" border="0" align="center" cellpadding="4" cellspacing="1" class="tabcat">
    <tr>
    <td width="170" class="tabsubcat"><img src="img/clock.gif" border="0" alt="".data."" title="".data."" width="11" height="11" /> $t_data</td>
    <td width="710" class="tabsubcat"><div align="right" class="testo11">$tastoreply $tastoquota $link_modifica $link_segnala</div></td>
    </tr>
    <tr>
    $colonnaautore
    <td valign="top" class="tabstat"><span class="testo11">$t_testo<br />$bloccoallegato<br />$c_firma
    <br />$gruppotracciamod</span></td>
    </tr>
    </table>";
    }
    $postiniz=0;
    }else if($pag==2){
    $postiniz=$arr_impostazioni['postsperpagina'];
    }else if($pag>2){
    $postiniz=$arr_impostazioni['postsperpagina']
    ($pag-1);
    }
    #- Elenco risposte -#
    if($totrisposte>0){
    $q_risp=quera("SELECT p.*,
    u.nome,u.livello,u.bannato,u.firma,u.avatar,u.nposts,u.datareg,u.luogo,u.sito,u.notifica_pvt,u.msn,u.icq,u.aim,u.yahoo,u.skype,
    a.nome AS nomeallegato, a.nomereale AS nomeallegator,
    COUNT(DISTINCT moo.id) AS num_modifiche, mo.id AS idmodifica, mo.userid AS idautoremodifica, mo.ultima,
    um.nome AS autoremodifica
    FROM ".$tblprefix."posts AS p
    LEFT JOIN ".$tblprefix."users AS u ON p.userid=u.id
    LEFT JOIN ".$tblprefix."allegati AS a ON p.id=a.postid
    LEFT JOIN ".$tblprefix."modifiche AS mo ON p.id_ultima_mod=mo.id
    LEFT JOIN ".$tblprefix."modifiche AS moo ON p.id=moo.postid
    LEFT JOIN ".$tblprefix."users AS um ON mo.userid=um.id
    WHERE p.topicid='$topicid' GROUP BY p.id
    ORDER BY p.pdata ASC, mo.id DESC LIMIT $postiniz,".$arr_impostazioni['postsperpagina']);
    if($pag==1){
    if($totrisposte>$arr_impostazioni['postsperpagina']){
    $dalla_alla="- visualizzate dalla ".($postiniz+1)." alla ".($postiniz+mysql_num_rows($q_risp));
    }else{
    $dalla_alla="";
    }
    if($totrisposte=="1"){
    $lett=num_risposte1;
    }else{
    $lett=num_risposte2;
    }
    echo "<table bgcolor="#3F6998" width="880" border="0" align="center" cellpadding="3" cellspacing="1" class="tabcat">
    <tr>
    <td class="tabadmin"><span class="testo11"><b>$totrisposte $lett $dalla_alla</b></span></td>
    </tr>
    </table>";
    }
    $indice_risposte=$postiniz+1;
    while($arr_risp=mysql_fetch_assoc($q_risp)){
    $idtopic=$arr_risp['topicid'];
    $idautorerisp=$arr_risp['userid'];
    $testorisp=$arr_risp['testo'];
    $datarisp=return_data($arr_risp['pdata'],true,false);
    $iprisp=$arr_risp['ip'];
    $r_nomeallegato=$arr_risp['nomeallegato'];
    $r_nome_veroallegato=$arr_risp['nomeallegator'];
    if(trim($r_nomeallegato)!=""){
    $r_bloccoallegato="<br /><br />
    <div class="allegato"><img src="img/allegato.gif" border="0" alt="$r_nomeallegato" title="$r_nomeallegato" /> ".allegato.": <a href="allegati/$r_nome_veroallegato">$r_nomeallegato</a></div>";
    }else{ $r_bloccoallegato=""; }
    $arr_info_autore['ip']=$iprisp;
    #- Barra controlli topic -#
    if(my_level!="0" || ($idautorerisp==my_id && user_esistente=="si" && my_bannato!="si")){
    $link_modificar=" | <a href="edit.php?postid=".$arr_risp['id']."&pag=$pag">".modifica."</a>";
    }else{ $link_modificar=""; }
    if(user_esistente=="si" && my_bannato!="si"){
    $link_segnalar=" | <a href="segnala.php?postid=".$arr_risp['id']."&pag=$pag">".segnala_post."</a>";
    }else{ $link_segnalar=""; }
    if(my_level=="2"){
    $link_cancella=" | <a onClick="return conferma();" href="topicadmin.php?act=delreply&topicid=$topicid&postid=".$arr_risp['id']."&pag=$pag">".admin_cancella."</a>";
    }else{ $link_cancella=""; }
    #- --------------------- -#
    if($idautorerisp>0){
    $arr_info_autore['userid']=$idautorerisp;
    $arr_info_autore['nome']=$arr_risp['nome'];
    $arr_info_autore['avatar']=$arr_risp['avatar'];
    $arr_info_autore['livello']=$arr_risp['livello'];
    $arr_info_autore['nposts']=$arr_risp['nposts'];
    $arr_info_autore['datareg']=return_data($arr_risp['datareg'],false,false);
    if($arr_risp['firma']!=""){ $firmaautorer="____________________________________<br />\n".formatta_testo_post($arr_risp['firma']); }else{ $firmaautorer=""; }
    $arr_info_autore['luogo']=$arr_risp['luogo'];
    $arr_info_autore['sito']=$arr_risp['sito'];
    $arr_info_autore['msn']=$arr_risp['msn'];
    $arr_info_autore['icq']=$arr_risp['icq'];
    $arr_info_autore['aim']=$arr_risp['aim'];
    $arr_info_autore['yahoo']=$arr_risp['yahoo'];
    $arr_info_autore['skype']=$arr_risp['skype'];
    $r_colonnaautore=colonna_autore(false,$arr_info_autore);
    }else{ // autore anonimo
    $r_colonnaautore=colonna_autore(true,$arr_info_autore);
    }
    if($t_chiuso=="0"){ $tastorquota="<a href="reply.php?act=quota&topicid=$topicid&postid=".$arr_risp['id']."&pag=$pag">".quota."</a>"; $tastoreply="<a href="reply.php?topicid=$topicid&pag=$pag">".rispondi."</a> |"; $tastoreplyfondo="<a href="reply.php?topicid=$topicid&pag=$pag">".rispondi."</a>"; }else{ $tastorquota=""; $tastoreply=""; $tastoreplyfondo=topic_chiuso; }
    #- Applico le varie funzioni sul testo -#
    $testorisp=formatta_testo_post($testorisp);
    if($arr_impostazioni['setcensura']=="1"){
    $testorisp=censura($testorisp);
    }
    if(isset($highlight) && trim($highlight)!=""){
    $testorisp=higlighting($testorisp);
    }
    #- ----------------------------------- -#
    #- Traccia modifiche -#
    if($arr_impostazioni['tracciamodifiche']=="1"){
    if($arr_risp['num_modifiche']>0){
    $gruppotracciamodr="<hr>\n<span class="tracciamodifiche">".messaggio_mod." ".$arr_risp['num_modifiche']." ".mod_volte_e_da." <a href="users.php?id=".$arr_risp['idautoremodifica']."">".$arr_risp['autoremodifica']."</a>, ".return_data($arr_risp['ultima'],true,false);
    if(my_level=="1" || my_level=="2"){
    $gruppotracciamodr.=" - <a href="modifiche.php?postid=".$arr_risp['id']."" target="blank">".vedi_modifiche."</a>";
    }
    $gruppotracciamodr.="</span>";
    }else{ $gruppotracciamodr=""; }
    }else{ $gruppotracciamodr=""; }
    #- ----------------- -#
    echo "<a name="post
    ".$arr_risp['id'].""></a><table width="880" border="0" align="center" cellpadding="4" cellspacing="1" class="tabcat">
    <tr>
    <td width="170" class="tabsubcat"><img src="img/clock.gif" border="0" alt="".data."" title="".data."" width="11" height="11" /> $datarisp</td>
    <td width="710" class="tabsubcat"><div align="right" class="testo11"><span class="testo10">[<a href="viewpost.php?postid=".$arr_risp['id']."" target="_blank">#$indice_risposte</a>]</span>   $tastoreply $tastorquota $link_modificar $link_cancella $link_segnalar</div></td>
    </tr>
    <tr>
    $r_colonnaautore
    <td colspan="3" valign="top" class="tabstat"><span class="testo11">$testorisp<br />$r_bloccoallegato<br />$firmaautorer
    <br />$gruppotracciamodr</span></td>
    </tr>
    </table>";
    $indice_risposte++;
    }
    }
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr class="tabcat">
    <td class="testo11"><strong><a href="index.php">Home</a> » <a href="forum.php?id=$idstanza">$nomestanza</a> » <a href="viewtopic.php?topicid=$topicid">$nometopic</a> </strong>".paginazione_posts($totrisposte,$arr_impostazioni['postsperpagina'],4,"viewtopic.php?topicid=$topicid",pagine)."</td>
    <td class="testo11"><div align="right" class="testo12"><b>$tastoreplyfondo</b> | <a href="sottoscrizioni.php?pag=topics&act=new&topicid=$topicid">".sottoscrivi."</a></div></td>
    </tr>
    </table>";
    #- Quick reply -#
    if($arr_impostazioni['setquickreply']=="1"){
    // Non metto la quick reply per gli anonimi
    if(user_esistente=="si"){
    if($t_chiuso!="1" || ($t_chiuso=="1" && my_level>0)){
    echo "<br /><table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr><form name="scrivo" action="reply.php" method="post">
    <td class="tabsubcat" colspan="2"><span class="testo12">".quick_reply."</span></td>
    </tr>
    <tr>
    <td width="22%" valign="top" class="tabstat" align="right"><span class="testo11">".risposta.":</span></td>
    <td width="78%" valign="top" class="tabstat"><textarea name="testo" rows="6" cols="60" id="scritto"></textarea></td>
    </tr>
    <tr>
    <td class="tabstat" colspan="2" align="center"><input name="act" type="hidden" value="memo" /><input name="topicid" type="hidden" value="$topicid" /><input name="pag" type="hidden" value="$pag" /><input type="submit" name="inviaform" accesskey="s" value=" ".invia_form." " class="pulsinvia" onClick="return invia();" /></td>
    </form></tr>
    </table>";
    }
    }
    }
    #- ----------- -#
    echo "<br /><table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr class="tabcat">
    <td class="testo12"><a href="saveorprint.php?topicid=$topicid&pag=$pag">".stampa_salva_invia."</a></td>
    <td align="right" class="testo12">".salta_stanza.": <select name="cambiastanza" onChange="saltastanza(this);"><option>".scegli_stanza."</option>".select_salta_stanza($idstanza,stanza_today)."</select></td>
    </tr>
    </table>";
    }
    }
    }
    if($_GET['debug']=="y"){ debugging(); }
    require_once "copy.php";
    ?>[/PHP]