Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Plugins & Atahualpa (http://forum.bytesforall.com/forumdisplay.php?f=16)
-   -   using wp_facebookconnect with Atahualpa (http://forum.bytesforall.com/showthread.php?t=4004)

nycgadgetgirl Oct 21, 2009 08:11 PM

using wp_facebookconnect with Atahualpa
 
The website: http://jennaandsnickers.com
WP version 2.8.5
Atahualpa version 3.3.2

The plugin: http://wordpress.org/extend/plugins/wp-facebookconnect/

I've been following the steps in this tutorial: http://projectheresy.com/public/begi...uide_fb_wp.pdf

I've activated the plugin, created a facebook application, entered my API and Secret into the settings. I'm at the point where I need to customize the theme files (page 20 in the tutorial).

Tried a few things without success. Want to save me from pulling out my hair and help me out with some code and directions of where to put it? I'd be super grateful!

nycgadgetgirl Oct 22, 2009 01:42 PM

If Flynn isn't around to help with code (I don't see a forum post from Flynn for the past week and a half), I'd happily take any advice anyone has on where to find help or another way to integrate facebook connect that may work with Atahualpa out of the box.

bushtool Oct 22, 2009 03:52 PM

I have tried to get this working without success. Not sure if it is atahualpa or the plugin or facebook that is the problem. Actually had to remove the plugin from the plugin directory in order to be able to login normally. After logging in I had to refresh the page to see that I was logged in. And then when I logged out, I remained logged in until I removed the plugin entirely from the plugin directory. So I gave up.

nycgadgetgirl Oct 22, 2009 04:00 PM

I wonder if you and I could combine our experiences to make it work. So far, the plug in isn't screwing up anything on my site, but I haven't added the Facebook Connect button to my comment section yet. How did you go about doing that? (In a regular theme, it would be a cinch, but I'm never quite sure how/where to make changes like these to the Atahualpa theme!)

bushtool Oct 23, 2009 10:25 AM

I would put it above this - <?php // Display Quicktags or allowed XHTML Tags

nycgadgetgirl Oct 23, 2009 03:53 PM

Quote:

Originally Posted by bushtool (Post 17359)
I would put it above this - <?php // Display Quicktags or allowed XHTML Tags

So, in the comments.php file just like in a regular theme? I tried making changes there and nothing happened. I thought maybe it needed to be somewhere else or I needed to add some custom functions. Maybe I'll play around with it some more tonight since I haven't heard from Flynn yet. I'd really like to get this pending post published.

nycgadgetgirl Oct 23, 2009 04:55 PM

Nope, that doesn't work. There is more required than just adding the facebook connect button to the comments.php or comments-paged.php file. Unfortunately, I'm not well versed enough in how Atahualpa is constructed to be able to figure it out.

I think something similar to what is in the tutorial needs to be added to the theme functions (functions.php) file first. I've tried doing it myself, but I just keep breaking the site and getting syntax errors.

So. Need. Help. :(

bushtool Oct 23, 2009 05:49 PM

I put it there today and it did not show up either. I have forgotten what I did previously to get it to show up. I've already spent hours wrestling with this and another similar plugin to no avail. When that happens I usually give up for a while and sometimes someone puts out a step by step tutorial that actually works.

Hopefully others on this forum may have succeeded in getting this working and will share there wisdom.

nycgadgetgirl Oct 23, 2009 06:50 PM

I GOT IT TO WORK!!!!!

So far it is working in Chrome. About to test in Firefox and IE. If it works, I'll post the steps.

nycgadgetgirl Oct 23, 2009 07:45 PM

Solution
 
OK, to use Facebook Connect

1) install and activate the wp_facebookconnect plugin
2) create a Facebook application (the tutorial mentioned above explains the steps if you need help)
3) put the following code in your theme functions file (replacing your-API-key and http://www.yoursite.com/ of course)
Code:

<?php

function add_fb_xml_ns($content) {
  return ' xmlns:fb="http://www.facebook.com/2008/fbml" ' . $content;
}

function fb_comment_box() {
  if (is_single()) {
  ?>
<a name="fb_comments"></a>
<p class="fb-comments">Comments:</p>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<fb:comments></fb:comments>
<script type="text/javascript"> FB.init("your-API-key", "http://www.jyoursite.com/xd_receiver.html"); </script>
  <?php
 }
}

function fb_comment_plug() {
  if (!is_single() && !is_page()) {
?>
<p class="fb-comments"><a href="<?php echo get_permalink(); ?>#fb_comments">Add a comment</a></p>
<?
 }
}

if ( is_admin() ) {
    global $current_user;
    get_currentuserinfo();
    $user_info = get_userdata($current_user->ID);
    if ( !is_null($user_info->fbuid) ) die( 'No access to WP-Admin for Facebook users!' );
}

?>

4) Add the following to your comments.php file
Code:

<?php if ( is_user_logged_in() ) { fbc_display_login_state(); } else {  fbc_display_login_button(); } ?>
That's it!

SupraTT Dec 10, 2009 08:05 PM

Hi NYCGadgetGirl or anyone that can help,

I followed the guide and your steps... but I am getting an error when I copy the code to functions.php:

Warning: Cannot modify header information - headers already sent by (output started at /home/XXXX/domains/mydomain.com/public_html/wp-content/themes/atahualpa344/functions.php:36) in /home/XXXX/domains/mydomain.com/public_html/wp-includes/pluggable.php on line 865

Where in functions.php do I need the put the code into?

Thank you,

SupraTT

Update: I did find an error on the above code, missing "php" after <? on 1 line... but still getting the error when I try to logout now.

nycgadgetgirl Dec 10, 2009 08:13 PM

I just dropped it at the end when I did it. Make sure you didn't miss any brackets, etc. when you copy/pasted.

SupraTT Dec 10, 2009 08:43 PM

Hi NYC Gadget Girl,

Thanks for the quick reply... I tried pasting it in the bottom of the functions.php and still getting errors... is the code you posted a straight copy/paste from your functions.php?

Thank you,

SupraTT

nycgadgetgirl Dec 10, 2009 09:32 PM

Yes, that's exactly the same code I put in mine, except for the domain name and API key of course.

SupraTT Dec 17, 2009 05:18 PM

Hi NYC Gadget Girl,

Thank for the help. It seems to be wrking fine now. I just had to fix the missing "php" in your code and paste the code directly at the end of functions.php.

SupraTT

SupraTT Dec 19, 2009 12:20 AM

Hi NYCGadgetGirl or anyone else using Facebook Connect,

I got the facebook connect to work, but when I login using facebook connect, I just get the WP comments box. How can I get the FB comment box to appear?

NYCGadgetGirl, the tutorial you posted shows the FB comment box when the user logins using facebook connect.

Thank you

SupraTT


All times are GMT -6. The time now is 01:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.