Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online
5 registered (KuKuKaChu, SteveS, Tainted, id242, Mike L), 22 Guests and 15 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
Registered: 06/21/10
Posts: 58
Top Posters (30 Days)
Ruben 61
SD 53
Gizmo 48
gliderdad 33
Dunny 21
driv 18
dbremer 16
Mark S 13
Stan 13
Iann128 11
Latest Photos
Testing
Basildon Train Station
Basildon Town Centre looking from the rounderbout
Basildon Town Square
Gizzo Marx
Page 1 of 4 1 2 3 4 >
Topic Options
#171341 - 12/28/06 01:56 AM Delete all PMs with 'Welcome' Subject
smallufo Offline
enthusiast
Registered: 06/05/06
Posts: 263
Loc: Taiwan
After I upgrade from UBBT6 to UBBT7 , My (administrator) PM box is full of 'Welcome' message which are automatically sent to users.
This cause my PM's box has 2200+ pages (20 message / page).

I want to delete all of these PMs with the same Subject 'Welcome' .
What SQL command should I write ?

Here is my table :
 Code:
| ubbt_PRIVATE_MESSAGE_POSTS   |
| ubbt_PRIVATE_MESSAGE_TOPICS  |
| ubbt_PRIVATE_MESSAGE_USERS   |


 Code:
mysql> select count(*) from ubbt_PRIVATE_MESSAGE_TOPICS where TOPIC_SUBJECT = 'Welcome';

+----------+
| count(*) |
+----------+
|    31330 |
+----------+
1 row in set (0.17 sec)

_________________________

English is not my native language.
I try my best to express my thought precisely.
I hope you understand what I mean.
If any misunderstanding results from culture gaps , I apologize first.
Top
Express Hosting
Express Hosting "We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
#171342 - 12/28/06 02:50 AM Re: Delete all PMs with 'Welcome' Subject [Re: smallufo]
Gizmo Offline

Registered: 06/05/06
Posts: 14904
Loc: Portland, OR; USA
as the pm users table contains only topic id's it's impossible to cleanly purge everything with sql commands; however I have built a php script (free, cas I'm nice like that) which is capable of doing just this. You can get it at UBBDev here.
_________________________
Forums: UGN Security & VNC Web Design & Development
UBB.Threads: UBB.Wiki, My UBBSkins, UBB.Sitemaps
Longtime UBB Supporter, UBB Beta Tester & Resident Post-A-Holic.
UBB Modifications, Styling, Coding Services, Disaster Recovery, and more!
Top
#171343 - 12/28/06 03:10 AM Re: Delete all PMs with 'Welcome' Subject [Re: Gizmo]
smallufo Offline
enthusiast
Registered: 06/05/06
Posts: 263
Loc: Taiwan
Thank you .
It helps me a lot , cleaning thousands of welcome messages ... \:\)
_________________________

English is not my native language.
I try my best to express my thought precisely.
I hope you understand what I mean.
If any misunderstanding results from culture gaps , I apologize first.
Top
#171344 - 12/28/06 04:03 AM Re: Delete all PMs with 'Welcome' Subject [Re: smallufo]
Gizmo Offline

Registered: 06/05/06
Posts: 14904
Loc: Portland, OR; USA
Not a problem; a lot of people had the same issues, figured something had to be done ;)...

One thing I'm thinking about is cleaning up non-existant pm's which are shown in the users table; as some people just purged the other two and left that one unaffected (granted, I provided the query to do it, so I feel semi responsible). But I haven't done much work on that one yet (though as I have the issue on my main forum, it will eventually be done); this one was just for the community to assist all imported users (as I'm sure other products will have similar issues as well , should they have welcome messages)
_________________________
Forums: UGN Security & VNC Web Design & Development
UBB.Threads: UBB.Wiki, My UBBSkins, UBB.Sitemaps
Longtime UBB Supporter, UBB Beta Tester & Resident Post-A-Holic.
UBB Modifications, Styling, Coding Services, Disaster Recovery, and more!
Top
#171383 - 12/28/06 02:32 PM Re: Delete all PMs with 'Welcome' Subject [Re: Gizmo]
ntdoc Offline
Registered: 11/09/06
Posts: 3382
Well I don't see why a "correct" SQL statement(s) can't correctly do it. I don't see where PHP adds anything to the mix that can't be done manually.

