Welcome, Guest. Please Login or Register.
November 25, 2024, 11:39:37 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  English User Help  |  English Help  |  Restore deleted member/profile « previous next »
Pages: [1] 2 Reply Ignore Print
Author Topic: Restore deleted member/profile  (Read 1658 times)
1759
Noobie
*
Posts: 2


I'm a llama!

Restore deleted member/profile
« on: April 11, 2003, 04:51:22 PM »
Reply with quote

How do you restore a forum member who has deleted his profile?

The member has re-registered with the same name- how do you re-associate the name with the old posts which are in the same name?

:P
Logged
Aether
Jr. Member
**
Posts: 96


The n00b has entered the building!

Re:Restore deleted member/profile
« Reply #1 on: April 11, 2003, 06:06:46 PM »
Reply with quote

Unless you have a backup of the database, you can't get his old profile back, but it sounds like you only want to reassociate his old posts with his new profile...

If you haven't got any other guest posts, you can just put in a php code that says:

<?php
include_once("Settings.php");

   $conn=mysql_connect($db_server,$db_user,$db_pass);
   if(!$conn) {
      die ("Could not connect to MySQL");
   }
   mysql_select_db($db_name,$conn) or die ("Could not open the requested database");

$user_get_query=mysql_query("SELECT ID_MEMBER FROM ".$db_prefix."members WHERE membername='INSERT USERNAME HERE'");
$user_get=mysql_fetch_assoc($user_get_query);

mysql_query("UPDATE ".$db_prefix."messages SET ID_MEMBER='".addslashes($user_get['ID_MEMBER'])."' WHERE ID_MEMBER='-1'");
?>



Copy that into NotePad, replace where it says INSERT USERNAME HERE with the members user name, save it as a ".php" file and upload it into your main yabbse folder (where Settings.php is). Run it, then delete it.

If you DO have other guest posts, it's more complicated... :S
If you have access to phpMyAdmin, use that to edit the posts he made, and just set all the ID_MEMBER to his ID_MEMBER of his posts. You have to do that in the messages table, and you can find out his ID_MEMBER by looking in members...

If you can't use either of these ways, it's more complicated and I don't know how best to help you...

Good Luck! :D
« Last Edit: April 11, 2003, 06:07:43 PM by Aether » Logged

Got rid of n00b ranking, cause I'd go off the scale ::)
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:Restore deleted member/profile
« Reply #2 on: April 11, 2003, 06:08:20 PM »
Reply with quote

Change this to use the membername column and then guests don't matter.

WHERE ID_MEMBER='-1'
Logged

1759
Noobie
*
Posts: 2


I'm a llama!

Re:Restore deleted member/profile
« Reply #3 on: April 13, 2003, 08:37:12 AM »
Reply with quote

Thanks folks!

:D
Logged
charlottezweb
Sr. Member
****
Posts: 446


charlottezweb.com

ICQ - 101387162 WWW
Re:Restore deleted member/profile
« Reply #4 on: May 27, 2003, 01:46:52 AM »
Reply with quote

I'm trying to utilize this script to restore an account that was just deleted.

That script is returning:

Quote
Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'xxxx_xxxx@localhost' (Using password: NO) in /home/xxxx/public_html/yabbse/restoreuser.php on line 4
Could not connect to MySQL

Can I enter the connection settings directly instead of using the php variables for them?  I don't understand why it's not connecting otherwise...would my admin pword have to mirror the db pword?

Thanks!
Jason
Logged

"yabb-sense makes the heart grow fonder"
-----------------------------------------------------
Charlottezweb.com
Reliable, well-supported & affordable hosting and design.  Free Yabbse installs.
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Restore deleted member/profile
« Reply #5 on: May 27, 2003, 02:14:03 AM »
Reply with quote

Try putting the script in the YaBB SE directory.

All passwords should be the MySQL/database passwords.

-[Unknown]
Logged
charlottezweb
Sr. Member
****
Posts: 446


charlottezweb.com

ICQ - 101387162 WWW
Re:Restore deleted member/profile
« Reply #6 on: May 27, 2003, 02:17:06 AM »
Reply with quote

It's in the yabbse root already...

Jason
Logged

"yabb-sense makes the heart grow fonder"
-----------------------------------------------------
Charlottezweb.com
Reliable, well-supported & affordable hosting and design.  Free Yabbse installs.
charlottezweb
Sr. Member
****
Posts: 446


charlottezweb.com

ICQ - 101387162 WWW
Re:Restore deleted member/profile
« Reply #7 on: May 27, 2003, 07:04:22 PM »
Reply with quote

Any other suggestions from anyone?  

Jason
Logged

"yabb-sense makes the heart grow fonder"
-----------------------------------------------------
Charlottezweb.com
Reliable, well-supported & affordable hosting and design.  Free Yabbse installs.
Ben_S
Disciple of Joe
Support Team
YaBB God
*****
Posts: 1586


I Love YaBB SE!

