• Resolved andybala

    (@andybala)


    Hi,

    I’m using WP 3.0.1 with TML 6.0.1 Alpha along with Simple Facebook Connect Ver 0.21. I found two issues.

    1. For some reason, the Connect Using Facebook does not appear by default on the login page when TML is enabled, but appears in the default WP login screen, when TML is diabled. (The workaround that I did on the template file was adding if($_GET['action']=='login' || !isset($_GET['action'])) echo sfc_connect_shortcode(); just after calling the_content() )

    2. After logging into the system using FB credentials, in the profile page when TML is enabled, although I’m getting the button “Attach this FB account to WP account” (or something similar), the button seems to throw an error upon clicking stating “Button not defined”. But the same functionality works fine if TML is not enabled. (I haven’t worked on this issue yet)

    I tried looking at the forums of SFC for a solution, but the Author had mentioned in one of his replies to contact the Author of TML just to check if all the hooks have been included.

    I would like to know if anyone else is facing this problem and if they found the solution. Appreciate your help.

    Best.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    TML calls all of the same hooks as wp-login.php

    Thread Starter andybala

    (@andybala)

    Hello Jeff,

    Thank you very much for responding. Do you think you could give me your email ID and I could send you a screenshot of the issues or could provide you with the source files if you require them and could also send you the link to the site? Thanks again.

    Best.

    Plugin Author Jeff Farthing

    (@jfarthing84)

    jeff [at] jfarthing [dot] com.

    Plugin Author Jeff Farthing

    (@jfarthing84)

    The problem is that SFC expects $action to be defined as a global variable, as it is defined at a global scope in wp-login.php. TML defines it within a function, therefore it is not global by default.

    So, create a file called theme-my-login-custom.php in the plugins directory. This is a file that TML always includes upon initialization, intended to maintain customizations between upgrades. Create a callback for a hook I provided in TML, called tml_request. The callback will simply assign the proper action to the global $action variable.

    function tml_request( &$theme_my_login ) {
    	$GLOBALS['action'] = $theme_my_login->request_action;
    }
    add_action( 'tml_request', 'tml_request' );
    Plugin Author Jeff Farthing

    (@jfarthing84)

    As for issue #2, this is caused by the proper javascript needed by SFC not being called, as it is attached to the admin_footer hook, which is only called in the admin area. Of course, the default profile is in the admin area, but TML is not. So, we just need to hook the required action to wp_footer instead.

    So, change the above code to this:

    function tml_request( &$theme_my_login ) {
    	$GLOBALS['action'] = $theme_my_login->request_action;
    
    	if ( 'profile' == $theme_my_login->request_action )
    		add_action( 'wp_footer', 'sfc_login_update_js', 30) ;
    }
    add_action( 'tml_request', 'tml_request' );

    Create a file called theme-my-login-custom.php in the plugins directory.

    Does it have to contain anything ?
    Where does this go ?

    function tml_request( &$theme_my_login ) {
    	$GLOBALS['action'] = $theme_my_login->request_action;
    
    	if ( 'profile' == $theme_my_login->request_action )
    		add_action( 'wp_footer', 'sfc_login_update_js', 30) ;
    }
    add_action( 'tml_request', 'tml_request' );

    What if I have two Footers

    Plugin Author Jeff Farthing

    (@jfarthing84)

    theme-my-login-custom.php

    When you say plugins directory for you mean the root or TML directory. I had it in the TML directory and still cannot see the button for SFC

    Put it in the plugins directory (root) and it works on all footers.
    Seemed to easy I suppose.

    Thanx

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Theme My Login] TML & Simple FB Connect plugins issues’ is closed to new replies.