News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Avatars on Deleted Accounts

Started by Miker1029, May 24, 2016, 11:59:52 AM

Previous topic - Next topic

Miker1029

Is there a way to Put a Default Avatar in posts For accounts that have been removed??

Also A Side Question, SOMEHOW in the Past my "OWNER" account ID#1 was not there (In the DB!), It was ID#2, Well I finally copied the ID#2 account to the ID#1 Account and deleted the ID#2 account, and as I figured it "Dis-Associated" all posts and things in the forum that was pointing to ID#2... I've done this in the past and just restored the ID#2 account and put it off till now.... (My Entire C-Panel and Forum was hacked about 7 Months ago, so that could be what happened, not sure if that or a MOD)

ANYWAY, Now All my posts on the Forum the Avatar is missing, And I'm figuring there isn't an Easy way to point all MY ID#2 Posts/Messages Etc to my ID#1 Account, If there is (DB edit or Whatever)?!?!

SO, If that is gonna be as big of a PITA as I think, I'd just Rather have a Default Avatar for Users That Have been Removed from the Forum (Deleted to to length of time of not logging in), I have a Working Default Avatar For Users that don't CHOOSE an Avatar and it works fine...

Anyone Have ANY Ideas on this???

Thanks

Mike

EDIT:

OK After stomping my BIG FEET around the Database, I did a Global search for ID#2 in "id_member" and found 500+ messages, I changed one Entry, My "Welcome message" and went and checked and it worked....

SOO Now this is more of a MASS Database action, I did google and found answers but WANT TO BE SURE!!!!

SO What I want to do is CHANGE All "id_member=2: to "id_member=1" IN Field - "smf_messages" and ONLY there, I'll do each field separately, just in case...

Sorry I know this is Deviating from the Topic of this Post, But As I investigate, I get more info....

Thanks

Kindred

First of all, I general, mucking with the database will cause many more issues then it solves, unless you know specifically what you are doing.

Second... To answer your avatar question... Anything is possible, if you know how to code it.  With regards to the base installation, though... No.   You would have to write new code to do that
Сл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."

Miker1029

QuoteFirst of all, I general, mucking with the database will cause many more issues then it solves, unless you know specifically what you are doing.

True that's why:

QuoteI did a Global search for ID#2 in "id_member" and found 500+ messages, I changed one Entry, My "Welcome message" and went and checked and it worked....

QuoteWith regards to the base installation, though... No.   You would have to write new code to do that

Ok thank you.

So Would you happen to know the command I can use in PhpmyAdmin>SQL to Change ALL the id_member=2 to id_member=1 in THAT table only??

My Plan Is to go through And do this to Sections at a time, as NOT to Mess anything up, But AS I stated, I did it to MY Welcome Message that has been on the forum for awhile under ID 2, When Changed to ID 1, My Avatar, and Info ALL came Back...

Thanks

Mike

Arantor

It takes multiple command to do it since there's a lot of affected places :(

It really is better not to mess with this stuff in the first place...

Miker1029

