php forum
php mysql forum
php mysql smarty
 
Page 3 of 6 < 1 2 3 4 5 6 >
Topic Options
#258546 - 01/09/04 10:30 AM Re: Useful MySQL Queries for UBB.Threads [Re: sf49rminer]
CurlGirl Offline
Newbie

Registered: 12/20/03
Posts: 18

   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
Believe me. It would have taken ME longer to do that and then fix what I screwed up doing that...right now I'm a bit gun shy. I knew that I couldn't screw things up too bad this way. Me and sleep deprivation are a dangerous mix. Stupidity abounds! Thanks anyway!

Top
#258547 - 01/14/04 12:53 PM Re: Useful MySQL Queries for UBB.Threads [Re: GrandAmEmt]
Storm_dup1 Offline
Member

Registered: 08/03/02
Posts: 263
Loc: Somewhere above Texas
What query would I need to find out who all belongs to a certain group?
_________________________
Some people read their stars..... I choose to write my own

Top
#258548 - 01/14/04 01:01 PM Re: Useful MySQL Queries for UBB.Threads [Re: ]
Storm_dup1 Offline
Member

Registered: 08/03/02
Posts: 263
Loc: Somewhere above Texas
oops... Never mind.... lol Figured out I could do it from the AP..... <img src="http://www.ubbdev.com/forum/images/graemlins/laugh.gif" alt="" />
_________________________
Some people read their stars..... I choose to write my own

Top
#258549 - 02/08/04 04:54 PM Re: Useful MySQL Queries for UBB.Threads [Re: ]
dman_dup1 Offline
Journeyman

Registered: 01/14/03
Posts: 144
I'd like to know that question. I demoted a moderator and it still showed him in group "2" and he could still read the forums in the admin section. I ran a querie to make his groups right but I can't seem to figure out the correct querie to see if anyone else is in that group that isn't supposed to be.

Top
#258550 - 02/08/04 07:31 PM Re: Useful MySQL Queries for UBB.Threads [Re: ]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
SELECT `U_Username` , `U_Groups` <br />FROM `w3t_Users` <br />WHERE `U_Groups` <br />LIKE "%-2-%" <br /> <br />change the FROM `w3t_Users` <br /> to your table extension, mine's w3t_ <br />also change the %-2-% to whichever group your looking for.
_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#258551 - 02/08/04 08:18 PM Re: Useful MySQL Queries for UBB.Threads [Re: 234234]
dman_dup1 Offline
Journeyman

Registered: 01/14/03
Posts: 144
<img src="http://www.ubbdev.com/forum/images/graemlins/waytogo.gif" alt="" /> Thanks!

Top
#258552 - 02/16/04 02:21 PM Re: Useful MySQL Queries for UBB.Threads [Re: sf49rminer]
smoknz28 Offline
Enthusiast

Registered: 04/10/03
Posts: 393
Loc: Washington, D.C.
My glasses need cleaning again? Is there a query to run that I can input an IP and find out who all (Username or Login Name) has been using that particular IP? <br /> <br />Thanks...
_________________________
F-Body Hideout
Project Speedy

Top
#258553 - 02/16/04 04:31 PM Re: Useful MySQL Queries for UBB.Threads [Re: General_Failure]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
SELECT `U_Username`, `U_Group`, `U_RegIP`, `B_IP`, `B_PosterId`<br />FROM `w3t_Posts`, `w3t_Users`<br />WHERE (((`B_IP` = '192.168.1.1') AND (`B_PosterId` = `U_Number`)) OR (`B_IP` = '192.168.1.1'))<br /><br />change I192.168.1.1 to what your loking for<br />and then stand back cause on large boards this MAY time out since it will go through all the posts looking for IP addresses of the poster and matching that up where it can to the User and if an anon it won;t spit out a Username.
_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#258554 - 02/16/04 07:58 PM Re: Useful MySQL Queries for UBB.Threads [Re: 234234]
smoknz28 Offline
Enthusiast

Registered: 04/10/03
Posts: 393
Loc: Washington, D.C.
I ran this query and it came up with errors:<br /><br />SELECT `U_Username`, `U_Group`, `U_RegIP`, `B_IP`, `B_PosterId`<br />FROM `w3t_Posts`, `w3t_Users`<br />WHERE (((`B_IP` = '199.253.23.1') AND (`B_PosterId` = `U_Number`)) OR (`B_IP` = '199.253.23.1'))<br /><br />The IP listed is the one in question from my site.<br /><br />Here are the errors that were returned:<br /><br />SQL ERROR: Unable to do_query: SELECT `U_Username`, `U_Group`, `U_RegIP`, `B_IP`, `B_PosterId` FROM `w3t_Posts`, `w3t_Users` WHERE (((`B_IP` = '199.253.23.1') AND (`B_PosterId` = `U_Number`)) OR (`B_IP` = '199.253.23.1'))<br />Unknown column 'U_Group' in 'field list'<br />Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource in /home/smoknz28/public_html/ubbthreads/mysql.inc.php on line 167<br /><br />Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/smoknz28/public_html/ubbthreads/mysql.inc.php on line 133
_________________________
F-Body Hideout
Project Speedy