Can you please explain in more detail why not (if this is too off-topic you can PM or e-mail me)

Thanks.
Top
#171395 - 12/28/06 06:04 PM Re: Delete all PMs with 'Welcome' Subject [Re: ntdoc]
Gizmo Offline

Registered: 06/05/06
Posts: 14904
Loc: Portland, OR; USA
Simple, the PM_Users table only has a number to identify which pm's are which pm's; there is no content to identify which is a "welcome". You could take the id from the other tables, but if you're doing a broad delete with an sql statement, i highly doubt in your ability to log every private topic id to be able to purge them from the database.

The php script opens the private topic table, grabs the id, and purges that id in all 3 tables at once, then continues; all done on its own, and messages purged from all 3 tables.

Simply put, you can't search "welcome" in the _users table as all it contains is numbers.
_________________________
Forums: UGN Security & VNC Web Design & Development
UBB.Threads: UBB.Wiki, My UBBSkins, UBB.Sitemaps
Longtime UBB Supporter, UBB Beta Tester & Resident Post-A-Holic.
UBB Modifications, Styling, Coding Services, Disaster Recovery, and more!
Top
#171410 - 12/28/06 06:47 PM Re: Delete all PMs with 'Welcome' Subject [Re: Gizmo]
ntdoc Offline
Registered: 11/09/06
Posts: 3382
isn't that what a JOIN command is for
Top
#171425 - 12/28/06 07:30 PM Re: Delete all PMs with 'Welcome' Subject [Re: ntdoc]
Gizmo Offline

Registered: 06/05/06
Posts: 14904
Loc: Portland, OR; USA
Keep in mind that most people who come here don't even know what MySQL is, much less how to use it ;).
_________________________
Forums: UGN Security & VNC Web Design & Development
UBB.Threads: UBB.Wiki, My UBBSkins, UBB.Sitemaps
Longtime UBB Supporter, UBB Beta Tester & Resident Post-A-Holic.
UBB Modifications, Styling, Coding Services, Disaster Recovery, and more!
Top
#177418 - 02/04/07 02:03 AM Re: Delete all PMs with 'Welcome' Subject [Re: Gizmo]
Nat Offline
stranger
Registered: 11/28/06
Posts: 9
I actually thought the opposite. It seems like most people interested in admin'ing UBB.threads would know about MySQL.

And yea, a JOIN could certainly get this done.
Top
#177426 - 02/04/07 03:00 AM Re: Delete all PMs with 'Welcome' Subject [Re: Nat]
Gizmo Offline

Registered: 06/05/06
Posts: 14904
Loc: Portland, OR; USA
you haven't met some of the larger site owners here then ;\)
_________________________
Forums: UGN Security & VNC Web Design & Development
UBB.Threads: UBB.Wiki, My UBBSkins, UBB.Sitemaps
Longtime UBB Supporter, UBB Beta Tester & Resident Post-A-Holic.
UBB Modifications, Styling, Coding Services, Disaster Recovery, and more!
Top
Page 1 of 4 1 2 3 4 >



Moderator:  AllenAyres, Harold, Ian, Ron M 
Shout Box

Today's Birthdays
No Birthdays
Recent Topics
Edit Post
by Bert
Today at 01:19 PM
A positive note
by SteveS
Yesterday at 09:36 PM
How to locate links to particular site if they are only used in images?
by Conrad
02/10/12 09:41 PM
Pictures not displaying
by Marker23
02/09/12 10:04 PM
Issue with logging out constantly
by Flanuva
02/09/12 07:05 PM
Forum Stats
10213 Members
36 Forums
33667 Topics
180917 Posts

Max Online: 978 @ 06/24/07 11:19 PM
Random Image