Forum Replies Created
-
In reply to: bbSync
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.
In reply to: bbSyncI 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.
In reply to: bbSyncOk, 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…
In reply to: bbSyncEDIT: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.
In reply to: bbSyncTested. 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?
In reply to: bbSyncThanks 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.
In reply to: bbSyncLots 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
In reply to: bbSyncThe 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
In reply to: bbSyncONE more post for now. My next task… Do we really need redundant blog comments if we call felbbreplies? I have this whole table of comments stored for anything posted through the blog, but i dont think I ever access them. If someone knows a quick way to help me out let me know. Otherwise, I think I’ll work on that tomorrow. Thanks again felb, you’ve saved me hours of work.
-Slex
In reply to: bbSyncThis has been scarcely tested, but I think I have a fix for my bug… weird…
in the bb-includes/capabilities.php file there is a function at the bottom that looks like this:
function bb_give_user_default_role( $user ) {
if ( !( is_object($user) && is_a($user, 'BB_User') ) )
return;
$user->set_role('member');
}I changed it to look like this:
function bb_give_user_default_role( $user ) {
if ( !( is_object($user) && is_a($user, 'wp_User') ) )
return;
$user->set_role('member');
}Instead of checking to see if the bb_user existed, we wanted to check to see if the wordpress user existed, assuming we merged our user table. For some reason, this seems like a bug in the bbPress code. Shouldn’t that be a variable prefix to begin with?
In reply to: bbSyncHey fel, sorry for the delay in replying. I did it the less cool way you mentioned. Just changed the template to call my own modified function with an extra parameter passed to it (the amount of posts in the topic -1). Pretty simple, but worked like a charm. You probably couldnt modify that stuff through your plugin, but you could do some magic by just writing some felfunctions that mostly do that same stuff as wordpress’s functions and then add them to the plugin. idk.
I do have a weird bug that im trying to figure out, I think crowspeaker had a similar one. I actually think his bug might be two separate bugs.
I can post back and forth and see comments yadadaada, everything works EXCEPT:
If I make a post in wordpress as an administrator, I lose my administrator powers in the forum (the forum only). I get the extra
capabilities(member)
thing. I just delete that database entry and i can go full on again. I havent quite tracked the culprit down yet, but ill let you know. For now I can just hack it and delete that entry after every post if it exists. rofl. dont ever do that though.In reply to: bbSyncI love the plugin fel. It takes a while to get used to what file is doing what, but to anyone who is using it along with the integration scripts you might realize that the posts on the forum show up as comments and visa versa, but the comment count on the main page only counts the comments made via wordpress, and doesnt take into account the comments that show up, but were originally made in the forum.
I added a function in the plugin that just recieved the number of posts (since this data is correct).
function bbreplycount() {
global $id, $opshuns;
$posties = 0;
if( !$opshuns )
$opshuns = get_option('bbsync');
require_once( $opshuns['bbpath'] );
$topic_id = felwptobb( $id );
if( $topic_id ) {
$topic = get_topic( $topic_id );
$posties = $topic->topic_posts;
}
return $posties - 1;
}Using this I was able to modify the
comments_popup_link(...)
to accept another variable (the number of posts returned by the new function). Then instead of getting the number of actual comments via the wordpress method, I simply replaced my new variable with that function call. Viola, works like a charm.Its nothing serious, but could be helpful to some. cheers. Thanks again fel.