• I sent you an email about a week or two ago with revised code to (optionally) link the # counts to appropriate user profile sections.

    It’s a private GitHub repo and your invitation is still pending.

    The code is good-to-go and ready for release as the next version unless you decide to make any changes to it yourself first.

    Copy/Paste from the repo readme.md:

    bbp-topic-count

    Robin W’s bbPress Topic Count plugin with a few changes and enhancements.

    Number counts can now (optionally) be linked to user profile pages!

    • These changes could/should also be ported over to the wonderful bbPress Style Pack plugin.

    Key changes:

    • New admin option: Link Counts or Do Not Link Counts
    • display.php re-worked: display_counts() & display_counts_in_reply() were nearly identical with the only differences being HTML tag wrappers. These two functions have been merged into one so there’s less repeated code. HTML tag wrappers are determined by a passed arg to the new render_display_counts() function. Much easier to maintain.
    • Linked Counts point to the profile page links for topics (topic count), replies (reply count), or engagements (post_count) within each user’s profile page.
    • Linked Counts use the optional admin setting topic_label, reply_label, or posts_label within the HTML a title=”” attribute along with the user’s “nicename” that bbPress uses.
    • Counts are only linked if they are greater than 0 (zero). No point linking to an empty profile page section!
    • display_topic_count, display_reply_count, and display_total_count shortcodes honor the optional admin setting for whether or not to link number counts to profile page sections.
    • Since tc_display_top_users shortcode can vary depending on how/where it’s used and does not directly correlate to the profile page topics/replies/engagements sections, no links are applied.
    • Language .pot file regenerated.

    Future Wish-list Changes/Additions:

    • Account for guest/annonymous users: They won’t have a $user_id so this plugin won’t work for them at all as it stands. Either exclude them from counts completely, or do counts based on supplied email address for guest/anonymous posts.
    • Display Order: I would personally put Total Posts first, then break it down by topic/reply counts. Adding selectable display order (like the bsp forum buttons) would be a nice touch!
    • Display font settings: I would personally want to display the number counts with a bold font style. Others may want the labels bold, but the numbers regular. Others may want it all bold. Setting the label font color, label font size, label font family, and label font style as well as the number font color, number font size, number font family, and number font style would be an awesome addition!
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Robin W

    (@robin-w)

    Thanks for this, I try and work on my free plugins when I can, and am really busy at the moment.

    But I really appreciate you help in improving these.

    I will get to this as soon as I can

    Have a great holidays

    Plugin Author Robin W

    (@robin-w)

    I have never used GITHIB, so just joined, but no idea how to get to this area – I accepted invitation, logged in, and no idea what i should do next.

    Just looked for tutorial, and it’s 2 hours long, and may not cover what I want ??

    Thread Starter codejp3

    (@codejp3)

    I re-added you as a collaborator for the repo. Once you accept, you should be able to access the code.

    Don’t worry about any tutorials on using the command line push/pull/merge commands. That’s a whole new system to learn. For now, just get used to the web interface. You can see the file structure and access each file.

    I’ve added 2 branches.

    Main” is your last release v2.8.

    proposed-release-2.9” is my code changes.

    I’ve created what GitHub calls a “pull-request” to merge code and apply the new changes to the main branch. Don’t worry about merging the two. The useful part for you is that you can view a code comparison between v2.8 and v2.9 side-by-side.

    To view this code comparison, access the bbp-topic-count repo (accept your invitation and it should show up as one of your repos), and then look for the “pull-requests” tab, and within that tab look for “commits“. Here’s a direct link:
    https://github.com/codejp3/bbp-topic-count/pull/1/commits/0176c6871c467b211289361b506349cd136a1e71

    You’ll see the exact differences between the two.

    You can also download the new proposed v2.9 directly to test it out on your test server before pushing it to the WP plugin directory.

    Don’t get caught up on the git command line stuff (2hr tutorial is just scratching the surface) unless you plan to integrate it into your workflow. It takes a bit to get used to.

    The web interface is sufficient enough for the purpose of code comparison, and downloading the new version.

    Plugin Author Robin W

    (@robin-w)

    great – thanks, I’ve just reviewed this and only made one change

    in includes/display line 17, I’ve changed

    function render_display_counts($reply_id = 0, $location) {

    to

    function render_display_counts($reply_id, $location) {

    newer versions of php do not like an optional variable declared then a mandatory one, but since we always pass a reply_id (albeit 0 in all cases!) it is fine.

    I’ll release this version on Thursday, as I’m out the next couple of days

    Thanks for all you work on this

    • This reply was modified 2 years, 2 months ago by Robin W.
    Thread Starter codejp3

    (@codejp3)

    Cool!

    I’ve already thought about releasing a v2.10

    Only change would be how the admin settings are rendered.

    Break them out as a template part.

    Then in the BSP plugin, if topic counts plugin is active, render the topic parts count template part within BSP. If not active, then render the standard BSP topic count tab.

    It would require changes to both this plugin and BSP, but once it’s done, the BSP topic counts tab will reflect the settings saved in topic counts plugin and vice-versa. That way, settings from both plugins “match” and the only difference between the two is whether you have shortcodes or not.

    Maintaining the two code bases should be easier, and there would no longer be a settings tab that “does nothing” in BSP when both plugins are active.

    Haven’t started on it, but I think that makes sense to implement.

    Thread Starter codejp3

    (@codejp3)

    Made one subtle change based on your input. Still supplying a post_id, but changing the order of the args so location is first, then post_id. Also changed the “bridge/helper” function values for those two passed args.

    Here’s the new branch:
    https://github.com/codejp3/bbp-topic-count/tree/propsed-release-2.9-revised

    Here’s the side-by-side comparison:
    https://github.com/codejp3/bbp-topic-count/pull/2/commits/01a567dd622cbece3e8f1c633af869e5e464c7c3

    Here’s the direct download link:
    https://github.com/codejp3/bbp-topic-count/archive/refs/heads/propsed-release-2.9-revised.zip

    Very minor, but should prevent future issues arising.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Link Counts To Profile Sections’ is closed to new replies.