Top
#258555 - 02/16/04 08:55 PM Re: Useful MySQL Queries for UBB.Threads [Re: General_Failure]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
SELECT `U_Username`, `U_Groups`, `U_RegIP`, `B_IP`, `B_PosterId` <br />FROM `w3t_Posts`, `w3t_Users` <br />WHERE (((`B_IP` = '199.253.23.1') AND (`B_PosterId` = `U_Number`)) OR (`B_IP` = '199.253.23.1')) <br /> <br /> <br />sorry I typoed.. U_Group should be U_Groups
_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#258556 - 03/03/04 10:47 AM Re: Useful MySQL Queries for UBB.Threads [Re: 234234]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25429
Loc: Texas
I've got a question:<br /><br />I imported a ubb.classic to threads. Because of an issue with custom forum headers I needed to empty the posts table and re-import them. Now all posts have the person who posted the message as 'unregistered':<br /><br />http://www.praisecafe.org/forum/ubbthreads.php<br /><br />Is there a way to re-associate the poster within the post with the actual user profile?<br /><br />note: this is a test forum, we plan to do this actually on a live site for someone else...
_________________________
- Allen wavey
- What Drives You?

Top
#258557 - 03/03/04 11:46 AM Re: Useful MySQL Queries for UBB.Threads [Re: SurfMinister]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
<img src="http://www.ubbdev.com/forum/images/graemlins/crazy.gif" alt="" /><br />Not sure how that can be done on a large scale. But to do it individually to a post - this is the query to use:<br /><br />UPDATE w3t_Posts<br />SET B_Reged = 'y',<br />B_PosterId = number<br /><br /><br />B_Reged is set to 'y' for "yes" meaning they are registered and B_PosterId is the user number.<br /><br />The name is being stored in the B_AnonName field - I'm not sure if there's a way to do a query which matches them up and would let you update the whole thing at a time. <img src="http://www.ubbdev.com/forum/images/graemlins/crazy.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#258558 - 03/03/04 11:55 AM Re: Useful MySQL Queries for UBB.Threads [Re: Daine]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Allen - untested, but name the attached .php and put it in your threads directory - and give it a run. See if it updates the posts to match the user database.


Attachments
109215-updateanonposts.txt (84 downloads)

_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#258559 - 03/03/04 12:47 PM Re: Useful MySQL Queries for UBB.Threads [Re: Daine]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25429
Loc: Texas
Done! 3 post records updated!<br /><br /><img src="http://www.ubbdev.com/forum/images/graemlins/tongue.gif" alt="" /> Thanks, not sure why it's only fixing 3 <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /> Maybe the posters aren't 'anon', just unregged, sorta like someone who gets banned or deleted?
_________________________
- Allen wavey
- What Drives You?

Top
#258560 - 03/03/04 06:25 PM Re: Useful MySQL Queries for UBB.Threads [Re: SurfMinister]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
OK - so it kinda worked but didn't update everything. Let me tweak it a bit. <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#258561 - 03/03/04 06:26 PM Re: Useful MySQL Queries for UBB.Threads [Re: Daine]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Allen - alter the first query to be like this:<br /><br />
Code:
<br /><br />	SELECT B_AnonName,B_Number<br />	FROM {$config['tbprefix']}Posts<br />	WHERE B_Reged = 'n'<br />	OR B_PosterId = 1<br />
<br /><br />See if that does more. <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#258562 - 03/03/04 08:09 PM Re: Useful MySQL Queries for UBB.Threads [Re: Daine]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25429
Loc: Texas
Done! 29763 post records updated!<br /><br /><img src="http://www.ubbdev.com/forum/images/graemlins/yay.gif" alt="" /><br /><br />OK, it works... if I try it on the other site with 400k posts it might kill the server, I'll give it a shot late at night <img src="http://www.ubbdev.com/forum/images/graemlins/tongue.gif" alt="" />
_________________________
- Allen wavey
- What Drives You?

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

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
he he<br />Yeah, it's not exactly "efficient" - but it works. <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /><br /><br />If the above times out - it shouldn't hurt to simply run it again - as each time it's grabbing anonymous posts and processing them. So if you have to rerun it, it'll just keep picking anonymous posts and looking up the user.<br /><br /><br />Also - the last little tidbit will be to update post counts (counting up all their posts) so that their profile is correct. I'll make you a separate little script for that. So that after you're done, you can run that and then the user's post counts will be correct. <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#258564 - 03/03/04 10:20 PM Re: Useful MySQL Queries for UBB.Threads [Re: Daine]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Allen - try this script (untested) to update everyone's post counts. <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />


Attachments
109302-count.txt (52 downloads)

_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#258565 - 03/03/04 11:09 PM Re: Useful MySQL Queries for UBB.Threads [Re: Daine]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25429
Loc: Texas
sweet, worked real well <img src="http://www.ubbdev.com/forum/images/graemlins/peace.gif" alt="" />
_________________________
- Allen wavey
- What Drives You?

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


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

Latest Posts
Blogs, love em or hate em?
by AllenAyres
Today at 02:05 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
pisa666, ghengis317, NitroX, Dogan, EliYah-
13345 Registered Users
Top Posters Last 30 Days
AllenAyres 18
blaaskaak 12
FREAK1 7
Mike L_dup1 4
Chris Bale 4
Ian_W 4
tackaberry 4

 

 

 
fusionbb message board php hacks