Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 15,126 through 15,150 (of 32,581 total)
  • Author
    Search Results
  • #120942
    redsavior
    Participant

    Ok, the only plugin I’ve updated recently was bbpress and since then, it’s stopped working. What would cause this? Right now, the forums will not load.

    Here’s the URL to them: http://www.tastyfresh.com/forums/

    That’s to a page that is calling the shortcode. Several actually. It may be possible that I have a conflict in there given that the page itself is made to have logged in and logged out views as well as multiple renders of the forums in tabs (All forums, login and recent topics specifically). It was functioning just fine until the 2.2.2 update.

    So, what are the potential issues that could cause this?

    sunnyt7
    Participant

    Sorry where does this code go?

    wp-content/themes/mytheme/functions.php?

    #120932
    freenet
    Participant

    hello, how to wirite .htaccess for bbpress
    my wordpress rule is
    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress
    this rule url is : http://www.duba.pro/177.html
    ——————————————————
    But when i install the bbpress , a topic for chianese’s title is
    http://www.duba.pro/bbs/title/%e8%ae%ba%e5%9d%9b%e5%bc%80%e5%90%af%e6%ac%a2%e8%bf%8e%e5%8f%91%e5%b8%83%e8%ae%a8%e8%ae%ba%e5%92%8c%e5%8f%8d%e9%a6%88

    —————————————————–
    how to wirte the htaccess rule lick wordpress,thanks.

    Lynq
    Participant

    It looks like there is a filter you might be able to use to create a plugin

    function bbp_get_topic_caps() {
    return apply_filters( 'bbp_get_topic_caps', array (
    'edit_posts'          => 'edit_topics',
    'edit_others_posts'   => 'edit_others_topics',
    'publish_posts'       => 'publish_topics',
    'read_private_posts'  => 'read_private_topics',
    'read_hidden_posts'   => 'read_hidden_topics',
    'delete_posts'        => 'delete_topics',
    'delete_others_posts' => 'delete_others_topics'
    ) );
    }

    #120847
    Stephen Edgar
    Keymaster

    @HistoryHouse The codex document you linked to is for the old ‘legacy standalone’ version of bbPress, not the new plugin version.

    This is what you are looking for (I think) https://codex.bbpress.org/theme-compatibility/

    Michael
    Participant

    Hi — I’m using v2.2.2 and hooking into a few of the bbp_current_user_* permissions checks in template-tags.php, and I noticed what I think may be a bug. Or maybe it’s a feature. 😉

    The function bbp_current_user_can_publish_forums() applies a filter of ‘bbp_current_user_can_publish_forums’ on the last line of the function.

    I noticed that function bbp_current_user_can_publish_topics() applies the same filter of ‘bbp_current_user_can_publish_forums’ — is that what is intended?

    All of the other bbp_current_user_can_* functions have their own respective filters, so  bbp_current_user_can_publish_topics() looks like the odd man out.  Shouldn’t the last line in the function look like:

    // Allow access to be filtered
    return (bool) apply_filters( 'bbp_current_user_can_publish_topics', $retval );

    Michael

    #120837
    HistoryHouse
    Participant

    If someone could just guide me please (I’m returning to bbPress after a confused time with it pre-plugin days).

    Plug-in installed OK and it was easy (thanks!). The forum is using my blog page layout which has a widget controlling the right sidebar (my own theme design adapted from blankslate).
    http://www.historyhouse.co.uk/historynews/

    The test page works fine (apart from it’s too wide – but I can solve that.)

    Problem is I want it to have its own unique page template (not using the sidebar widget). Probably something like this template I created.
    http://www.historyhouse.co.uk/historynews/history-of-ashen-my-ancestors

    In my stumbling I thought a child theme may have been the answer so I looked the below page but the bbpress version number is not the same. Besides it didn’t seem to work for me.
    http://codex.bbpress.org/legacy/step-by-step-guide-to-creating-a-custom-bbpress-theme/

    So in a nut shell. How can I make it use the template in my second example?

    Thanks in advance and be gentle with me 😉

    royho
    Participant

    I ended up just doing it the old fashion way:


    $user = new WP_User( 1 );
    $user->add_role( 'bbp_keymaster' );

    #120827
    frenzis73
    Participant

    Widget and shortcode are not so “themable” like I would. WP_QUERY is right, but then I cannot use bbp_* in my file.

    What I want is use every BBP Functions inside my, eg, single.php: show author, show forums, show topic simple calling bbp_**

    How bbp_has_forums() works? It loads the functions ouside the BBP pages?

    Regards, Francesco.

    Stephen Edgar
    Keymaster
    Shane Gowland
    Participant

    You can use the shortcode in the PHP template files with the do_shortcode() function.

    echo do_shortcode('[bbp-topic-index]'); would do the trick.

    Of course; there is a performance overhead involved with making WordPress parse the shortcode before displaying the content. Using WP_Query and creating a custom loop would be the ideal method, but it’s also much trickier.

    #120794
    Halo Diehard
    Participant

    Well, I’ve created a page and am using the shortcode and it seems to bypass the issue. For anybody having this layout trouble, the shortcodes can be found here:

    https://codex.bbpress.org/shortcodes/

    #120790
    Michael
    Participant

    Hi John James — thanks for responding, much appreciated.

    Regarding get_the_ID() not working on an archive page, I understanding your point — there isn’t a page associated with it.

    The only issue I have is that the Forum Archive page is associated (“partnered” to use the documentation phrase) with a real page, and essentially it is just a regular page with embedded shortcodes.

    In my case, the partnered page has content and embedded shortcodes, and it has a real page ID (#1296 in my case).  That’s what I wanted to find so I can extract information specific to that partnered page.

    What am I doing with all this?  Well, the short story is that certain specific pages on my website have some special header images attached above the_content(), and I have created a custom Template in my child theme to handle it.  Information about the slug is extracted, which is used to lookup random images in a database of images.

    I’m trying to keep a consistent approach with all pages, hence the use of a custom Template that I set as a page attribute in the editor.

    None of this is fatal for my needs, but if a page is partnered with the Forum or Topic Archive pages, it seems like the selected Template for displaying those pages should come from the Template page attribute associated with it.  Hence the need for post ID of the partnered page.

    Cheers.

    Michael

    #120781
    plannerguy
    Participant

    @JJJ – need help in the same regard.

    I’m using amember and not s2member – and I need to block users from bbpress when their subscription becomes inactive (which means they are assigned a WP role of “amember expired” by amember).

    Will JJJ’s code or tzelding88’s code above achieve this? Will it sustain mapping so that when a user’s WP role changes, bbpress’s role changes as well?

    Many thanks.

    #120777
    padekan
    Participant

    Ok , so it’s a bit of physician heal thyself but here’s how I fixed in case other people are having the problem.

    I found this:

    https://codex.bbpress.org/theme-compatibility/

    which shows how to create a custom bbpress.css in 2.0 and later.  Then I changed line 62 to be:

    list-style-type:   inherit /* was ‘none’ */;

    (basically took out the none override for basic list elements).

    Seems like overkill to have a complete copy of bbpress.css just to change one line but I could not find another place to override it.  Tried playing around with trying a skeleton bbpress.css that @import’ed the default one but didn’t have much success with that.

    Anyways, issue has been resolved, thanks!

    regards, Paul

    #120775
    Shane Gowland
    Participant

    bbPress is now a plugin for WordPress. That means that it doesn’t run without an install of WordPress.

    As for the design; that’s entirely up to you. You can go with the default bbPress styles, use a WordPress theme that overrides them or apply your own CSS and make the forums totally original. I recommend having a good read of the bbPress 2.0+ documentation.

    #120771
    • Use a regular old WP_Query()
    • Use a widget
    • Use bbp_has_forums()
    • Use the shortcode mentioned above

    There are lots of examples, in the forums, on the codex, and in the bbPress code itself. Also, unclear what you mean by “latest forum.” Do you mean topics, or replies, or something else?

    #120770

    Modifying core files is never the way. There are plenty of filters in place to override any bit of functionality regarding bbPress’s theme compat,

    There are, as you’ve already found, numerous vectors depending on exactly what you want to accomplish. Each filter has an intended purpose, and solves a specific problem. The underlying code is identical to WordPress’s own template loader, until a template isn’t found (which is a majority of installations.) In that case, bbPress replaces the_content with template parts using page.php, or whatever is a match in the stack you found already.

    Also, don’t forget about the typical WordPress templates: archive-forum.php, and archive-topic.php, etc…

    To answer your question about why get_the_ID() doesn’t work on archive pages, why would it? It’s an archive, not a post/page. There is not ID to get.

    From your posts here, you’ve basically solved much of what’s already in the codex regarding how some of these things work; also, I’m fuzzy on what problem you’re trying to solve. What is the end goal you’re working towards? I can give you some advice on what I think will work best.

    #120766
    Michael
    Participant

    Okay, I’ve made some further progress with method #3 above (hooking into bbp_get_bbpress_template ).  Here’s the general approach I’m taking:

    add_filter( 'bbp_get_bbpress_template', 'my_add_page_template', $templates );
    function my_add_page_template( array $templates ) {
      $page_template = get_post_meta( $post_id, '_wp_page_template', true );
      if ( $page_template != 'default' )
        array_unshift( $templates, $page_template );
    return $templates;
    }

    The only issue I have right now is that $post_id is difficult to extract if the archive pages (Archive Base and Topics Base) are being displayed. Right now I am hard wiring it to the post_id of the Archive Base page (getting it from the editor), and it works okay but not what I want.

    Since these pages (archives) are custom post types, I haven’t found an easy way to find their post_id’s, and querying globals like $post->ID and calling functions like get_the_ID() and url_to_postid() don’t work for custom post IDs ($post->ID and get_the_ID() return 0).

    QUESTION: For a bbPress page that is currently being built for display, is the post_id of the page being stored somewhere in a bbPress global?

    Michael

    #120765
    Stephen Edgar
    Keymaster

    Use the [bbp-forum-index] shortcode https://codex.bbpress.org/shortcodes/

    Stephen Edgar
    Keymaster

    Basically all these functions names need to be unique…

    If you use the above from @JJJ with ‘foo’ and then you use another function from another topic called ‘bar’ and then use a third again called ‘foo’ you will now have a conflict because two custom functions are trying to use ‘foo’.

    A common practice is to name the functions with something to remind yourself (or others reading your code) that it is custom code you have added to your install.

    eg. Prefixing ‘foo’ with ‘hd_’ for ‘Halo Diehard’

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

    Better yet, a more descriptive name again with ‘hd_’ Halo Diehard prefix.

    function hd_custom_teeny_mce_override( $args = array() ) {
        $args['teeny'] = false;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'hd_custom_teeny_mce_override' );
    #120751
    Stephen Edgar
    Keymaster

    Here are the steps I would follow:

    – Backup everything and often (WordPress, Xooops, MySQL etc)
    – Install WordPress locally to test the import
    – Research the Xoops MySQL database structure
    – Make a copy of importer example.php as xoops.php in the same folder
    – Edit xoops.php to match the xoops database table & field names

    eg. This from Example.php:
    // Forum id. Stored in postmeta.
    $this->field_map[] = array(
    'from_tablename' => 'forum',
    'from_fieldname' => 'forumid',
    'to_type' => 'forum',
    'to_fieldname' => '_bbp_forum_id'
    );

    Would become:
    // Forum id. Stored in postmeta.
    $this->field_map[] = array(
    'from_tablename' => 'xoops_forum_table_name',
    'from_fieldname' => 'xoops_forumid',
    'to_type' => 'forum',
    'to_fieldname' => '_bbp_forum_id'
    );

    The above is not accurate as I have no idea what table and field names xoops uses for its database, that is the bits you need to research. Do the above for as much as you can matching all the tables and fields testing your import.

    Once you have an import working and are happy with you can then look to importing it to your live site and I cannot emphasize this enough, backuyp, backup and more backups in case things go wrong.

    Halo Diehard
    Participant

    Thank you for your quick response, I guess what I’m trying to convey is my uncertainty whether or not I can just plug that code in and rename “foo” anything? I don’t understand why I have to rename the foo, so I thought perhaps there was another step as well it was assumed I would know. (aka: you also have to put “” into your html)

    Sorry I’m such a “foo” when it comes to coding 😉 I’m learning as fast as I can!

    Wait, I might understand! We rename “foo” so we can recognize what it does when we’re looking at the code?

    Hansaplastique
    Participant

    For some reason my code didn’t stick; I mean remove:

    bb_new_topic_link();

    Hansaplastique
    Participant

    +1 for me.

    I installed “bbPress Topics for Posts” (plugin link).
    I wanted to create one forum that collects comments on articles (this plugin does that very well – only downside is that comments made in the forum do not count as comments but are visible).

    Anyhow; I want users to be able to reply, but NOT create new topics.
    Right now it’s either no new topics and no new replies, OR new topics and new replies.

    Of course I could modify the forum.php and remove the for the specific forum. Is there an easier (more future proof) way?

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