Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 15,851 through 15,875 (of 32,581 total)
  • Author
    Search Results
  • #115245
    pimarts
    Participant

    Ok, a litle more info:

    I run a bbPress + BuddyPress installation. And I put that function in the functions.php file of my WordPress theme.

    It would remove the widgets inside. If needed you could remove the rest of the / entire sidebar with CSS. The advantage over a simple CSS hide is the fact that less code gets written to the browser / less code to download for the user.

    Aside from that I use it to put the login widget at the top of the forums (with CSS) and remove all the other widgets.

    #115229
    Lynq
    Participant

    Hey guys,

    I am putting up a topic to show how I have created the layout on http://teamoverpowered.com/forums/

    My aim when creating the theme was to try and create a last poster block that would work throughout the forums and sub forums list.

    custom_bbp_list_forums – this function creates the sub forums under the main forum

    public function custom_bbp_list_forums( $args = '' ) {
    
        // Define used variables
        $output = $sub_forums = $topic_count = $reply_count = $counts = '';
        $i = 0;
        $count = array();
    
        // Defaults and arguments
        $defaults = array (
            'before'            => '',
            'after'             => '',
            'link_before'       => '',
            'link_after'        => '',
            'count_before'      => ' (',
            'count_after'       => ')',
            'count_sep'         => ', ',
            'separator'         => ', ',
            'forum_id'          => '',
            'show_topic_count'  => true,
            'show_reply_count'  => true,
            'show_freshness_link'  => true,
        );
        $r = bbp_parse_args( $args, $defaults, 'list_forums' );
        extract( $r, EXTR_SKIP );
    
        // Bail if there are no subforums
        if ( !bbp_get_forum_subforum_count( $forum_id ) )
            return;
    
        // Loop through forums and create a list
        $sub_forums = bbp_forum_get_subforums( $forum_id );
        if ( !empty( $sub_forums ) ) {
    
            // Total count (for separator)
            $total_subs = count( $sub_forums );
            foreach ( $sub_forums as $sub_forum ) {
                $i++; // Separator count
    
                // Get forum details
                $count     = array();
                $show_sep  = $total_subs > $i ? $separator : '';
                $permalink = bbp_get_forum_permalink( $sub_forum->ID );
                $title     = bbp_get_forum_title( $sub_forum->ID );
    
                // Show topic count
                if ( !empty( $show_topic_count ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
                    $count['topic'] = bbp_get_forum_topic_count( $sub_forum->ID );
                }
    
                // Show reply count
                if ( !empty( $show_reply_count ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
                    $count['reply'] = bbp_get_forum_reply_count( $sub_forum->ID );
                }
    
                // Counts to show
                if ( !empty( $count ) ) {
                    $counts = $count_before . implode( $count_sep, $count ) . $count_after;
                }
    
                if ( !empty( $show_freshness_link ) ) {
                    $freshness_link = "" . BBP_Default::teamop_get_last_poster_block( $sub_forum->ID ) . "";
                }
    
                // Build this sub forums link
                if ($i % 2) { $class = "odd-forum-row"; } else { $class = "even-forum-row"; }
                $output .= "" . $link_before . '<a href="' . $permalink . '">' . $title . '</a>' . $counts . $freshness_link . $link_after . "";
            }
    
            // Output the list
            echo apply_filters( 'bbp_list_forums', $before . $output . $after, $args );
        }
    }
    

    I then call that function inside loop-single-forum.php like so:

    BBP_Default::custom_bbp_list_forums( array (
            'before'            => '',
            'after'             => '',
            'link_before'       => '',
            'link_after'        => '',
            'count_before'      => 'Topics: ',
            'count_after'       => '',
            'count_sep'         => 'Posts: ',
            'separator'         => '',
            'forum_id'          => '',
            'show_topic_count'  => true,
            'show_reply_count'  => true,
            'show_freshness_link' => true,
            ));
    

    Inside the first function I am also calling a second custom function called custom_get_last_poster_block

    function custom_get_last_poster_block( $subforum_id = "" ) {
    
                if ( !empty( $subforum_id ) ) {
                    $output = "";
                    $output .= "<a href='". bbp_get_forum_last_topic_permalink( $subforum_id ) ."'>" . bbp_get_topic_last_reply_title( bbp_get_forum_last_active_id( $subforum_id ) ) . "</a>";
                    $output .= "";
                    $output .= "by ";
                    $output .= bbp_get_author_link( array( "post_id" => $subforum_id, "size" => 14 ) );
                    $output .= "";
                    $output .= "";
                    $output .= bbp_get_forum_last_active_time( $subforum_id );
                    $output .= "";
                } else {
                    $output = "";
                    $output .= "<a href='". bbp_get_forum_last_topic_permalink() ."'>" . bbp_get_topic_last_reply_title( bbp_get_forum_last_active_id() ) . "</a>";
                    $output .= "";
                    $output .= "by ";
                    $output .= bbp_get_author_link( array( "post_id" => bbp_get_forum_last_active_id(), "size" => 14 ) );
                    $output .= "";
                    $output .= "";
                    $output .= bbp_get_forum_last_active_time( bbp_get_forum_last_active_id() );
                    $output .= "";
                }
    
                return $output;
    
            }
    

    This then creates my sub forum list, I added some extra classes in I can hook onto and display:none if need. I decided when creating me theme that I would get as much information showing as possible, then just use CSS to customise it.

    The final functions is one I call inside loop-single-topic.php.

        public function custom_get_last_poster_block_topics() {
    
                $output .= "";
                $output .= bbp_get_author_link( array( "post_id" => bbp_get_forum_last_active_id(), "size" => 14 ) );
                $output .= "";
                $output .= "";
                $output .= bbp_get_topic_last_active_time( bbp_get_topic_last_active_id() );
                $output .= "";
    
            return $output;
    
        }
    

    This is my final function and it just adds the last poster block inside the topics list.

    If you need any more help then let me know.

    UPDATE: Please see the following topic for updated code

    I have created a bbPress starter theme with a phpBB look and feel

    #115206
    Bookkus
    Member

    Does anyone have any ideas?

    #115192
    pimarts
    Participant

    I posted this in another topic, this works for me:

    function disable_all_widgets( $sidebars_widgets ) {       
        if ( function_exists('is_bbpress') ) {
            if (is_bbpress()) {
                $sidebars_widgets = array(false);
                remove_all_actions('bp_register_widgets');
                unregister_sidebar( 'bp_core_widgets' );
            }
        }
        return $sidebars_widgets;
    }
    
    add_filter('sidebars_widgets', 'disable_all_widgets', 1, 1);
    

    But that’s because I haven’t looked into custom themes yet. Did everything with functions and CSS at the moment.

    #115168
    Parker
    Member

    Oh! I was able to figure out what was wrong. All I needed to do was move:

    ?>

    to the bottom of the bbPress settings.

    • This reply was modified 14 years, 3 months ago by Parker.
    • This reply was modified 14 years, 3 months ago by Parker.
    • This reply was modified 14 years, 3 months ago by Parker.
    • This reply was modified 14 years, 3 months ago by Parker.
    #115152
    Bookkus
    Member

    It’s just the shortcode forum when I post it into a page: http://www.bookkus.com/test-forum/

    If I use the other forum it looks like this: http://www.bookkus.com/forums-2/

    #115150
    Lynq
    Participant

    Oh wow umm,

    It looks as though there isn’t a lot of styling going on for your forum.

    Where did you get your bbpress.css file from? It looks really short compared the one I got originally.

    #115149
    Lynq
    Participant

    Hi there,

    I actually had this issue with my custom plugin, it turned out that a recent version of wordpress has tightened the security on plugins I believe, so if the plugins are not coded correctly then it will cause the issue you are describing.

    Have you updated all the plugins aswell?

    #115146
    Martin
    Participant

    Hi all,

    To help promote anonymous posters to post questions, I’d like to put up some sort of permanent notice information box above the forums to display said message.
    Any ideas what file/code I need to be playing with, as a start?

    #115139
    Bookkus
    Member

    I am having some trouble with the layout of my forum. Once I add the shortcode to a new page the layout goes very strange. I have tried going to full-width with no result.
    I am using custom community theme. My buddypress, wordpress, and bbpress are fully updated.

    http://www.bookkus.com/test-forum/

    Thanks in advance for your help.

    #115135
    DNBrawler
    Participant

    It’s calling JQuery scripts–the only one I could find is this one:wp_enqueue_script( 'bp-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array( 'jquery' ) );
    I tried to implement the topic.js many times It’s just not working :/

    #115113
    DNBrawler
    Participant

    I’m stumped. lol

    Do I have to call the script? :L I have no idea.. what to do.

    I found this:

        if ( bbp_is_single_topic() )
            wp_enqueue_script( 'bbp_topic', $this-&gt;url . 'js/topic.js', array( 'wp-lists' ), $this-&gt;version, true );
    

    Am I close ? :/
    Okay now I do believe that my theme is causing the problem since I switched themes and it started to work. I have more work to do.

    • This reply was modified 14 years, 3 months ago by DNBrawler.
    • This reply was modified 14 years, 3 months ago by DNBrawler.
    • This reply was modified 14 years, 3 months ago by DNBrawler.
    #115112
    Lynq
    Participant

    It did the same again, I have had a couple of issues with the code button too!

    It is kind of a tricky to pick out a specific forum, you would need to do a little bit of coding to try and change the way your loop-topics loop works.

    You would need to be able to pass in an argument of something like $limit and then set the limit based on the forum id. Feels like a lot of work to me, but someone else might have a better idea.

    Sorry!

    #115109
    DNBrawler
    Participant

    Sorry must not have worked. Here it is again:

                             '_bbp_reply_count', 'meta_value' =&gt; '1', 'meta_compare' =&gt; ' 'date', 'show_stickies' =&gt; false ) ) ) : ?&gt;
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
                    <!-- #topics-front -->
    

    “ EDIT: Now it’s deleting the content of the code sample. Here’s the link from pastebin. http://pastebin.com/3TLgVni2

    • This reply was modified 14 years, 3 months ago by DNBrawler.
    • This reply was modified 14 years, 3 months ago by DNBrawler.
    #115102
    Lynq
    Participant

    Hey DNBrawler,

    Your code got cut off 🙁 can you try posting it again and using the code button?

    #115100
    DNBrawler
    Participant

    I’m using a template to customize the number of posts on one of my pages. My default number of forum posts on one single page is 6. I want 15 to appear on a page so after noticing in the statistics template that the popular topics can show more than than the default setting I ventured to apply it to a single forum called from the forum id. Here’s the code:

    15, ‘post_parent’ => bbp_get_forum_id(568), ‘show_stickies’ => false ) ) ) : ?>

    My problem: The forums are only showing 16 unfortunately. My question: How do I limit the number of posts on individual pages?

    #115097

    In reply to: Reply Truncation

    Lynq
    Participant

    You have the following CSS on your site which is restricting the height of the replies.

    div.reply {
        height: 32px;
    }
    

    I didn’t search heavily, but it looks like it is coming directly from the page, I can’t find the stylesheet where that is coming from, good luck hunting!

    #115069
    Lynq
    Participant

    By the way this code snippet works for me:

    function custom_bbp_breadcrumb() {
        $args['sep'] = ' | ';
        return $args;
    }
    
    add_filter('bbp_before_get_breadcrumb_parse_args', 'custom_bbp_breadcrumb' );
    
    • This reply was modified 14 years, 3 months ago by Lynq.
    #115065
    Clay
    Member

    So, using the code example several posts above, from manuelmasia — let’s say that I wrap that in php tags and drop it into a functions.php file in my child theme directory. Is there anything else that I would need to do in order to get the breadcrumbs to display differently?

    • This reply was modified 14 years, 3 months ago by Clay.
    #114999
    Erlend
    Participant

    Yesterday I offered to help write some copy for bbPress.org, so this is the first of many such posts in a series of sorts as I work my way through the pages and contents in question.

    Today I’ve been looking at the examples page. This page is not linked to yet, but we’ll sort that out once we’re happy with the page itself.

    Also, down the line bbPress should simply have its own “flavor” on the WordPress Showcase site, coupled with a custom page on bbpress.org that pulls information from there, much like how the BuddyPress showcase probably already works. But since that might take a while (all I know is it’s beyond my capabilities) I figured a static page would serve as a good substitute in the meantime.

    Styling

    I realized that a common question that’s going to be popping up as I work on these pages is “Changes to bbpress.org vs Changes to my article formatting“. So when I give this feedback, know that I probably have a reasonable workaround for it in mind already if you don’t agree with the proposed changes.

    • Page headers – Either make them take charge of the page (more prominent than h1) or don’t show them at all. One of my favorite examples of a beautifully dominant page title is WooThemes’ Optimize.
    • On my test site (also where my images are currently loaded from because I don’t have that privilege here yet) I used captions to achieve some simple compartmentalization. It seems the bbpress.org theme doesn’t have any styling for captions yet. Furthermore, on hover they expand slightly instead of highlighting in some other way (e.g. a shadow overlay), making the content below shift downwards slightly, which looks weird.
    • The showcase codex page should be retired.

    Your input is most welcome, including my choice of “featured” items.

    • This reply was modified 14 years, 3 months ago by Erlend.
    • This reply was modified 14 years, 3 months ago by Erlend.
    • This reply was modified 14 years, 3 months ago by Erlend.
    #114995
    selise
    Participant

    thanks jjj.

    here’s what i needed to do, in case anyone else is interested.

    1. install bbpress and wptouch pro plugins
    2. in bbpress settings, under theme packages, choose the bbpress
      default – bbp-theme-compat
    3. create a wp page forums and use [bbp-forum-index] short code for a
      forum index page
    4. in wptouch admin make sure that both “Enable ‘topic’ post type” and
      “Enable ‘reply’ post type” are NOT selected (thanks to emilio at
      bravenewcode)
    5. put a copy of bbpress/bbp-theme-compat/extras/archive-forum.php into
      the active wptouch child theme iphone (etc) directory(ies).
    6. tweak style

    i have no idea why a copy of archive-forum.php was needed in the wptouch theme as i didn’t need to copy any of the bbpress files into my desktop theme (twentyten child) and i didn’t copy any of the other bbpress files into the wptouch theme. but at least it seems to be working with a minimum of fuss.

    #114991
    pimarts
    Participant

    You could try something like this (for an install that also has BuddyPress):

    function disable_all_widgets( $sidebars_widgets ) {       
        if ( function_exists('is_bbpress') ) {
            if (is_bbpress()) {
                $sidebars_widgets = array(false);
                remove_all_actions('bp_register_widgets');
                unregister_sidebar( 'bp_core_widgets' );
            }
        }
        return $sidebars_widgets;
    }
    
    add_filter('sidebars_widgets', 'disable_all_widgets', 1, 1);
    

    Looks very promising – thanks for your input!

    #114982
    Erlend
    Participant

    @JJJ this is mainly for you & anyone else who might be editing the site, so if there’s a better place to discuss this, e.g. the the bbPress devblog, let me know.

    I looked at the current page structure and thought it could be structured a bit differently:

    About & Features reshuffled

    • About

      • GNU License
      • Domains (possibly merged with License page)
      • Get involved
      • Privacy
      • The Story
      • Development
    • Features

      • Fully Integrated
      • Multisite Forums
      • Simple Setup
      • Examples/Showcase (might be better off as its own parent)

    Move to codex

    • Installation
    • Requirements

    This also depends on the plan for pages like ‘simple’, ‘integration’ and ‘multisite’, which might not need dedicated pages if they can be explained simply enough in a paragraph (I’ll give it a shot).

    • This topic was modified 14 years, 3 months ago by Erlend.
    • This topic was modified 14 years, 3 months ago by Erlend.
    • This topic was modified 14 years, 3 months ago by Erlend.
    #114980
    Clay
    Member

    Lynq, that’s what I assumed, too. This link suggests the approach you took:
    https://codex.bbpress.org/theme-compatibility/

Viewing 25 results - 15,851 through 15,875 (of 32,581 total)
Skip to toolbar