php forum
php mysql forum
php mysql smarty
 
Page 4 of 6 < 1 2 3 4 5 6 >
Topic Options
#258566 - 04/07/04 04:42 PM Re: Useful MySQL Queries for UBB.Threads [Re: SurfMinister]
DLWebmaestro Offline
Member

Registered: 08/08/00
Posts: 1753
Loc: California, MD

   Re: Useful MySQL Queries for UBB.Threads to Del.icio.us Add to del.icio.us
  Digg Re: Useful MySQL Queries for UBB.Threads Digg it
How about a query that will pull all users that have posted in the past X number of days?
_________________________
Webmaster
Drumlines.org

Drumlines.org UBBThreads

Top
#258567 - 04/09/04 10:21 PM Re: Useful MySQL Queries for UBB.Threads [Re: eslmix]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
You want fries and a coke with that <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /> <br /> <br />SELECT t2.U_Username <br />FROM w3t_Posts AS t1 <br />LEFT JOIN w3t_Users AS t2 ON t1.B_PosterId = t2.U_Number <br />WHERE B_Posted > UNIX_TIMESTAMP( DATE_SUB( CURDATE( ) , INTERVAL 1 <br />MONTH ) ) <br />GROUP BY t2.U_Username ASC <br /> <br />Change the interval to whatever you want <br /> <br />3 DAY <br />7 DAY <br />15 DAY <br />1 WEEK <br />3 WEEK <br />6 WEEK <br />2 MONTH <br />6 MONTH <br />etc etc
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#258568 - 04/10/04 02:35 PM Re: Useful MySQL Queries for UBB.Threads [Re: sf49rminer]
DLWebmaestro Offline
Member

Registered: 08/08/00
Posts: 1753
Loc: California, MD
w00t! You da man! <img src="http://www.ubbdev.com/forum/images/graemlins/grin.gif" alt="" />
_________________________
Webmaster
Drumlines.org

Drumlines.org UBBThreads

Top
#258569 - 04/15/04 01:52 PM Re: Useful MySQL Queries for UBB.Threads [Re: eslmix]
DLWebmaestro Offline
Member

Registered: 08/08/00
Posts: 1753
Loc: California, MD
I want to write a query that will delete all threads that were either closed or moved over a month ago. Here is what I have come up with: <br /> <br />
Code:
 <br />DELETE FROM w3t_Posts <br />WHERE B_Last_Post &gt; UNIX_TIMESTAMP( DATE_SUB( CURDATE( ) , INTERVAL 1 MONTH ) ) <br />AND B_Status = "C" <br />OR B_Status = "M" <br />
<br /> <br />Is this all correct?
_________________________
Webmaster
Drumlines.org

Drumlines.org UBBThreads

Top
#258570 - 04/15/04 04:46 PM Re: Useful MySQL Queries for UBB.Threads [Re: eslmix]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
Question.. whatif there is a poll in one of those posts.. won't that mess up the poll tables?
_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#258571 - 04/15/04 07:15 PM Re: Useful MySQL Queries for UBB.Threads [Re: 234234]
DLWebmaestro Offline
Member

Registered: 08/08/00
Posts: 1753
Loc: California, MD
So I guess I'd have to make a script out of it then, so it can look for polls and purge the corresponding tables? But without that, it would just leave orphaned tables though, right? No harm but taking up space, right?
_________________________
Webmaster
Drumlines.org

Drumlines.org UBBThreads

Top
#258572 - 04/15/04 10:08 PM Re: Useful MySQL Queries for UBB.Threads [Re: eslmix]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Yeah, I wouldn't manually delete posts - there are several other things which need adjusting and mismatched post counts to board totals and post totals are exactly what cause that blank page issue you have from time to time.<br /><br />Study the scripts which expire or delete the threads - and you'll see the stuff that needs to be deleted as well.<br /><br />Off the top of my head:<br /><br />- Adjust the post/thread count in the boards table.<br />- Any users who have those threads as their favorites<br />- Anybody with post reminders to those threads<br />- Polls, their options and results attached to those posts<br />- File attached to those posts<br /><br />You don't want all that stuff to get out of sync.<br />There might be more - just thinking out loud.
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#258573 - 04/17/04 01:59 PM Re: Useful MySQL Queries for UBB.Threads [Re: Daine]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
As Josh suggested study the expire files real well to see everything that transpires.
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#258574 - 04/17/04 09:08 PM Re: Useful MySQL Queries for UBB.Threads [Re: charts]
Ohmu Offline
Lurker

Registered: 04/12/04
Posts: 3
Has anyone ever written a script to automate adding new users or adding a long list of users in one fell swoop? <br /><br />We've got a bunch of users from a newsgroup and would like to move the entire group to ubb.threads but adding users one by one is drudgery.<br /><br />Seems like it'd be possible to figure out by analyzing the addusers.php file line by line but just wondering if anyone's tried it.

Top
#258575 - 04/17/04 10:20 PM Re: Useful MySQL Queries for UBB.Threads [Re: Arash]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
You could add the users and give them all the same generic password which they could then change using an INSERT but all the other options that basically get entered also would suffer the same fate as the password. Easier to setup the board and let the user himself register himself.
_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#258576 - 04/19/04 02:31 AM Re: Useful MySQL Queries for UBB.Threads [Re: 234234]
Ohmu Offline
Lurker

