Top Posters of the Month (TPM2) [Deleted]

Hello, can you share a screen please?
top-poster-of-the-month-banner.webp

So
  1. increasing the width to match the standard XF banners would work; or
  2. centering the TPM banner - it looks awkward currently.
Actually, now that I look at it, option #1 would be better.
 
I don't have this problem, do you have changed the code for your userBanner class ?
No. This is XF 2.2.1 currently but I believe it was also an issue with the recent 2.1.x versions.

I use Firefox as my default desktop browser.
 
Hello,

Yes it's normal, if you want it to work perfectly, you'll have to modify the file: xenMade\TPM\XF\Template\Templater
You will have to add this: (just before the line: 28)
PHP:
$class = $this->processAttributeToRaw($attributes, 'class', ' %s', true);
and the line: 42:
Replace :
PHP:
$res .= "<{$tag} class=\"userBanner userBanner--tpm\"><span class=\"userBanner-before\"></span><strong>{$tpm}</strong><span class=\"userBanner-after\"></span></{$tag}>";

Replace with :
PHP:
$res .= "<{$tag} class=\"userBanner userBanner--tpm {$class}\"><span class=\"userBanner-before\"></span><strong>{$tpm}</strong><span class=\"userBanner-after\"></span></{$tag}>";

I don't encourage you to do so! but to wait for @au lait to post an update.
You can, then delete the piece of code that I give you to put in the extra.less

Regards, CRUEL-MODZ
 
Can you add seperately different statistics for threads too? I want to calculate both messages and threads but right now they both combined in statistics so I can't see who posted how many threads. Please support this feature.
 
I've found a bug in the SQL for TPM2 that it uses to counts posts. This results in higher TPM2 post counts, resulting in incorrect and bloated post counts.

Explanation:

I have a user with 1 active and visible post, but in TPM2, it shows they have 5 posts (when they should only have 1).

The reason is the following:
  • The user created 5 threads (each thread has 1 post)
  • 4 of their threads were deleted (leaving 1 thread and 1 post)
  • However, in the xf_post table they have 5 posts that have the message_state as "visible"
    • Xenforo marks the "xf_thread" as deleted (but leaves posts as message_state "visible)
    • Due to this, TPM2 incorrectly counts all "visible" posts in xf_post and doesn't account for the fact that the xf_thread was deleted
Because of the above, TPM2 counts 5 posts as message_state visible.

However, the user actually only has 1 post that is visible and should be counted towards their TPM2 count.

Hope this explanation helps for a quick fix.
 
I've found a bug in the SQL for TPM2 that it uses to counts posts. This results in higher TPM2 post counts, resulting in incorrect and bloated post counts.

The simple solution is to add the following code to line 41 of /Util/Helper.php

Code:
                AND
                    thread.discussion_state = 'visible'

Love the add-on by the way so I'm off to write a review ;)
 
One small request. It'd be nice if the SQL query results were cached for a period of time, even if only for 5-10 minutes (or user option).
 
Back
Top Bottom