Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbPress_Live_Widget_Forums() from bp-forums-bbpress-live.php


  • Windhamdavid
    Participant

    @windhamdavid

    I just noticed… bbpress-live.php vs bp-forums-bbpress-live.php

    so the forums are using “bbpress_live_widget_forums”.

    is this the same as sam’s bbpress-live plugin?

    bbpress_live_get_forums() or bbpress_live_widget_forums.

    bbpress_live_get_topics() or same..

    . anyone had any experience with these as template functions or widgets?

Viewing 20 replies - 1 through 20 (of 20 total)

  • Burt Adsit
    Participant

    @burtadsit

    Yes, bp uses the bbpress live widget code.


    Windhamdavid
    Participant

    @windhamdavid

    i see that.. but I tore apart bp_forums_templatetags.php, bp_forums_bbpress_live.php… look at all the diffs.. tried to instantiate the globals, tried the old bbpress live template tags.. no widgets, php errors? I even messaged sam bauers to see if he knew what was up and haven’t heard back yet… I’m still working on it now.. so we’ll see if I can come up with anything.. It looks like they should work.. I’ve reset widgets on two local copies and a remote and I don’t see anything contrary on the trac. Does anyone have these widgets rolling?


    Windhamdavid
    Participant

    @windhamdavid

    so the functions in bbpress live return an array.. first hurdle down.

    but there may be a little creature (bug) buried in the widget somewhere – https://bbpress.org/forums/topic/fail-to-make-bbpress-live-working#post-19692


    Burt Adsit
    Participant

    @burtadsit

    Well, the problem is that activating the regular bbpress live widget conflicts with the code already loaded. It’ll never work. You’ll have to figure out how to register the code that bp uses *as a widget*. I think it would be easier to just create a small template loop using the bp provided code. Or use the function bp_forums_get_topics( $forum_id = 0, $number = 0, $page = 1 ) that lives in bp-forums.php


    Burt Adsit
    Participant

    @burtadsit

    I think you are attempting to do this at too low a level. Try the loop functions for forums or bp_forums_get_topics(). There’s no need to code down at bare metal when all the work is done for you with the higher level functions and classes.


    Windhamdavid
    Participant

    @windhamdavid

    you can see my struggle.. :) bless you.

    bp_forums_get_topics(args) – no errors.. but no output!

    a custom loop for forums functions?


    Burt Adsit
    Participant

    @burtadsit

    Ya, custom loop for forums:

    It doesn’ t look like Andy has documented this yet but there is a group forum loop just like other parts of bp have a loop. Look at bp_has_topics() in bp-forums-templatetags.php. It looks like I’d use that if I were you.

    See: https://codex.buddypress.org/developer-docs/custom-buddypress-loops/ for examples using other bp_has_[something]() loops.

    That might be the best way to go with this.


    Windhamdavid
    Participant

    @windhamdavid

    Burt, thk u much.. I’m headed in that direction now, but that still doesn’t explain the missing widgets.


    Burt Adsit
    Participant

    @burtadsit

    When you get the template loop working how you want it to, then you can wrap it in widget code to turn it into a widget. If that’s what you absolutely have to have is a widget.


    Burt Adsit
    Participant

    @burtadsit

    Missing widgets? Well, widgets aren’t really widgets until they get registered with:

    wp_register_sidebar_widget( 'oci-wcm', __( 'Member Tags', 'oci-contents' ),
    'oci_widget_cloud_members' );
    wp_register_widget_control( 'oci-wcm', __( 'Member Tags', 'oci-contents' ),
    'oci_widget_cloud_members_control' );

    Something like that. That’s for one of mine.


    Windhamdavid
    Participant

    @windhamdavid

    midget wissing :) .. line 34 of ..bbpress-live.php wp_register_sidebar_widget() ?
    that should cut it there. has_topics() is still giving me nothing.. but I just realized I’ve had xmlrpc.php out of my header for the last hour. when it’s like this it always turns up to be something so very simple I’m overlooking.

    			<?php if ( bp_has_topics() ) : ?>
    <?php while ( bp_has_topics() ) : bp_the_topics(); ?>
    
    <li>
    <?php the_topics() ?>
    </li>
    		 <?php endwhile; ?>
    
    			<?php else: ?>
    <p>No Topics Found.</p>
    <?php endif; ?>

    Burt Adsit
    Participant

    @burtadsit

    Looks like that should work.


    Kunal17
    Participant

    @kunal17

    How do you use the code above? Paste it in a text widget?


    Windhamdavid
    Participant

    @windhamdavid

    no.. you don’t want to paste it into a text widget..

    You would use it as a custom loop in your theme.

    But, that code does Not work (for me right now)

    <?php if ( bp_has_topics() ) : ?> is always giving null…

    and I’ve tried three or four incarnations of a custom loop based on the buddypress/forums/bp-forums-templatetags.php I had previously used sam’s bbpress live plugin successfully (same code)? I will return to this issue on monday unless some brilliant mind steps up to the plate over the weekend. :)


    Burt Adsit
    Participant

    @burtadsit

    Where are you putting this loop code? You either have to specify a forum_id or be inside group forums for bp_has_topics() to return anything.

    bp_has_topics(‘forum_id=xx’); Look at the code for bp_has_topics()..


    Windhamdavid
    Participant

    @windhamdavid

    a freakin’ sidebar with it’s own loop inside of the two others. I’m most likely outside of the loop as always, but I don’t want to specify a forum Id :(, I want all of the forums with the – bp_get_forum_permalink().. same as the ole.. bbpress_live_get_forums() and bbpress_live_get_topics().. I probably sound like a skipping record to you…thks.


    vusis
    Participant

    @vusis

    i think the loop we are looking for is:

    bp_has_forum_topics


    vusis
    Participant

    @vusis

    hey i’ve got it to work, I’m quickly setting up the plugin to work as a widget and i’ll upload it :)
    Note i’m still working on getting the correct permalink though, but that shouldn’t be a train-smash. will you posted

    <div class="topic-list">
    <?php if (bp_has_forum_topics() ) : ?>
    <?php while ( bp_forum_topics() ) : bp_the_forum_topic(); ?></p>
    <div class="topic-list-item"><a>" rel="bookmark" class="title"><?php bp_the_topic_title(); ?></a></div>
    <?php endwhile; ?>
    <?php else: ?>
    <p>There are no topics</p>
    <?php endif; ?>
    </div>

    vusis
    Participant

    @vusis

    bp_get_the_topic_object_permalink() – not working

    Burt perhaps you can assist.


    vusis
    Participant

    @vusis

    I have a problem:

    how do i pickup the group_id of the forum topic. Thant way i can build the link to the from topic from the home page.

Viewing 20 replies - 1 through 20 (of 20 total)
  • The topic ‘bbPress_Live_Widget_Forums() from bp-forums-bbpress-live.php’ is closed to new replies.
Skip to toolbar