Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 26,776 through 26,800 (of 32,481 total)
  • Author
    Search Results
  • #4090
    cralor
    Member

    Here is how to correctly install Avatar Upload.

    The “Additional Info” is not too detailed.

    Here is the instructions on how to get the plugin (currently) on your bbPress site:

    1. Download and upload the plugin to your bbPlugins directory.

    2. Activate the plugin in the bbPress Admin section.

    3. Follow the file movement instructions:

    In the “additional-files” folder (inside this Avatar Upload plugin directory) there is several files. These need to be moved elsewhere.

    • Move the entire “avatars/” folder to your bbPress root directory. (Including the “default.png” inside.)
    • Move the “avatar-upload.php” to the bbPress root directory.
    • Move the “avatar.php” (inside the “my-templates” folder) to your template(s) (theme(s)). Example: Move “my-templates/avatar.php” to “forums/bb-templates/kakumei/” (So it is like “forums/bb-templates/kakumei/avatar.php”.)

    I hope this helps someone :D

    #4089

    When I use my keymaster account, and try to edit a user, there’s a part of the administration section that says, “Allow this user to” but there’s no form, text box or anything else to fill in after it. This line appears between “User Type” and “Custom Title”.

    So what’s the point of the “Allow this user to” line? Looking at the code, it’s supposed to be for specifying specific user capabilities (like whether they can add posts, edit posts etc.) but it doesn’t seem to be fully functional yet. Is this expected?

    If it helps I have the latest bbpress version, it’s 0.9.0.2.

    Thanks.

    fandangoflip
    Member

    nice tool… very useful :)

    fandangoflip
    Member

    Thanks mate, well spotted :)

    #4084
    qlister
    Member

    I’m using WordPress 2.6 and I was trying to install bbPress 0.9.0.2 and integrate it and it came up with this error at the end of the installation:

    “Duplicate key name ‘user_nicename’

    >>> User tables will already exist when performing a database integrated installation.”

    My forum got installed, however when I try to click on the topics or the forums or tag, it doesn’t open anything, I can’t get to read any of those. It just stays on the same page.

    The only function I am able to use is the add topic, but I can’t get to read anything I click.

    What should I do? Any advice is greatly appreciated :)

    #67800

    In reply to: Cooking forum

    fandangoflip
    Member

    nice :)

    #67515

    In reply to: Plugin suggestions

    Detective
    Member

    I would like to code a plugin to prevent double posting in a certain period of time. For example, i’m adding this reply to this topic, and in 5 minutes i could add another. This plugin would take the second reply and append it to the first one, instead of making a new post (if no one else replied in those 5 minutes).

    It should be straightforward to do, but i don’t have the time :'(

    #67919
    andersson
    Participant

    Well then this problem may just be locally for me then, but when running the alpha 1.0, for a topic for instance, runing _CK_’s excellent admin tool you’ll see about 50-60 queries that does something like this:

    # 51 : 0.0195 seconds
    SELECT * FROM bb_users WHERE ID = '6526'

    # 52 : 0.0122 seconds
    SELECT meta_key, meta_value FROM bb_usermeta WHERE user_id = '6526' /* WP_Users::append_meta */

    # 53 : 0.0004 seconds
    SELECT * FROM bb_users WHERE ID = '5605'

    # 54 : 0.0003 seconds
    SELECT meta_key, meta_value FROM bb_usermeta WHERE user_id = '5605' /* WP_Users::append_meta */

    # 55 : 0.0014 seconds
    SELECT user_id, meta_key, meta_value FROM bb_usermeta WHERE user_id IN (365,1325,267,1088,2295,1106,94,1259,1225,1210,2230,3055,7,4566,3869,2992,1894,5690,2713,5873,6526,5605) /* WP_Users::append_meta */

    As you can see, it has run over 50 queries that simply does what is done correctly in query 55 (the last query). It seems it runs this for every post it displays (I display 30 posts per page).

    Like I said, maybe this is something that is just happening for me but I seem to remember someone having this problem with the first page also, but that time it was the topic meta I think.

    Any help is much appreciated.

    #68007
    chrishajer
    Participant

    Sounds like you have the mobile browser agent stuff figured out with the Tera-WURFL library. So, when you detect a mobile browser, you want to display your forum using the1col_fixed theme? Looks like it checks for a match to a mobile browser like this:

    $matched = $wurflObj->getDeviceCapabilitiesFromAgent($_SERVER['HTTP_USER_AGENT']);

    // see if this client is on a wireless device (or if they can't be identified)
    if(!$matched || !$wurflObj->getDeviceCapability("is_wireless_device")){
    echo "<h2>You should not be here</h2>";
    }

     

    So, instead of the <h2> message they are displaying, you could use a theme switcher plugin to set the theme and direct someone to that URL. How about something like this:

    https://bbpress.org/plugins/topic/bbpress-theme-switcher/

    That plugin says it uses cookies to persist the theme choice.

    #66819

    In reply to: admin link not working

    Jimmy B.
    Participant

    This a very good thread, might even want to sticky it. I’ve tested this and it works and is needed if you really want true cookie sharing :)

    #66104
    eschen
    Member

    Something I could not find in this or any other thread concerning integration of 0.9.0.2 with wp 2.5. Problem is that a login to either bbPress or WordPress will log a user OUT of the other, can not be logged into both at same time. Common problem but different question. Several people have suggested adding the following to the bb-config.php:

    $bb->usercookie = ‘wordpressuser’;

    $bb->passcookie = ‘wordpresspass’;

    Questions: are these really needed, should the full hash number (wordpressuser_full.hash.number) also be included and if so, where do I find the hash code? Using Firefox, the I see two cookies when logged into either bb or wp:

    wordpress_test_cookie

    wordpress_cabxxxxxxxxxxxx

    The Secret keys are identical for both bb and wp config files. Also I have:

    In bb-config file:

    $bb->wp_table_prefix = ‘wp_’;

    $bb->user_bbdb_name = ‘xxxxxxxxxx’;

    $bb->user_bbdb_user = ‘xxxxxxxxxx’;

    $bb->user_bbdb_password = ‘xxxxxxx’;

    $bb->user_bbdb_host = ‘xxxxxxxxxxx’;

    $bb->custom_user_table = ‘wp_users’;

    $bb->custom_user_meta_table = ‘wp_usermeta’;

    $bb->authcookie = ‘wordpress_cabxxxxxxx’; //identical to what is shown in Firefox cookie

    $bb->cookiedomain = ‘.alleventsadviser.com’;

    define(‘COOKIE_DOMAIN’, ‘.alleventsadviser.com’);

    $bb->cookiepath = ‘/’;

    define(‘COOKIEPATH’, ‘/’);

    $bb->sitecookiepath = ‘/’;

    In wp-config:

    $table_prefix = ‘wp_’;

    $wp->cookiedomain = ‘.alleventsadviser.com’;

    define(‘COOKIE_DOMAIN’, ‘.alleventsadviser.com’);

    $wp->cookiepath = ‘/’;

    define(‘COOKIEPATH’, ‘/’);

    $wp->sitecookiepath = ‘/’;

    define(‘SITECOOKIEPATH’, ‘/’);

    A registered user is shown in both bb and wp.

    Thanks for any help.

    #67973
    Sam Bauers
    Participant

    The only real problem you have is that the Warning is being printed to screen. On a production site you shouldn’t print PHP errors on the screen.

    The warning in that case should be dealt with though and I will do so in trunk for 1.0. If you want to modify the bb_safe_redirect() function then use the below code for a plugin to rid you of the warning.

    <?php
    /*
    Plugin Name: Suppress bb_safe_redirect Warnings
    Plugin URI:
    Description:
    Author:
    Author URI:
    Version: 0.1
    */

    function bb_safe_redirect($location, $status = 302) {

    // Need to look at the URL the way it will end up in wp_redirect()
    $location = wp_sanitize_redirect($location);

    // browsers will assume 'http' is your protocol, and will obey a redirect to a URL starting with '//'
    if ( substr($location, 0, 2) == '//' )
    $location = 'http:' . $location;

    $home = bb_get_uri(null, null, BB_URI_CONTEXT_HEADER);

    if ( !$lp = @parse_url($location) )
    return wp_redirect($home, $status);

    $wpp = parse_url(bb_get_uri());

    $allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '');

    if ( isset($lp['host']) && !in_array($lp['host'], $allowed_hosts) )
    return wp_redirect($home, $status);

    return wp_redirect($location, $status);
    }
    ?>

    #67890
    Sam Bauers
    Participant

    The filter will only be passed one argument by default, so you need to change your add_filter() call to this:

    add_filter('get_user_profile_link', 'ss_get_user_profile_link', 10, 2);

    .

    The third parameter is the priority, the second is the number of arguments to pass.

    #4075
    finigan
    Member

    Hi,

    I’ve successfully integrated WordPress 2.5.1 with bbPress 0.9.2, but I’ve encountered some issues with registering (display_name, multiple sign-ups with same email, etc.).

    What I’m trying to do now is redirect all registration to the WordPress register page. My main questions are:

    (1) how/where do I change the bbPress code to point to the WordPress register page.

    (2) is there a way for the system to know where a user came from (forums or blog) and redirect the user appropriately after sign-up?

    Thanks.

    #67514

    In reply to: Plugin suggestions

    thion
    Member

    Been there, tried that – it’s definitely more than 10 minutes :P

    #67830

    In reply to: Get Current Forum ID?

    iuxc
    Member

    Thanks! Worked perfectly. :)

    #67513

    In reply to: Plugin suggestions

    _ck_
    Participant

    WP-Syntax should take all of 10 minutes to port to bbPress:

    http://bbshowcase.org/forums/topic/syntax-highlighter-plugin

    I have a “Syntax-Lite” plugin in development that is less than 1k and uses PHP’s built-in (high speed) highlighter but only works with PHP code of course. It also won’t be available for quite awhile as I don’t have time for bbPress projects these days.

    #4071
    ikailo
    Member

    This was originally going to be an “It’s not working!” post, but I made some progress. Now it’s “Is what I did ok?” post.

    I kept getting a”This Topic is Closed” error every time I tried to create a new topic. Traced it back to the insert statement in ‘bb_insert_topic’ in functions.php. The database was responding with the error of “The value ‘ ‘ is not a valid integer for column ‘topic_id’. (I am paraphrasing, I don’t have the exact response in front of me)

    I suspected it had something to do with the fact that the topic_id value is being supplied to MySql, but it is set to be an auto-increment / not null field.

    So, I commented out in the $default array definition in ‘bb_insert_topic’:

    // 'topic_id' => false, // accepts ids or slugs

    and I changed this line:

    unset( $default, $defaults );

    to this:

    unset( $args, $defaults );

    Did the same thing under the ‘bb_insert_post’ function in the same file, but for the ‘post_id’ variables.

    Presto. Everything seems to work OK now.

    Could this issue be specific to my version of MySql? Although it is strange, because the original query works just fine using a third party tool (SQLyog).

    Has anyone encountered this issue before? Or – can anyone comment on the validity of my changes, and if they might cause issues going forward?

    Finally – should this be logged as a bug?

    Thanks!

    WP 2.6, BB 1.0, IIS 6.

    #67972
    Olaf Lederer
    Participant

    as a work arround, I use this value for the hidden field “re”:

    <?php
    if ($re == 'http://#postform') {
    echo $_SERVER['HTTP_REFERER'].'#postform';
    } else {
    $re;
    }
    ?>

    #67512

    In reply to: Plugin suggestions

    Olaf Lederer
    Participant

    I’m sorry Vadi,

    I thought a long time about what the best solution for posting code tutorials.

    Actually it’s better to use drupal for this kind of content :(

    #67971
    Olaf Lederer
    Participant

    just checked the code and it seems to me that this function is not 100% fine:

    function new_topic( $args = null ) {
    $defaults = array( 'text' => __('Add New &raquo;'), 'forum' => 0, 'tag' => '' );
    if ( $args && is_string($args) && false === strpos($args, '=') )
    $args = array( 'text' => $args );

    $args = wp_parse_args( $args, $defaults );
    extract( $args, EXTR_SKIP );

    if ( $forum && $forum = get_forum( $forum ) )
    $url = get_forum_link( $forum->forum_id ) . '#postform';
    elseif ( $tag && ( ( is_numeric($tag) && $tag = bb_get_tag( $tag ) ) || $tag = bb_get_tag_by_name( $tag ) ) )
    $url = bb_get_tag_link( $tag->tag ) . '#postform';
    elseif ( is_forum() || is_bb_tag() )
    $url = '#postform';
    elseif ( is_topic() )
    $url = get_forum_link() . '#postform';
    elseif ( is_front() )
    $url = add_query_arg( 'new', '1', bb_get_option( 'uri' ) );

    if ( !bb_is_user_logged_in() )
    $url = add_query_arg( 're', urlencode($url), bb_get_option( 'uri' ) . 'bb-login.php' );
    elseif ( is_forum() || is_topic() ) {
    if ( !bb_current_user_can( 'write_topic', get_forum_id() ) )
    return;
    } else {
    if ( !bb_current_user_can( 'write_topics' ) )
    return;
    }

    if ( $url = attribute_escape( apply_filters( 'new_topic_url', $url ) ) )
    echo "<a href='$url' class='new-topic'>$text</a>n";
    }

    this part is not good and result im some error:

    elseif ( is_forum() || is_bb_tag() )
    $url = '#postform';

    what is your adbvice to fix that? rewriting the function / adding a filter as a kind of plugin?

    #4068
    #67510

    In reply to: Plugin suggestions

    Olaf Lederer
    Participant

    A syntax highlighter in wordpress/bbpress is always a hard to do.

    Geshi and tinyMCE = forget it

    I have finally a parser in WP but need to work in code view only.

    #4067
    thion
    Member

    I would like to disable ‘BBcode Buttons’ automatic placement, and put the toolbar manually – I tried to place bbcode_buttons() in the post.php but nothing shows – any tips?

    #67961
    eschen
    Member

    Thanks chrishaje, but I have tried the one line “Options +MultiViews” and the code from “/bb-admin/rewrite-rules.php” and a few others variations in the .htaccess, didn’t make any difference. I just tired again, same result, doesn’t work.

    Can someone tell me if this sounds like a cookie problem?

    thanks

Viewing 25 results - 26,776 through 26,800 (of 32,481 total)
Skip to toolbar