![]() |
|
|||||||
| Feature Requests Post your wish list for future upcoming ClipShare versions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
|Forum Regular|
![]() ![]() ![]() Join Date: Feb 2008
Posts: 112
![]() |
Title really says it all. Needs to be an option for people who no longer wish to be a part of your site or to receive emails from it to close their own accounts without contacting you to do it manually.
|
|
|
|
|
|
#2 |
|
Member
|Forum Guru|
![]() ![]() ![]() ![]() ![]() Join Date: Nov 2007
Posts: 2,501
![]() |
Yep, that's smart request.
It even happened so one of my site's user asked for it. That's why some time ago I have added such option to user profile page. Function must destroy all user activity: videos, profile, pms, comments, buddies list, etc. In fact - not very complicated thing. |
|
|
|
|
|
#3 |
|
Member
|Forum Regular|
![]() ![]() ![]() Join Date: Feb 2008
Posts: 112
![]() |
Yeah I noticed your site had a way to do it, but I figured as much.
|
|
|
|
|
|
#4 |
|
Member
|Forum Guru|
![]() ![]() ![]() ![]() ![]() Join Date: Nov 2007
Posts: 2,501
![]() |
Ok, let's give a try.
In file "templates/my_profile.tpl" put anywhere in visible place a link to close account: Code:
<a href="{$baseurl}/my_profile.php?a=close_account" onclick="javascript:return confirm('Are you sure you want to close account?');">Close account</a><br />
By closing account all information, videos, messages, comments will be deleted as well.
Code:
chk_member_login(); $uid = mysql_real_escape_string($_SESSION['UID']); Code:
if(isset($_REQUEST['a'])) {
if($_REQUEST['a'] == 'close_account') {
$conn->execute("DELETE FROM video WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
$conn->execute("DELETE FROM signup where UID = '".mysql_real_escape_string($_SESSION['UID'])."' LIMIT 1");
$conn->execute("DELETE FROM buddy_list WHERE username = ".mysql_real_escape_string($_SESSION['USERNAME'])."'");
$conn->execute("DELETE FROM buddy_list WHERE buddy_name = ".mysql_real_escape_string($_SESSION['USERNAME'])."'");
$conn->execute("DELETE FROM comments WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
$conn->execute("DELETE FROM favourite WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
$conn->execute("DELETE FROM friends WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
$conn->execute("DELETE FROM friends WHERE FID = '".mysql_real_escape_string($_SESSION['UID'])."'");
$conn->execute("DELETE FROM group_tps WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
$conn->execute("DELETE FROM group_tps_post WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
$conn->execute("DELETE FROM last_5users WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
$conn->execute("DELETE FROM playlist WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
$conn->execute("DELETE FROM pm WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
$conn->execute("DELETE FROM subscribe_video WHERE subscribe_to = '".mysql_real_escape_string($_SESSION['USERNAME'])."'");
$conn->execute("DELETE FROM subscribe_video WHERE subscribe_from = '".mysql_real_escape_string($_SESSION['USERNAME'])."'");
$conn->execute("DELETE FROM subscriber WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
$conn->execute("DELETE FROM users_online WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
$conn->execute("DELETE FROM verify WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
$_SESSION['UID']="";session_unregister("UID");
$_SESSION['EMAIL']="";session_unregister("EMAIL");
$_SESSION['USERNAME']="";session_unregister("USERNAME");
session_write_close();
header("location: ".$config['BASE_URL']);
die();
}
}
In case of error, you may always set debug mode to "true" in "include/config.php" and post what error appeared. If there is a line with error - find the line and quote here. Important: For test create any useless account ![]()
__________________
Nuevoplayer 6 with HTML5 support - best player for video scripts Clipshare mods and video code services by Nuevolab Last edited by dargre : 08-31-2009 at 03:24 AM. |
|
|
|
|
|
#5 |
|
Member
|Forum Regular|
![]() ![]() ![]() Join Date: Feb 2008
Posts: 112
![]() |
Hey thanks for trying even if there is a typo. I just wanted to say thanks before I even try it. I'll let you know, but as always, great having you around these forums.
Best Quick edit: Just looking at your script, there is no my "my_profile.php" in siteadmin, but people should know what you mean. Last edited by Locrian : 08-31-2009 at 03:20 AM. |
|
|
|
|
|
#6 |
|
Member
|Forum Guru|
![]() ![]() ![]() ![]() ![]() Join Date: Nov 2007
Posts: 2,501
![]() |
Corrected.Also changed POST to REQUEST as this is link and not a form.
__________________
Nuevoplayer 6 with HTML5 support - best player for video scripts Clipshare mods and video code services by Nuevolab Last edited by dargre : 08-31-2009 at 03:24 AM. |
|
|
|
|
|
#7 |
|
Member
|Forum Regular|
![]() ![]() ![]() Join Date: Feb 2008
Posts: 112
![]() |
Yes changing from a "POST" to a "REQUEST" worked perfectly and deleted a newly made account along with some test comments.
Again Dargre answers the Clipshare users call. Can't thank you enough. Edit: So people know, this was done on 4.1.4 and if you guys do it on other versions please post them so people know. Last edited by Locrian : 08-31-2009 at 04:28 AM. Reason: version |
|
|
|
|
|
#8 |
|
Member
|Forum Regular|
![]() ![]() ![]() Join Date: Jun 2009
Posts: 146
![]() |
thanks, works fine.
|
|
|
|
|
|
#9 |
|
Member
|Forum Junior|
![]() ![]() Join Date: Nov 2011
Location: New York, NY
Posts: 57
![]() |
Great, thanks!
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ability to add users from admin page | abelp | Feature Requests | 0 | 03-16-2009 08:05 PM |
| I'm thiiiiis close, just a couple questions. | ryno | Pre-Sales Questions | 5 | 09-08-2007 09:08 PM |