Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - REQ: Update Members Post Counts
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

REQ: Update Members Post Counts

 Post Reply Post Reply Page  <123>
Author
MrMellie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 December 2006
Location: United Kingdom
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote MrMellie Quote  Post ReplyReply Direct Link To This Post Posted: 26 March 2007 at 9:44am
Oli, I could probably sort this for you. I had to do something similar for the Photo Album to resync the image and comment counts whilst I was developing it. I'm sure it could be simply changed to do what you require.
Back to Top
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post Posted: 26 March 2007 at 12:18pm
If you don't mind, that would be great!
 
Thanks
Back to Top
MrMellie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 December 2006
Location: United Kingdom
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote MrMellie Quote  Post ReplyReply Direct Link To This Post Posted: 26 March 2007 at 10:18pm
You have email Oli. Smile
Back to Top
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post Posted: 27 March 2007 at 12:44pm
Thanks Ric!
 
Testing it now - a couple of problems, but due to the server timeout settings, so I've had to temporarily change them in common.asp so it continues to run to update each member (setting them in the update file doesn't work, as common.asp seems to override it).
 
Thanks again!
Back to Top
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post Posted: 27 March 2007 at 12:58pm
Just completed running it on my test forum, and not sure why, but there's a difference in numbers...
 
Forum says 124,280 (which a count on tblThreads also shows)
Sum of No_of_posts in tblAuthor shows 124,177
 
Strange Confused but a lot closer than it was!  Any ideas?
Back to Top
MrMellie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 December 2006
Location: United Kingdom
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote MrMellie Quote  Post ReplyReply Direct Link To This Post Posted: 27 March 2007 at 1:13pm
Have you ever deleted a user? Just wondering if there's some threads that relate to a now non-existant author_id?
 
edit: scratch that, there's a foreign key constraint on author_id that doesn't allow threads with non-existant author_id's.


Edited by MrMellie - 27 March 2007 at 1:28pm
Back to Top
MrMellie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 December 2006
Location: United Kingdom
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote MrMellie Quote  Post ReplyReply Direct Link To This Post Posted: 27 March 2007 at 1:38pm
OK, just incase there are somehow some threads with non-existant authors (maybe created from the Snotz transfer?) try running this SQL against the database. It will show any author_id's in tblThreads with no matching author.
 
select distinct T.author_id, A.Username
from tblThread T left join tblAuthor A on A.author_id=T.Author_id
where username is null
Back to Top
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post Posted: 27 March 2007 at 6:37pm
Bingo!
 
There's 103 replies which belong to an Author_ID of 2, but no author exists.
 
124,177 + 103 = 124,280
 
Now, is it a simple case of deleting those replies, or will that knock something out somewhere?  I've already checked to see if they're showing on the forum, which they're not.  I don't think there's anyway of inserting a user of Author_ID = 2 into the database, as Guest uses that number...I think.
 
EDIT - I created a new user, and edited the Author_ID = 2 to reflect the new user's ID.  The posts have appeared on the forum now, so looks like that'll solve the problem.  I've done all this on a test forum, so please let me know if you can think of anything that this will affect, before running on my live forum.
 
Cheers Ric!


Edited by MortiOli - 27 March 2007 at 6:56pm
Back to Top
 Post Reply Post Reply Page  <123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.