From a373e6f500e172fed02ea6c892b69af69da4f688 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sun, 11 Jan 2009 08:33:28 +0000 Subject: trac750 Automatically update Identi.ca profile box with user's latest dent --- lib/facebookaction.php | 55 ------------------------------------------------ lib/facebookutil.php | 57 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 56 deletions(-) (limited to 'lib') diff --git a/lib/facebookaction.php b/lib/facebookaction.php index 04bbd67ba..ddf81c034 100644 --- a/lib/facebookaction.php +++ b/lib/facebookaction.php @@ -29,61 +29,6 @@ class FacebookAction extends Action parent::handle($args); } - function update_profile_box($facebook, $fbuid, $user) - { - - $notice = $user->getCurrentNotice(); - - # Need to include inline CSS for styling the Profile box - - $style = ''; - - $html = Facebookaction::render_notice($notice); - - - $fbml = "$style $html"; - $fbml .= "$style $html"; - - $fbml_main = "$style $html"; - - $facebook->api_client->profile_setFBML(null, $fbuid, $fbml, null, null, $fbml_main); - } - - # Display methods - function show_header($selected = 'Home', $msg = null, $success = false) { diff --git a/lib/facebookutil.php b/lib/facebookutil.php index e844dd09a..2529b8a4b 100644 --- a/lib/facebookutil.php +++ b/lib/facebookutil.php @@ -48,4 +48,59 @@ function start_fbml($indent = true) $xw = new XMLWriter(); $xw->openURI('php://output'); $xw->setIndent($indent); -} \ No newline at end of file +} + +function update_profile_box($facebook, $fbuid, $user, $notice) +{ + + // Need to include inline CSS for styling the Profile box + + $style = ''; + + global $xw; + $xw = new XMLWriter(); + $xw->openMemory(); + + $item = new NoticeListItem($notice); + $item->show(); + + $fbml = "$style " . $xw->outputMemory(false) . ""; + $fbml .= "$style " . $xw->outputMemory(false) . ""; + + $fbml_main = "$style " . $xw->outputMemory(false) . ""; + + $facebook->api_client->profile_setFBML(null, $fbuid, $fbml, null, null, $fbml_main); +} -- cgit v1.2.3-54-g00ecf