Viewing 15 replies - 16 through 30 (of 53 total)
  • Plugin Author Jonathan Daggerhart

    (@daggerhart)

    Thanks Ovidiu, I appreciate it!

    Updated the gist to pass the row number into the row template function. https://gist.github.com/daggerhart/09b0dbc7eb766486353b
    The lines you’ll need to adjust are 47 & 63. Then you’ll have the $row_number variable to work with. Also in the update, I show determining if the row is even or odd.

    For the output you need. The easiest way to do it might be to add the UL outside of the shortcode.
    Ex.
    <ul>[bbpress_recent_replies_by_topic]</ul>

    But if you’d rather put the UL in your php file, you can do it in the query part of the code after ob_start(); and before ob_get_clean();

    Rough example:

    ob_start();
      print '<ul>';
        // loop through results and output our rows
        while($query->have_posts()){
          $query->the_post();
          // custom function for a single reply row
          custom_bbpress_recent_reply_row_template( $query->current_post + 1 );
        }
      print '</ul>';
      $output = ob_get_clean();

    Thread Starter Ovidiu

    (@ovidiu)

    Awesome! I’m deeply grateful! I’ve also posted the link in the bbpress forum for the others who had the same problems with the built-in widgets.

    The code seems very efficient, my page changed from

    41 queries executed in 0.606 seconds

    to

    It took 45 queries executed in 0.715 seconds

    I think that’s acceptable.

    Plugin Author Jonathan Daggerhart

    (@daggerhart)

    Great! Glad to hear it’s working out for you. The way I wrote that snippet was significantly geared towards making it easy to use and edit than performance. If you (or others) want the fastest possible version of the shortcode, I could start another gist.

    Btw, what plugin are you using to time your pages and queries?

    Thread Starter Ovidiu

    (@ovidiu)

    ATM I use https://www.ads-software.com/plugins/nginx-helper/ ( I need it to purge my fastcgi_cache anyway) as it prints the timings into the source code.

    Its not 100% accurate since there is a lot of caching going on: nginx + php5_fpm + fastcgi_cache + mysql query cache + APC + WP Object cache to APC via: www.ads-software.com/plugins/tribe-object-cache and on top of that I run ngx_pagespeed …

    If you can significantly improve performance, go right ahead but I’m pretty happy with the results already.

    Btw. seeing that you are so responsive, any idea what is the best way to check performance:

    a) https://gist.github.com/ovizii/7788282
    b) https://gist.github.com/ovizii/6262151
    c) https://gist.github.com/ovizii/6097921

    ??

    Plugin Author Jonathan Daggerhart

    (@daggerhart)

    Not sure if this will be a significant improvement, but it should be technically faster on average. https://gist.github.com/daggerhart/4244c147f47a6bd95255

    I’m a fan of Debug Bar – https://www.ads-software.com/plugins/debug-bar/ . When SAVEQUERIES is true, it will show you queries and their timing. It doesn’t have a ton of information, but provides the basics. There are also a good number of other Debug Bar plugins that add functionality.

    Thread Starter Ovidiu

    (@ovidiu)

    HI Jonathan, I just discovered another issue:

    it seems to link to the last reply but if there are multiple pages it simply jumps to the first page, i.e. this thread: https://www.die-kellerkinder.eu/topic/rise-of-the-runelords-1-burnt-offerings/ has 12 pages but your widget links to the first page, any chance to get this fixed?

    Plugin Author Jonathan Daggerhart

    (@daggerhart)

    Updated the gist: https://gist.github.com/daggerhart/09b0dbc7eb766486353b

    Check out line 86 –
    <div>Link To Topic/page/#/#Reply: <a href="<?php bbp_reply_url( get_the_ID() ); ?>">view reply paged</a></div>

    That should cover what you’re looking for. Let me know if you run into issues.

    Thread Starter Ovidiu

    (@ovidiu)

    Brilliant!

    Forgive me if this is off-topic or needs a separate thread. I’m wondering if this has enough functionality or can be customised to solve the following:

    I have a site with several topical Areas that I want to link BBPress Forums with each one.

    It would be ideal to have a shortcode I can embed in a page that filters Recent replies or topics ONLY for that specific Area/Forum. So that I can use a varied shortcode for each page to display replies only related to that Forum.

    Is this far beyond the scope of this or is there even an easier way I am completely missing?

    Thanks very much for your expertise!

    Plugin Author Jonathan Daggerhart

    (@daggerhart)

    Hi elxr.

    I’m having trouble understanding exactly what you’re asking for. I assume by ‘Areas’, you mean Forums? But you want to put the shortcode into a Page? Does the Page know what Forum it represents? If so, how does it know (post meta or something)?

    Could you rephrase the question and be more specific?

    Hi Jonathan –

    Sure. By ‘areas’ I wasn’t referring to any wordpress lexicon, just divisions of the content of this site, in this case an educational module for a course.

    And as these are Pages (not posts) there’s no post metadata so I would be looking to manually add some shortcode (no not shortcake auto-correct ?? to each page that I would customise manually.

    On the BBPress side I would set up individual Forums for each course module. What would be ideal is if you could use a shortcode to filter recent discussions by 1 forum (using simply an ID# or something). But it seemed like your function might have been another solution.

    Thanks – Jason

    Plugin Author Jonathan Daggerhart

    (@daggerhart)

    Updated the gist to allow for ‘forum’ attribute in shortcode: https://gist.github.com/daggerhart/09b0dbc7eb766486353b

    You can use this like: [bbpress_recent_replies_by_topic forum=239] where ‘forum’ is the forum post ID.

    Hi Jonathan,

    im sure you did a great job here and the bbpress community is thankful for such an upgrading possibility.

    But i got problems to realize it on my page :/

    I was searching for exact the same thing, like ovidiu did.
    So i copied your code and paste it into my templates functions.php.
    My next step was, to create a text widget and insert the shortcode: [bbpress_recent_replies_by_topic]. Am Im still on the right path?

    The replies appear in my sidebar, but in a horrible chaos.
    What have i done wrong?

    Thanks .

    Thread Starter Ovidiu

    (@ovidiu)

    do you want to share a link to the site so we can see what’S going on?

    Hey… yes of course. LINK

Viewing 15 replies - 16 through 30 (of 53 total)
  • The topic ‘Need some help getting this right?’ is closed to new replies.