Skip to:
Content
Pages
Categories
Search
Top
Bottom

Is there a latest forum topic widget?

  • Avatar of rossagrant
    rossagrant
    Participant

    @rossagrant

    Would love a sidebar widget displaying the latest 5 or so forum topic titles? Is this available anywhere?
    Cheers
    Ross :)

Viewing 25 replies - 1 through 25 (of 42 total)
  • Avatar of finni3
    finni3
    Participant

    @finni3

    It´s included in the BuddyPress Forums Extras plugin.

    correct, under the forum index sub-plugin. (you can set the max topics)

    it calls bp_has_forum_topics so if viewed from a group page or profile page – it will filter for those components as well.

    Avatar of rossagrant
    rossagrant
    Participant

    @rossagrant

    @nuprn1 Great stuff! This is exactly what I need but I only need the widget and not the index. The index is a great idea but I have 2000 groups so isn’t really suitable.

    I’m a bit of a numpty when it comes to extracting code but would really like to hear how I can use just the widget without the index! I’d even pay for this to be made into a standalone widget.
    Cheers
    Ross :)

    well the easiest way is to just extract the snippet and replace a line of code

    open up
    bp-forum-extras-index.php

    place this class BP_Forum_Extras_Index_Latest_Topics_Widget extends WP_Widget into the bp-custom.php file

    then replace the line
    if ( bp_forum_extras_blogs_component() )
    with
    if ( $bp->forums->slug == $bp->current_component )

    Avatar of rossagrant
    rossagrant
    Participant

    @rossagrant

    @nuprn1 Sorry for having to ask such simple questions but I am exactly that… Simple!

    Wen you say ,’place this class BP_Forum_Extras_Index_Latest_Topics_Widget extends WP_Widget into the bp-custom.php file’

    What am I actually placing in the custom php file?
    I’m not sure how much of the code I am cutting and pasting?

    So sorry, I’m just learning!
    Thanks so much!

    Avatar of rossagrant
    rossagrant
    Participant

    @rossagrant

    @nuprn1 Thanks so much.
    So I have pasted that code into my bp-custom.php file.

    So should the widget show up or do I need to activate the sub plugin. Will that not activate the forum index with it? I just need the widget. We’re nearly there!

    wp-admin > appearance > widgets

    Avatar of rossagrant
    rossagrant
    Participant

    @rossagrant

    @nuprn1 Hmm… maybe I have done something wrong but I have pasted the code in and yet I can’t see a widget?

    Avatar of finni3
    finni3
    Participant

    @finni3

    thanks rich!

    Avatar of rossagrant
    rossagrant
    Participant

    @rossagrant

    @nuprn1

    So sorry, I just can’t get this to work.
    I have copied the code from your post to my clipboard and pasted it between php tags in my bp-custom.php file but no widget is showing. Do I have to activate any of the forum extras plugins for it to work?
    I just need this widget and not the forum index.

    I have other code in my bp-custom.php file that works so not sure why adding this code in there doesn’t.
    Apologies once again as I’m clearly doing something wrong but I just don’t know what.
    Thanks for your patience!

    you have to activate the widget under wp-admin > appearance > widgets (drag it to the sidebar)

    Avatar of abcde666
    abcde666
    Participant

    @erich73

    @nuprn1
    looks like your Forum-plugin is working nice, but I am also having a huge number of Groups (around 2k), so is there a chance to get this Plugin without the Forum-Index included in the Widget ?
    Or is there a chance to activate / deactivate the Forum-Index in the backend ?

    I am not a programmer so I am not able to fiddle around in any code.

    Many thanks,

    Erich

    Avatar of rossagrant
    rossagrant
    Participant

    @rossagrant

    @nuprn1 thats the only thing, it isnt showing in the widgets section. There isnt a latest topics widget to drag across.

    oh sorry, i forgot to include the register widget hook

    function my_register_widgets_init() {
    add_action(‘widgets_init’, create_function(”, ‘return register_widget(“Whatever_You_Named_It_Latest_Topics_Widget”);’) );
    }
    add_action( ‘bp_register_widgets’, ‘my_widgets_init’, 15 );

    Avatar of rossagrant
    rossagrant
    Participant

    @rossagrant

    @nuprn1
    Ahhh, that must be it then! Does this go in the bp-custom.php file too or elsewhere and if it does go in custom.php should it be before or after your code?
    Thanks!

    yep same file, below – make sure to change “Whatever_You_Named_It_Latest_Topics_Widget” to the name of the widget class

    I’ve installed and activated this. Widgets are showing up nicely in my “members” sidebar, but it will not show in my homepage sidebar. Any idea of why?

    the only pages it won’t load on is forum component index || bp_is_register_page() || bp_is_activation_page() || bp_is_user_blogs()

    the only pages it won’t load on is forum component index || bp_is_register_page() || bp_is_activation_page() || bp_is_user_blogs()

    Sorry, is ^^^^ in response to my post? I do’t understand what that means. I have the widget placed on my blog index page and it’s not showing.

    Avatar of rossagrant
    rossagrant
    Participant

    @rossagrant

    @nuprn1
    When you said ‘make sure to change “Whatever_You_Named_It_Latest_Topics_Widget” to the name of the widget class’

    I don’t think Im doing this right. I have just copied your original code you supplied so what class do I need to put in the function?
    I keep getting a white page when I try.

    Cheers,
    Ross :)

    HI,

    No matter what I do, the widget won’t appear on my home page. Can you please point me in the right direction?
    Thanks.

    @tfblogs Like I mentioned above – those are the only pages explicitly where the widget won’t load up. If you grab just the widget code off my demo site – then you can modify it to suit your needs. (hard for me to know what is causing your problem – tested with frontpage set as activity stream or blog posts and it works fine here)

    @rossagrant – i updated the code on my demo site with a different naming schema – just grab all the code from there again. (as the same name with the forum extras plugin would cause a WSOD)

    Avatar of rossagrant
    rossagrant
    Participant

    @rossagrant

    @nuprn1

    thanks for the new code! I have this working now!
    the only thing that is happening now is that the widget is displaying a ? in a black diamond before the title of each topic in the widget.

    I am using WP 3.0.

    Is this something to do with an unrecognised character or something?
    Cheers.

    I give up. As much as I like this plugin, I can’t get it to appear on any sidebar outside of the members sidebar. :(

Viewing 25 replies - 1 through 25 (of 42 total)

You must be logged in to reply to this topic.