bbPress

Simple, Fast, Elegant

bbPress support forums » Plugins

bbSync

(255 posts)
  • Started 1 year ago by fel64
  • Latest reply from lagoonix
  • This topic is not resolved
  1. Fel: I just made a small change to the felbbreplies(); function in order to get a reply link on pages where there aren't yet any replies. I simply added echo '<h3><a href="' . bbreplylink() . '">Reply!</a></h3>'; to the else clause. If the topic has been created in the forums, it works perfectly, if not, the "Reply!" button simply links to the current page. Not ideal, I know, but it at least makes sure that the reply link appears, whether there are previous replies or not.

    I actually just installed the Upload Avatars plugin, but it doesn't seem to be working correctly with bbsync - the<?php bbreplyavatar(); ?> portion of felbbreplies(); is returning the following on the WP pages: <img alt="admin avatar" src="http://path_to/wp/forums/avatars/" class="avatar" /> So it appears to know which directory contains the avatar, but doesn't include the avatar's file name.

    *Update* - I have just noticed that new forum replies don't appear back in WP unless the original post is re-saved.

    Posted 1 year ago #
  2. Sorry to leave you guys in limbo, but I can't give you the new version because I'm halfway through adding stuff so it probably doesn't work and I've got exams over the next few days so I'm a bit busy :o Will be back on this on Thursday. Could be quite rad! :P

    Posted 1 year ago #
  3. SneakyM
    Member

    Hey fel just wanted to give you an update that may or may not help you. BBpress-Post works 1oo% fine for me. All of my wp posts go right into BB and when I click on "leave a comment/discuss in fourm" I go straight to the topic in BB. All I would need is for those comments to come back into wp so that you can view them without going into BB and for the avatars to be supported/viewable in wp which is what bbsync does and it is killing me that I cant get it to work!!!!

    Anyway, I thought this might help because it seems their code/config (use of three php files?) works fine on my end...thought you might able to adapt something in your next version based on this...

    thanks again fel!!!!

    Posted 1 year ago #
  4. Yeah, I know, but thanks. ^^ In the meantime you can use this hack I brewed up a while ago to display replies as comments beneath bbPress-Post integrated posts. Don't think it supports avatars, though. But we'll get this to work :)

    Posted 1 year ago #
  5. SneakyM
    Member

    hey fel! Thanks for the reply! I was actually trying this hack now. I am very close but I am getting an error whereby it is looking for my posts in "dbname.posts". That database doesnt exist, the database is simply wp_posts, not databasename.posts.

    Here is the error:

    [Table 'databasename.posts' doesn't exist]
    SELECT poster_id, post_text, post_time FROM posts WHERE topic_id = 6

    I took out the database name out but i am sure you get the point!

    Posted 1 year ago #
  6. fel, thanks for the plugin. i haven't tried it yet, but it sounds like exactly what i'm looking for.

    Posted 1 year ago #
  7. Sneaky, I have an idea of what it is. Find this line near the beginning:

    $bbprefix = get_option( 'wpbb_bbprefix' );

    And replace with

    $bbprefix = 'bb_';

    or your actual bb table prefix.

    Posted 1 year ago #
  8. SneakyM
    Member

    Sorry fel but that piece of code isnt in there. This is what it looks like

    '<?php
    function felblogtotopicid( $felpostID ) {
    global $table_prefix, $wpdb;
    $posts_table = $table_prefix . "bbpress_post_posts";
    $topic_id = $wpdb->get_var("SELECT topic_id FROM $posts_table WHERE post_id = $felpostID LIMIT 1;");
    return $topic_id;
    }
    global $post, $wpdb;
    if( $forumtopic = felblogtotopicid( $post->ID ) ) {
    $bbprefix = get_option( 'wpbb_bbprefix' );
    $replies = $wpdb->get_results( '
    SELECT poster_id, post_text, post_time
    FROM ' . $bbprefix . 'posts
    WHERE topic_id = ' . $forumtopic
    );'

    I think it has something to do with '$table_prefix, $wpdb;' and '$posts_table = $table_prefix . "bbpress_post_posts";'. My table prefix is not wpdb (where wpdb = database name) it is just wp. Plus that '.' in there is throwing it off as well as the error reads:

    [Table 'databasename.posts' doesn't exist]
    SELECT poster_id, post_text, post_time FROM posts WHERE topic_id = 6

    ".posts" That '.' is getting into the code and appending itself to the db name...

    I think...

    You are the master though....

    Posted 1 year ago #
  9. It's there! I'm looking at it right now. In the code you copied it is line 10.

    The bb_posts table is what we're looking for, not wp_posts (also a table), and it tells you the databasename.tablename so it's actually trying to look for a table called "posts". I don't think the wpbb_prefix option exists in your tables, I suspect that's a Latest Discussions plugin thing (ah, hindsight). If it did, it would read bb_. The . is used to join two strings together, so what it should be doing is joining 'bb_' and 'posts' together into the table name 'bb_posts', but since that option doesn't exist in your tables it just join together '' (a blank) and 'posts', leaving us with the incorrect table name of just 'posts'. I suspect.

    Posted 1 year ago #
  10. SneakyM
    Member

    I am blind thats why I called you the master. I will fix it as soon as I can! Now go study!

    Posted 1 year ago #
  11. like i said, i haven't implemented this plugin as of yet (haven't even installed bbpress, just planning to in the near future), but will this plugin allow me to put the "Add this topic to your favorites" link on the wordpress post page? i would like to have that capability to allow the users who don't comment to create a list of their favorites without having to follow the link to the thread in the forum to do so.

    Posted 1 year ago #
  12. sorry for the double post, my internet's screwy

    Posted 1 year ago #
  13. SneakyM
    Member

    fel! Sucess! That got it to work! The only problem now is that the Reply link is not pointing correctly to the topic, it is pointing to the post's permalink...

    Oh well, I will wait for bbsync to do the rest!

    Posted 1 year ago #
  14. Anton, no. :o But looking at your site I see you have a password-protected post, which reminds me I should deal with that.

    Sneaky, cool!

    Posted 1 year ago #
  15. Sneaky, sitting on some code to look through error logs here but it's working at what you might call a sub-optimal level in several respects. Gonna brood on it some more, sorry to still leave you waiting. Will upload it when it works.

    Posted 1 year ago #
  16. Hey, got that to work surprisingly quickly, all that file stuff was new to me. This (bb) plugin should work on .8.2.

    http://rapidshare.com/files/38571149/errorlogs.php.html

    Tell me if it finds any error logs. I hope all servers handle it the same! I think mine is Linux so if yours is Windows then maybe it won't work, I dunno.

    Posted 1 year ago #
  17. Well crap.

    I tried to upgrade to the new version of bbPress today, and now my entire setup is, well, broken. All I get from the forums is "Doesn’t look like you’ve installed bbPress yet, go here." yet I have already installed them (it gave me this earlier, so I went in, cleared the database tables as there wasn't anything important in the forums yet, and reinstalled completely) and have confirmed this by checking the database to make sure everything was there. Now I can't post anything in WP because every time I try, the bbPress install gives me the same "Doesn't look like..." message. I've gone ahead and disabled bbSync until I can figure out what is up.

    Posted 1 year ago #
  18. This is the function that checks if you're installed.

    function bb_is_installed() { // Maybe we should grab all forums and cache them.
    	global $bbdb;
    	$bbdb->hide_errors();
    	$installed = $bbdb->get_var("SELECT * FROM $bbdb->forums LIMIT 1");
    	$bbdb->show_errors();
    	return $installed;
    }

    Your database version must be correct because it connects ok. Are you sure there's something, anything, in bb_forums?

    Posted 1 year ago #
  19. Ah ha! There aren't any records in bb_forums, but the table is there. Any suggestions?

    Posted 1 year ago #
  20. Yup. If you have any backups, take data from that, else fill with some fake data.

    Posted 1 year ago #
  21. SneakyM
    Member

    Hey fel, I dont know how to use this php file. I put it in my-plugins, now what?

    Posted 1 year ago #
  22. Now activate it! Go to bb-Admin > Site Management and activate "Error Logs". Then a tab appears in the Site Management sub-panel also saying Error Logs.

    Posted 1 year ago #
  23. Thanks fel, that worked. Now my problem is it won't let me in to the admin area - if I try to go to /path_to/forums/bb-admin/ it just spits me back out in /forums/. I figured this must have something to do with the rewrite rules, but I tried accessing them /path_to/forums/bb-admin/rewrite-rules.php and the same thing happens as when I try to access the normal admin area.

    Posted 1 year ago #
  24. No, I think that means that your status is no longer keymaster. I also had this problem. Open phpMyAdmin, go to your wp_usermeta table, Browse it, click edit to modify the MySQL query (this is potentially fatal, be careful).

    This query will hopefully show the record you want:

    SELECT * FROM wp_usermeta where meta_key = 'bb_capabilities' AND user_id = 1

    If your user_id is not one you will need to change it. You should now be seeing a record like this:
    a:1:{s:9:"keymaster";b:1;}
    That would make you a keymaster. If the record is like this, however:
    a:1:{s:6:"member";b:1;}
    then you got turned into a regular member. Click the pencil to edit this entry and replace the member thing with the keymaster value (make sure this is your account!). Save changes and check bb.

    Be careful, the databases are crucial. This worked for me, but it's not guaranteed to work or make things better - I can't see risks but there might be some!

    Posted 1 year ago #
  25. Thanks so much fel, that got everything working!

    Posted 1 year ago #
  26. I have a question about the plugin fel64.

    What will happen in bbPress if the post is paginated? Generally, every post on my site is 3 pages (for a reason), but I would only like the first page to be submitted to bbPress. Is this possible?

    Posted 1 year ago #
  27. Not yet possible, but I can add it. I've made it stop at the more tag if desired, if there's a function to get a certain page (and I'm sure there is) it'll be very quick to put that in. Last exam tomorrow, more coding then \o/

    Posted 1 year ago #
  28. http://rapidshare.com/files/39242488/bbsync.zip.html

    Hurrah. Cuts off at more tag and after first page if desired, doesn't post password-protected posts and lets you add a link at the bottom. Version close-to-but-still-a-bit-to-go-before-version-1.

    Posted 1 year ago #
  29. fel, great progress! I just installed the new version, and while the more tag funciton is working perfectly, I'm having some problems with the links it's creating in the new forum post that heads back to the original post in WP - it's spitting out my IP address instead of the installation's URL, and isn't linking to the correct URL - and it doesn't make the "Reply!" text on the WP pages link to the new post in the forums. Anything you'd like me to try out to see if we can get it working?

    Posted 1 year ago #
  30. What's the exact text it's spitting out and what settings have you got?

    Oh, right. I think I modified that function for my own nefarious purposes. bbreplylink() now returns the URL to the forum topic. So that this would give you the url:

    <?php echo bbreplylink(); ?>

    I did that for a little more template flexibility. This is what I'm using:

    <?php if($topic_id = felwptobb( $id ) ) { echo '<a href="' . bbreplylink( $topic_id ) . '">Reply!</a>'; } else { comments_popup_link('&nbsp;comments', '1 comment', '% comments','',''); } ?>

    Do you think that should be changed to make a single template tag? I guess it would be easier to use. Any suggestions?

    Posted 1 year ago #

RSS feed for this topic

Reply »

You must log in to post.

Code is Poetry.