bbPress_Live_Widget_Forums() from bp-forums-bbpress-live.php
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?
. anyone had any experience with these as template functions or widgets?
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?
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
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
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.
you can see my struggle.. bless you.
bp_forums_get_topics(args) – no errors.. but no output!
a custom loop for forums functions?
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.
Burt, thk u much.. I’m headed in that direction now, but that still doesn’t explain the missing widgets.
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.
Missing widgets? Well, widgets aren’t really widgets until they get registered with:
wp_register_sidebar_widget( 'oci-wcm', __( 'Member Tags', 'oci-contents' ),
wp_register_widget_control( 'oci-wcm', __( 'Member Tags', 'oci-contents' ),
Something like that. That’s for one of mine.
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; ?>
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.
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()..
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.
i think the loop we are looking for is:
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>
bp_get_the_topic_object_permalink() – not working
Burt perhaps you can assist.
- The topic ‘bbPress_Live_Widget_Forums() from bp-forums-bbpress-live.php’ is closed to new replies.