• Resolved humberto.rodrigues

    (@humbertorodrigues)


    Hi!

    I’m using this plugin inside my forum. But when I vote the number do not changed without a page reload.
    Looking at the bbp-voting.js code responsible for update the number of votes I see:

    jQuery('.post-' + post_id + '.topic-author .bbp-voting, .post-' + post_id + '.type-reply .bbp-voting').each(function() {

    However, my forum template do not have this CSS classes structure. The missing css class in my forum is “topic-author”.

    Any idea why my forum do not have such css class? This class structure is really a pattern in bbpress forums?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author natekinkead

    (@natekinkead)

    Yes, this is utilizing the standard class from bbPress (unless they recently changed it). Do you happen to use a theme that has a bbpress overrides folder in it? Or, are you using a plugin that substantially changes the structure of bbPress views?

    Thread Starter humberto.rodrigues

    (@humbertorodrigues)

    Yes, I’m using a custom bbpress theme and the css structure isn’t the same.

    Plugin Author natekinkead

    (@natekinkead)

    Ok, yeah, I’m using standard bbPress hooks for showing my voting buttons. But, if you know how to find a hook in the place where you want your voting buttons to be, then you can add this to your functions.php file…

    add_action('some_custom_hook_name', 'bbp_voting_buttons');

    Thread Starter humberto.rodrigues

    (@humbertorodrigues)

    Hi!

    Sorry about the delay.
    I’m not sure this is going to solve the problem, because the JS code expects the following css structure to update total votes:

    jQuery(‘.post-‘ + post_id + ‘.topic-author .bbp-voting, .post-‘ + post_id + ‘.type-reply .bbp-voting’)

    As my classes are not the expected ones, number of votes won’t update even if put the voting buttons somewhere else.

    As a suggestion, the score div holder should have an id like “bbpress-score-(post_id). This way, you can directly update the score without depending on theme classes.

    Plugin Author natekinkead

    (@natekinkead)

    That’s a great point. I’m not sure why I had so much specificity on that jQuery selector. I removed all the extra specificity since I only need to target each ‘.bbp-voting’ element. Update the plugin and let me know if that works for you.

    Thread Starter humberto.rodrigues

    (@humbertorodrigues)

    Well, we have a bug not. haha
    This way, all scores on page are changing when voting. I suggest you the following:
    jQuery(“.bbp-voting-post-“+post_id+” .score”)

    Plugin Author natekinkead

    (@natekinkead)

    Oops, sorry about that. Fixed. Please update and test again.

    Thread Starter humberto.rodrigues

    (@humbertorodrigues)

    Working perfectly now!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘CSS classes used’ is closed to new replies.