Forums

[Plugin : WP_SMF] Problem for login twice after bridge. (1 post)

  1. bubbleball
    Member
    Posted 2 years ago #

    I want to bridge wordpress to smf forum , so I use this plugin http://wordpress.org/extend/plugins/wp-smf-a-simplemachines-bridge/

    But I use version 1.08 because can't install 1.09.

    And I use this mod for smf (smf 1.1.9)
    http://gumfi.de/wordpress-251-smf-forum-bridge/

    At first, I have problem about install plugin in hostgator, but I can fix problem by this comment in latest link.

    I’ve found out the problem!
    It has nothing to do with cookies or wordpress 2.5, but with the sql connection in the api.

    In smf_api_1.1.php, in line 166 we should change:
    @mysql_connect($db_server, $db_user, $db_passwd)

    to:
    @mysql_connect($db_server, $db_user, $db_passwd, true)

    This will prevent the SMF bridge from hogging the sql connection, thus allowing for wordpress to keep on running as usual

    But after I have succeed in installing plugin, I found that I have to login twice in wordpress and I don't know why, but I think it is about cookie problem.

    And I found more problem in smf forum about connecting table OPTIONS, so I correct this problem for the first.

    $vbsalt = $wpdb->get_row("SELECT * FROM OPTIONS WHERE option_name='secret'");

    to become

    $table_prefix = wp_path($boarddir,'wp_table_prefix'); //bubbleball
    $wpdb->wpoptions = $table_prefix . 'wp_options'; //bubbleball
    $vbsalt = $wpdb->get_row("SELECT * FROM $wpdb->wpoptions WHERE option_name='secret'");
     //bubbleball edit

    (line around 100 to 120)

    But after test to login in smf, it alert problem like this.

    Fatal error: Call to undefined method stdClass::get_row() in /home/nineb/public_html/mysite.com/th/forum/Sources/SMF_Wordpress.php on line 1084

    This problem come frome this line

    require_once (ABSPATH . 'wp-includes/wp-db.php');
    
    $wpdb->table_prefix = $table_prefix;
    
    $wpdb->users = $table_prefix . 'users';
    
    $wpdb->usermeta = $table_prefix . 'usermeta';
    
    $wpdb->wpsmfuser = $table_prefix . 'wpsmf_users';
    
    $row = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE user_login = '$username'");

    I think that It can't find user login in wordpress, so I try to test by login wordpress for a once (but still not redirecto to admin page) and try to login smf for the next step. After that it work and no problem (So I think this problem is about cookies or anything of wordpress or plugin problem).

    After that I test to register user in smf forum and get this error.

    Fatal error: Call to undefined function is_admin() in /home/nineb/public_html/mysite.com/th/wp-includes/vars.php on line 16

    I try to search for this error, and still not find any solutions, only see that should upgrade wordpress and error will be fixed.

    This is all my problems and need your help. thank you and sorry for my english.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags