superann (@superann)

Forum Replies Created

Viewing 17 replies - 1 through 17 (of 17 total)
  • Hi Citizenkeith, I just saw this now… you’d put the hack at the end of pm_new_message. So my function now looks like this:

    function pm_new_message( $id_receiver, $id_sender, $pmtitle, $message ){
    global $bbdb, $bb_table_prefix;

    $created_on = bb_current_time('mysql');
    $id_receiver = intval($id_receiver);
    $id_sender = intval($id_sender);

    $pmtitle=substr(strip_tags($pmtitle),0,64);
    remove_filter('pre_post', 'post_regulation');
    $message=substr($message,0,2048);
    $message=force_balance_tags($message);
    $message=apply_filters('pre_post',$message,0,0);
    $message=apply_filters('post_text',$message,0);

    $bbdb->query("INSERT INTO ".$bb_table_prefix."privatemessages
    (id_sender, id_receiver, pmtitle, message, created_on)
    VALUES
    ('$id_sender', '$id_receiver', '$pmtitle', '$message','$created_on')");

    $to = bb_get_user_email($id_receiver);
    $pm_link = bb_get_option('uri') . 'message.php?id=' . $bbdb->insert_id;
    $message = __("You have a new private message: %1$s nFrom: %2$s nn%3$s ");
    mail( $to, bb_get_option('name') . ':' . __('Private Message'),
    sprintf( $message, $pmtitle, get_user_name($id_sender), $pm_link ),
    'From: ' . bb_get_option('from_email')
    );

    }

    Btw, when you do cookie integration please keep in mind that there are some login hooks in pluggable that might not be called in either WP or bbPress depending on which side your user logged in from. This might affect the functionality of some plugins.

    For example, after rerouting all my bbPress logins to WP I realized that the ‘bb_set_current_user’ action hook on a bbPress plugin I used was no longer being called, so I had to incorporate it in on the WP side using the ‘set_current_user’ hook.

    Yeah, it’s definitely a quick and dirty temporary hack! I didn’t even realize until now that admin_email has changed to from_email… oops! My forum’s not so busy so I’m ignoring race conditions for now. In the future I might just rip off the bbpress post functions. Or wait for someone else to fix this plugin, heh! :p

    Hmm proxied email seems to be not working…

    http://forum.developers.facebook.com/viewtopic.php?id=29568

    Hmm, yeah someone should definitely try to get the current repository transferred to another person. I’m pretty new to bbPress so someone else would be a way better candidate than me for rewriting this plugin.

    Btw, what did detective’s mod add? I’m not even sure what I’m using…

    Anyway while I was replacing pm_new_message with ck’s mod I decided to hack email notification in there at the end (formatting stolen shamelessly from the existing notification plugin):

    $to = bb_get_user_email($id_receiver);
    $pm_link = bb_get_option('uri') . 'message.php?id=' . $bbdb->insert_id;
    $message = __("You have a new private message: %1$s nFrom: %2$s nn%3$s ");
    mail( $to, bb_get_option('name') . ':' . __('Private Message'),
    sprintf( $message, $pmtitle, get_user_name($id_sender), $pm_link ),
    'From: ' . bb_get_option('admin_email')
    );

    Actually, that’s not true. You can collect a proxy email that goes directly to the person’s inbox and can be sent using your app.

    Whoa sweet, sheatsb! That does make it friendlier and a bit more worth looking into… why hasn’t anyone written this into their plugins?

    Nope, no email. They make you have to go through facebook if you want to contact a user, so any email notifications plugins you might be using would be rendered useless.

    You can manually mark spam posts with my “Mass Edit” plugin.

    https://bbpress.org/plugins/topic/mass-edit/

    There are two email notification plugins available, one is the “post notification”

    https://bbpress.org/plugins/topic/post-notification/

    https://bbpress.org/plugins/topic/auto-add-favorites/

    and the other is my “subscribe to topics” (which is not robust yet).

    Sweet! Thanks for the recommendations, ck! I think I actually found mass edit at some point and downloaded it somewhere to my desktop. Unfortunately I have hundreds of files all over my desktop and I forgot what it was called. Post notification I’m using; I think I modified it at some point to not send on your own posts.

    Hey detective, are you the owner of the pm plugin? It would be great to get independent enhancements bundled into the one plugin in the repository!

    In reply to: WordPress 2.7 options

    You’re welcome, krischan68! You should be able to upgrade all the way to the current WP 2.7.1 as far as integration is concerned; I’ve tested this method on another site and have gotten it working.

    I highly doubt the plugin will break with minor point releases; it wouldn’t make much sense for the dev team to make such drastic changes unnecessarily.

    Thanks johnmc! I worked hard on the site; haven’t spent nearly as much time with bbPress as I have with WP so I kind of did the absolute minimum to start and was lazy about the cookie integration that didn’t work out of the box… until someone else on my forums complained…

    WP and bbPress are running side by side off the same user database, same process to set up as described in the integration thread here. No deep integration, just customized the templates to match. Registrations are routed to WP via a direct link to it in the login-form.php template, which is cool as I use the Register Plus plugin there to customize things a bit. Logins (and outs) are integrated via cookies using the plugin which you can grab here:

    http://superann.com/2009/02/26/wordpress-26-27-bbpress-09-cookie-integration-plugin/

    Also, thanks for the welcome, ck! I do more theme customizations for WP but usually do it all the quick and dirty way, cramming things into function.php file rather than packaging it up nicely, and I often just hack features into other plugins to get it all working the way I want. Right now as far as bbPress is concerned on my to-do list is to find a good solution for manually marking spam posts, work email notification into the pm plugin, and set up the post notification to send email by default. Just haven’t had time to look into all that yet… if there are any existing solutions/patches, please let me know! Otherwise I’ll probably look into it at some point and contribute what I can (if anyone else is interested).

    In reply to: WordPress 2.7 options

    Yep, cleared all my cookies and it appears that things work as they should. I haven’t pored over the source too considerably but from what I saw it looks like there are very few dependencies, which makes sense as I’m guessing WP wants you to be able to integrate sign on systems without jumping through hoops.

    My sites aren’t “deeply” integrated, so it would be great to get some feedback from anyone who tries this on a deep integration.

    Plugin here:

    http://superann.com/2009/02/26/wordpress-26-27-bbpress-09-cookie-integration-plugin/

    In retrospect I shouldn’t have put this at v1.0, but I expect its useful life might be short anyway once bbPress 1.0 is released…

    I find FB Connect a bit annoying as it’s really not giving you any information about your visitor… I mean, most profiles are private and I’d much rather be able to check out my visitor’s preferred website than just see a small picture of them (or often someone/thing random) on their FB profile. Couple that with not even being able to contact them (no email) and they may as well be anonymous.

    In reply to: WordPress 2.7 options

    Hey _ck_… that’s great news! It’s probably better to do it your way but I did it this way as I was lazy… I didn’t have to write a single line of code and it was literally just copy and paste from WP 2.5 pluggable functions. And yep, I did override the salt with the old function too.

    In reply to: WordPress 2.7 options

    Yep, same method above works with WP 2.7.1 and bbPress 0.9.0.4. Just tested and there’s full cookie integration.

    In reply to: WordPress 2.7 options

    Are the login functions any different in 2.7 from 2.6? I just wrote in the WP + bbPress integration forum about having successfully integrated WP 2.6 and bbPress 0.9 logins by just overriding all the WP pluggable cookie functions via a plugin with code copied right from WP 2.5’s pluggable.php file. I was thinking I could just do the same for 2.7…

    I followed some of these instructions and completely integrated WP 2.6.2 and bbPress 0.9 logins on my site today (BayAnime.com). I’d already had 2.6 up and running when I installed bbPress and didn’t want to roll back (I really need to roll forward at some point), so I just copied and pasted all the old WP 2.5 cookie functions from pluggable.php into a separate plugin file for my 2.6 install, set all the paths and keys, and it’s working well. I expect you can just do the same with WP 2.7 if you want to integrate it with bbPress 0.9. Anyway just wanted to report that it IS possible to get 2.6 (and up probably) working with bbPress 0.9 without too much more pain. If anyone’s interested in the plugin file that has the WP 2.5 functions you need, just let me know!

    Replace register.php with:

    <?php

    header(‘Location:http://your-wordpress-url.com/wp-login.php?action=register&#8217;);

    ?>

Viewing 17 replies - 1 through 17 (of 17 total)