e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
321 stars 213 forks source link

User post counts in user.php don't reflect those in the drop down on forum posts #716

Closed skcihmit closed 10 years ago

skcihmit commented 10 years ago

The short code referenced in the user.php is either counting wrong (it counted 25 posts for me when I have 1500 not including pruned posts) or if changing to the commented out code to use user_forums (apparently we still have that field in our user table). I feel it should be using the extended user field user_plugin_forum_posts which accounts for pruned posts and is what the {USERCOMBO} shortcode uses to determine user post count for that drop down box above an avatar.

Moc commented 10 years ago

Please check and see if things are more accurate now, using the latest files from Github.

Minnn commented 10 years ago

I can confirm this fixed the problem (skcihmit and I are working on the same site); thanks for the prompt update Moc! User profile now displays the updated forum post count.

skcihmit commented 10 years ago

Great! (you got to it just before me Min haha). Thanks Moc.

Moc commented 10 years ago

Yay! I had some struggles on my own test site as the percentage of the user forum posts in relation to the total amount of forum posts exceeded 100%, Hopefully it works fine though as it's probably an error that happened when I was editing the database manually.

Closing this issue. Keep them coming! Also, if any of you have some experience in coding, feel free to contribute to e107 by submitting pull-requests. We could use an extra pair of hands!

Moc commented 10 years ago

Oh, and on a sidenote. The user_forums field in the user table should not be there on a clean install (I think). It might still be there on websites that were upgraded from v1 to v2 but the field is not in use anymore (or it shouldn't be!) as it's replaced with the value in the extended user fields. The same should be happening for the chatbox plugin (which is a work in progress).

Moc commented 10 years ago

Going to re-open this one as I'm not quite happy with the current solution. When deleting posts, they are not deducted from the post count. This may result in strange numbers on the profile page, for example:

Forum posts 12 ( 1200% )

I'll look into this further.

@skcihmit @Minnn What do you think? How should this be calculated, taking into consideration pruned/deleted posts?

Minnn commented 10 years ago

I'm pretty sure user post count wasn't recalculated taking deleted or pruned posts in the old version until you ran the forum tool that recalculated user forum post counts. I'm not sure if the forum total post/reply count was live or if it took these into account either, until you ran the forum tool to recalculate forum post/reply count.

Is the difference in the calculations that it's using the live (pruned/deleted considered) forum post count but the non-live (pruned/deleted not considered) user post count?

There's an option in forum tools that recalculates post/reply counts - does the pre-pruned/deleted forum post count value get stored/not updated somewhere until this forum tool is run? It feels like consistency wise the calculation could either:

Opinion wise; ideally it would be a live indication of activity, but don't mind (and can totally validate) it using the pre-pruned/deleted values for both either until a forum tools recalculation occurs. Don't know if this is any help/makes sense!

Moc commented 10 years ago

Thanks for the extensive elaboration Minn, really helpful.

I think my issues are caused by a bug. I'll be digging deeper, to be continued.. engineer_avatar