Wordpress MU + BuddyPress + WPBook

18 views
Skip to first unread message

NTulip

unread,
Oct 6, 2009, 2:51:59 PM10/6/09
to ScholarPress Dev
Hello

Thank you for building plugin. It it awesome.

I am running wordpress MU + BuddyPress and I've installed the WPBook
extension. I've performed the necessary steps on facebook for the
application and here is what I have:

The application:
http://apps.facebook.com/anglerspot/

The blog URL:
http://anglerspot.com/blog/

On facebook, clicking on the first article link just takes me back to
the facebook app. Am I missing something?

John Eckman

unread,
Oct 6, 2009, 2:58:09 PM10/6/09
to scholarp...@googlegroups.com
NTuiip - what have you set as the callback url of your Facebook
application?

I'd bet the problem you're running into is that your home page has /
blog/ in it, but your permalinks don't.

WPBook expects (I should probably say requires, but I'm hoping to fix
it) that your permalinks are "below" your homepage url.

If http://anglerspot.com/blog/ is your callback url, but your
permalinks look like:
http://anglerspot.com/2009/09/21/hello-world/

The facebook app will instead be looking for a page like:
http://anglerspot.com/blog/2009/09/21/hello-world/

And since that doesn't exist it just shows the home page again.

If you add /blog/ into your permalinks it should be fine - or you may
be able to set an rewrite rule using apache that makes those work.

In the long run, I need to have two different variables set;
- the blog domain, used to calculate permalinks (in your case http://anglerspot.com/
)
- the blog home page, used to show the main canvas page (in your case http://anglerspot.com/blog/
)
----------------------------------------
John Eckman
eckma...@gmail.com
http://www.johneckman.com/





John Eckman

unread,
Oct 6, 2009, 3:03:33 PM10/6/09
to scholarp...@googlegroups.com
Or maybe it's the other way around - the Facebook app calculates the
permalink and removes the callback from it, so that this url:

http://apps.facebook.com/anglerspot/blog/2009/09/21/hello-world/

Gets translated into:

http://anglerspot.com/blog/blog/2009/09/21/hello-world/

which doesn't work.

If you look at the page when you clicked on the link, and view frame
info you see facebook is trying to load into the iframe of the app
this url;

http://anglerspot.com/blog/blog/2009/09/21/hello-world/

(I cut out all the query-string variables facebook adds).

So basically something's gone wrong in WPBook's attempt to create a
permalink from your existing blog's url and the permalink it gets from
the default Wordpress function.




On Oct 6, 2009, at 2:51 PM, NTulip wrote:

>

NTulip

unread,
Oct 6, 2009, 3:16:46 PM10/6/09
to ScholarPress Dev
Cool - i will take a look and make sure the permalinks are setup
correctly.
> eckman.j...@gmail.comhttp://www.johneckman.com/

NTulip

unread,
Oct 6, 2009, 3:38:58 PM10/6/09
to ScholarPress Dev
You are right. (awesome firebug info when dealing with the facebook
app)

Looks like FB is calling:

http://anglerspot.com/blog/blog/2009/09/21/hello-world/?fb_sig_in_iframe=1&fb_sig_iframe_key=BLAH
which shows the list of link

The correct link should be:

http://anglerspot.com/blog/2009/09/21/hello-world/?fb_sig_in_iframe=1&fb_sig_iframe_key=BLAH

The permalinks are set as Custom: /blog/%year%/%monthnum%/%day%/
%postname%/

So how do I fix this since I have /blog/ as the canvas url on
facebook?

Thank you

John Eckman

unread,
Oct 6, 2009, 4:05:12 PM10/6/09
to scholarp...@googlegroups.com
The problem is that in the current version I'm not sure you can.

If you set the callback url to just be:
http://anglerspot.com/

Then the permalinks will work, but your main canvas url will be wrong,
since your blog's homepage is http://anglerspot.com/blog/

If you set the callback url correctly, but change your permalinks to
not have /blog/ in them, does that work?

I don't think so, because WPBook will be looking for them at /blog/
2009/09 etc. but the blog will be hosting them at anglerspot.com/
2009/09 etc.

I think you may have to edit the code directly - as a hack until I get
this fixed.

There are at least two places, unfortunately, where an offset is
calculated as a way to determine what the permalink should be inside
FB - in WPBook.php, it's at:

Lines 463-469
Lines 538-543

In each case, you'll need to change the offset, adding 5 more chars
(blog/)

So change:
$my_offset = strlen(get_option('home'));

to
$my_offset = strlen(get_option('home')) + 5;

in both places

Leave your callback url set to http://anglerspot.com/blog/
and leave the /blog/ part in your permalink structure

That should do it

NTulip

unread,
Oct 6, 2009, 4:12:15 PM10/6/09
to ScholarPress Dev
That's so awesome. it fixed it. Thank you John.

On Oct 6, 4:05 pm, John Eckman <eckman.j...@gmail.com> wrote:
> The problem is that in the current version I'm not sure you can.
>
> If you set the callback url to just be:
>        http://anglerspot.com/
>
> Then the permalinks will work, but your main canvas url will be wrong,  
> since your blog's homepage ishttp://anglerspot.com/blog/
>
> If you set the callback url correctly, but change your permalinks to  
> not have /blog/ in them, does that work?
>
> I don't think so, because WPBook will be looking for them at /blog/
> 2009/09 etc. but the blog will be hosting them at anglerspot.com/
> 2009/09 etc.
>
> I think you may have to edit the code directly - as a hack until I get  
> this fixed.
>
> There are at least two places, unfortunately, where an offset is  
> calculated as a way to determine what the permalink should be inside  
> FB - in WPBook.php, it's at:
>
> Lines 463-469
> Lines 538-543
>
> In each case, you'll need to change the offset, adding 5 more chars  
> (blog/)
>
> So change:
>                 $my_offset = strlen(get_option('home'));
>
> to
>                 $my_offset = strlen(get_option('home')) + 5;
>
> in both places
>
> Leave your callback url set tohttp://anglerspot.com/blog/
> and leave the /blog/ part in your permalink structure
>
> That should do it
>
> On Oct 6, 2009, at 3:38 PM, NTulip wrote:
>
>
>
>
>
>
>
> > You are right. (awesome firebug info when dealing with the facebook
> > app)
>
> > Looks like FB is calling:
>
> >http://anglerspot.com/blog/blog/2009/09/21/hello-world/?fb_sig_in_ifr...
> > which shows the list of link
>
> > The correct link should be:
>
> >http://anglerspot.com/blog/2009/09/21/hello-world/?fb_sig_in_iframe=1...
> eckman.j...@gmail.comhttp://www.johneckman.com/
Reply all
Reply to author
Forward
0 new messages