summaryrefslogtreecommitdiff
path: root/lib/facebookutil.php
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-01-11 08:33:28 +0000
committerZach Copley <zach@controlyourself.ca>2009-01-11 08:33:28 +0000
commita373e6f500e172fed02ea6c892b69af69da4f688 (patch)
tree438f470c8c26f2eddcd6d60a8d5ce7edc4966458 /lib/facebookutil.php
parent689be142158dae5af1516cb38b947f0364d725dd (diff)
trac750 Automatically update Identi.ca profile box with user's latest dent
Diffstat (limited to 'lib/facebookutil.php')
-rw-r--r--lib/facebookutil.php57
1 files changed, 56 insertions, 1 deletions
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 = '<style>
+ #notices {
+ clear: both;
+ margin: 0 auto;
+ padding: 0;
+ list-style-type: none;
+ width: 600px;
+ border-top: 1px solid #dec5b5;
+ }
+ #notices a:hover {
+ text-decoration: underline;
+ }
+ .notice_single {
+ clear: both;
+ display: block;
+ margin: 0;
+ padding: 5px 5px 5px 0;
+ min-height: 48px;
+ font-family: Georgia, "Times New Roman", Times, serif;
+ font-size: 13px;
+ line-height: 16px;
+ border-bottom: 1px solid #dec5b5;
+ background-color:#FCFFF5;
+ opacity:1;
+ }
+ .notice_single:hover {
+ background-color: #f7ebcc;
+ }
+ .notice_single p {
+ display: inline;
+ margin: 0;
+ padding: 0;
+ }
+ </style>';
+
+ global $xw;
+ $xw = new XMLWriter();
+ $xw->openMemory();
+
+ $item = new NoticeListItem($notice);
+ $item->show();
+
+ $fbml = "<fb:wide>$style " . $xw->outputMemory(false) . "</fb:wide>";
+ $fbml .= "<fb:narrow>$style " . $xw->outputMemory(false) . "</fb:narrow>";
+
+ $fbml_main = "<fb:narrow>$style " . $xw->outputMemory(false) . "</fb:narrow>";
+
+ $facebook->api_client->profile_setFBML(null, $fbuid, $fbml, null, null, $fbml_main);
+}