A few problems after install.

Hello,
I just purchased UF and installed on my site here.

http://apps.facebook.com/costaclassifieds

it is of course a wordpress site which I am trying to run as a facebook app, to make it as transparent and as easy as possible for my users to use.

My first stumbling block is that it doesnt seem to 'register' when you click on register it brings up the auth form but from then it takes you out of the app and to where my page files actually exist which is
http://ads.gfabrecords.com/class

Im confused. please let me know how i can fix this and of course any further info you need from me.

regards,
Brad

  • bradholland

    Hi Joe,

    I 'THINK' i have done it.
    I found this code and placed it inside my header.

    perhaps I dont need all of this code??

    It does seem to be working exactly how i wanted it to, although it looks quite ugly at the moment.

    $opts = Wdfb_OptionsRegistry::get_instance();
    		$register = ($register && get_option('users_can_register')) ? $register : false;
    
    		if ($opts->get_option('wdfb_connect', 'allow_facebook_registration')) {
    			echo $before_widget;
    			if ($title) echo $before_title . $title . $after_title;
    
    			$user = wp_get_current_user();
    
    			if (!$user->ID) {
    				if (!$register) { // Do the simple thing first
    					echo '<p class="wdfb_login_button"><fb:login-button scope="' . Wdfb_Permissions::get_permissions() . '" redirect-url="' . wdfb_get_login_redirect() . '">' . __("Login with Facebook", 'wdfb') . '</fb:login-button></p>';
    				} else {
    					$fields = wdfb_get_registration_fields();
    					$force = ($opts->get_option('wdfb_connect', 'force_facebook_registration') && $opts->get_option('wdfb_connect', 'require_facebook_account'))
    						? 'fb_only=true&' : ''
    					;
    					echo '<div class="wdfb_connect_widget_container">';
    					echo '	<div class="wdfb_connect_widget_tabs"><ul class="wdfb_connect_widget_action_links">';
    					echo '		<li><a href="#wdfb_connect_widget_login"><span>' . __("Login", 'wdfb') . '</span></a></li>';
    					echo '		<li><a href="#wdfb_connect_widget_register"><span>' . __("Register", 'wdfb') . '</span></a></li>';
    					echo '	</ul></div>';
    					echo '	<div style="clear:both"></div>';
    					echo '	<div class="wdfb_connect_target" id="wdfb_connect_widget_login">';
    					echo '		<p class="wdfb_login_button"><fb:login-button scope="' . Wdfb_Permissions::get_permissions() . '" redirect-url="' . wdfb_get_login_redirect() . '">' . __("Login with Facebook", 'wdfb') . '</fb:login-button></p>';
    					echo '	</div>';
    					echo '	<div class="wdfb_connect_target" id="wdfb_connect_widget_register">';
    					echo '	<iframe src="http://www.facebook.com/plugins/registration.php?' . $force .
    						        'client_id=' . trim($opts->get_option('wdfb_api', 'app_key')) . '&' .
    						        'redirect_uri=' . urlencode(site_url('/wp-signup.php?action=register&fb_register=1')) . '&' .
    						        'fields=' . $fields . '&width=' . $width . '&locale=' . wdfb_get_locale() . '"
    						        scrolling="auto"
    						        frameborder="no"
    						        style="border:none; overflow:hidden; width:' . $width . 'px;"
    						        allowTransparency="true"
    						        width="' . $width . '"
    						        height="650">
    							</iframe>';
    					echo '	</div>';
    					echo '</div>';
    				}
    			} else {
    				$logout = site_url('wp-login.php?action=logout&redirect_to=' . rawurlencode(home_url()));
    				echo get_avatar($user->ID, 32);
    				echo "<p><a href='{$logout}'>" . __('Log out', 'wdfb') . "</a></p>";
    			}
    
    			echo $after_widget;
    		}
  • Vladislav

    Hi,

    If it's just the "connect" button you're after, the plugin actually comes with the Facebook connect button shortcode which may be useful in your scenario. If you want to embed it on your page or post, you can just use the "[wdfb_connect]" shortcode tag in your content. You can learn more about it and the other shortcodes on the plugin shortcode page.

    Also, if you wish to place the button somewhere within your template rather then in a post/page, you could add something like this to your template file where you wish the button to appear:

    <?php echo do_shortcode('[wdfb_connect]'); ?>

    If you also want the registration form, that's a bit more complex as there's much more code involved. I hope this helps.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.