Registered: 04/12/04
Posts: 3
We'd like to keep the board ultra-secure/private so I've deleted the New User button and am being the doorman.<br /><br />We've already got old user info/password hashes in mysql, and would like to just transfer this old mysql database to ubb.threads. <br /><br />Seems like there's a lot more involved than just the w3t_users table when creating new users though. If anybody's got any idea of the web of chain mysql reactions that goes into creating a new user, please give a honk. <img src="http://www.ubbdev.com/forum/images/graemlins/rainbow.gif" alt="" />

Top
#258577 - 04/19/04 08:10 AM Re: Useful MySQL Queries for UBB.Threads [Re: Arash]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
Just take a look at Adduser.php its all there <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#258578 - 04/19/04 08:17 AM Re: Useful MySQL Queries for UBB.Threads [Re: 234234]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
also take a look at this mod<br /><br />http://www.ubbdev.com/forum/showflat.php/Number/104373
_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#258579 - 04/22/04 07:48 PM Re: Useful MySQL Queries for UBB.Threads [Re: 234234]
Ohmu Offline
Lurker

Registered: 04/12/04
Posts: 3
Wow, that mod rocks and does most of the job.<br /><br />Thanks scroungr!<br /><br /> <img src="http://www.ubbdev.com/forum/images/graemlins/thankyousign.gif" alt="" />

Top
#258580 - 05/01/04 01:35 PM Re: Useful MySQL Queries for UBB.Threads [Re: Arash]
msula Offline
Addict

Registered: 02/18/02
Posts: 1969
Loc: Lansing, Michigan
Here is one I need help with. I did some major group re-structuring last week, and a few dozen people (maybe more) are now not part of any group, not even the default "Users" <img src="http://www.ubbdev.com/forum/images/graemlins/blush.gif" alt="" /><br /><br />This causes them to get mysql errors when trying to browse the forums, since they aren't in a group so they get weird errors. <br /><br />I want a query to find these users who do not have a group assigned so I can fix their accounts. And even better, another query to automatically search for someone without a group, and if they don't have one they are assigned to the Users group.

Top
#258581 - 05/01/04 02:26 PM Re: Useful MySQL Queries for UBB.Threads [Re: palmen]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
Select * from w3t_Users where U_Groups = "" or U_Groups is NULL or U_Groups = "--"<br /><br />That should grab all users with empty groups. The last one shouldn't be necessary.
_________________________
Running a community? -> Keep informed and take it to the next level

Top
#258582 - 05/01/04 10:05 PM Re: Useful MySQL Queries for UBB.Threads [Re: -Fusion-]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
yeah then do an <br /><br />UPDATE w3t_Users SET U_Groups = "-4-" WHERE U_Groups = "" or U_Groups is NULL or U_Groups = "--"
_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#258583 - 05/02/04 10:06 AM Re: Useful MySQL Queries for UBB.Threads [Re: 234234]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
Thx, forgot to write up the update statement.
_________________________
Running a community? -> Keep informed and take it to the next level

Top
#258584 - 05/03/04 02:57 PM Re: Useful MySQL Queries for UBB.Threads [Re: -Fusion-]
msula Offline
Addict

Registered: 02/18/02
Posts: 1969
Loc: Lansing, Michigan
Thanks, you guys rock <img src="http://www.ubbdev.com/forum/images/graemlins/grin.gif" alt="" />

Top
#258585 - 05/13/04 02:48 PM Re: Useful MySQL Queries for UBB.Threads [Re: Daine]
Slawek_L Offline
Enthusiast

Registered: 01/28/03
Posts: 364
Loc: Poland, Warsaw
TOP posters from any forum (here 'hp') <br /><br />SELECT t1.B_PosterId,t2.U_Username,count(*) AS liczba <br />FROM w3t_Posts AS t1,w3t_Users AS t2 <br />WHERE t1.B_PosterId = t2.U_Number <br />AND t1.B_Board = "hp" <br />GROUP BY t1.B_PosterId <br />ORDER BY liczba desc

Top
Page 4 of 6 < 1 2 3 4 5 6 >


Who's Online
0 Registered (), 23 Guests and 4 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Blogs, love em or hate em?
by Ian_W
10/05/08 03:47 PM
What do you use to edit the files
by Ian_W
10/05/08 03:33 PM
BeyondCompare v3.00
by Ian_W
10/05/08 03:32 PM
Glossy Black Theme with Image Reflection
by Gizmo
10/05/08 02:17 PM
ShareThis
by Gizmo
09/28/08 05:06 AM
[7.3] Viewing MySQL logfiles made easier
by AllenAyres
09/27/08 09:57 PM
Looking for a simple upload script
by Murphdog
09/26/08 08:45 PM
New Mods
[7.3] Viewing MySQL logfiles made easier
by blaaskaak
09/24/08 05:39 PM
[7.3] Language file checker
by blaaskaak
09/09/08 12:56 AM
[7.3.1] add search to showmembers page
by blaaskaak
09/07/08 04:50 AM
Multiple Identity Detector
by
12/30/06 06:39 PM
Newest Members
ghengis317, NitroX, Dogan, EliYah-, W-D
13344 Registered Users
Top Posters Last 30 Days
AllenAyres 16
blaaskaak 12
FREAK1 7
Mike L_dup1 4
Chris Bale 4
Ian_W 4
W-D 3

 

 

 
fusionbb message board php hacks