Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 26,401 through 26,425 (of 32,495 total)
  • Author
    Search Results
  • #69503

    In reply to: counting forums

    _ck_
    Participant

    update: there is a better version a few posts down

    I had worked this out this quick and dirty routine but then I realized you might mean not to show it within the forum list. If you mean something different let me know.

    In front-page.php

    Change

    <?php  while ( bb_forum() ) :  ?>

    to

    <?php
    forum_totals("init");
    while ( bb_forum() ) :
    forum_totals();
    ?>

    and then this after the end of the forum list routine

    <?php  endwhile;  ?>

    to this

    <?php
    endwhile;
    forum_totals("finish");
    ?>

    This is the main function you can just drop at the bottom of front-page.php

    <?php
    function forum_totals($x="") {
    static $last_parent,$total_posts,$total_topics,$all_topics,$all_posts,$total_counter,$all_counter;
    if (function_exists('bb_get_forum_is_category')) {$category=bb_get_forum_is_category();} else {$category=false;}
    if ($x=="init") {$last_parent=false; $total_topics=0; $total_posts=0; $all_topics=0; $all_posts=0; $total_counter=0; $all_counter=0; return;}
    if ($x=="finish" || $last_parent!==$GLOBALS['forum']->forum_parent || $category) {
    if ($last_parent!==false && $total_counter>1) {echo "<tr><td align='right'>$total_counter subforums:</td><td class='num'>$total_topics</td><td class='num'>$total_posts</td></tr>";}
    $last_parent=$GLOBALS['forum']->forum_parent; $total_topics=$GLOBALS['forum']->topics; $total_posts=$GLOBALS['forum']->posts;
    $total_counter=0;
    } else {$total_topics+= (int) $GLOBALS['forum']->topics; $total_posts+=(int) $GLOBALS['forum']->posts;}
    $all_topics+= (int) $GLOBALS['forum']->topics; $all_posts+=(int) $GLOBALS['forum']->posts;
    if ($x=="finish") {echo "<tr><td align='right'>$all_counter total forums:</td><td class='num'>$all_topics</td><td class='num'>$all_posts</td></tr>";}
    elseif ($category) {$last_parent=false;} else {$all_counter++; $total_counter++; }
    }
    ?>

    #69051
    eliwagar
    Member

    :( I have just realized that…Bugfixing can be so frustrating…I will check again tonight…

    #68714

    @mvds: The idea is that logging into or out of either/or will do that action on both sides for a unified website function. If you log into or out of either, and it affects the other immediately, and you have admin access to both sides regardless of where you login, that’s a good thing. :)

    #69050

    Have you tried logging in and out of both your WordPress and bbPress installations and accessing both admin panels? I mean each combination each way.

    1. Log into WordPress; Check admin panel access and cookies; Log out of WordPress
    2. Log into bbPress; Check admin panel access and cookies; Log out of bbPress
    3. Log into WordPress; Check admin panel access and cookies; Log out of bbPress
    4. Log into bbPress; Check admin panel access and cookies; Log out of WordPress

    That is where the problem lies, and I have been running the most updated trunks of both bbPress and WordPress the entire time. :/

    #69447
    chrishajer
    Participant

    _ck_ – FWIW, I hate the vBulletin search layout. :-)

    #69048

    Short term, I was able to make this work by modifying 1 core WordPress file. This only allows for integration of the theme, but still does not allow access to the bbPress admin panel without changing the bb-config.php file back to original.

    It’s essentially a quick fix to get the theme working with all capabilities playing nicely.

    Basically I’m hard-coding the capability check from bbPress into WordPress. There should be a filter for this, but I’m not sure how to hook into it correctly without a mod or plug-in on the WordPress side.

    ~My fix is in no way a permanent solution. Auto-updating your WordPress installation will overwrite this fix.~


    In FILE wp-includes/capabilities.php:

    In the meta_map_cap function:

    Around Line 906:

    AFTER break;

    BEFORE default

    INSERT:

    /*
    
    */
    case 'write_post':
    $caps[] = 'write_posts';
    break;
    case 'edit_post':
    // edit_posts, edit_others_posts, edit_deleted, edit_closed, ignore_edit_lock
    if ( !$bb_post = bb_get_post( $args[0] ) ) {
    $caps[] = 'magically_provide_data_given_bad_input';
    return $caps;
    }
    if ( $user_id == $bb_post->poster_id )
    $caps[] = 'edit_posts';
    else
    $caps[] = 'edit_others_posts';
    if ( $bb_post->post_status == '1' )
    $caps[] = 'edit_deleted';
    if ( !topic_is_open( $bb_post->topic_id ) )
    $caps[] = 'edit_closed';
    $post_time = bb_gmtstrtotime( $bb_post->post_time );
    $curr_time = time() + 1;
    $edit_lock = bb_get_option( 'edit_lock' );
    if ( $edit_lock >= 0 && $curr_time - $post_time > $edit_lock * 60 )
    $caps[] = 'ignore_edit_lock';
    break;
    case 'delete_post' :
    // edit_deleted, delete_posts
    if ( !$bb_post = bb_get_post( $args[0] ) ) {
    $caps[] = 'magically_provide_data_given_bad_input';
    return $caps;
    }
    if ( 0 != $bb_post->post_status )
    $caps[] = 'edit_deleted';
    // NO BREAK
    case 'manage_posts' : // back compat
    $caps[] = 'delete_posts';
    break;
    case 'write_topic':
    $caps[] = 'write_topics';
    break;
    case 'edit_topic':
    // edit_closed, edit_deleted, edit_topics, edit_others_topics
    if ( !$topic = get_topic( $args[0] ) ) {
    $caps[] = 'magically_provide_data_given_bad_input';
    return $caps;
    }
    if ( !topic_is_open( $args[0]) )
    $caps[] = 'edit_closed';
    if ( '1' == $topic->topic_status )
    $caps[] = 'edit_deleted';
    if ( $user_id == $topic->topic_poster )
    $caps[] = 'edit_topics';
    else
    $caps[] = 'edit_others_topics';
    break;
    case 'move_topic' :
    $caps[] = 'move_topics';
    break;
    case 'stick_topic' :
    $caps[] = 'stick_topics';
    break;
    case 'close_topic' :
    $caps[] = 'close_topics';
    break;
    case 'delete_topic' :
    $caps[] = 'delete_topics';
    add_filter( 'get_topic_where', 'no_where', 9999 );
    if ( !$topic = get_topic( $args[0] ) ) {
    $caps[] = 'magically_provide_data_given_bad_input';
    return $caps;
    }
    if ( 0 != $topic->topic_status )
    $caps[] = 'edit_deleted';
    remove_filter( 'get_topic_where', 'no_where', 9999 );
    break;
    case 'manage_topics' :
    // back compat
    $caps[] = 'move_topics';
    $caps[] = 'stick_topics';
    $caps[] = 'close_topics';
    $caps[] = 'delete_topics';
    break;
    case 'add_tag_to':
    // edit_closed, edit_deleted, edit_tags;
    if ( !$topic = get_topic( $args[0] ) ) {
    $caps[] = 'magically_provide_data_given_bad_input';
    return $caps;
    }
    if ( !topic_is_open( $topic->topic_id ) )
    $caps[] = 'edit_closed';
    if ( '1' == $topic->topic_status )
    $caps[] = 'edit_deleted';
    $caps[] = 'edit_tags';
    break;
    case 'edit_tag_by_on':
    // edit_closed, edit_deleted, edit_tags, edit_others_tags
    if ( !$topic = get_topic( $args[1] ) ) {
    $caps[] = 'magically_provide_data_given_bad_input';
    return $caps;
    }
    if ( !topic_is_open( $topic->topic_id ) )
    $caps[] = 'edit_closed';
    if ( '1' == $topic->topic_status )
    $caps[] = 'edit_deleted';
    if ( $user_id == $args[0] )
    $caps[] = 'edit_tags';
    else
    $caps[] = 'edit_others_tags';
    break;
    case 'edit_user':
    // edit_profile, edit_users;
    if ( $user_id == $args[0] )
    $caps[] = 'edit_profile';
    else
    $caps[] = 'edit_users';
    break;
    case 'edit_favorites_of':
    // edit_favorites, edit_others_favorites;
    if ( $user_id == $args[0] )
    $caps[] = 'edit_favorites';
    else
    $caps[] = 'edit_others_favorites';
    break;
    case 'delete_forum':
    $caps[] = 'delete_forums';
    break;
    case 'change_user_password':
    // change_password, edit_users
    $caps[] = 'change_password';
    if ( $user_id != $args[0] )
    $caps[] = 'edit_users';
    break;
    /*
    */

    #69445
    _ck_
    Participant

    Eh don’t defend bbPress – it’s the same problem with WordPress. They’ve never had a good search because writing a good search is hard and takes time from other needed things.

    I haven’t released the search because after working on it for a week it became so overly complex that debugging parts of it was taking way too much time. When that happens I get mad and then usually re-write things from scratch.

    I think my biggest mistake was I tried to make the layout template-able, so you could move stuff around. That added way too much code and logic problems. And then there was the wordpress awareness, more code.

    I might just make a simpler version of it. I may just copy some of the vbulletion search layout since it’s very logical. Maybe I’ll have something by the end of the coming weekend if I have enough time.

    #69488

    We’re all experiencing the same issue.

    Integration appears to be a little broken still.

    If you need to use the WP functions in your bbPress, that will break it further by not allowing you to access your bbPress admin panel at all.

    The problem looks like the bb_map_meta_cap filter is ignored when the WordPress functions are loaded in place of the bbPress ones.

    Some users have been able to resolve this by using a .htaccess file to redirect to the bbPress login and register page whenever an attempt to register or login is made through WordPress. That is the best fix at the moment if you do not require access to the WP functions.

    If you do require that access, then you will need to wait until a fix comes out for the issue I mentioned above. That’s where I am. :(

    #69459

    Yes, I installed WP first, then BB and integrated from the beginning, so BB is using wp_users. In fact, there’s no bb_users table according to my phpMyAdmin. Somehow, it seems that BB cannot access that wp_users table for one reason or another. But what exactly it is, is a mystery to me :-(

    #68219
    mvds
    Member

    No issues so far, just wanted you to know that :) Runs fine on my (live) site!

    #69443
    block
    Member

    Interesting. There any code from there you can release in the mean time? Pretty disappointed that bbPress has such poor search, but not surprising given how little information and documentation there is.

    #69047

    It seems like there are several issues here, and I’m not sure which is really the issue or which is a bug…

    Firstly, when integrated, bbPress wants to use the WordPress classes and functions where possible. Namely, the problem with capabilities lies currently with the difference in the WP_User->has_cap function.

    On the WordPress side of it, it is missing the global $wp_roles; and the corresponding check of those roles against the current capability to check.

    $caps = call_user_func_array( array(&$wp_roles, 'map_meta_cap'), $args );

    So I’m not sure if this is just a case of bbPress not keeping up with the WordPress user/role classes, or if this is WordPress not properly carrying over bbPress capabilities.

    Ugh…

    #69472
    peuter
    Member

    Thanks for trying to help on this Chris. Here is what my htaccess file looks like at the moment:

    Options +MultiViews

    # BEGIN WordPress

    <IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule . /index.php [L]

    </IfModule>

    # END WordPress

    Keep in mind this is in my root directory. (so both WP and BBpress are both using it?)

    Am I supposed to have a seperate htaccess file in the bbpress directory too?

    I got access to the code you sent me. Do I delete the above code and replace it with this code you sent?

    #69456

    It worked alright before I started moving around with the directories.

    If you’re talking about the params from config.php they stay untouched as they were before so BBDB_NAME, BBDB_USER etc. are correct….

    Dont’t know what a socket connection is or how it differs :-(

    #68986

    Yeah, found the bb_mail function and will use a couple spam protection functions from WP-Mail to hardcode it for my site but won’t be able to make a plugin out of it :-(

    #68984

    Oh, that’s a little too complex :-) I don’t think I can get my head around this one lest it was stripped down to the core functionality. The best part of my PHP days is unfortunately numbered but I’ll try to look for something easier.

    #49661

    In reply to: Emoticons For bbPress?

    _ck_
    Participant

    See this part of the plugin, you need to change the bb_add_filter and bb_add_actionto justadd_filterandadd_action`

    /******************************************************************************
    * - Define for bbPress interface
    *****************************************************************************/

    $bbemoticons = & new bbEmoticons();

    bb_add_filter('post_text', array(&$bbemoticons, 'convert_smilies'));
    //bb_head is not called always. :-)
    //bb_add_action('bb_head', array(&$bbemoticons, 'bb_grins_head'));
    bb_add_action('bb_feed_head', array(&$bbemoticons, 'bb_grins_head'));
    bb_add_action('bb_grins', array(&$bbemoticons, 'bb_grins'));

    #49660

    In reply to: Emoticons For bbPress?

    _ck_
    Participant

    See this part of the plugin, you need to change the bb_add_filter and bb_add_actionto justadd_filterandadd_action`

    /******************************************************************************
    * - Define for bbPress interface
    *****************************************************************************/

    $bbemoticons = & new bbEmoticons();

    bb_add_filter('post_text', array(&$bbemoticons, 'convert_smilies'));
    //bb_head is not called always. :-)
    //bb_add_action('bb_head', array(&$bbemoticons, 'bb_grins_head'));
    bb_add_action('bb_feed_head', array(&$bbemoticons, 'bb_grins_head'));
    bb_add_action('bb_grins', array(&$bbemoticons, 'bb_grins'));

    #68982

    I can see there’s no plugin like that yet, however can anybody just hint as to what backpress functions I can use in order to hardcode this myself? I’m learning the php + bbpress stuff quite fast so I’d give it a whirl with a little help.

    Think it may come useful for others as well.

    #57729
    chrissydunno
    Member

    where in the code do you add your redirect hook exactly?

    #69416
    _ck_
    Participant

    There is no bb_do_action, only do_action.

    bb_do_action has been removed.

    Are you talking about the plugin created in this thread:

    https://bbpress.org/forums/topic/emoticons-for-bbpress

    Why not post your question there, where it will actually be relevant?

    #69411
    _ck_
    Participant

    bbPress Plugin Index, A – M

    A

    B

    C

    D

    E

    F

    G

    H

    I

    L

    M

    #69315

    In reply to: Locked Out of Forum!

    _ck_
    Participant

    Change the bbpress tables prefixs to bb_ via phpmyadmin and then fix the prefix setting in bb-config.php

    I tried to understand the new database structure by checking the upgrade-schema.php. I found one thing could cause problem:

    $bb_queries = “CREATE TABLE IF NOT EXISTS $bbdb->users (

    ID bigint(20) unsigned NOT NULL auto_increment,

    user_login varchar(60) NOT NULL default ”,

    user_pass varchar(64) NOT NULL default ”,

    user_nicename varchar(50) NOT NULL default ”,

    user_email varchar(100) NOT NULL default ”,

    user_url varchar(100) NOT NULL default ”,

    user_registered datetime NOT NULL default ‘0000-00-00 00:00:00’,

    user_status int(11) NOT NULL default 0,

    display_name varchar(250) NOT NULL default ”,

    PRIMARY KEY (ID),

    UNIQUE KEY user_login (user_login),

    UNIQUE KEY user_nicename (user_nicename)

    );”;

    my old database table bb_users the user_nicename does not have unique key on it, but now upgrade try to setup as unique key. will it be the reason for the upgrade timeout?

    Unfortunately for my cpanel host I could not access the mysql log, but please help me solve this. any inputs are welcome.

    thanks.

    I follow the steps. After extract the new bbpress files and rename the config.php (v0.8) to bb-config.php, I could see all my previous posts.

    However, when I login to the Admin, it displays:

    It looks like your database is out-of-date.

    You can update it here.

    After click the Upgrade Database button, after a few seconds, the http://www.travelsuperlink.com/forum/bb-admin/upgrade.php page just display a blank webpage (timeout?)

    I am stuck here, please help.

Viewing 25 results - 26,401 through 26,425 (of 32,495 total)
Skip to toolbar