TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,236
  • Total Topics: 21,353
  • Online today: 739
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 231
  • Total: 231

Need help with Facebook Javascript bloc...

Started by lextalionis, December 17, 2009, 05:28:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lextalionis

Link to my site: http://www.motleypixel.com
SMF version: SMF ver. 1.1.10
TP version: TP ver. 1.0 beta 4
Theme name and version: Black Rain
Browser Name and Version: IE 7.0.5730.10
Mods installed: TPReviews, iFrame, YouTube, Ads Management (all current for SMF 1.1.9)
Related Error messages: See below.

Trying to make the below javascript provided by Facebook work on my portal as a center top bloc:

<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US"></script><script type="text/javascript">FB.init("450e193a56f78651d8b47090dffca693");</script><fb:fan profile_id="169960296001" stream="1" connections="10" width="300"></fb:fan><div style="font-size:8px; padding-left:10px"><a href="http://www.facebook.com/pages/The-Motley-Pixel/169960296001">The Motley Pixel on Facebook</a> </div>

I'm wondering if maybe converted to php would work?  I atempted this but it didn't work.

Thanks,
Roy


Freddy

#1
I managed to get this to work okay.

Steps I took :

1) Add upper panel block.

2) Change Type to 'HTML & Javascript code'

3) Save the block so it updates the options.

4) Clicked on the <> button in the editor to swap to straight HTML.

5) Pasted in your code.

6) Set the display options and changed 'status' to 'on' and then saved it all again.

7) Works as shown in screenshot.

I would say that it doesn't seem layed out suitably for an upper panel block which is what I put it in.

lextalionis

Humm...thanks for the tip.  I tried several times, even deleted the bloc and started fresh...all I see is a worded link to the facebook page an no graphics.  I left it like this for you to check.

I agree about not being suitable for an upper panel bloc but I need to figure out how edit the width of a left/right block first before I use it there.

Thanks,
Roy

Freddy

If it's blocking the code from retrieving the info from Facebook, it might be a server issue.

I don't know much about that kind of thing, but IchBin is clued up on it.  Hopefully he will pop in later.

In the meantime I guess you could try testing the code on an external HTML page on the same domain, just to see if your server is actually allowing it to work properly.

lextalionis

Hummm okay yea something is up:  http://www.motleypixel.com/test.html  I will in the meantime head over to facebook developer wiki to read around.  Thanks for the helps and tips.

-Roy

Freddy

#5
Yeah, looks like a server issue then atm... and no problem - happy to try and help.

Mick

It looks like you added that code in a php block.   Add echo' before the code and add '; at the end of the code.  That's if you still using a php block.

lextalionis

Well I never got this one figured out.  It seems like something is being blocked w/in featureloader.js.php files, just can't seem to get it to resolved correctly.

-Roy

Lord Anubis

If you are still having trouble with this or if anyone else is having a problem, a solution is using the IFrame

<iframe scrolling="no" frameborder="0" src="http://www.facebook.com/connect/connect.php?id=YOUR_PAGE_ID&connections=10&stream=1&css=PATH_TO_STYLE_SHEET&locale=your_LOCALE" allowtransparency="true" style="border: none; width: 300px; height: 550px;"></iframe> <div style="font-size:8px; padding-left:10px"><a href="URL_TO_YOUR_PAGE">PAGE_NAME</a> on Facebook</div>

Here is the steps I took to get this working

1.  Go to http://www.facebook.com/facebook-widgets/fanbox.php
2.  Get the Javascript Code
3.  Use the Javascript code fill in the areas for the IFrame
4.  Add it to a scriptbox
5.  Save and turn on

For instance for yours lextalionis your would be:

<iframe scrolling="no" frameborder="0" src="http://www.facebook.com/connect/connect.php?id=169960296001&connections=10&stream=1&css=PATH_TO_STYLE_SHEET&locale=your_LOCALE" allowtransparency="true" style="border: none; width: 300px; height: 550px;"></iframe> <div style="font-size:8px; padding-left:10px""><a href="http://www.facebook.com/pages/The-Motley-Pixel/169960296001">The Motley Pixel on Facebook</a> </div>

Some editable areas:

1. connections = # ---> This is how many fans you would like to show (1-100)
2. Stream=# ---> How many threads you want to show on the box
3. Width / Height ---> well changes the size  :2funny:

Hope this helps others

lextalionis

Thanks for the help, this worked!  http://www.motleypixel.com/forum/index.php

Only problem is when I use my css the hyperlinks change to the same color as the background.  I suppose there's no way to change the Facebook BG color right?

-Roy

This website is proudly hosted on Crocweb Cloud Website Hosting.