I agree fully, But after 7 Months or So of Getting 2 E-mails for every forum event that I want to be notified (AND the Forum IS Supposed to be Set for ID#1 Being the Owner....) I figured I'd fix it....

As I said, I didn't MAKE the Change, NOT sure Where or How it happened.  I only noticed it because I MOD I had Installed claimed I wasn't the Owner because I wasn't Account #1....

And I DO NOT want to Change the whole ID_MEMBER, I just want to Change it  "smf_messages" for right now as that's the only one I tested... I'll test the other areas with 1 HAND MADE change, then Going in to See if it does what I want, If not I'll change it back, If it Works I'll MASS Change it for that Table only....

This is the Closest thing I've found, and AS I said, I don't TRUST doing it from a google search, I'd rather have someone here who KNOWS so I don't mess anything, I mean Ya with trial and error on localhost I can Figure it...

UPDATE my_table SET my_column='new value' WHERE something='some value';


Kindred

Its too late now...   but there is an admin toolbox mod which alliws for clean, programatic reassignment of posts from one user to another.

Ask first... sql last
Сл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."

Arantor

You still need to change it for more than smf_messages. smf_topics is pretty important too.

Miker1029

QuoteIts too late now...   but there is an admin toolbox mod which alliws for clean, programatic reassignment of posts from one user to another.

Ask first... sql last

TRUE, I figured that would've been assumed by my NOT wanting to trample on the database, so YES, ANY OTHER ALTERNATIVES THAT WILL HELP or IDEAS Would be GREAT!!!  Thank you!
Quote
You still need to change it for more than smf_messages. smf_topics is pretty important too.

Oh, I'm SURE, there are other things I need to change, I'm gonna go through the DB table by table.... THIS is just the Start as I KNOW it works when viewing my messages in the threads....  All I care about at this second, that ALL my users don't think I'm deleted or something because All my info is missing from the posts, I'll get to the rest in time....

BUT If I know the command to use, WHEN I get THERE I'll be prepared, I'm testing it local first anyway...

AND AS STATED ABOVE, Any alternate ideas, links, fix, etc, Will be GREATLY Appreciated..

Mike

Deprecated

I'm for quick and dirty solutions.

If I had this problem I would just locate the account on the member list and (if this part is necessary) change the status back to member, then go into his account and delete the avatar, then demote him back to guest.

You have to understand that avatars are stored same as attachments and unless you want lots of garbage you can't just delete the account (like via database commands). (This applies to remotely uploaded avatars, not avatars chosen from your local store.)

In the future, go into their account and delete their avatar before deleting their account.

Kindred

Ummm... What?  I think you missed the actual point of the question, deprecated
Сл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."

Deprecated

Quote from: Miker1029 on May 24, 2016, 11:59:52 AM
Is there a way to Put a Default Avatar in posts For accounts that have been removed??

Use my Generic Avatars mod (see my signature) and enable only the banned avatar part. Note that you have to supply your own banned avatar. The mod package comes with only male, female and neuter avatars.

If I were running the forum I'd run through wanted posters, Charlie Manson etc, or search Google for "in jail' and select -> images. :)

Sorry Kindred. I'm so poor I can't afford to pay attention. :P It's cuz nobody supports my mods with donations. I'm feeding my dog shredded junk mail tonight because I'm so poor. No I'm not that unkind! I put gravy on top! :P

Quote from: Kindred on May 26, 2016, 09:34:37 PM
Ummm... What?  I think you missed the actual point of the question, deprecated

Please use capitals for proper nouns. :)

Miker1029

Ok Here's An Update:

Today I had an Issue with "Login Security" MOD, Not working with the Secure Log-in Link in the E-mail to the User, SO The User took it upon themselves not to WAIT the 15 minutes for the Lock-Out to be Over, and created a new account, and I Found the Option In Forum Maintenance to Re-Attribute (NICE!!!!  Never even knew it was there).

SOOOO, The Plan This Monday Morning is to Shut-Down the Forum, Back-Up the DB and USE THAT FOR My Account 2-1 POSTS, I HAVE found the Command for MYSQL to Change 2-1 in id_member and SPECIFIC TABLES (TESTED On Backup DB), NOT THE WHOLE DB, So I can Check before I Change ANYTHING, Then Plug-In The Back-up VIA Repair_settings.php and see what I get....

QuoteUse my Generic Avatars mod (see my signature) and enable only the banned avatar part. Note that you have to supply your own banned avatar. The mod package comes with only male, female and neuter avatars.

If I were running the forum I'd run through wanted posters, Charlie Manson etc, or search Google for "in jail' and select -> images. :)

Sorry Kindred. I'm so poor I can't afford to pay attention. :P It's cuz nobody supports my mods with donations. I'm feeding my dog shredded junk mail tonight because I'm so poor. No I'm not that unkind! I put gravy on top! :P

