diff options
author | Evan Prodromou <git@evanprodromou.name> | 2009-01-24 10:38:11 +0100 |
---|---|---|
committer | Evan Prodromou <git@evanprodromou.name> | 2009-01-24 10:38:11 +0100 |
commit | 1b07e65277fafde9e8b9e1809e012d4e954fc2c2 (patch) | |
tree | fe701d0998fb59cd26f0ea160b659d3f03ee37e8 /lib | |
parent | 8638479cb6287a4c22e485ba71fab4b12a6fc40f (diff) | |
parent | cf7908a9715fe91836aa41d5bcf9f32e33be8644 (diff) |
Merge branch 'master' of evan@dev.controlyourself.ca:/var/www/trunk
Diffstat (limited to 'lib')
-rw-r--r-- | lib/facebookaction.php | 24 | ||||
-rw-r--r-- | lib/facebookutil.php | 35 | ||||
-rw-r--r-- | lib/searchaction.php | 16 | ||||
-rw-r--r-- | lib/searchgroupnav.php | 2 |
4 files changed, 32 insertions, 45 deletions
diff --git a/lib/facebookaction.php b/lib/facebookaction.php index 92130e199..c781b86f4 100644 --- a/lib/facebookaction.php +++ b/lib/facebookaction.php @@ -95,21 +95,35 @@ class FacebookAction extends Action function showStylesheets() { + // Add a timestamp to the file so Facebook cache wont ignore our changes + $ts = filemtime(INSTALLDIR.'/theme/base/css/display.css'); $this->element('link', array('rel' => 'stylesheet', 'type' => 'text/css', - 'href' => getFacebookBaseCSS())); - + 'href' => theme_path('css/display.css', 'base') . '?ts=' . $ts)); + + $theme = common_config('site', 'theme'); + + $ts = filemtime(INSTALLDIR. '/theme/' . $theme .'/css/display.css'); + + $this->element('link', array('rel' => 'stylesheet', + 'type' => 'text/css', + 'href' => theme_path('css/display.css', null) . '?ts=' . $ts)); + + $ts = filemtime(INSTALLDIR.'/theme/base/css/facebookapp.css'); + $this->element('link', array('rel' => 'stylesheet', 'type' => 'text/css', - 'href' => getFacebookThemeCSS())); + 'href' => theme_path('css/facebookapp.css', 'base') . '?ts=' . $ts)); } function showScripts() { + // Add a timestamp to the file so Facebook cache wont ignore our changes + $ts = filemtime(INSTALLDIR.'/js/facebookapp.js'); + $this->element('script', array('type' => 'text/javascript', - 'src' => getFacebookJS()), - ' '); + 'src' => common_path('js/facebookapp.js') . '?ts=' . $ts)); } /** diff --git a/lib/facebookutil.php b/lib/facebookutil.php index a2a2d7cb1..8454590d6 100644 --- a/lib/facebookutil.php +++ b/lib/facebookutil.php @@ -32,7 +32,8 @@ function getFacebookNotices($since) 'FROM notice ' . 'JOIN foreign_link ' . 'WHERE notice.profile_id = foreign_link.user_id ' . - 'AND foreign_link.service = 2'; + 'AND foreign_link.service = 2 ' . + 'ORDER BY notice.created DESC'; // XXX: What should the limit be? return Notice::getStreamDirect($qry, 0, 100, 0, 0, null, $since); @@ -45,38 +46,6 @@ function getFacebook() return new Facebook($apikey, $secret); } -function startFBML($indent = true) -{ - global $xw; - $xw = new XMLWriter(); - $xw->openURI('php://output'); - $xw->setIndent($indent); -} - -function getFacebookBaseCSS() -{ - # Add a timestamp to the CSS file so Facebook cache wont ignore our changes - $ts = filemtime(INSTALLDIR.'/theme/base/css/facebookapp.base.css'); - $cssurl = theme_path('css/facebookapp.base.css', 'base') . "?ts=$ts"; - return $cssurl; -} - -function getFacebookThemeCSS() -{ - # Add a timestamp to the CSS file so Facebook cache wont ignore our changes - $ts = filemtime(theme_file('css/facebookapp.theme.css')); - $cssurl = theme_path('css/facebookapp.theme.css') . "?ts=$ts"; - 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; -} - function updateProfileBox($facebook, $flink, $notice) { $fbaction = new FacebookAction($output='php://output', $indent=true, $facebook, $flink); $fbaction->updateProfileBox($notice); diff --git a/lib/searchaction.php b/lib/searchaction.php index 70e63146a..fdfb8dc5a 100644 --- a/lib/searchaction.php +++ b/lib/searchaction.php @@ -114,17 +114,21 @@ class SearchAction extends Action $q = $this->trimmed('q'); $page = $this->trimmed('page', 1); $this->elementStart('form', array('method' => 'get', - 'id' => 'login', + 'id' => 'form_search', + 'class' => 'form_settings', 'action' => common_local_url($this->trimmed('action')))); - $this->elementStart('p'); + $this->elementStart('fieldset'); + $this->element('legend', null, _('Search site')); + $this->elementStart('ul', 'form_data'); + $this->elementStart('li'); if (!isset($config['site']['fancy']) || !$config['site']['fancy']) { $this->hidden('action', $this->trimmed('action')); } - $this->input('q', '', $q); - $this->text(' '); + $this->input('q', 'Keyword(s)', $q); $this->submit('search', 'Search'); - - $this->elementEnd('p'); + $this->elementEnd('li'); + $this->elementEnd('ul'); + $this->elementEnd('fieldset'); $this->elementEnd('form'); if ($q) { $this->showResults($q, $page); diff --git a/lib/searchgroupnav.php b/lib/searchgroupnav.php index 9fe3c2379..3ba3f9cd9 100644 --- a/lib/searchgroupnav.php +++ b/lib/searchgroupnav.php @@ -82,7 +82,7 @@ class SearchGroupNav extends Widget $this->out->menuItem(common_local_url('noticesearch', $args), _('Notice'), _('Find content of notices'), $action_name == 'noticesearch', 'nav_search_notice'); $this->out->menuItem(common_local_url('groupsearch', $args), _('Group'), - _('Find groups on this site'), $action_name == 'groupsearch', 'nav_search_notice'); + _('Find groups on this site'), $action_name == 'groupsearch', 'nav_search_group'); $this->action->elementEnd('ul'); } } |