News:

Wondering if this will always be free?  See why free is better.

Main Menu

Change the user's name and then delete it.

Started by User2, January 02, 2022, 02:10:05 PM

Previous topic - Next topic

User2

I'm just a user, I don't know where to make changes. I have seen the codes, but I do not know where to insert them.

Steve

DO NOT pm me for support!

Aleksi "Lex" Kilpinen

If you have access to the forum's files, then you can find the file Sources/Subs-Members.php

In that file you would need to find this location
Code (find) Select
    // Make these peoples' posts guest posts.
    $smcFunc['db_query']('', '
        UPDATE {db_prefix}messages
        SET id_member = {int:guest_id}, poster_email = {string:blank_email}
        WHERE id_member IN ({array_int:users})',
        array(
            'guest_id' => 0,
            'blank_email' => '',
            'users' => $users,
        )
    );

And add this immediately before it
Code ("BEFORE that, add this") Select
    // Reset the names on these posts.
    foreach ($user_log_details as $user)
    {
        $smcFunc['db_query']('', '
            UPDATE {db_prefix}messages
            SET poster_name = {string:poster_name}
            WHERE id_member = {int:id_member}',
            array(
                'id_member' => $user[0],
                'poster_name' => $user[1],
            )
        );
    }

Before making any changes, it is always a perfect idea to make a backup copy of the file - just in case.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

User2

Steve, I am an admin user, not an admin programmer. I use the user interface to work with the forum.

User2

Arantor, yes, your code works at first glance. I will use it until the SMF developers make changes to the forum.

Kindred

The SMF developers are ***NOT*** going to make this change to the core.

I'll repeat this one more time, since you don't quite get it.

The way the system currently works IS NOT A BUG.
The way the system currently works is FUNCTIONING AS DESIGNED.

The way *YOU* would like it to work is counter to our design, based on your opinion, and will not ever be part of the core product.

Basically, you are trying to do something that is not recommended, in a way which is counter to how 99.999999999% admins manage their sites (I have never heard of a site in which the accounts are deleted as you are doing -- and if I ever joined such a site, I would be happy to leave if an admin did what you are doing).
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

User2

When I come to the forum, I don't join anyone. I come to the forum to ask a question and get an answer. Why do you go to the forums - I do not know. Are you confusing forums and social networks?

Aleksi "Lex" Kilpinen

#67
Never is a strong word, but I agree this is highly unlikely to change in the near future. Certainly not likely to ever change for 2.0

Quote from: Participant on January 12, 2022, 01:08:12 PMWhen I come to the forum, I don't join anyone. I come to the forum to ask a question and get an answer. Why do you go to the forums - I do not know. Are you confusing forums and social networks?
Somewhat ironically, I think the complete opposite is more common - People use social networks and such to seek out simply fast answers, and forums are often more natural platforms for discussions aimed at a more limited but somewhat more invested audiences.

For example, you have been a member on this forum since 2015 and have posted over a 100 times in that time .
If we deleted users after a year, you would have had to re-register at least 4 times already.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

User2

It's not difficult for me to register anywhere if I need an answer to a question. 1 time a year is not often.

a10

So, the breadtoaster I've chosen to use won't play mp3 files. I'll simply contact Philips and expect they immediately, and free of charge, implant that capability.


Hint >
https://www.simplemachines.org/community/index.php?board=50.0
2.0.19, php 8.0.23, MariaDB 10.5.15. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.

Aleksi "Lex" Kilpinen

Quote from: Participant on January 12, 2022, 02:46:44 PMIt's not difficult for me to register anywhere if I need an answer to a question. 1 time a year is not often.
I can guarantee that this works to prevent any sort of long time regular userbase from ever forming, and will also work well to prevent anyone else from volunteering to offer the answers, to what the users you do get are seeking. This will also mean you need to do a lot of manual work, that offers no benefit to you or the users.

Better approach would be to let your users request deletion if they want to, and only act then.
Lot less work, lot less worries.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

efk

#71
Lex, we all might be wrong. What if he is running a black market and so his site users does deals via tickets and after some time of inactivity Admin wants to give them back promised privacy, to his user, or just after the job was done. This makes sense  ;)
If you join website and website is promising you that after whatever business you have, after deal is completed, for both sides is better to not keep information.
I as admin can see this as possible to have deals like that and its definitely a good thing to have such an option if circumstances are similar to example which I provided in 1st sentence of this post.

Aleksi "Lex" Kilpinen

Then you would definitely remove the posts as well, and the usernames would be the least of your worries as there would be IP addresses and e-mail addresses to deal with as well.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

User2

You're getting off topic. This topic does not discuss whether to delete users or not. This topic discusses the use of tools built into the forum that work unpredictably for the administrator.

User2

The solution proposed by Arantor is 100% suitable for me. SMF developers need to implement this solution in the next patch. And then the topic can be considered closed.

Aleksi "Lex" Kilpinen

Will not happen. Period.
And since you have confirmed the solution offered is working for you, we can just let this issue rest now.
Topic is marked solved, and if need be will be locked as well.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

User2

Aleksey "Lex" Kilpinen, you write that this is what is intended: after deleting a user, in the themes of this user, his display name is replaced with the original login name. Why is this invented - why should the display name be replaced with the original login name, what is the logic in this?

Aleksi "Lex" Kilpinen

I did already try to explain some of it to you earlier,
and the why really isn't even that important right now, since this is not likely to change for 2.0.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

User2

Can you give a link to the answer in which you explain this? I didn't see any explanations, you just reported the fact that it was intended that way. So I have a question: what is the logic of such a tool?

I'm not asking you to make changes, I realized that it's not important to you. The question just appeared: what is the logic?

Arantor

Because of the underlying functionality that copes with guest posts being promoted to regular account posts, this is used to be able to later differentiate posts made by the original guest posting and those made under a real account.

I don't expect you to understand, though, that other people have different use cases to yours, or that this is a courtesy giving you an explanation.

Advertisement: