1

Topic: Count Posts On The Fly

I recently deleted 5 or so posts from a suser on my PunBB test forum and it didn't affect the users post count. Now I was wondering if you could insert a function where when a thread/profile is viewed it will quickly count posts from that user and display the number.

If you did it that way, it would eliminate some code on the Profile page. Therefore making it faster.

"You start coding. I'll go find out what they want." - Computer Analyst to Programmer

Re: Count Posts On The Fly

The post count reflects the number of posts a user has made, not the number of posts that is in the database. This is a design choice I made.

I don't really understand what you are proposing. How would that eliminate code on the profile page?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3

Re: Count Posts On The Fly

Hmm. Well why not have it so it reflects the number of posts the user currently has in the database. Or I could do a mod for you so if people want it counting the database posts they can use the mod.

And by doing it this way, it would eliminate the code on the profile page where you can change the number of somebodys posts. If the post number is automatically created o-t-f, then you wouldn't need the ability to edit the # of their posts. Right?

"You start coding. I'll go find out what they want." - Computer Analyst to Programmer

Re: Count Posts On The Fly

Mako wrote:

Hmm. Well why not have it so it reflects the number of posts the user currently has in the database.

Because I think the actual number of posts a user has made is more interesting than how many are left in the database. A lot of big boards have to prune old posts on a regular basis and if post counts are decreased when they do this, the users get mad.

Mako wrote:

Or I could do a mod for you so if people want it counting the database posts they can use the mod.

Yes, you can :)

Mako wrote:

And by doing it this way, it would eliminate the code on the profile page where you can change the number of somebodys posts. If the post number is automatically created o-t-f, then you wouldn't need the ability to edit the # of their posts. Right?

Well, as an administrator there are several reasons why you would want to change someones post count. As "punishment" for people who spam the forums to get a high post count is one. The code for allowing admins to change the post count is just a few lines anyway, so I can't think of a good reason for removing it. It doesn't affect performance in any way.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

5

Re: Count Posts On The Fly

Alright. Would you want me to make a mod that counts the posts a user has in the db?

"You start coding. I'll go find out what they want." - Computer Analyst to Programmer

Re: Count Posts On The Fly

I want there to be as many mods as possible for PunBB, so yeah :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

7

Re: Count Posts On The Fly

Alright. When I am done with it, you want me to email it to you so you can post it on the PunBB site?

"You start coding. I'll go find out what they want." - Computer Analyst to Programmer

Re: Count Posts On The Fly

No, download the MOD_SDK from the download page. It includes instructions :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

9 (edited by Mako 2003-08-26 20:41)

Re: Count Posts On The Fly

Awesome. Thanks man. These mods should be done within a week.

"You start coding. I'll go find out what they want." - Computer Analyst to Programmer

10

Re: Count Posts On The Fly

Frankly, I think that PunBB should include that if you delete 1 post of a member, he's post count should be changed into {count} -1 (less a 1).

Dan, (Official, i hope :D) PunBBHeb Translator.

Re: Count Posts On The Fly

Well, I don't :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

12

Re: Count Posts On The Fly

Lol. Don't worry Wooty. My mod for that will be out by Monday. :-)

"You start coding. I'll go find out what they want." - Computer Analyst to Programmer