1. @mention members 1.1.3 [ Uninstall ]
2. Tagging System 3.0 [ Uninstall ]
3. ****************Generic Avatars******************* 1.11 [ Uninstall ]
4. Responsive Curve 1.0.0 [ Uninstall ]
5. EzPortal 3.1 [ Uninstall ]
6. Email Inactive Users 1.1.1 [ Uninstall ]
7. SA Chat 1.0a1 Rev120 [ Uninstall ]
8. reCAPTCHA for SMF 1.0.0 [ Uninstall ]
9. Disable Right Click 4.1.2 [ Uninstall ]
10. Enhanced PM Popup 1.0.1 [ Uninstall ]
11. PM Attachments 1.6 [ Uninstall ]
12. Annoy User 1.2.4 [ Uninstall ]
13. nCode Image Resizer 1.4 [ Uninstall ]
14. Default Avatar 1.1.1 [ Uninstall ]
15. InLine Attachments 1.2.1 [ Uninstall ]
16. Voter Visibility 2.1 [ Uninstall ]
17. SA Twitter 1.2 [ Uninstall ]
18. Show Number of Errors at Top of Forum 1.1.2 [ Uninstall ]
19. KeyCAPTCHA for SMF 2.11 [ Uninstall ]
20. Treasury 2.12 [ Uninstall ]
21. Ad Managment 3.2 [ Uninstall ]
22. E-Arcade 3.0 [ Uninstall ]
23. Share this topic - SMF Mod 1.3 [ Uninstall ]
24. Stop Spammer 2.3.9 [ Uninstall ]
25. Code Highlighting 1.0 [ Uninstall ]
26. Highslide 4 SMF 0.8.1 [ Uninstall ]
27. SA GPlus 0.3 REV 9 [ Uninstall ]
28. Register Redirect 1.0 [ Uninstall ]
29. Membergroup ID with Group Name 1.1 [ Uninstall ]
30. Default_Membergroup 2.0 [ Uninstall ]
31. Block Email Usernames 0.4.2 [ Uninstall ]
32. httpBL 2.5.1 [ Uninstall ]
33. Topic Solved 1.1.1 [ Uninstall ]
34. Say Thanks 1.3 [ Uninstall ]
35. Downloads System 2.5 [ Uninstall ]
36. ICAP: Info Center Access Permission 1.0.0 [ Uninstall ]
37. Users mass actions 0.1.1 [ Uninstall ]
38. SA Facebook 3.0 [ Uninstall ]


Yes that Was My First attempt to fix, OK, NOW FOR THIS and it is TOTALLY OF TOPIC, I'm running EZ-portal and SPLAT! Theme (See Screenshots as I'm Confusing....) I get Guest Avatar Errors With Ez-Portal in the Error Logs (Almost 20-30 Pages a day), SO I Checked Where I can Have a GUEST Avatar Displayed in the Forum in the Theme Settings, Couldn't find it, SO I installed your MOD and Still NO Guest Avatar in theme (Installed with NO Errors)...

