Išsiregistravimas
Parašė Rytis 2007 gruodžio 16 14:12:02
1. Sukurkite unregister.php failą ir įterpkite šį kodą:
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright &#65533; 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------+
| Unreg addon created by Rytis S. (webdnd.com)
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
if(!iMEMBER || iADMIN){redirect('news.php');}
opentable('I&#353;siregistruoti');
if(!$step)
{
echo"
<center>
<form  name='unreg' method='post' action='unregister.php?step=ok'>
<table align='center' cellpadding='0' cellspacing='0'>
<tr>
<td class='tbl'>&#302;veskite savo slapta&#382;od&#303;:<span style='color:#ff0000'>*</span></td>
<td class='tbl'><input type='password' name='passwrodas' maxlength='30' class='textbox' style='width:200px;'></td>
</tr>
<tr>
<td colspan='2'><input type='submit' value='I&#353;siregistruoti' class='button' style='width:300px'></td>
</table>
<br/><br/>
<span style='color:#ff0000'><b>D&#278;MESIO:</b> atlik&#281; &#353;&#303; veiksm&#261; j&#363;s i&#353;trinsite &#353;&#303; vartotoj&#261; ir visus su juo susijusius duomenis. Pra&#353;ome rimtai apm&#261;styti &#353;&#303; &#382;ingsn&#303;.</span>
</form>
</center> ";
}
else
{
$passw1 = addslashes(md5($_POST['passwrodas']));
$passw2 = $userdata['user_password'];
if($passw1 == $passw2){
dbquery("DELETE FROM ".$db_prefix."posts WHERE post_author='".$userdata['user_id']."'");
dbquery("DELETE FROM ".$db_prefix."submissions WHERE submit_user='".$userdata['user_id']."'");
dbquery("DELETE FROM ".$db_prefix."messages_options WHERE user_id='".$userdata['user_id']."'");
dbquery("DELETE FROM ".$db_prefix."online WHERE online_user='".$userdata['user_id']."'");
dbquery("DELETE FROM ".$db_prefix."threads WHERE thread_author='".$userdata['user_id']."'");
dbquery("DELETE FROM ".$db_prefix."thread_notify WHERE notify_user='".$userdata['user_id']."'");
dbquery("DELETE FROM ".$db_prefix."poll_votes WHERE vote_user='".$userdata['user_id']."'");
dbquery("DELETE FROM ".$db_prefix."ratings WHERE rating_user='".$userdata['user_id']."'");
dbquery("DELETE FROM ".$db_prefix."shoutbox WHERE shout_name='".$userdata['user_id']."'");
dbquery("DELETE FROM ".$db_prefix."messages WHERE message_from='".$userdata['user_id']."' AND message_to='".$userdata['user_id']."'");
dbquery("DELETE FROM ".$db_prefix."comments WHERE comment_name='".$userdata['user_id']."'");
dbquery("DELETE FROM ".$db_prefix."users WHERE user_id='".$userdata['user_id']."' AND user_password='".$passw1."'");

echo"J&#363;s i&#353;siregistravote. ";
}
else
{
echo"<span style='color:#ff0000'><b>Neteisingai &#303;ved&#279;te slapta&#382;od&#303;</b></span><br/><br/>
<a href='unregister.php'>Bandyti dar kart&#261;</a>";
}
}
closetable();
require_once "side_right.php";
require_once "footer.php";
?>




2. Jei norite, kad nuoroda į išsiregistravimą atsirastų vartotojo meniu, infusions/user_info_panel/user_info_panel.php faile kodą pakeiskite šiuo:

<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright &#65533; 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }

if (iMEMBER) {
   openside($userdata['user_name']);
   $msg_count = dbcount("(message_id)", "messages", "message_to='".$userdata['user_id']."' AND message_read='0'AND message_folder='0'");
echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."edit_profile.php' class='side'>".$locale['080']."</a><br>
<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."messages.php' class='side'>".$locale['081']."</a><br>
<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."members.php' class='side'>".$locale['082']."</a><br>\n";
   if (iADMIN && (iUSER_RIGHTS != "" || iUSER_RIGHTS != "C")) {
      echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".ADMIN."index.php".$aidlink."' class='side'>".$locale['083']."</a><br>\n";
   }
   echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."setuser.php?logout=yes' class='side'>".$locale['084']."</a>
<br/>
<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."unregister.php?' class='side'>I&#353;siregistruoti</a>\n";
   if ($msg_count) echo "<br><br><center><b><a href='".BASEDIR."messages.php' class='side'>".sprintf($locale['085'], $msg_count).($msg_count == 1 ? $locale['086'] : $locale['087'])."</a></b></center>\n";
} else {
   openside($locale['060']);
   echo "<div align='center'>".(isset($loginerror) ? $loginerror : "")."
<form name='loginform' method='post' action='".FUSION_SELF."'>
".$locale['061']."<br>
<input type='text' name='user_name' class='textbox' style='width:100px'><br>
".$locale['062']."<br>
<input type='password' name='user_pass' class='textbox' style='width:100px'><br>
<input type='checkbox' name='remember_me' value='y' title='".$locale['063']."' style='vertical-align:middle;'>
<input type='submit' name='login' value='".$locale['064']."' class='button'><br>
</form>
<br>\n";
   if ($settings['enable_registration']) {
      echo "".$locale['065']."<br><br>\n";
   }
   echo $locale['066']."
</div>\n";
}
closeside();
?>




Free Image Hosting at www.ImageShack.us Free Image Hosting at www.ImageShack.us Free Image Hosting at www.ImageShack.us