WWW
Re:Restore deleted member/profile
« Reply #8 on: May 27, 2003, 08:21:46 PM »
Reply with quote

try chaning the include to the full path to your settings.php or ./Settings.php
Logged
charlottezweb
Sr. Member
****
Posts: 446


charlottezweb.com

ICQ - 101387162 WWW
Re:Restore deleted member/profile
« Reply #9 on: May 27, 2003, 10:47:26 PM »
Reply with quote

I just tried the entire path and your second suggestion with no luck...I'm wondering if it has something to do with the "using password:no" part...??

Jason
Logged

"yabb-sense makes the heart grow fonder"
-----------------------------------------------------
Charlottezweb.com
Reliable, well-supported & affordable hosting and design.  Free Yabbse installs.
Douglas
aka The Bear
Support Team
YaBB God
*****
Posts: 1050


Bears rule! Llamas rule too!

WWW
Re:Restore deleted member/profile
« Reply #10 on: May 27, 2003, 10:59:29 PM »
Reply with quote

I came across that myself.

If it's reading the DB variables in the mod file, the DB variables need to be globalized in the call to connect to the database.
Logged

Need help? Please SEARCH first.  No need for a bad attitude, we like helping positive minded people.
ComeHit.us Short URL  redirection svcs with YSE powered forums, COMING SOON!
Want to say thanks?  Check out http://comehit.us/?u=3
charlottezweb
Sr. Member
****
Posts: 446


charlottezweb.com

ICQ - 101387162 WWW
Re:Restore deleted member/profile
« Reply #11 on: May 27, 2003, 11:12:04 PM »
Reply with quote

Quote from: Douglas on May 27, 2003, 10:59:29 PM
I came across that myself.

If it's reading the DB variables in the mod file, the DB variables need to be globalized in the call to connect to the database.

Wow, I know there's some important info there, alas you're over my head ;)

I'm not following you on the mod file variables, or the globalizing of the db variables part  :)  

Since this isn't a safe file to keep accessible anyway, isn't there some syntax I could use in the mysql connect part to just type in the username passwords myself rather than using the yabb-defined variables?  Maybe that would be a more simple approach?

Or even better, would the middle part of the script run as a query in phpmyAdmin as it is?

Thanks!
Jason
Logged

"yabb-sense makes the heart grow fonder"
-----------------------------------------------------
Charlottezweb.com
Reliable, well-supported & affordable hosting and design.  Free Yabbse installs.
Douglas
aka The Bear
Support Team
YaBB God
*****
Posts: 1050


Bears rule! Llamas rule too!

WWW
Re:Restore deleted member/profile
« Reply #12 on: May 28, 2003, 12:08:31 AM »
Reply with quote

Okay, do this then

Quote<?php
include_once("Settings.php");
global $db_server, $db_user, $db_pass, $db_name, $db_prefix;

  $conn=mysql_connect($db_server,$db_user,$db_pass);
  if(!$conn) {
     die ("Could not connect to MySQL");
  }
  mysql_select_db($db_name,$conn) or die ("Could not open the requested database");

$user_get_query=mysql_query("SELECT ID_MEMBER FROM ".$db_prefix."members WHERE membername='INSERT USERNAME HERE'");
$user_get=mysql_fetch_assoc($user_get_query);

mysql_query("UPDATE ".$db_prefix."messages SET ID_MEMBER='".addslashes($user_get['ID_MEMBER'])."' WHERE ID_MEMBER='-1'");
?>

Follow the directions in the original post, just add the global line in.  It should work then.  :)
Logged

Need help? Please SEARCH first.  No need for a bad attitude, we like helping positive minded people.
ComeHit.us Short URL  redirection svcs with YSE powered forums, COMING SOON!
Want to say thanks?  Check out http://comehit.us/?u=3
charlottezweb
Sr. Member
****
Posts: 446


charlottezweb.com

ICQ - 101387162 WWW
Re:Restore deleted member/profile
« Reply #13 on: May 28, 2003, 01:16:25 AM »
Reply with quote

I see what you're saying.  It didn't work, but I see what you're saying :)

Jason
Logged

"yabb-sense makes the heart grow fonder"
-----------------------------------------------------
Charlottezweb.com
Reliable, well-supported & affordable hosting and design.  Free Yabbse installs.
Douglas
aka The Bear
Support Team
YaBB God
*****
Posts: 1050


Bears rule! Llamas rule too!

WWW
Re:Restore deleted member/profile
« Reply #14 on: May 28, 2003, 02:00:59 AM »
Reply with quote

Jason, what error messages are you getting?  I'd love to see this work for you, so I'll help you out as much as I can.
Logged

Need help? Please SEARCH first.  No need for a bad attitude, we like helping positive minded people.
ComeHit.us Short URL  redirection svcs with YSE powered forums, COMING SOON!
Want to say thanks?  Check out http://comehit.us/?u=3
Pages: [1] 2 Reply Ignore Print 
YaBB SE Community  |  English User Help  |  English Help  |  Restore deleted member/profile « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.089 seconds with 20 queries.