Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 15,151 through 15,175 (of 32,581 total)
  • Author
    Search Results
  • #120738
    Michael
    Participant

    Okay, after some sleuthing I’ve figured out why page.php is *always* called to display the Archive Base and Topic Base.

    The set of available templates appears to be hard-wired in (rather than selecting from all available Templates in the selected Theme) in bbp_get_theme_compat_templates() in …/bbpress/includes/core/template-loader.php.

    bbPress appears to want to select from a known list of “bbPress friendly” Templates to display pages, so it uses this hard-wired list when it goes hunting for the Template to use for displaying a given bbPress page.

    The $templates array includes the following Template file names (as of v2.2.2):

    $templates = array(
    'plugin-bbpress.php',
    'bbpress.php',
    'forums.php',
    'forum.php',
    'generic.php',
    'page.php',
    'single.php',
    'index.php'
    );

    What’s important here is that the ORDERING of the Templates in the array matters, as the function bbp_locate_template() goes through this array sequentially and returns the first Template it finds, which gets used to display the bbPress page.

    bbp_locate_template() searches the Child Theme first, then the Parent Theme, and finally the theme-compat folder, so in theory one can install a Template in the Child or Parent Theme with one of the above Template file names, and so long as bbp_locate_template() finds it first, we’re all cool — that Template will get used for Forum pages.

    There are 3 ways I can see to ensure my special Template is used when the Archive Base is displayed, in order of simplicity:

    1.  Edit the hard-wired $templates array in bbp_get_theme_compat_templates() in template-loader.php and add my template name to the top of the list.  Of course, this is BAD PRACTICE since it will get overwritten in the next bbPress update, but a quick way to test out a Template.

    2.  Create a Template called “plugin-bbpress.php” and put it in my Child Theme directory.  That’s the simplest.

    3.  Hook into bbp_get_bbpress_template, which is used as a filter on the $templates array and add my Template name as the first entry in the array.  This is the way it’s intended to be done, from what I can tell.

    All three of these will work, but they all have the downside of completely ignoring the Template setting of the Page Attribute for a given WP page (see here for what I’m talking about).  For a given WP page that is “partnered” with a bbPress page, bbPress should use the Template specified in the Page Attribute.  That’s what it’s there for.

    While I haven’t tried it yet, perhaps I can hook into bbp_get_bbpress_template and inject the current page’s Page Attribute for the Template.  I’ll have to dig into this a bit and see if it’s worth the effort.  It seems like that would be the cleanest way, as well as in the spirit of how Page Attributes are supposed to be used.

    Wish me luck.

    Michael

    #120735
    Pippin Williamson
    Participant

    Did you setup the home page of the forums using the short codes? If so, switch to the HTML view of your page editor and you will be able to see the PRE tags.

    #120734
    Michael
    Participant

    Okay, I’ve been doing some digging and perhaps as expected, the theme Template page.php (the default WP Template) is being called to build the Archive Base page.  I can edit the page.php in my child theme and customize from there (where it eventually calls the_content(), which apparently executes content-archive-forum.php to display the Forum “front page”), but that’s a brute-force method since page.php is the default Template for all pages. I want to create a Template explicitly for bbPress pages, which means I need a way to specify the Template to use on a per-page basis.

    Normally this would be done by simply creating a Template (like page.php) and put it in your child theme directory, then select it for a specific page you want to apply it to using the wp-admin Edit Page -> Page Attributes -> Template pull down, save it and voila, your page uses your custom Template.

    But with bbPress pages that are “partnered with a WordPress page” (per this topic discussion), this doesn’t work for the partnered page.  The Template setting seems to be ignored, and only for bbPress pages partnered this way.

    This may not be a show-stopper for me, but may be for others looking to customize the overall page Template for their bbPress pages.  Is it a bbPress bug?  I can’t tell, and hopefully I’m missing something painfully obvious, being new to installing/using bbPress.

    Seems like there must be some kind of code frag in the plugin that does something like:

    if (request to display (Archive Base | Topic Base) {
      if ((Archive Base | Topic Base) is partnered with WP page) {
        point the_content() at (content-archive-forum.php | content-archive-topic.php);
        call default page Template;
      }
    }

    JJJ or someone else in-the-know, can you comment on how the “partnering with a WordPress page” works? Where is this performed? Sorry if the question is naive, I’m just having trouble understanding how this partnering works at the Template execution level.

    Many thanks.
    Michael

    #120727
    tomazi
    Participant

    how do i add the code correctly to the core?

    is it ?

    I think its really wierd that bbpress does not have a easy way to add post count to the forum. Or is it something really easy i have missed?

    Thanks!

    #120720

    Exactly like you’d expect:

    • Create a page with the slug ‘topics’
    • Use the ‘bbp-topic-index’ shortcode in the page content.
    • Done.
    #120702
    Michael
    Participant

    For what it’s worth, I’m looking for whatever function is calling content-archive-forum.php.  I can edit this file in my child theme per the Codex, but I’m trying to figure out which function is calling this, and in particular, what function generates the code above the <div id=”bbpress-forums”> at the start of content-archive-forum.php.

    Does bbPress simply use the default post display template, and if so, where is the call to load and execute content-archive-forum.php  made?

    I tried a grep for content-archive-forum in the entire wordpress tree from wp-content on down, and I can’t find where this is called from.

    Many thanks

    Michael

     

    and not just this template file

    #120698
    Michael
    Participant

    Hi there — I’m running WP 3.4.2, bbPress 2.2.2 & buddypress 1.6.1.  Overall, I’m quite happy with the installation, and I’ve done a fair amount of customization on my site  to give it a nice L&F.  I’ve been using a child theme to do all customization, and it’s been reasonably straightforward, but not trivial.  That said, many thanks to all the bbPress folks who are putting lots of time in on this plugin — it’s a great platform.

    Onto my question:  How is the main forum archive page generated?  I want to create my own template to generate this page, and I’ve been stumped trying to trace the sequence of files/calls used to create it.

    For context, I have the Forums Base set to “member-area/forums” in Settings -> Forums. I can go to http://mysite/member-area/forums and see the standard listing of all the forums in a table.  Perfect, just what I want.

    That said, how exactly is this page created?  Which files & calls in the plugin create it?  I’ve found loop-forums.php in …/plugins/bbpress/templates/default/bbpress/which is used to create the table within the page (apparently called as the_content() somewhere), but I can’t find the code blocks that create the header, footer, etc.  Is there a single template page used to create the Archive Base page?

    Apparently this page is generated regardless of whether there is an existing page (permalink) to the same permalink used as Archive Base.  Nifty, but I want to use my own template (the whole thing) for creating the Archive Base page.

    Even when I create a page with a permalink address the same as Archive Base and insert a  [bbp-forum-index] in the post content, I can’t seem to select a Template from the Page Attribute pull down that has any effect on the creation of the Archive Base page.  It’s like it’s hard wired to use a very specific template — that I can’t find in the directory tree.

    Long winded, but I hope that conveys what I’m trying to do.  In short, I just want to create my own template for creating the Archive Base page.  Any pointers are appreciated.

    Cheers,

    Michael

    Pierre-Luc Auclair
    Participant

    Hi tzeldin88,

    I had a similar problem. I am using various get_post_field calls to display parts of a footer that need to be editable by a client and needed to do apply_filters(‘the_content’,$x).

    I have found that if I call bbp_restore_all_filters('the_content',0);, it will bring the filter back, but it doesn’t affect the rest of the forum. 🙂 I would assume that calling the bbp_remove_all_filters() function after will disable it back.

    Hopefully my example here is clearer.
    http://pastebin.com/BdiMFGTV

    #120692

    In reply to: bbPress 2.2.2 released

    SK
    Participant

    As reported elsewhere, my theme doesn’t seem to like bbPress 2.2.2 either.

    The problem caused is that I think the template files that make bbPress work with other themes broke.

    I can still go to the forum pages with direct URLs or links in forum list widget, but the forums (list of forums or list of topics) are not visible. All I see in content area is page/forum title and forum description.

    Similarly, on topic pages, I see topic title, but nothing else…

    When I view source, the code is not there. e.g. when on forums home I view code, I can’t find the forum names (except in the forum list widget)

    P.S. Reinstalling 2.2.2 has not resolved the issue.

    #120682
    sambedingfield
    Participant

    Not be the most elegant solution, but it’ll have to do for now:


    //redirect user profile topic permalinks to fix pagination, as we have topics embedded on profiles
    function rats_redirect_user_pagination( $pagination ) {
    // Get bbPress
    $bbp = bbpress();
    if (bbp_is_single_user() && is_array($pagination) && isset($pagination['base']) ) {
    //if topics has not been included in the url yet
    $check_topic = strpos($pagination['base'], '/topics/page/');
    if($check_topic === false) {
    $pagination['base'] = str_replace('/page/','/topics/page/', $pagination['base']);
    }
    }
    //return pagination array
    return $pagination;
    }
    add_action('bbp_topic_pagination', 'rats_redirect_user_pagination', 99, 1 );

    #120678

    In reply to: RSS feeds broken

    Steve
    Participant

    Sorry, I lost sight of this… there’s another bug – you use

    get_option( 'rss_language' );

    which no longer works…. it needs to be changed to:

    bloginfo_rss( 'language' )

    I can raise another trac ticket when I get home if you like

    Steve

    #120667
    Stephen Edgar
    Keymaster

    Make sure you select ‘phpBB’ with the ‘import forums tool’ option ‘Select Platform’

    Check out the brief docs here https://codex.bbpress.org/import-forums/

    The import works pretty well for the base of phpBB migration for users, forums, topics & replies.

    #120659
    #120655

    In reply to: How to rollback

    SK
    Participant

    Thanks @labsecrets, but that may not work for us because when I view source the code is not there. e.g. when on forums home I view code, I can’t find the forum names (except in the forum list widget)

    #120652

    In reply to: bbPress 2.2.2 released

    LabSecrets
    Participant

    Between 2.2.1 and 2.2.2, we found that the profile pages suddenly “vanished” (but the code was still there). It was a CSS issue.

    For our clients and personal sites, the fix was on line 78 of the default css:

    We changed “clear:none” to “clear:both”


    #bbpress-forums #bbp-user-wrapper ul.bbp-lead-topic, #bbpress-forums #bbp-user-wrapper ul.bbp-topics, #bbpress-forums #bbp-user-wrapper ul.bbp-forums, #bbpress-forums #bbp-user-wrapper ul.bbp-replies, #bbpress-forums #bbp-user-wrapper fieldset.bbp-form {   clear: both; }

    Pierre-Luc Auclair
    Participant

    I’m trying to understand if/how it is possible to call BuddyPress functions outside the forum (in a regular WP page). The Codex isn’t of much help…

    I am trying to create a latest topics list and a forums list on regular WP pages (home.php, index.php), etc.

    Thanks for the help !

    #120647

    It’s a bit difficult to wrap your head around at first, but the reason theme compatibility exists, is because you should not modify code/templates that come with plugins or themes. When using a plugin like bbPress, and a theme that isn’t yours, you need some other way to introduce code into WordPress.

    You can use either a plugin, or a child theme to do this.

    You’ll want to research both methods, and figure out which one suits your situation and needs.

    #120646

    Yep!

    • bbp_get_forum_content( $forum_id ); to return
    • bbp_forum_content( $forum_id ); to echo
    #120645
    nickzee
    Participant

    Dear community.

    I have spent the last few (5) hours reading the various posts, trying to get bbpress to integrate with my custom WP theme. Unfortunately, I don’t have the knowledge (or enough) to figure out how to make the two work together.

    Info
    Wordpress: 3.4.2
    Site link: http://www.restorationcoach.com/restoration_coach/forums/
    Using this theme: http://www.templatemonster.com/wordpress-themes/39849.html
    bbpress: 2.2

    My main issue seams to be css related. I think bbpress is and the theme are sharing css files, causing a funky appearance. Overall forum function seems to be working fine.

    So far I’ve done the following.

    Completely removed bbpress and installed new 2.2 version.
    Read: http://codex.bbpress.org/theme-compatibility/ (this is for customizing the bbpress theme, if you want? And if you don’t, then leave the install as is?)
    Watched: http://www.youtube.com/watch?v=lB2Oodx2GJw (not sure if this applies with 2.2)
    Switched to Twentyeleven: Looks better, side bar is missing, and footer contact form, map and links are over top one another.

    I can see in firebug where both style.css and bbpress.css are being used to style the forum. Most specifically #page-content ul li. This, I believe, is causing the issues but not quite sure how to fix it.

    Thank you in advance for the assistance.

    #120642
    Kevin Behrens
    Participant

    Capabilities are saved in the database, per user, per site, and they bubble based on the role they are granted. If you use any plugin that modifies editable roles or capabilities in the database, what you’re doing is changing the individual capabilities for every user that gets that role going forward, but not necessarily every user that had that role in the past.

    I think the type-specific dynamic roles are a nice addition to the WP permissions layer. No doubt a significant minority of users will continue to find value and convenience in the ability to customize stored role definitions. Once WP moves to disregard the wp_user_roles array, role editing plugins will just be forced to store the rolecaps array externally and apply them through the filters you provide.

    I won’t argue the philosophy of how much customization to fence off for safety/liability, but your writeup exaggerates some of the existing hazards. The “existing users unaffected by role edit” scenario only occurs if custom user capabilities were explicitly assigned. Otherwise, under stock code:

    Granting a role stores the role name into the user’s usermeta capabilities array. So editing a stored role definition does affect current members of that role (not just future members).

    Granting a role does not store a copy of all currently defined rolecaps into the usermeta capabilities array.

    Put this in mu-plugins, or make a plugin out of it, or put it in your functions.php file of your theme. Probably will want to rename “foo” though.

    function foo( $args = array() ) {
        $args['teeny'] = false;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'foo' );

    That’s not a great solution, because you’re missing out on all the other things that hook to the_content otherwise.

    Are you using query_posts() anywhere? Are you not using wp_reset_query(); when your WP_Query’s are done?

    htz77
    Participant

    I found a solution: if my template uses get_the_content() instead of the_content(), then I can apply the normal content filters — wpautop() and wptexturize() — directly to the raw content, untouched by bbPress.
    $raw_content = get_the_content();
    echo wptexturize(wpautop($raw_content));

    padekan
    Participant

    I updated to bbPress 2.2.1 last night and had the same problem with Ultimate TinyMCE plugin. The plugin sued to work beautifully with bbPress, now I get the default fancy editor. I’m not a PHP guru so I’ve been trying to avoid messing around in the code as Michael suggests. Is there any other option to get that editor enabled (it does show up in the dashboard versions of new Topic and I miss the table drawer)

    regards, Paul

    #120626

    In reply to: Filter name

    Changed to bbp_single_user_details_avatar_size in the branch, will be 2.2.3, which has no date set yet. You can safely modify that code in your file if you’d like, any future update will include it.

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