Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
This script will display the thread and post count of your boards along with the actual thread and post count at the time of loading. Stored values that do not match the actual values will be highlighted. If there are discrepencies you will have an option to "UPDATE" the information.


The instructions are in the script for installation. Basicly add a new link to your menu.php script in your admin directory and upload both scripts to your admin directory.


Hope someone finds this usefull. I made it because I wanted to try and count posts for each board with one query and then it evolved. LoL <img src="/threads/php/images/icons/crazy.gif" alt="" />


Edit: The latest version of this script is attached to this post.
Attachments
51574-checkpostcount.zip (0 Bytes, 53 downloads)

Last edited by Gardener; 11/12/2002 11:53 PM.
Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
interesting

mine was off a bit in both threads and posts - what happened to the posts that were stored and not counted when I clicked on "update" It showed ~18044 listed and 18060 stored... When I updated, both numbers dropped to 18044 )


- Allen wavey
- What Drives You?
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
The stored number was off then. The "actual" number list is what the script counted for each board when it loaded. When you cliked "update" it loads the page again but adjusts the stored count to what it actually counted while loading.


Just a note: It will not count unapproved posts.

Last edited by JustDave; 07/02/2002 10:56 PM.
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
ok, thanks neat little utility


- Allen wavey
- What Drives You?
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Your Welcome

Sponsored Links
Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Now this is a useful tool! I'll add it to my 'add on after upgrading to 6.0.2 list'

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
It works great.

I'm using it with 6.1b2.

The only change needed is to replace "w3t_" with "{$config['tbprefix']}" for 6.1. Otherwise, I think it's ready for Finished Modifications.

I wonder if the following code could be used for 6.0-6.1 compatibility:
if (!isset($config['tbprefix'])) {
$config['tbprefix'] = 'w3t_';
}

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
That's not a bad idea. Then it will be of use across both versions.

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
A couple of other suggestions.

1) $error should be set if the thread or post counts differ for any of the individual boards, rather than by comparing the total counts. It's possible, although unlikely, that discrepancies in two boards could cancel out.

2) To make this function more user-friendly, add the following text (or something similar) to the top of the display.

If all counts agree: "Stored and actual counts agree - no corrections required."

If there are discrepancies: "Stored and actual counts differ - use the Update button to correct the stored counts."


Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
I have updated the script to make it work with 6.0.x as well as 6.1+ as was mentioned in this thread. I also added the more detailed error check and added the extra information to make it more user friendly as was suggested as well. Some cosmetic changes were made as well.

It is still the same script that JustDave wrote though, so all credit should go to him.
Attachments
60315-checkpostcount.zip (0 Bytes, 17 downloads)

Sponsored Links
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Thanks

Shouldn't the initial post be updated with the new attachment?

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Yeah, you're right. I've updated the original post with the new version of the script.

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Just in case I forget ...

A small fix to this hack will make it compatible with 6.2. If no one else adds this fix, please remind me about this after 6.2 goes into public beta, and I'll post it here.

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
I'll jump the gun and post this fix for 6.2 now, while I'm thinking about it, although 6.2br1 hasn't been released yet.

Change:

code:
if ($option == "UPDATE") {



To (option 1, compatible with 6.0, 6.1 and 6.2):

code:
if (isset($HTTP_POST_VARS['option']) and $HTTP_POST_VARS['option'] == "UPDATE") {



Or To (option 2, compatible with 6.2 only):

code:
if (get_input('option', 'post') == "UPDATE") {



Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Thanks keeping this updated Dave/Gardener.
I am surpised this little utility gets the use it does. (it is handy though)


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)