Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbSync

  • @fel64

    Member

    This is a WordPress plugin. It will not work as a plugin in bbPress. WordPress and bbPress must be integrated.

    bbSync will integrate WordPress and bbPress pretty thoroughly. Any posts made on the blog will create a new topic on the forums (this supports slugs and anything else that will come). Any replies made to the topic in the forums can be shown under the WP post with <?php felbbreplies(); ?>, and it will show people’s avatars if you use Louisedade’s avatar upload plugin.

    You can migrate the old synchronisation from bbPress Post and delete the unnecessary tables (this plugin keeps its data in topicmeta, with the key wp_posts).

    Hoping to add stuff later, either when I want it myself or when other people want it. I want feedback if you have it! I eat my own dog food and I’m finding it delicious. Will upload as official plugin when I get access.

    bbPress Post and this plugin should not be running at the same time, otherwise you’ll get duplicate topics when you blog. If you get some error about a call to member function of a non-object, there’s a good chance adding this in the middle of your bbPress’ config.php file will help:

    global $bbdb;

    This plugin does need configuring to do anything useful. Head to Options > bbSync and fill things in please.

    http://rapidshare.com/files/35813637/bbsync.zip.html

Viewing 25 replies - 126 through 150 (of 259 total)
  • @fel64

    Member

    Joe, np. Re: #3, no, you need to modify the template to use fellbbreplies() and return all replies (comments and bb posts).

    Jazbek, excellent!

    Hey Slex, the less cool way is cool too. There’s somd rewriting due on this plugin that I’ll have to do somdtimd soon and I’ll hopefully improve things then. The bug you found does exist, but I believe the problem is _before_ that function when it checks if the user has a capability. Or did you fix it? In any case, from a theoretical viewpoint, I thought bb used the bb_user class regardless of integration.

    We don’t _need_ blog comments. Note that you can simply get rid of the wp comments form and prevent them. I did a lot of work (quite a long tiem ago now) to get a bb form in there, but a lot of globals need setting/spoofing and I eventually ran into difficulties.

    @slexaxton

    Member

    The fix that I made to that function has been tested now and it seems to work, but the fact of the matter is that it could have very well just broke that function all together. I think everything works to my satisfaction now though, so I probably wont worry about it until I run into some more problems. The only thing that gives me hope in that respect is that previously, that if statement was failing. meaning that the user was not a bb_user:

    if ( !( is_object($user) && is_a($user, 'BB_User') ) )

    so it would create new capabilities for the user (incorrectly at that). But when I changed it to wp_User, for some reason that if statement catches and just returns without creating the new capabilities that break access permissions. I don’t know why this works after looking into the code, but until I see negative side effects, I might turn a shy eye (<— i dont think thats a real saying…).

    Also, on the topic of redundant database entries, I think since we have the integration set up from the WP comment box, it wouldnt be incredibly difficult to simply take out the one database call (somewhere in the wordpress code never-never-land) that actually posts the comment to the database. So we’re not inputting a box from bbpress, but we would effectively stop wordpress comments from being saved to the database since we never actually look at them. This of course wouldn’t work if you were merely copying database entries in order to post the comments as posts in bbPress, but I dont think thats what you’re doing. It probably is two separate database INSERT calls, and I bet we can take the wordpress one out, and have identical functionality (assuming we took out wordpress comments and exclusively use felbbreplies()). It’s merely an optimization though, and unless the user base is larger than any of us probably are going to have it might not matter… I’ll look into it tonight when I get home, and let you know.

    sorry for the long post

    -Alex

    @fel64

    Member

    Strange that it’s not catching if it’s a BB_User. That does seem to be the actual class name. Do you want to do some more testing on that? Are users usually instantiated as wp_User if it’s integrated? Or is it just if you set up the current user as bbSync does, from wp, that you get the user as a wp_User object? It’s up to you, if you could check that and arising questions out I’d be grateful as I’m all over the place right now.

    Thanks for your post, really! I feel a lot more confident about finding the solution now.

    @jazbek

    Member

    Actually, I figured out when in the felfunctions the “member” capability was being set (you may already know this) – line 36

    I thought that maybe the globals should be changed to

    global $bb_current_user;

    instead of

    global $current_user;

    That seemed to work when I was posting in wordpress as an admin, but I just tried posting with another user account and got an SQL error, so no dice. I have some other stuff to work on right now, but will come back to this later. Maybe the global $bb_current_user needs to be set to the $current_user instead of doing

    bb_set_current_user( $current_user->ID );

    ?

    @slexaxton

    Member

    Lots of stuff to check on now. Didn’t think of some of that, my normal users are probably messed up now… Ill get back on this later tonight, We’ll figure it out fel. Thanks for the insight as well jazbek, ill take a look at that function…

    -slex

    @jazbek

    Member

    slex, i just noticed that the code in my reply was screwed up and fixed it just now. i put a link to trac for the line where the user is being set, might want to re-read.

    @slexaxton

    Member

    Thanks for the edit jazbek, ill try that next. It seems more like an actual fix compared to whatever I did. However, I still have failed to run into a problem with my “hack.” All my users have the ability to make posts and comments, and all of my administrators can do the same. And now my administrators all keep their administrator status after making a wordpress post. I’m confused to why this hack even works, now that I look deeper into it… But I can’t break it… idk what to do.

    @fel64

    Member

    Jazbek, you may well be right. I believe my original reason for that code was that I ran into problems with bb not properly initialising the user and that $bb_current_user would not be set (hence, no posting either). However, if that fix works then I may well have made a mistake then (or in remembering). Would be lovely.

    @jazbek

    Member

    Yeah, I think that did it. I just tested a post as a regular user and it worked without any errors. I am short on time right now so if anyone else has a chance to try it out, that’d be cool. Here’s all I did (all in felsyncpost()):

    1) added $bb_current_user to the globals

    2) commented out line 36

    3) added $bb_current_user = $current_user; in its place.

    Try it out. :)

    @slexaxton

    Member

    Tested. Works. Good job Jaz… now I dont have to wonder how many months from now my hack would have caused a nuclear war in china.

    And just for the sake of completeness. I did not test the case where a user is a blog writer (can write new posts), but is not some sort of administrator on the forum. I can’t foresee needing this functionality, but if it doesnt work, dont get mad at me.

    Database redundancy time?

    @slexaxton

    Member

    EDIT:THIS IS NOT A VALID POST IT WAS USER ERROR (aka im dumb)

    I may have spoke too soon. I dont know what caused it, but i lost all keymaster functionality. Nothing gets added to the database, but it doesnt recognize me as an admin. I even reverted back to old code, and keymaster has no “keymaster” capabilities, even though the database clearly shows the entry that says it does.

    I’ll let you guys know if I find out the problem. :(

    @slexaxton

    Member

    Ok, I just had the wierdest 10 minutes of my life, but to sum it up, my server went crazy, along with some cookie problems, and then fixes for those problems caused others, but I got everything standing up straight again and made the change that jaz did, and everything works perfectly. I did new user registrations and admin posts and user and admin comments and admin registrations and changing of user types, as much as I could think of and I couldn’t break it. So we are back to the green light, and God is playing tricks on me. Sorry if I scared anyone…

    @jazbek

    Member

    You didn’t scare me, but you made me laugh.. :)

    @fel64

    Member

    Nice one jaz. I’ll try it (note that I never had this problem) and add it tonight I hope. Has anyone else had this problem, can they try it?

    Hehe, slex, at least it’s alright now. Do you actually know what caused your loss of privileges? It may be important.

    Re. database redundancy, I’d say no. It’s a one-time database hit and I feel somewhat better letting the comments actually sit in the database, so that once someone’s had enough of bb or bbsync they still have _something_. But if you can code a neat implementation, I’ll gladly branch the code.

    @fel64

    Member

    Looks good. No fatal error, and I was able to post. ^^ Also fixed a glaring oversight – unescaped text – but it makes me wonder if bb has a method for doing the whole shebang of creating a post from standard user input. Hmm. Should be nice now, though. Uploadin’ now.

    [Edit] Release μ.

    @vitovarducci

    Member

    I’m not sure what I’m doing wrong.

    I filled out all of the proper synchronization options and everything registered correctly.

    But when I go to migrate from bbpress post, I receive this error:

    WordPress database error: [Table 'db218346346.wp_bbpress_post_posts' doesn't exist]
    SELECT * FROM wp_bbpress_post_posts

    WordPress database error: [Table 'db218346346.wp_bbpress_post_posts' doesn't exist]
    SELECT * FROM wp_bbpress_post_posts

    How do I fix this?

    Thank you for your help!

    @fel64

    Member

    Hey vitovarducci. Are you sure you had bbpress post installed? It doesn’t look like you do now. Check whether any old posts you had synchronised through bbpress post are synchronised now. If they are, or you didn’t have any synchronised, well, that’s good. It’s sorted. If they aren’t, can you check your database (through phpmyadmin or similar) and looks for a table called wp_bbpress_post_posts? Also check that you actually activated bbpress post (don’t if you hadn’t).

    @slexaxton

    Member

    I understand having “something” as far as saving the wordpress comments, but the fact is that only WORDPRESS comments will be saved. Since the forum holds the integrated comments of both, all the comments are relevant, but if you were to look just at the wordpress comments, they wouldn’t make sense because if anyone replied to a message using bbpress, and had a conversation with someone on wordpress, we would only get half of the conversation. They are pretty much worthless, unless we can sync both database tables to store all comments, and in that case, we might as well just have a backup… unless you consider having potentially broken comments as a back up worth having, which I can see a case for, since alot of the information would be perfectly valid. But to me it seems like an all or nothing thing.

    @vitovarducci

    Member

    fel,

    Thank you so much. I never even had bbpress post, I thought that this migration would create new topics for each already existing blog post.

    But every time I try to create a new post, I receive this error:

    Fatal error: Call to a member function on a non-object in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/functions.php on line 997

    The post is still created on the blog, but nothing happens in bbpress.

    Is this an error on my part?

    Also, is there any way to create the new topics for each already existing blog post?

    Thank you so much for all your help.

    @fel64

    Member

    Slex, indeed there’s some issue there. It probably needs further thinking about. However, like I said if you want to modify it to stop wp saving comments, or even to make bb add replies to wp comments, implement the change and I would definitely like to make a branch of bbsync.

    Vito, can you please open bb’s config.php file and add this line to it somewhere?

    global $bb_cache;

    That should fix that error (assuming you’re using the latest stable, .8.3!).

    No good news on making backdated topics I’m afraid, because there’s no way to use the API to create the topic and set the time of it to be in the past. You’d have to copy and modify some large blocks of code, which is exactly what I want to avoid with bbsync (regarding the problem that became with bbpress post, for example).

    However, if you edit an old post in wp and press save, it will create a new topic in bb for you (but with today’s date, rather than the appropriate one). It’s an unfortunate limitation of bbsync.

    @slexaxton

    Member

    fel, I just wanted to say that I have had a couple drinks tonight and I feel like maybe I sounded confrontational, but I was really just weighing pros and cons. I will check it out and help you make the branch, but I really love what you have done with the plugin. I’ll post again after some sleep/sobering up. Have a great weekend man.

    -Alex

    P.S. Felix is an awesome name.

    @jazbek

    Member

    fel, do you think maybe you should add global $bb_cache; to the bbsync.php file instead of telling everyone to add it to their config? wouldn’t it work out of the box that way?

    @fel64

    Member

    Slex, you didn’t, it’s cool, and for the last week I have barely posted here without being rather drunk (since I usually see posts late at night when I come home). I did not know about you and I somewhat hope that you did not know about me. It is cool.

    Jazbek, have you tried it? It has been a good half-year since I came up with the globals solution, but even from a purely theoretical standpoint I don’t see why it would work. The key issue is that bb-include files cannot access the globals, and declaring globals in some function in wp shouldn’t change that. The only thing that seems like it could is the main code, ie. config.php.

    Of course, perhaps I’m making something of a fool of myself and it would totally work. If you’ve tried it and it worked for you (meaning also that without the globals code in bbsync.php you had fatal errors) then I’ll check it out again. Cheers.

    @vitovarducci

    Member

    hmm… I did it… but I get another error when creating new posts…

    Warning: array_filter() [function.array-filter]: The second argument, 'Array', should be a valid callback in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 271

    Warning: Invalid argument supplied for foreach() in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 275

    Warning: array_filter() [function.array-filter]: The second argument, 'Array', should be a valid callback in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 271

    Warning: Invalid argument supplied for foreach() in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 275

    Warning: array_filter() [function.array-filter]: The second argument, 'Array', should be a valid callback in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 271

    Warning: Invalid argument supplied for foreach() in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 275

    Warning: array_filter() [function.array-filter]: The second argument, 'Array', should be a valid callback in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 271

    Warning: Invalid argument supplied for foreach() in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 275

    Warning: Cannot modify header information - headers already sent by (output started at /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php:271) in /homepages/28/d126493713/htdocs/cbusaffairs1/wp-includes/pluggable.php on line 341

    Sorry, I just don’t understand the code well enough to figure it out myself… :(

    @fel64

    Member

    Yo,

    good good. Now instead of global $bb_cache; try global $bb_cache, $bb_roles; :)

Viewing 25 replies - 126 through 150 (of 259 total)
  • The topic ‘bbSync’ is closed to new replies.
Skip to toolbar