[Plugin: WP-FB-AutoConnect] Changing Widget layout?
-
I am wanting to change the widget to have the same look as the AJAX login plugin. I am wanting it to show their avatar, profile, logout and blog admin link on the widget. I got the logout, blog admin and avatar to work on a localhost copy, but it won’t show the profile link. Then when I load that exact same file up onto my actual site it comes back broken??? I am also wanting to have the widget title work the same, saying login when not logged in, and “hi ‘username’ once logged in, but I’m not sure what code to change.
So this is what I have so far
<?php /** * Sidebar LoginLogout widget with Facebook Connect button **/ class Widget_LoginLogout extends WP_Widget { ////////////////////////////////////////////////////// //Init the Widget function Widget_LoginLogout() { $this->WP_Widget( false, "WP-FB AutoConnect", array( 'description' => 'A sidebar Login/Logout form with Facebook Connect button' ) ); } ////////////////////////////////////////////////////// //Output the widget's content. function widget( $args, $instance ) { //Get args and output the title extract( $args ); echo $before_widget; $title = apply_filters('widget_title', $instance['title']); if( $title ) echo $before_title . $title . $after_title; //If logged in, show "Welcome, User!" if( is_user_logged_in() ): ?> <div id="LoginWithAjax"> <?php global $current_user; global $user_level; global $wpmu_version; get_currentuserinfo(); ?> <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td class="avatar" id="LoginWithAjax_Avatar"> <?php echo get_avatar( $current_user->ID, $size = '50' ); ?> </td> <td id="LoginWithAjax_Info"> <?php //Admin URL if ( $lwa_data['profile_link'] == '1' ) { if( function_exists('bp_loggedin_user_link') ){ ?> <a href="<?php bp_loggedin_user_link(); ?>"><?php echo strtolower(__('Profile')) ?></a><br/> <?php }else{ ?> <a href="<?php bloginfo('wpurl') ?>/wp-admin/profile.php"><?php echo strtolower(__('Profile')) ?></a><br/> <?php } } //Logout URL ?> <a id="wp-logout" href="<?php echo wp_logout_url() ?>"><?php echo strtolower(__( 'Log Out' )) ?></a><br /> <?php //Blog Admin if( !empty($wpmu_version) || $user_level > 8 ) { ?> <a href="<?php bloginfo('wpurl') ?>/wp-admin/"><?php _e("blog admin", 'loginwithajax'); ?></a> <?php } ?> </td> </tr> </table> </div> <?php //Otherwise, show the login form (with Facebook Connect button) else: ?> <form name='loginform' id='loginform' action='<?php echo get_settings('siteurl')?>/wp-login.php' method='post'> <label>User:</label><br /> <input type='text' name='log' id='user_login' class='input' tabindex='20' /><input type='submit' name='wp-submit' id='wp-submit' value='Login' tabindex='23' /><br /> <label>Pass:</label><br /> <input type='password' name='pwd' id='user_pass' class='input' tabindex='21' /> <span id="forgotText"><a href="<?php echo get_settings('siteurl')?>/wp-login.php?action=lostpassword"><?php _e('Forgot')?>?</a></span><br /> <?php //echo "<input name='rememberme' type='hidden' id='rememberme' value='forever' />";?> <?php echo wp_register('',''); ?> <input type='hidden' name='redirect_to' value='<?php echo htmlspecialchars($_SERVER['REQUEST_URI'])?>' /> </form> <?php global $opt_jfb_hide_button; if( !get_option($opt_jfb_hide_button) ) { jfb_output_facebook_btn(); //jfb_output_facebook_init(); This is output in wp_footer as of 1.5.4 jfb_output_facebook_callback(); } endif; echo $after_widget; } ////////////////////////////////////////////////////// //Update the widget settings function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = $new_instance['title']; return $instance; } //////////////////////////////////////////////////// //Display the widget settings on the widgets admin panel function form( $instance ) { ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php echo 'Title:'; ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $instance['title']; ?>" /> </p> <?php } } //Register the widget add_action( 'widgets_init', 'register_jfbLogin' ); function register_jfbLogin() { register_widget( 'Widget_LoginLogout' ); } ?>
Can anyone help me?
Thanks in advance
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Plugin: WP-FB-AutoConnect] Changing Widget layout?’ is closed to new replies.