OK, I've worked with drupal for only a couple of days so don't know precisely where the problem originates, but the fact is that post count does not show in author pane.

if I put

<?php print user_stats_get_stats('post_count', $account_id) >

directly in advf-author-pane.tpl.php , the number shows up, but the way advaced forum does that:

<?php if (isset($user_stats_posts)): ?>
      <div class="author-pane-line author-posts">
        <span class="author-pane-label"><?php print t('Posts'); ?>:</span> <?php print $user_stats_posts; ?>
      </div>
    <?php endif; ?>

does not work for me, $user_stats_posts is not set. I would continue the investigation, but I don't know who is responsible for setting this variable, advanced forum or user_stats?

Comments

Michelle’s picture

Status: Active » Postponed (maintainer needs more info)

You're sure you have the view statistics permission set? Also, please confirm that you are, in fact, using alpha 13 and not the dev as I know for sure this isn't working in the dev as none of the contrib integration works currently.

Michelle

sniegs’s picture

Yes, 6.x-1.0-alpha13 (double checked in admin/build/modules).

Yes, "view statistics" permission is set for authenticated user both in statistics and in user_stats modules in admin/user/permissions (even if it was not, I guess user 1 as a superadmin would still be able to view post count?)…

Michelle’s picture

Hmm... This is a toughie. Can you put in some debugging code into user-stats.forum.inc and make sure the variable is getting set there?

Michelle

sniegs’s picture

I already did that and IMHO function user_stats_preprocess_author_pane is not being called (who is responsible for that? I don't know drupal architecture yet unfortunately).

If I put the contents of this function (including permission checks) in advf-author-pane.tpl.php, everything works though. So this definitely is not a permission problem.

Michelle’s picture

Drupal should be calling that, provided the file is getting included properly. Try putting a deliberate typo in that file, but outside of the function and clear the cache. If it doesn't choke on the error, then the problem is with the include code.

Is the contact link showing up, assuming you use that module?

Michelle

sniegs’s picture

OK, will try.

The same problem is with privatemsg.

Contact , join date and online/offline status work flawlessly.

Michelle’s picture

Hmm... That is really bizarre. The join date and on/offline status are in the .module not in .inc files but contact is done via the hook just like contrib.

Just to be sure, in advanced_forum/modules, you have privatemsg.forum.inc and user_stats.forum.inc, correct?

Sorry for all the questions but this is working just fine for me so it's hard for me to guess what might be wrong.

Michelle

sniegs’s picture

I put a bunch of echos both in user_stats_preprocess_author_pane function and outside it. None showed up.

But cleaning the cache solved everything! All echos were displayed as well as post count and privatemsg.

Removed my own code from everywhere and everything works now. Cache was set to Normal, don't know why it would interfere…

Anyway, thanks and sorry for wasting your time Michelle!

Michelle’s picture

Status: Postponed (maintainer needs more info) » Fixed

Strange. Those files are cached but they should all have been cached at once when the module was enabled. Anyway, glad you got it working. :)

Michelle

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

maki124’s picture

Version: 6.x-1.0-alpha13 » 5.x-1.0-alpha16
Status: Closed (fixed) » Active

I'm afraid I have the same problem, but with 5.x-1.0-alpha16.

print user_stats_get_stats('post_count', $account_id)

works, but the Advanced forum code returns nothing. For now I'm using the above to display post counts. (I've tried flushing the cache, and the usual debugging methods like echoing the variables, as above too. $user_stats_posts is not set.)

Maybe I'm missing something, but I don't see a user-stats.forum.inc file anywhere. Is this 6.x specific? Should it have been included in the alpha-16 package?

Thank you so much for this module in any case. It's helped me get a forum up within Drupal in record time without resorting to a 3rd party forum. I opened the forum on Thursday and it's already getting hit hard (which is a good thing). You can see it in action here: http://justbento.com/forum .

Michelle’s picture

Status: Active » Fixed

The user stats hook is included in user stats itself. Make sure you're using the dev version and clear your cache after installing.

Michelle

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

McSukkelaar’s picture

Version: 5.x-1.0-alpha16 » 7.x-2.x-dev
Issue summary: View changes

Thanks a lot, Michelle #1. I was working around this for way too long when you're comment made me realize that i dit not set permissions for this. D'oh!