MyBB Central

Full Version: List of Useful SQL's - can we have ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was reading THIS POST and thought how handy it would be if there were some kind of sticky on this site where you can find more handy queries like this.

For instance, we can have quick queries for things like:

Resetting a users password if they can't manage to do it on their own.
Get a list of all unactivated users
Find members who have 0 post counts
See who has the same email addresses
Pull up a list of members by username and email address
Force all invisible members to be visible
Change one specific member's theme and no one else
Force email from admins/board to those who have this feature turned off

These are a "one shot" deal like the forcing email thing but if you have an emergency or anouncement that you MUST make sure everyone knows about this kind of stuff can be very handy to have.

Anyone know of other things that would be useful?

I know I could really use one to delete attachments to posts by a certain date. I would like to delete all photos in posts that are over a year or two old.

Anyone got one for that?
Quote:Resetting a users password if they can't manage to do it on their own.
Should be a plugin.

Quote:Get a list of all unactivated users
Already a link in the admincp when you login on the index page.

Quote:Find members who have 0 post counts
Admin cp allows for members by post count searches.

Quote:See who has the same email addresses
Same...

Quote:Force all invisible members to be visible

UPDATE mybb_users set invisible='0';

Quote:Change one specific member's theme and no one else
UPDATE mybb_users SET style='X' WHERE uid='USERID'; (change X and USERID)

Quote:Force email from admins/board to those who have this feature turned off
UPDATE mybb_users SET allownotices='1';
Excellent! thanks guys. I bookmarked the link on the mybb board too.
Jesse, most of the queries you answered stating mybb had them in admin panel I knew, I was just running a list off of stuff I needed for my wowbb boards and had the queries.

Considering I know nothing about these things, I figured some others could use that info.

I also noticed that the queries are very similar. Change the database name from wowbb to mybb is applicable in quite a few of those answers. Nice to know.