Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
Who's Online
1 Registered (1 invisible), 20 Guests and 18 Spiders online.
Key: Admin, Global Mod, Mod
Top Posters
Gizmo 11670
Rick 7543
Ian 4099
Mark S 3969
ntdoc 3101
Sirdude 2041
jgeoff 1876
David Dreezer 1748
driv 1552
AllenAyres 1519
Latest Photos
Carrie - So Very
Testing
Test Photo
4TH of July at the river!
Test shots from D300 part 3
Page 1 of 3 1 2 3 >
Topic Options
Rate This Topic
#171341 - 12/27/06 10:56 PM Delete all PMs with 'Welcome' Subject
smallufo Offline
member

Registered: 06/05/06
Posts: 165
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
#171342 - 12/27/06 11:50 PM Re: Delete all PMs with 'Welcome' Subject [Re: smallufo]
Gizmo Moderator Offline


Registered: 06/04/06
Posts: 11670
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.
_________________________
UGN Security, Elite Web Gamers & VNC Web Design Owner
Longtime UBB Supporter, UBB7 Beta Tester & Resident Post-A-Holic

Top
#171343 - 12/28/06 12:10 AM Re: Delete all PMs with 'Welcome' Subject [Re: Gizmo]
smallufo Offline
member

Registered: 06/05/06
Posts: 165
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 01:03 AM Re: Delete all PMs with 'Welcome' Subject [Re: smallufo]
Gizmo Moderator Offline


Registered: 06/04/06
Posts: 11670
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)
_________________________
UGN Security, Elite Web Gamers & VNC Web Design Owner
Longtime UBB Supporter, UBB7 Beta Tester & Resident Post-A-Holic

Top
#171383 - 12/28/06 11:32 AM Re: Delete all PMs with 'Welcome' Subject [Re: Gizmo]
ntdoc Offline


Registered: 11/08/06
Posts: 3101
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 03:04 PM Re: Delete all PMs with 'Welcome' Subject [Re: ntdoc]
Gizmo Moderator Offline


Registered: 06/04/06
Posts: 11670
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.
_________________________
UGN Security, Elite Web Gamers & VNC Web Design Owner
Longtime UBB Supporter, UBB7 Beta Tester & Resident Post-A-Holic

Top
#171410 - 12/28/06 03:47 PM Re: Delete all PMs with 'Welcome' Subject [Re: Gizmo]
ntdoc Offline


Registered: 11/08/06
Posts: 3101
isn't that what a JOIN command is for

Top
#171425 - 12/28/06 04:30 PM Re: Delete all PMs with 'Welcome' Subject [Re: ntdoc]
Gizmo Moderator Offline


Registered: 06/04/06
Posts: 11670
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 ;).
_________________________
UGN Security, Elite Web Gamers & VNC Web Design Owner
Longtime UBB Supporter, UBB7 Beta Tester & Resident Post-A-Holic

Top
#177418 - 02/03/07 11:03 PM 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 12:00 AM Re: Delete all PMs with 'Welcome' Subject [Re: Nat]
Gizmo Moderator Offline


Registered: 06/04/06
Posts: 11670
Loc: Portland, OR; USA
you haven't met some of the larger site owners here then ;\)
_________________________
UGN Security, Elite Web Gamers & VNC Web Design Owner
Longtime UBB Supporter, UBB7 Beta Tester & Resident Post-A-Holic

Top
#177440 - 02/04/07 09:10 AM Re: Delete all PMs with 'Welcome' Subject [Re: Gizmo]
24hourcampfire Offline
journeyman

Registered: 11/02/06
Posts: 52
Like me.

I just upgraded and found that every single PM the site has ever generated are back. Purged PMs, weren't. Everybody's mailbox is full, full, full.

Any way to delete everything before a certain date, or let's not be picky, by ANY orderly means en masse???

Rick
_________________________
Rick Bin
24hourcampfire.com

http://www.24hourcampfire.com/ubbthreads/ubbthreads.php

Top
#177465 - 02/04/07 02:00 PM Re: Delete all PMs with 'Welcome' Subject [Re: 24hourcampfire]
Gizmo Moderator Offline


Registered: 06/04/06
Posts: 11670
Loc: Portland, OR; USA
Well, theres a reason they're "back"; they never where gone...

Keep in mind that there are 2 parties in a PM, not just one. So when one person deletes, it's still there for the other user, until they delete the message as well.

There where two differant ways to go about pm importing:
A. Don't import them, gone forever.
B. Import all pm's and assign them to the users who had posted in them.

Seeing as most users use pm's, we all harassed rick till he went with B :x...

And you could purge pm's by using the datestamp and a unix epoch date...
_________________________
UGN Security, Elite Web Gamers & VNC Web Design Owner
Longtime UBB Supporter, UBB7 Beta Tester & Resident Post-A-Holic

Top
#184511 - 05/20/07 03:12 AM Re: Delete all PMs with 'Welcome' Subject [Re: 24hourcampfire]
cclapper Offline
stranger

Registered: 05/20/07
Posts: 3
hmm.. I hope Rick can fix it..
_________________________
http://www.you-switch.org - Youswitch provides advice on switching utility bills.
http://www.broardband.net - broadband advice

Top
#184512 - 05/20/07 04:13 AM Re: Delete all PMs with 'Welcome' Subject [Re: cclapper]
Gizmo Moderator Offline


