idleStudios

Home | Projects | About
words & stuff...
.
fBoxes 0.1 Released
thursday, december 27, 2007 - 12.01 am
fBoxes is a php class for creating Facebook-style movable boxes in FBML/FBJS. It only works on Facebook FBML pages right now, no normal HTML support (yet). Boxes are fully movable, they can be locked in place, layout changes are saved automatically, multiple sets of boxes can be put on a single page (just initiate a new fBoxes object with a different id)
Download - View Demo

It supports storing user layouts in either a flat file or MySQL database. If you are using MySQL, remember to do your mysql_connect() before calling the load/save functions.

The simple configuration is at the top of fboxes.php:
// path to your fboxes ajax save script
public $ajax_save_url = '';

// 0 for flat file, 1 for MySQL (you will have to do
// mysql_connect() yourself before calling any load or save functions)
public $db_type = 0;

// for flat file db, box id will be appended
public $db_file_path = './fboxes_store/boxes_';

// for mysql, name of table
// CREATE TABLE fboxes_position (uid BIGINT UNSIGNED NOT NULL,
// id CHAR(16) NOT NULL, data TEXT NOT NULL, UNIQUE KEY (uid, id));
public $db_table_name = 'fboxes_position';

An example on how to use fBoxes is provided in the example_fboxes.php file.
comments
[...] idleStudios just unveiled an open source PHP class that is sure to help Facebook application developers easily create Facebook-like user interface components. Similar to the standard Facebook profile, fBoxes v0.1 enables developers to [...]
thursday, december 27, 2007 - 02.18 am
it is very perfect thanks
thursday, december 27, 2007 - 03.11 am
Amazing work !!!
saturday, december 29, 2007 - 12.59 pm
The code references a lib.php file but it is not included, is this an oversight or is it not important.
saturday, december 29, 2007 - 01.07 pm
a lib.php is where you include your facebook client library, set your $api_key and $secret, connect to mysql, etc.
6. Jm
wednesday, january 2, 2008 - 08.07 pm
hey bro amazing work ):)) but can u write a tutorial about installing the script , thanks in advance Jm
7. Alan Hester
tuesday, january 8, 2008 - 03.48 pm
After realizing that this will only work with PHP 5, I have it running but I have encountered another small problem. When trying to expand or collapse the box I get the following error: Line: 320 Char: 2 Error: ..._fboxes[...].movable is null or not an object. Code: 0
8. Rob
thursday, january 17, 2008 - 03.07 pm
I also noticed a similar error on the test site. This occurs when you click the collapse button of a movable box. The collapse button works for non-movable boxes, but in the case of a movable box it throws an error (a7548812845_fboxes[idx(a7548812845_fbx_act_id)] has no properties); however, a movable box will still collapse when you click anywhere on the title bar with the exception of the collapse button. This is on firefox 2.0.0.11
9. Gilles
sunday, january 20, 2008 - 12.59 pm
Thanks for that nice piece of work. I'm using it on zenbook (the dev version: zenbook-dev) and it works perfectly. I do not encounter the issue mentionned by rob and alan (using firefox 2.0.0.11 on ubuntu gutsy). Also it would be nice if there was a way to focus a box (as in the profile page) - perhaps through some exposed javascript interface.
thursday, january 24, 2008 - 11.55 am
Rob: Thanks for pointing that out, the bug has been fixed and I have posted a new version of fBoxes (0.1.5). Gilles: By 'focus' do you mean like scroll and highlight the box? I guess I could make it flash an outline, but FBJS doesn't provide any scrolling methods.
11. Gilles
friday, january 25, 2008 - 11.32 am
Indeed, I was referring to the "scroll and highlight"behaviour. I thought the animation lib facebook released a few weeks ago would allow to scroll the page. Too bad, but it's not like it is a mandatory feature..
12. Chris
friday, february 1, 2008 - 12.17 pm
this is marvelous stuff! decided to use it for our fb app.
but i found another little problem. fboxes-0.1.5 on IE6, after moving boxes around the narrow boxes (right) get screwed up.
however it works fine on on IE7 or firefox. is there any workaround for internet explorer 6?
friday, february 1, 2008 - 03.33 pm
change the line (should be #308) that reads
fbx_act.setStyle('width', ((fbx_ol.getClientWidth() ? fbx_ol.getClientWidth() : fbx_ol.getScrollWidth()) + 8) + 'px');


to just
fbx_act.setStyle('width', '');
14. Chris
friday, february 1, 2008 - 03.51 pm
thanks, works perfect
15. Alan
friday, february 15, 2008 - 04.11 pm
I am probably just being thick but I can't seem to get the MySQL option to work. I have tried putting the mysql_connect in fboxes and fboxes_save and it does not seem to work either way. No data ever makes it into the database. I know that the database connection works because it is used extensively for the rest of my application. Has anybody tried this with the MySQL option, any ideas?
saturday, february 16, 2008 - 06.24 pm
You are doing mysql_select_db() as well, right?
17. Alan
tuesday, february 19, 2008 - 12.05 pm
Yes. Here is the code for the function:

function get_db_conn() {
$conn = mysql_connect($GLOBALS['db_ip'], $GLOBALS['db_user'], $GLOBALS['db_pass']);
if (!$conn) {
echo "Unable to connect to DB: " . mysql_error();
exit;
}
if(!mysql_select_db($GLOBALS['db_name'], $conn)) {
echo "Unable to open DB: " . mysql_error();
exit;
}
return $conn;
}

It is used extensively throughout my application and seems to work fine in every other case.
18. Arvind Sharma
tuesday, march 18, 2008 - 01.35 pm
I have encountered a problem while using this script. It works fine if there are no scrollbars, but if we decrease the height of div and add overflow as auto then its not working properly.
19. Anonymous
tuesday, march 18, 2008 - 01.37 pm
Sorry missed this thing

It works fine in mozilla but gives problem in IE7
20. Anonymous
sunday, march 30, 2008 - 02.12 am
The download and demo links do not work. Have you taken down the scripts?
21. Ankit
friday, april 11, 2008 - 04.51 am
hi

i am using that code also i get error in my application sp can u plz tell me what i am missing and can u give me idea for drag and drop for image for ordering?
22. Hana
wednesday, may 21, 2008 - 01.18 am
I use Advanced Wall often these days. Once I uploaed any pics and images with the application,I realized I can just copy of the images on my hotmail and send them without attachment file. My friends can double-click on the images I copyed to see them. This is very convenient method for many things as I love using images on documents. I am just loving this wall. Thanks, thanks!
post a comment

Name:

E-mail: (will not be publicly visible)

Website:

Message:

«  Home


Contact

Get Firefox

Valid XHTML 1.1