SO This WHOLE Thing Started with the BLANK Deleted Member Avatars in POSTS, My Issue With MY Admin Account, AND Ezportal Errors (Which, Yes I've Posted on at their forum and no response)....

Hope I explained Ok....LOL

Mike


Miker1029

Anyone have An Idea On this??

Any help would cool, It's not that the error interferes with the operation of the forum, Just me as Admin hate to have to "filter/delete" the errors, to see the REAL errors that might need work....

Thanks

Mike

Miker1029

Quote from: Deprecated on May 26, 2016, 08:55:41 PM
I'm for quick and dirty solutions.

If I had this problem I would just locate the account on the member list and (if this part is necessary) change the status back to member, then go into his account and delete the avatar, then demote him back to guest.

You have to understand that avatars are stored same as attachments and unless you want lots of garbage you can't just delete the account (like via database commands). (This applies to remotely uploaded avatars, not avatars chosen from your local store.)

In the future, go into their account and delete their avatar before deleting their account.

Ok, I'm slow, Just re-read this and I get what your saying now, Sounds about a big PITA, but ya, that would do it.... If I'm remembering right the Mass Action MOD (I have to Un-Install-reinstall as Forumspam mode side tracked i, Fixed it awhile ago same way, just haven't had a need yet), And Ya that'll allow me to Put them back the the "Guest" user group....

Give it a Shot...

Miker1029

OK BACK ON TOPIC:

Are Maybe Not as this whole thing went sideways..... But here's my results:

SITUATION:

SOMEHOW/WHERE my Admin User account ended up being #2 instead of #1, So I created a #1 Account (That was Empty, Awhile ago as I didn't want #1 Open) in phpmyadmin (Copied 1 to 2) and changed the Name to "TheOwner"

Today, I shutdown the Forum, Copied the Current Database to a Back-up Database.

In PUTTY (Or your preferred SSH Console)

mysql -uUSERNAME -pPASSWORD DATABASEBU < DATABASE-ORIGINAL (No Spaces In -u AND -p), Assuming HOME Directory of Server, and DATABASEBU is Already CREATED.

Went to Forum Maint>Members, and Re attributed ALL Posts from #2 To #1, Copied the Database to Backup.

Used Repair_Settings.php to Plug-in the Backup DB in Maintenance Mode.

Loaded Up Phpmysql, and did an "EXACT" Search for #2, In ALL Tables, Inside the filed "id_member". MAKE SURE IT'S EXACT OR YOU'LL HAVE ISSUES!

BROWSED the Results to MAKE SURE it WASN'T Doing something off the wall..

Clicked "SQL" and Entered: Example-

UPDATE `smf_themes`(TABLE you WANT TO CHANGE)
SET `id_member` = replace(id_member, '2', '1') (THE FIELD YOU WANT TO CHANGE AND CHANGE FROM AND TO I.E. Change ALL 2's to 1's)

Went through all Browsed Checked and Changed...

I Did Have Some issues, that if I see an Issue in the future I'll post back...

But on these Tables:

smf_log_mark_read
smf_log_topics
smf_themes

I got the Error:

- Duplicate Entries#1062 - Duplicate entry  .... for key 'PRIMARY'

Didn't search it, Will after this post, SOO Still on the Changed Backup DB, Logged in to the forum, All messages/avatars/Attachments, were set to Id 1, and MikeR1029, Which is what I wanted...

The MAIN Forum Avatar was Missing (Top-Left), The Posts were ALL NEW, and my Menu On Sides was back to Default (Drop Down)....

I Re-uploaded Avatar, Mark the Entire Forum as Read, and Re-Changed to Side menu...

Everything else Looks exactly the same....

Haven't had a chance to do the Suggestion Above, I have a Few members coming up on a year of inactivity, post back when I delete them...

Mike

Miker1029

UPDATE:

  Ok I have the Avatars working now, At some point I must of Installed another Default Avatar Type MOD, and apparently it was having issues with it.... Everything works now, Deleted Users Show as A Blank Avatar, and Banned Shows As Well..... If They DON'T already have an Avatar, Which I can Live with.

I'm Using "Generic Avatars" MOD.

On the Database editing, Everything is great, BUT, I Noticed today, That the messages I edited, Say edited By Guest on Like 1969 Date, Which Again, I can live with.... Everything else including mods are working great..

Thanks for the Input everyone, It is really appreciated, 1 Step Closer making the Forum BE BETTER..

Mike

Deprecated

To get rid of the "edited by Guest in 1969" just go into your smf_messages table and delete the content of the modified_name field. The zero in the modified_time is default, and 0 = Jan 1 1969 0000 GMT or something like that in Unix timestamps.

I hate to recommend something potentially dangerous without testing it (WTH, being alive is dangerous, I guarantee that being alive is eventually going to kill you) you could issue the following SQL query if you backup your database first.

UPDATE `smf_messages` SET `modified_name` = '' WHERE `modified_time` = '0';

If this explodes your forum either restore the database or pretend Kindred told you to do this! ROFL ;)

Advertisement: