Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 23,251 through 23,275 (of 32,481 total)
  • Author
    Search Results
  • #79962

    In reply to: removing tags

    Mark
    Member

    Looks like it’s bb_repermalink that’s choking and causing us to get that blank page.

    Submit to trac? You can modify the following in functions.bb-core.php, starting on line 737;

    $_original_id = $id;
    if ( !$id )
    $permalink = bb_get_tag_page_link();
    else {
    global $tag, $tag_name;
    $tag_name = $id;
    $tag = bb_get_tag( (string) $tag_name );
    $permalink = bb_get_tag_link( 0, $page ); // 0 => grabs $tag from global.
    }

    To;

    $_original_id = $id;
    $tag = bb_get_tag( (string) $id );
    if ( !$tag )
    $permalink = bb_get_tag_page_link();
    else {
    global $tag, $tag_name;
    $tag_name = $id;
    $permalink = bb_get_tag_link( 0, $page ); // 0 => grabs $tag from global.
    }

    And instead of returning that blank page, it will return the global tags page. Possibly not the most eloquent solution, but works nonetheless.

    #79998
    Mark
    Member

    Honestly when it comes to basic integration there’s absolutely no difference. WP and WPMU are the same codebase after all. The only real difference is whether or not you want your blog owners to be automatically added to your primary blog and by proxy as members of the forum.

    Deep integration is accomplished exactly the same on either platform too. Just stick with µ, eventually (as in anywhere from tomorrow to 2017) the two will merge anyways and if you install a second copy of standalone WP.org for your forums, you’re just going to wind up with two µ’s down the road. ;)

    I noticed you tagged this convo bbmu, just so you know (you probably do) but when you integrate bbPress with µ you don’t get bbPress µ as a result. When /bbpress is accessed, no matter the blog, the viewer will get the exact same forum.

    #64937
    kaz1844
    Member

    here’s what I did to get a page in wordpress in my navigation bar that redirects to the bbpress part of my site: set up a page template and made sure it was selected when I set up the forum page in wordpress – the template simply included redirection code:

    <?php

    /*

    Template Name: Forum Section

    */

    ?>

    <?php

    header( ‘Location: http://www.yourdomain.com/your-forum-name-directory&#8217; ) ;

    ?>

    #79961

    In reply to: removing tags

    chrishajer
    Participant

    I didn’t actually check the code, if it was 200 or 500. I just assumed the blank page was due to a 500 error. It would be nice to see “sorry that tag does not exist” or something on an error page.

    Try to browse a non-existent tag here and see what happens.

    Just checked here and it’s a 200 response with a blank page. My information about 500 error earlier was incorrect.

    #79960

    In reply to: removing tags

    Mark
    Member

    You might want to explore where that 500 is coming from, that probably shouldn’t happen. I did the same thing just to see if it was inherent to bbPress or maybe just bbPress.org, and it seems it might be just you. :) I got a blank page (would be nice to see that redirect somewhere else for non-existent tags) but it was showing a 200 ok, and not a 500.

    I just realized bbPress doesn’t have anywhere to view/edit tags in the administration panel. Is that coming down the road?

    #79951
    <?php

    function add_email_spec_meta( $arr ) {

    if( !bb_is_user_logged_in() || bb_current_user_can( 'edit_users' ) )
    return $arr;

    if( bb_get_location() != 'profile-page' || stripos( $_SERVER[ 'QUERY_STRING' ], 'tab=edit' ) !== false )
    return $arr;

    $arr['email_spec'] = $arr['user_email'];

    global $wp_users_object;

    $id = bb_get_current_user_info( 'id' );

    $meta_key = 'email_spec';

    $meta_value = bb_get_usermeta( $id, 'user_email' );

    $wp_users_object->update_meta( compact( 'id', 'meta_key', 'meta_value' ) );

    return $arr;

    }
    add_filter( 'get_profile_info_keys', 'add_email_spec_meta' );

    ?>

    #79995

    Technically its all feasible.

    a) you can override bbPress login functions with the ones matching with your portal

    b) that’s again feasible (I think CK was working on a plugin for this, try some searching)

    c) its feasible but I don’t have any idea of going about it

    d) which credentials? login credentials through GET? u gotta be kidding me

    #79948
    chrishajer
    Participant

    Maybe you could add that capability to the member role?

    https://bbpress.org/plugins/topic/role-manager/

    #79993
    chrishajer
    Participant

    If you want to reinstall, you also need to remove the database tables, in addition to bb-config.php.

    You can also edit your bb-config.php and add a line like this to override the configuration:

    $bb->uri = 'http://klikerlab.pl/forum/';

    Help! I renamed my bbpress file directory name…

    You have to rename the folder where you installed bbPress as well, from bbpress to forums. You can’t just make the configuration changes.

    #79992
    ailusia
    Member

    Update – now both urls show 404 error ;)

    #79945

    With what I understand, the thing is only functions in functions.bb-pluggable.php can be masked (plugged) as its the last file to look for undefined functions. Defining any function which is there overrides the definition in that file. But what if we need to change the behaviour of a function which is somewhere else?

    I would love to see someone prove me wrong.

    #79944

    On line 2368 of functions.bb-template under bb-includes dir of your bbPress resides the code you want to change.

    bb_current_user_can( 'edit_users' )

    Editing a core file is not recommended but I am unsure of how to mask it to call a custom function instead of the core function.

    If its unmaskable for now (architectural) and you want a fix, then either you can change that bb_current_user_can( 'edit_users' ) with bb_is_user_logged_in() but you will have to do it again when you upgrade (or till someone posts a recommended fix) or you can append this line in your profile.php after the call to the bb_profile_data()

    <?php
    if ( bb_is_user_logged_in() ) {
    echo $user->user_email;
    }?>

    [untested but should work]

    #79862
    hpguru
    Member

    Edit a themes front-page.php.

    Replace

    <h2><?php _e('Hot Tags'); ?></h2>
    <p class="frontpageheatmap"><?php bb_tag_heat_map(); ?></p>

    with…

    <h2><?php _e('Some Text'); ?></h2>
    <p>Text text text.</p>

    #79955
    chrishajer
    Participant

    I think you could probably add it an allowed tags, but I don’t think I’ve ever seen it.

    https://bbpress.org/plugins/topic/admin-can-post-anything/

    https://bbpress.org/forums/topic/plugin-using-the-strike-tag#post-3709

    https://bbpress.org/forums/topic/allowing-html#post-5279

    To align the text, you’re going to need to allow a div or span I think, with a limited number of attributes.

    There was some recent discussion too, with someone posting a lot of code, but I can’t find that reply right now.

    #79887

    In reply to: Link Cloaking

    aiitee
    Member

    hey kawauso, thanks for that code i will try it!

    i was thinking to cloak almost all links inside a post or thread.

    mostly links to download sites like megaupload or rapidshare, etc. but also links to anything inside a post.

    the code from kawauso is exactly what i’m talking about.

    cya and thanks!

    #79923

    In reply to: Some PHP help please

    The cleanest way of doing this hasn’t been mentioned. Instead of using echo commands, it’s a lot easier to just wrap HTML.

    <?php if ( bb_is_user_logged_in() ) : ?>
    this
    <?php elseif : ?>
    not this
    <?php endif; ?>

    #79920
    Mark
    Member

    @olaf, muchos appreciado senor, but I’ve already written my own workaround. :) Just more of a suggestion based on situations I’ve ran into, something to consider as a future feature to make it easier for those who aren’t at home with PHP.

    The problem with simply truncating such a thing is you could wind up with a front page description of something like “The following forum is a good place to…” or something of the sort. I’ve looked at a lot of other bbPress sites in the last couple of months, and they all seem to be fairly out of the box setups, so I’m not so sure this is really widely being sought out, just something that would be fairly easy to implement and might aid in future scalability of bbPress installations.

    #79929
    gerikg
    Member

    part 1. This will work in BBpress only: <?php if ( !in_array( bb_get_location(), array( 'login-page', 'register-page' ) ) ) login_form(); ?> put that in the header.php I’m not sure how to do it in WP to make it work.

    part 2. edit the logged-in.php in your bb theme

    #79921

    In reply to: Some PHP help please

    gerikg
    Member

    me either..

    try this..

    <?php if ( bb_is_user_logged_in() )  echo "";
    else
    echo "PUT_YOUR_LINK_IN_HERE"; ?>

    see if that works, hopefully someone who can write php will chime in.

    #31916
    AphelionZ
    Participant

    I need to create a few urls from my forum root at /community like so:

    /community/forums/ – shows just a simple list of all forums

    /community/leaderboards/ -custom functionality

    /community/achievements/ – more custom functionality

    It’s easy enough to achieve this with a query string and if statements in front-page.php, but I’m trying to use .htaccess to achieve this like so:

    RewriteRule ^forums/$ index.php?view=forums [L,QSA]

    I was getting the bbpress 404 page until I drilled down into bb-admin/functions.bb-core.php and changed line 667 from

    $issue_404 = true;

    to

    $issue_404 = false

    It worked fine but I’m not comfortable changing the core code like that, as it’s indicitave that I’m doing something wrong – but what exactly? What should I change about my approach to get the page to serve correctly?

    #79859
    amylmc
    Member

    I’m not code savvy. Can you please advise the specifics of what and where within the file to add it?

    Thank you!

    #79919
    Olaf Lederer
    Participant

    Maybe you can shorten the desription using this custom php function?

    if (!function_exists('substring_words')) {
    function substring_words($str, $txt_len, $prefix = ' [...]') {
    $words = explode(' ', $str);
    $count = 0;
    $new_str = '';
    $abbr = '';
    foreach ($words as $val) {
    if ($count < $txt_len) {
    $new_str .= $val.' ';
    $count = $count + strlen($val);
    }
    }
    $new_str = rtrim($new_str, ' ,.;:');
    $new_str .= (strlen($str) > $txt_len) ? $prefix : '';
    return $new_str;
    }
    }

    #79844
    Mark
    Member

    Downgrading is not an option.

    If I could use signatures here, that would be my new one. :)

    #79909
    01020230302
    Member

    I have it integrated with WPMU and it works fine in that respect – linking user/pass from WPMU and so on. However, when I login as admin I am able to create post,reply. When I login as a member I am not able to create a new topic and I see the words ‘REPLY’ but no option to :(

    gerikg
    Member

    Josef, take out in wp-config

    /**bbpress integration **/
    define('USER_COOKIE', 'wordpressuser');
    define('PASS_COOKIE', 'wordpresspass');
    define('COOKIEPATH', $base);
    define('SITECOOKIEPATH', '/');
    define('COOKIE_DOMAIN', '.thisissite2.com'); // same as bbPress

    and bb-config

    $bb->wp_home = 'http://thisissite2.com/';
    $bb->wp_siteurl = 'http://thisissite2.com/';

    // Integrating with mu
    $bb->cookiepath = '/';
    $bb->cookiedomain = '.thisissite2.com'; // leading . allows subdomain sharing
    $bb->usercookie = 'wordpressuser'; // WPMU doesn't hash cookies
    $bb->passcookie = 'wordpresspass'; // WPMU doesn't hash cookies

    Use this plugin https://wordpress.org/extend/plugins/bbpress-integration/

    If you’re using MU you will get 4 lines, cookiehash, cookie_domain, sitecookiepath, and cookiepath.

    get the information from there and put it right AFTER this line in wp-config

    * @package WordPress
    */

    then paste only cookie_domain, sitecookiepath, and cookiepath in bb-config file. leave out cookiehash right after

    * @package bbPress
    */

    Then get new keys, use this link https://api.wordpress.org/secret-key/1.1/salt it has 8 keys put it in both like you did before. Don’t forget the BB_ prefix in bb-config.

    Clear your cache and cookies. Give it a try. if that doesn’t work then look in your BB dashboard and check your settings on wordpress integration. make sure if you left out “www” in wordpressd to leave it out on bbpress.

Viewing 25 results - 23,251 through 23,275 (of 32,481 total)
Skip to toolbar