Support Forum
Mr Papa said
yes, need a bit more background data when you see it... any patterns?when you see it, is it repeatable? if you reload page, does it still show? if should be or might indicate caching type activity at play... if it is repeatable, can you go to forum - toolbox - data inspector and turn on the spThisPostUser data... and then relook at the page and get us the thanks data in the user object where you see 0...
There is no discernible pattern that I may point to. It seems it happens randomly to everyone.
Did you mean this:
[thanks] => 75 [thanked] => 344
This is what it shows, however right now this user has the zero times thanked.
Yellow Swordfish said
Sorry - can you be a little more precise...Are you saying that the data inspector shows those two values for a specific user but at the same time is displaying zero on the actual post display?
Yes, here is another user:
[reputation_daily] => 0 [thanks] => 110 [thanked] => 437<br /><br />Here is what his thanks look like:
September 30, 2014
I can give you some code for a temporary fix if you are up to making some small changes to a file.
This will be temporary as I believe the actual final fix will need to be a little more diagnosis and work. Bit then the final, real foix will come throu8gh ion a plugin update so this should see you through
Are you OK to make some code edits?
YELLOW
SWORDFISH
|
Yellow Swordfish said
I can give you some code for a temporary fix if you are up to making some small changes to a file.
This will be temporary as I believe the actual final fix will need to be a little more diagnosis and work. Bit then the final, real foix will come throu8gh ion a plugin update so this should see you through
Are you OK to make some code edits?
Sure, shoot. I'll try and work it in.
OK - these changes will work assuming that you ONLY use this template function within the forum display and not outside of the forum - such as a sidebar for example. If this is not the case then do not do this!
The file you will need is located in the simple-press plugins location - by default:
/wp-content/sp-resources/forum-plugins/post-thanks/template-tags/sp-thanks-user-stats.php
On the very first line if the function change:
global $spThisUser;
to
global $spThisUser, $spThisPostUser;
locate this block of code:
# set up the user data if (empty($userid)) { $user = $spThisUser; } else { $user = sp_get_user($userid); }
and replace it with this single line:
$user = $spThisPostUser;
and that should do it - I hope!
YELLOW
SWORDFISH
|
Ok, updated the code but still see this for me:
August 28, 2014
function sp_thanks_do_user_stats($args='', $userid, $label='') { global $spThisUser, $spThisPostUser; $defs = array('tagClass' => 'spThanksUserStats', 'usespan' => 0, ); $a = wp_parse_args($args, $defs); $a = apply_filters('sph_ThanksUserStats_args', $a); extract($a, EXTR_SKIP); # sanitize before use $tagClass = esc_attr($tagClass); $usespan = (int) $usespan; $userid = (int) $userid; $label = sp_filter_title_display($label); # bail if empty userid and we have a guest if (empty($userid) && empty($spThisUser->ID)) return; $user = $spThisPostUser; if (empty($user->thanked)) $user->thanked = 0; if (empty($user->thanks)) $user->thanks = 0;
1 Guest(s)