diff options
author | Zach Copley <zach@controlyourself.ca> | 2009-01-18 06:12:47 +0000 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2009-01-18 06:12:47 +0000 |
commit | 8fdf888edbd74e707d2698c7625dc90b22f0aeef (patch) | |
tree | 72af2801ce38ae37064e9f14a3bf47597d0d963f /lib | |
parent | 3e18c2f0f8bbab01e16f66254dc9eadc9e1ffd60 (diff) |
trac750 Javascript file for Facebook app
Diffstat (limited to 'lib')
-rw-r--r-- | lib/facebookaction.php | 15 | ||||
-rw-r--r-- | lib/facebookutil.php | 10 |
2 files changed, 21 insertions, 4 deletions
diff --git a/lib/facebookaction.php b/lib/facebookaction.php index 1bf026281..a8f16b34a 100644 --- a/lib/facebookaction.php +++ b/lib/facebookaction.php @@ -37,7 +37,11 @@ class FacebookAction extends Action common_element('link', array('rel' => 'stylesheet', 'type' => 'text/css', - 'href' => get_facebook_css())); + 'href' => getFacebookCSS())); + + common_element('script', array('type' => 'text/javascript', + 'src' => getFacebookJS()), + ' '); common_element_start('a', array('class' => 'url home bookmark', 'href' => common_local_url('public'))); @@ -58,6 +62,12 @@ class FacebookAction extends Action start_fbml(); + common_element_start('fb:if-section-not-added', array('section' => 'profile')); + common_element_start('span', array('id' => 'add_to_profile')); + common_element('fb:add-section-button', array('section' => 'profile')); + common_element_end('span'); + common_element_end('fb:if-section-not-added'); + $this->showLogo(); common_element_start('dl', array("id" => 'site_nav_local_views')); @@ -141,8 +151,7 @@ class FacebookAction extends Action common_element('link', array('rel' => 'stylesheet', 'type' => 'text/css', - 'href' => get_facebook_css())); - + 'href' => getFacebookCSS())); $this->showLogo(); diff --git a/lib/facebookutil.php b/lib/facebookutil.php index 532e9c9d7..61469b3c6 100644 --- a/lib/facebookutil.php +++ b/lib/facebookutil.php @@ -105,7 +105,7 @@ function update_profile_box($facebook, $fbuid, $user, $notice) $facebook->api_client->profile_setFBML(null, $fbuid, $fbml, null, null, $fbml_main); } -function get_facebook_css() +function getFacebookCSS() { # Add a timestamp to the CSS file so Facebook cache wont ignore our changes $ts = filemtime(theme_file('facebookapp.css')); @@ -113,6 +113,14 @@ function get_facebook_css() return $cssurl; } +function getFacebookJS() { + + # Add a timestamp to the FBJS file so Facebook cache wont ignore our changes + $ts = filemtime(INSTALLDIR.'/js/facebookapp.js'); + $jsurl = common_path('js/facebookapp.js') . "?ts=$ts"; + return $jsurl; +} + class FacebookNoticeList extends NoticeList { |