Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 25,526 through 25,550 (of 32,481 total)
  • Author
    Search Results
  • #72394
    Sam Bauers
    Participant
    #72246
    psheld
    Member

    I think I’m going to have delete my WordPress instance now and reinstall. :-(

    Thanks Chris for your help, but bbPress has really messed things up. I used the installation process to set the config files, so it’s not entirely clear what I need to do. I have cleaned up the wp-config.php file back to how I think it should have been, but still no go.

    I think changes may have been made to the db tables for which I’m not sufficiently skilled to reverse.

    So that’s that. Thanks again for you help though.

    #72435

    In reply to: wp-functions error

    Billy Wilcosky
    Participant

    yay! I figured it out… in the “my views” plug in you have add_action(‘bb_foot’, ”); at the end of the code. I think that is the problem because then I basically have add_action(‘bb_foot’, ”); twice on one page. The my views plugin has it, and then it is also in my footer.

    When I remove add_action(‘bb_foot’, ”); from the my views plug in (but leave it in my footer), everything works and the error goes away!

    Finally, now I can sleep ;)

    #72432

    In reply to: wp-functions error

    Billy Wilcosky
    Participant

    Ok, I found out what is causing the error. It is the following line of code in my footer:

    <?php do_action(‘bb_foot’, ”); ?>

    But I believe I have to have that line of code in place for one or more of _ck_’s plugins… Any suggestions anyone?

    #72393
    maharzan
    Member

    Great.. Thanks.

    Can you post which file you have edited.. so I can only replace that file?

    bb-includes/functions.bb-formatting.php ??

    #72407
    _ck_
    Participant

    No do not start with 1.0 unless you plan to not use any plugins.

    You can always upgrade from 0.9 to 1.0

    You can *never* downgrade from 1.0 to 0.9 because of the dramatic db changes involving tags and meta.

    Even if you are “only using part of bbPress” (not sure what that means) 1.0a6 is about to do a semi-radical change with 1.0a7 involving permalinks.

    bbPress 0.9 templates will (mostly) work with 1.0 but not visa versa.

    1.0 is about 150% the code size than 0.9 for the same functionality.

    I could go on but the point is that 1.0 is changing and unstable by nature. It should not even be called alpha but pre-alpha.

    ganzua
    Member

    This other nice trick by you doesn’t work either from the wp comments template;

    global $wpdb;
    $result=$wpdb->get_var("SELECT COUNT(*) FROM bb_posts WHERE poster_id = $user_id AND post_status = 0");
    echo $result;

    No errors though. I tried replacing poster_id with wp comment_author_id but it didn’t make it.

    What I was trying to do is to put the the whole count of wp comments and bbpress posts all together.

    The previous question was because I produced a hit counter that runs for both; wp and bbpress. I added the total hits of the bbpress post views plugin to the wp counterize plugin. It works but I think I did this by the hard way.

    #71817
    Chad Holden
    Member

    Positive. I am also getting this message on every install :

    >>> WordPress “auth” cookie salt not set.

    >>>>>> Could not fetch “auth” cookie salt from the WordPress options table.

    >>>>>> You will need to manually define the “auth” cookie salt in your database.

    >>> WordPress “logged in” cookie salt not set.

    >>>>>> Could not fetch “logged in” cookie salt from the WordPress options table.

    >>>>>> You will need to manually define the “logged in” cookie salt in your database.

    Not sure if that matters.

    AND This is at the top :

    DB Error in BB_Install::process_form_finalise_installation: Table ‘wpmu.wp_options’ doesn’t exist

    SELECT option_value FROM wp_options WHERE option_name = ‘auth_salt’ LIMIT 1

    DB Error in BB_Install::process_form_finalise_installation: Table ‘wpmu.wp_options’ doesn’t exist

    SELECT option_value FROM wp_options WHERE option_name = ‘secure_auth_salt’ LIMIT 1

    DB Error in BB_Install::process_form_finalise_installation: Table ‘wpmu.wp_options’ doesn’t exist

    SELECT option_value FROM wp_options WHERE option_name = ‘logged_in_salt’ LIMIT 1

    #4995
    _ck_
    Participant

    HttpOnly cookies are a security advancement that is finally supported now by all major browsers (Firefox eventually got it right in 3.1, while IE 7 still has a bug but it generally works).

    HttpOnly means a cookie cannot be read by javascript in the browser, only by the server (via PHP, etc.) This practically stops XSS exploits and makes it much harder if not impossible in most cases.

    HttpOnly may “save your bacon” when a plugin has a security hole (like Private Messaging and bb-Reputation 0.0.5) and prevent a malicious script from forwarding your keymaster cookie to someone else via a XSS script.

    I manged to get them to include HttpOnly in WordPress 2.7 and bbPress 1.0 but it’s still not in older WordPress or bbPress 0.9 because they worried about backward compatibility with some WordPress plugins that try to directly read the cookie (bad technique) instead of using server-side helpers.

    However there are NO bbPress plugins that direct read the auth cookie and very few WordPress plugins still do this. I am not 100% positive how it will affect ajax but it shouldn’t because it’s still authorized on the server-side via PHP.

    So if you’d like to try out HttpOnly on your bbPress 0.9, here’s how, it’s as simple as a mini-plugin. Note that if you are already using a cookie replacement plugin like my “Freshly Baked Cookies” or “Year Long Cookies” you will need to edit them instead of using the following (you can only use one cookie replacement plugin at a time).

    I’d appreciate any feedback or experiences with this, especially if it causes problems:

    Save this as _HttpOnly.php and upload into your my-plugins/ directory:

    <?php
    /*
    Plugin Name: HttpOnly Auth Cookie
    */

    function wp_set_auth_cookie($user_id, $remember = false) {
    global $bb;

    if ( $remember ) {
    $expiration = $expire = time() + 1209600;
    } else {
    $expiration = time() + 172800;
    $expire = 0;
    }

    $cookie = wp_generate_auth_cookie($user_id, $expiration);
    do_action('set_auth_cookie', $cookie, $expire);

    setcookie($bb->authcookie, $cookie, $expire, $bb->cookiepath, $bb->cookiedomain. '; HttpOnly' );
    if ( $bb->cookiepath != $bb->sitecookiepath )
    setcookie($bb->authcookie, $cookie, $expire, $bb->sitecookiepath, $bb->cookiedomain. '; HttpOnly' );
    }
    ?>

    To prove it’s working, you CANNOT use the Firefox webdeveloper plugin because that looks at the cookie in Firefox’s chrome, not at the user level. What you have to do is

    1. prove you can see your bbpress/wordpress cookie by typing or copying this to your browser address bar javascript:alert(document.cookie);

    2. install the plugin

    3. log out and then log in

    4. again type or copy this to your browser address bar javascript:alert(document.cookie);

    5. if it’s working, you should NOT see your wordpress/bbpress cookie in the alert

    Currently the only plugin I am aware of that tries to read the cookie directly in WordPress is the WP-UserOnline plugin from GamerZ, and he may have even fixed that by now in the newest versions. However there may be others, so test your setup.

    #4993

    Okay, this is an oldy but a goodie.

    I’ve got bleeding edge trunk (as of lunchtime yesterday) and once I installed it, I could no longer share my login cookies between WP and BB. I reverted to my backup and it magically worked again. At first I thought I must have whacked my bb-settings (since that’s how I thought I fixed it last time), but that didn’t work.

    I’ve been fiddling with this a couple times, and I finally found my notes that my ‘working’ version of bb-settings.php was how I fixed it (basically I fiddled with it and now it works). I can’t use it, though, since if I try and paste up that file with the trunk build, the forums die.

    My ‘fix’ was to change this:

    if ( $bb->path != '/' ) $bb->path = '/' . trim( $bb->path, " tnrx0B/" ) . '/';

    to

    if ( $bb->path != '/' ) $bb->path = '/' . trim( $bb->path, '/' ) . '/';

    No longer works.

    I’m not sure why the cookies are borked that way, and I have a lingering suspicion that it’s becuase I have my blog in /blog, but I’m running it out of / (root). My forums are in /forums.

    WP 2.7.1

    BB trunk bleeding edge

    #57287

    In reply to: LaTex support

    I’ve had a go at adapting one of the WordPress plugins (easy LaTeX) for bbPress. It works for me, but there are probably a few things a little too specific to my set-up for it to be released “in the wild” – for example, I’m using both WordPress and bbPress so there’s a little cross-over information which wouldn’t be available on a bbPress-only site (putting in some options for that would probably be a good idea).

    However, it might be suitable for beta-testing. I’ve put a copy here if anyone’s interested in taking a look and tweaking it.

    A few details:

        It uses a public server so no need for LaTeX to be installed locally.

        It uses a cache (needs to be writable by the server) to save on server load.

        It has a two-step parsing (not in the original) since forum posts are saved in their original format. This makes it more robust since the plugin allows for changing the tags that surround the mathematics. The saved format uses <math> tags which has the added advantage of avoiding markdown processing.

        Due to being a rather limited programmer, I ended up copying stuff from other plugins to get it to work without really understanding what I was doing (particularly with add_filter and the like) so if some kind soul wishes to take pity on me and clean up my code I’d be very grateful.

    #72392
    Sam Bauers
    Participant

    This was a bug. Fixed in trunk now.

    Old posts will need to be edited to get fixed. Hitting edit then save straight away should do it.

    #66145

    How I do deep integration using WordPress 2.7 and bbPress 1.0 Alpha 6.

    Add to beginning of bb-config.php:

    if ( !defined('ABSPATH') & !defined('XMLRPC_REQUEST')) {
    define('WP_USE_THEMES', false);
    include_once( '/absolute/path/to/yourdomain.com/wp-blog-header.php' );
    header("HTTP/1.1 200 OK");
    header("Status: 200 All rosy");
    }

    #72414
    #72391
    maharzan
    Member

    and yes using with wordpress 2.7.1. any ideas?

    #4989

    Not a great title but it’s after 3am here.

    I remembered in October last year _ck_ posted a link to ForumMatrix and it’s information on BBpress:

    http://www.forummatrix.org/show/bbPress

    Now, if it’s not someone involved with the project that keeps ForumMatrix up to date, then i’m very sorry for asking but right now i find it a good source of “where we’re at”, but ee seem to have PLUGIN listed in every box. The thing is, i dont think we have plugins for some of this stuff.

    For example, where is the WYSIWYG plugin?

    According to forum matrix BBpress has plugins for Full BBcode, WYSIWYG editor, nested quotes, syntax highlighting, multiple file attatchments, acl, blacklist, warnings, suspensions, ip-block, audit logging, user reports, rating/karma system, custom profile fields, split threads, calendar, pruning , archiving, export private messages, lo-fi view.

    Thing is, i dont see any working plugins that do those jobs. Now, i’m more than happy to admit that i may be wrong (be great if i was), but i do find the whole current plugin page a bit of a mess (given that the latest plugins, latest talked about plugins, and the highest rated plugins are generally quite similar).

    Any help in finding working plugins that BBpress is supposed to have would be really helpful :)

    Thank you all

    #65893
    _ck_
    Participant

    Showing the gravatar for topic starter and last poster would be something like this (untested)

    Topic started by
    <?php echo "<img src='http://www.gravatar.com/avatar.php?gravatar_id=".md5(bb_get_user_email($topic->topic_poster))."'> $topic->topic_poster_name"; ?>
    Last Poster
    <?php echo "<img src='http://www.gravatar.com/avatar.php?gravatar_id=".md5(bb_get_user_email($topic->topic_last_poster))."'> $topic->topic_last_poster_name"; ?>

    ganzua
    Member

    Ok, thanks for your help :) I’m going to try more of these queries. I find them very useful to integrate small details.

    ganzua
    Member

    That is with bbPress 1.0 right? the object_type is for 1.0

    Yes, it is bb 1.06a with wp 2.7 :)

    I tried with get_var and I get the same error for get_var;

    Fatal error: Call to a member function get_var() on a non-object in….

    but then I changed $bbdb for $wpdb and it works. Why? I don’t understand this.

    #4986
    dphs
    Member

    Hi,

    There is an answer to this question posted a year ago, but when I open the header.php file from my bb-templates/kakumei folder all that is there is “>”. I tried adding the code there, but it deleted the header. Is it located in another place?

    I’m using bbpress 0.9.0.4 and wordpress 2.7.1.

    Thanks!

    _ck_
    Participant

    That is with bbPress 1.0 right? the object_type is for 1.0

    You get nothing using get_results because it returns an array – use get_var instead

    <?php
    global $bbdb;
    $result=$bbdb->get_var("SELECT SUM(meta_value) FROM bb_meta WHERE object_type='bb_topic' AND meta_key='views'");
    echo $result;
    ?>

    ganzua
    Member

    I need more info than “didn’t work”

    Fatal error: Call to a member function get_results() on a non-object in wordpress/wp-content/themes/mytheme/header.php on line 149 (line where I placed the code)

    Try replacing $bbdb with $wpdb

    no error but what I want is to query bbpress data base. Whenever I echo $results there is no answer.

    ganzua
    Member

    and remember to use $wpdb on WordPress pages, vs $bbdb on bbPress pages

    I want to query $bbdb from a wp page. In particular, I want to fetch the total amount of views from your bb Topic Views plugin. This code didn’t work;

    <?php
    global $bbdb;
    $results=$bbdb->get_results("SELECT SUM(meta_value) FROM bb_meta WHERE object_type='bb_topic' AND meta_key='views'");
    $results=$bbdb->get_results($query);
    ?>

    WordPress is installed in /wordpress/ and bbpress in /wordpress/bbpress/ both deep integrated. What’s missing?

    #72273

    In reply to: bb topic view problem

    djeelo
    Member

    Thanx a lot for your help dragunoff !

    It’s indeed an easy css basics ;) I think I’ll learn it one day …

    I just add the .view one width because other rules break my Tags position…

    Everything is fine now !

    Thank you and have a nice evening !

    bye!

    djeelo

    #72390
    maharzan
    Member

    using alpha 1.0 v 6.. is that the issue? and I would love to know the solution if any…

    thanks.

Viewing 25 results - 25,526 through 25,550 (of 32,481 total)
Skip to toolbar