Registered: 06/04/06
Posts: 11670
Loc: Portland, OR; USA
the only real "fix" would be to not import PM's... Theres not much of a grey area, as in there isn't really a way to check if they exist for both or one user with the import scripts.
_________________________
UGN Security, Elite Web Gamers & VNC Web Design Owner
Longtime UBB Supporter, UBB7 Beta Tester & Resident Post-A-Holic

Top
#184523 - 05/20/07 10:15 PM Re: Delete all PMs with 'Welcome' Subject [Re: Gizmo]
ntdoc Offline


Registered: 11/08/06
Posts: 3101
I'm not sure and have not looked, but don't ALL messages regardless of type or area contain a unique id ? If not perhaps it would be a good idea to implement a unique ID for all messages that way in the future it could be used for multiple purposes of tracking or other uses.

Top
#184525 - 05/20/07 10:42 PM Re: Delete all PMs with 'Welcome' Subject [Re: ntdoc]
Gizmo Moderator Offline


Registered: 06/04/06
Posts: 11670
Loc: Portland, OR; USA
All messages do have a unique id; it'd be their index id in the database
_________________________
UGN Security, Elite Web Gamers & VNC Web Design Owner
Longtime UBB Supporter, UBB7 Beta Tester & Resident Post-A-Holic

Top
#184548 - 05/21/07 07:24 PM Re: Delete all PMs with 'Welcome' Subject [Re: Gizmo]
ntdoc Offline


Registered: 11/08/06
Posts: 3101
Well then perhaps I'm off base but if he's trying to keep out duplicates can't some type of query be written to ignore duplicates based on the unique id ?

Top
#184557 - 05/21/07 08:31 PM Re: Delete all PMs with 'Welcome' Subject [Re: ntdoc]
Gizmo Moderator Offline


Registered: 06/04/06
Posts: 11670
Loc: Portland, OR; USA
just becuse it's the same content in the message doesn't mean it's the same message; a new message is created when a user signs up, it's not the same message at all, so each message would have it's own id
_________________________
UGN Security, Elite Web Gamers & VNC Web Design Owner
Longtime UBB Supporter, UBB7 Beta Tester & Resident Post-A-Holic

Top
#184563 - 05/21/07 10:03 PM Re: Delete all PMs with 'Welcome' Subject [Re: Gizmo]
ntdoc Offline


Registered: 11/08/06
Posts: 3101
True, I get ya

Top
#192931 - 07/26/07 09:11 AM Re: Delete all PMs with 'Welcome' Subject [Re: Gizmo]
Taylor Offline
journeyman

Registered: 10/06/06
Posts: 85
Thank you for the script Gizmo.
I am one of the large site owners that does not have a clue about MySQL that welcomes anything that can make my look like if I did :-)

Top
#192961 - 07/26/07 04:45 PM Re: Delete all PMs with 'Welcome' Subject [Re: Taylor]
Gizmo Moderator Offline


Registered: 06/04/06
Posts: 11670
Loc: Portland, OR; USA
You're quite welcome; you may also be interested in my ubb sitemap script over @ UBBDev if you just moved over from another product, it'll help search engines to get your new urls in their discovery database all at once
_________________________
UGN Security, Elite Web Gamers & VNC Web Design Owner
Longtime UBB Supporter, UBB7 Beta Tester & Resident Post-A-Holic

Top
#215735 - 07/22/08 04:32 PM Re: Delete all PMs with 'Welcome' Subject [Re: Gizmo]
Markus_003 Offline
journeyman

Registered: 07/25/06
Posts: 54
Originally Posted By: Gizmo

Keep in mind that there are 2 parties in a PM, not just one. So when one person deletes, it's still there for the other user, until they delete the message as well.



Am I missing something? But how do you delete a PM. I know how to do it using MySQL, but having difficulty doing it through UBBthreads FORUM.

And I am talking here about deleting one post (reply) within a PRIVATE MESSAGE, not the entire PRIVATE TOPIC.

For instance, you have PERSON 1 creating TOPIC in PM and sending a PM to a PERSON 2. How PERSON 2 does delete his own message (reply) without removing himself from the topic.

There is no problem to edit your own PM post, but how do you delete it completely. Please note again, I am not talking about how to delete entire PRIVATE TOPIC.

Top
#215736 - 07/22/08 04:50 PM Re: Delete all PMs with 'Welcome' Subject [Re: Markus_003]
Gizmo Moderator Offline


Registered: 06/04/06
Posts: 11670
Loc: Portland, OR; USA
AFAIK there is no way to delete a POST from a Private Topic...
_________________________
UGN Security, Elite Web Gamers & VNC Web Design Owner
Longtime UBB Supporter, UBB7 Beta Tester & Resident Post-A-Holic

Top
#215741 - 07/22/08 05:19 PM Re: Delete all PMs with 'Welcome' Subject [Re: Gizmo]
Mitch P. Offline
addict

Registered: 06/23/06
Posts: 662
Somewhat related...I think there should be admin rights in private topics, allowing you to edit/delete.

http://www.ubbcentral.com/forums/ubbthre...html#Post198860

Top
#215768 - 07/23/08 03:47 AM Re: Delete all PMs with 'Welcome' Subject [Re: Gizmo]
Markus_003 Offline
journeyman

Registered: 07/25/06
Posts: 54
Originally Posted By: Gizmo
AFAIK there is no way to delete a POST from a Private Topic...



That is what I taught, however I had in one private topic two posts (original post and one reply). After a day there is only an original post. It is interesting that REPLIES COUNTERS is still displaying 1 but there is no reply. Any taught on how it might happen?

Top
Page 1 of 3 1 2 3 >