1 (edited by Grez 2012-01-10 16:33)

Topic: Real posts count

Real posts count extension changes PunBB's post counter so that it will lower the post count when post is deleted.

//Note: Extension recounts users posts when installed

Download v1.0a (with fixes by Astro)
GitHub

Eraversum - scifi browser-based online webgame

2 (edited by gragra 2012-01-10 17:11)

Re: Real posts count

Hey thanks for the efforts. Got error when installing.

Database reported: Unknown column 'posts.poster_id' in 'where clause' (Errno: 1054).

Failed query: UPDATE prefix_users AS u SET u.num_posts = (SELECT count(*) FROM prefix_posts WHERE posts.poster_id = u.id GROUP BY posts.poster_id)

3

Re: Real posts count

Weird... what db engine do you use in your forum?

Eraversum - scifi browser-based online webgame

Re: Real posts count

Wamp. MySQL. After i change posts.poster id to poster_id then it install. But not work how it have to.

Re: Real posts count

So? Any news?

Re: Real posts count

Hello

it works for punbb 1.3.x ?

7 (edited by Astro 2012-04-05 20:45)

Re: Real posts count

There were two typos in the manifest.xml file.

Lines 26–31 (typo is on line 28)

        $subquery = array(
            'SELECT' => 'count(*)',
            'FROM' => 'posts',
            'WHERE' => 'posts.poster_id = u.id',
            'GROUP BY' => 'posts.poster_id'
        );

should have been

        $subquery = array(
            'SELECT' => 'count(*)',
            'FROM' => 'posts as posts',
            'WHERE' => 'posts.poster_id = u.id',
            'GROUP BY' => 'posts.poster_id'
        );

and line 68

        <hook id="fn_delete_post_qr_delete_post'">

should have been

        <hook id="fn_delete_post_qr_delete_post">

Tested and works with 1.4.2.

Re: Real posts count

Hello
This is a great plug in
But....I have some problems
I can't install
it's always show me I should install later when I try to install every time......
my pun 1.4.2 was installed with  SQLite
Are there any extensions should be install first?..or require..

9 (edited by testam 2012-04-17 16:56)

Re: Real posts count

Any guides to help me thank a lots

10

Re: Real posts count

Have you made the changes described in #7 before installation?

PS: Additionaly I've corrected the extension for those who don't want to fix it themselves, so if you didn't you can easily download it by clicking on this link and install right away.

11

Re: Real posts count

This is very useful feature.
It has to be included in PunBB core. Or at minimum PunBB developers has to make this extension official.

Using PunBB since 2006 at Forex Forum

12 (edited by Astro 2012-04-26 00:06)

Re: Real posts count

I don't think that this will ever be included into the core (read more, focus on posts by Rickard). Actually I don't really think that it is a good idea to use this extension because it doesn't recover values upon uninstallation, so if you are (or ever were) forced to prune old posts due to database capacity or whatever the reason for pruning database could be or you just change your mind – either way you are going to lose information about who has contributed the most in the past.

13

Re: Real posts count

lose information about who has contributed the most in the past

Spam we delete is not a contribute.

Without this feature "Number of posts" must be renamed to "Number of postings".

..
P.S.
Your "read more" link is broken.

Using PunBB since 2006 at Forex Forum

14

Re: Real posts count

I tried to download and install the file which was fixed ...
but....still...Error
Please  try again after 5-10min...
So sad    (T口T)    Problem still here
may be it isn't for sqlite  _~_"?
anyway thanks    @v@ I will decrease the post counter manually on my punbb forum site

15 (edited by testam 2012-04-22 09:58)

Re: Real posts count

^^ Oh yeah   It is work if use Grez's original manifest.xml
Thanks Astro and Grez

If someone have the same problem remind you install  later after x mins
you could 

  • creat a blank txt file

  • changes described in #7 before installation Post By Astro

  • save and rename to manifest.xml

Re: Real posts count

thx astro..
your script is work smile

17

Re: Real posts count

I've approved fixes by Astro and updated first post. Enjoy!

Re: Real posts count

This little mod not working how it have to. When deleting topics via topic moderate no effect on post count at all.

Re: Real posts count

With fixes by Astro works perfectly, but last posted timestamp leaves unchanged. Please improve to update last posted too.

Re: Real posts count

Works for 1.4.4. Thanks.