Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Add current post counter to each post! Details »»
Add current post counter to each post!
Mod Version: 1.00, by Tommy Boy (Coder) Tommy Boy is offline
Developer Last Online: Apr 2014 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 2.2.x Rating: (0 vote - 0 average) Installs: 1
Released: 08 Dec 2001 Last Update: Never Downloads: 0
Not Supported  

This hack adds a static counter to each post, in addition to the dynamic (total user posts) counter, which is currently used. It will show "Posts: 55/73" under the poster name, which indicated that this is the 55th post by this user, who has posted until now 73 posts in total.

This hack does NOT add any load to your board (except for deleting threads/posts, but this is optional). It is easy to install, just download the attached text file, and read the instructions.

What's new in version 1.1?
- Old posts counters are updated correctly (requested by bira)
- Correctly dealing with forums where posts should not count
- Fixed displayed counters for guests and imported posts

What's new in version 1.2?
- Static post counter is updated when deleting posts/threads (requested by bira)

What's new in version 1.3?
- Added support for single users update (useful in several situations)

What's new in version 2.0? (major release)
- Installer and updater integrated in the Admin control panel
- Option to update total users' post counts at the same time

What's new in version 2.1?
- Fixed bug in v2.0 installation (upgrade was still smooth)


Links:
- DOWNLOAD the hack
- Live Demo
- Admin control panel screenshot

Good luck!

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 08 Dec 2001, 23:44
exodus's Avatar
exodus exodus is offline
 
Join Date: Nov 2001
Real name: Jeff
is this the accumlative post number? or like they have here on vB.org where every post in a specific thread gets numbered? post #1, post #2, etc...

?
Reply With Quote
  #3  
Old 09 Dec 2001, 00:17
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
this is a very nice idea.

If I understand correctly, this is the number of post per USER, not per thread.

Meaning, when you read this post now, this is my 115th post out of 115 total posts I made on this Bulletin Board.

But the next time I post (here or in a different thread), this will show it to be my 115th post out of a total of 116th, etc.

So it will allow users to easily see at what point in your posting history this post was made. Was it your very first post? Was it your very last? etc.

I'll try this hack - the idea is nice.
Reply With Quote
  #4  
Old 09 Dec 2001, 03:23
pipi pipi is offline
 
Join Date: Nov 2001
Any demo? thanks for your hard work
Reply With Quote
  #5  
Old 09 Dec 2001, 03:50
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Ok, I am trying this hack on my development server which has NO traffic at all, and I can already tell you of one big pitfall in this hack:

The update-post-counters.php runs an UPDATE post SET ... query on ALL YOUR POSTS. With over half a million posts in my database, and for other websites with a lot of posts, this process will take A LONG TIME, and will eventually exceed the execution timeout limit in php.ini (if not crash your MySQL!)

You MUST change your hack installer to run at X number of posts at a time (like the "update counters" does). You cannot just release this installer without making this modification, because it will not be fully installed, and most posts will show 0/xxx.

I myself can't even get the hack installed yet because I have so many posts in the db. So I don't even know what it looks like or how it works

Last edited by bira : 09 Dec 2001 at 04:02.
Reply With Quote
  #6  
Old 09 Dec 2001, 04:43
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
After editing your update-post-counters.php to use limit and startat points, I've managed to install this hack.

Here is why the hack is at the moment worthless for existing bulletin boards:

Pitfall 1:

Users will now show in all of their existing posts totalposts/totalposts.

Eg, if I had 3000 posts so far, all my posts up to now will show 3000/3000 -- not very informative.

Pitfall 2:

If I delete a post, or an admin deletes a post, the currentpost will be bigger than the total posts.

Eg, if to use the same example as above, all my posts up to now will show:

3000/2999

....

Sorry, but only a new Bulletin Board owner should use this hack. It's worthless for boards that have been operating as long as I have

If you want to make it valuable, you need to change it to:

ORDER BY dateline ASC

and add $postcount = 1 before the loop, and $postcount++ after the loop. That will at least solve pitfall #1. It won't solve pitfal #2. Nothing normal will.

Either way, a word of warning: installing this hack takes, on moderate to big boards, close to one hour. And it takes a LOT or resources.
Reply With Quote
  #7  
Old 09 Dec 2001, 06:54
Tommy Boy Tommy Boy is offline
 
Join Date: Nov 2001
Lightbulb

Hehe, it's amazing, I was just thinking about these things when I went to sleep last night! If you want to wait, I'll provide a fix when I come back from work.

This hack IS possible, and has a lot of potential. Please give me a chance to prove it.
Reply With Quote
  #8  
Old 09 Dec 2001, 10:48
Tommy Boy Tommy Boy is offline
 
Join Date: Nov 2001
Ok, I couldn't wait, so I released the fix already (first post updated)

Bira, please try it on your huge database, it should work fine, but let me know if it doesn't, for any reason... It takes less than 5 seconds to run on my database, and I have over 60k posts.

So anyway, this fixes your pitfall #1. Now let's talk about your pitfall #2. First of all, many people will not consider it a problem, but a "feature", since even though some of this user's posts were deleted, this still remains his Xth post, and there is no reason to modify this. This is a "logical" issue, if you will. In any case, I have decided to make it part of the hack after all.

Anything else I can do for you, sir?
Reply With Quote
  #9  
Old 09 Dec 2001, 11:08
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Tommy I'm a girl!

I want to send you something by e-mail. I can't attach files to an e-mail via the BB, so can you please e-mail me at goren@atlasf1.com your addy, so I can send it to you?

I think you'll like it
Reply With Quote
  #10  
Old 09 Dec 2001, 11:13
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Tommy did you upload a new zip file? The one I just downloaded has exactly the same php file
Reply With Quote
  #11  
Old 09 Dec 2001, 11:14
Tommy Boy Tommy Boy is offline
 
Join Date: Nov 2001
Oops, sorry about that, m'lady!

Email sent.
Reply With Quote
  #12  
Old 09 Dec 2001, 11:20
Tommy Boy Tommy Boy is offline
 
Join Date: Nov 2001
Originally posted by bira
Tommy did you upload a new zip file? The one I just downloaded has exactly the same php file
It must be your cache... Anyway, I have uploaded it under another name now, so please try to download it again.
Reply With Quote
  #13  
Old 09 Dec 2001, 11:29
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Tommy this is so weird. When I click on the link to the zip file, even though it's named ***v12, it downloads static-post-counter.zip -- the old zip.

I cleared my cache and it still does that

Can you e-mail it to me please?
Reply With Quote
  #14  
Old 09 Dec 2001, 11:36
Tommy Boy Tommy Boy is offline
 
Join Date: Nov 2001
Sure, there you go girl!
Reply With Quote
  #15  
Old 09 Dec 2001, 21:05
Tommy Boy Tommy Boy is offline
 
Join Date: Nov 2001
I removed the attachment from the first post by mistake, and now I can't add it back

So download the hack from here please. Thank you!
Attached Files
File Type: txt install_post_counters_v21.txt (11.5 KB, 166 views)

Last edited by Tommy Boy : 18 Dec 2001 at 18:17.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 00:51.

Layout Options | Width: Wide Color: