summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/action.php69
-rw-r--r--lib/error.php2
-rw-r--r--lib/galleryaction.php2
-rw-r--r--lib/jsonsearchresultslist.php2
-rw-r--r--lib/peoplesearchresults.php2
-rw-r--r--lib/personal.php2
-rw-r--r--lib/popularnoticesection.php25
-rw-r--r--lib/profileaction.php5
-rw-r--r--lib/searchaction.php2
9 files changed, 85 insertions, 26 deletions
diff --git a/lib/action.php b/lib/action.php
index ecd1978f2..3e43ffe3e 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -124,6 +124,7 @@ class Action extends HTMLOutputter // lawsuit
$this->showShortcutIcon();
$this->showStylesheets();
$this->showScripts();
+ $this->showRelationshipLinks();
$this->showOpenSearch();
$this->showFeeds();
$this->showDescription();
@@ -194,37 +195,33 @@ class Action extends HTMLOutputter // lawsuit
if (Event::handle('StartShowLaconicaStyles', array($this))) {
$this->element('link', array('rel' => 'stylesheet',
'type' => 'text/css',
- 'href' => theme_path('base/css/display.css') . '?version=' . LACONICA_VERSION,
- 'media' => 'screen, projection, tv'));
- $this->element('link', array('rel' => 'stylesheet',
- 'type' => 'text/css',
- 'href' => skin_path('css/display.css') . '?version=' . LACONICA_VERSION,
+ 'href' => theme_path('css/display.css', null) . '?version=' . LACONICA_VERSION,
'media' => 'screen, projection, tv'));
if (common_config('site', 'mobile')) {
$this->element('link', array('rel' => 'stylesheet',
'type' => 'text/css',
- 'href' => theme_path('base/css/mobile.css') . '?version=' . LACONICA_VERSION,
+ 'href' => theme_path('css/mobile.css', 'base') . '?version=' . LACONICA_VERSION,
// TODO: "handheld" CSS for other mobile devices
'media' => 'only screen and (max-device-width: 480px)')); // Mobile WebKit
}
$this->element('link', array('rel' => 'stylesheet',
'type' => 'text/css',
- 'href' => theme_path('base/css/print.css') . '?version=' . LACONICA_VERSION,
+ 'href' => theme_path('css/print.css', 'base') . '?version=' . LACONICA_VERSION,
'media' => 'print'));
Event::handle('EndShowLaconicaStyles', array($this));
}
if (Event::handle('StartShowUAStyles', array($this))) {
$this->comment('[if IE]><link rel="stylesheet" type="text/css" '.
- 'href="'.theme_path('base/css/ie.css').'?version='.LACONICA_VERSION.'" /><![endif]');
+ 'href="'.theme_path('css/ie.css', 'base').'?version='.LACONICA_VERSION.'" /><![endif]');
foreach (array(6,7) as $ver) {
- if (file_exists(theme_file('base/css/ie'.$ver.'.css'))) {
+ if (file_exists(theme_file('css/ie'.$ver.'.css', 'base'))) {
// Yes, IE people should be put in jail.
$this->comment('[if lte IE '.$ver.']><link rel="stylesheet" type="text/css" '.
- 'href="'.theme_path('base/css/ie'.$ver.'.css').'?version='.LACONICA_VERSION.'" /><![endif]');
+ 'href="'.theme_path('css/ie'.$ver.'.css', 'base').'?version='.LACONICA_VERSION.'" /><![endif]');
}
}
$this->comment('[if IE]><link rel="stylesheet" type="text/css" '.
- 'href="'.skin_path('css/ie.css').'?version='.LACONICA_VERSION.'" /><![endif]');
+ 'href="'.theme_path('css/ie.css', null).'?version='.LACONICA_VERSION.'" /><![endif]');
Event::handle('EndShowUAStyles', array($this));
}
Event::handle('EndShowStyles', array($this));
@@ -265,6 +262,19 @@ class Action extends HTMLOutputter // lawsuit
}
/**
+ * Show document relationship links
+ *
+ * SHOULD overload
+ *
+ * @return nothing
+ */
+ function showRelationshipLinks()
+ {
+ // output <link> elements with appropriate HTML4.01 link types:
+ // http://www.w3.org/TR/html401/types.html#type-links
+ }
+
+ /**
* Show OpenSearch headers
*
* @return nothing
@@ -791,9 +801,12 @@ class Action extends HTMLOutputter // lawsuit
*
* MAY override
*
+ * @param array $args other arguments
+ *
* @return boolean is read only action?
*/
- function isReadOnly()
+
+ function isReadOnly($args)
{
return false;
}
@@ -1041,4 +1054,36 @@ class Action extends HTMLOutputter // lawsuit
{
return null;
}
+
+ /**
+ * Generate document metadata for sequential navigation
+ *
+ * @param boolean $have_before is there something before?
+ * @param boolean $have_after is there something after?
+ * @param integer $page current page
+ * @param string $action current action
+ * @param array $args rest of query arguments
+ *
+ * @return nothing
+ */
+ function sequenceRelationships($have_next, $have_previous, $page, $action, $args=null)
+ {
+ // Outputs machine-readable pagination in <link> elements.
+ // Pattern taken from $this->pagination() method.
+
+ // "next" is equivalent to "after"
+ if ($have_next) {
+ $pargs = array('page' => $page-1);
+ $this->element('link', array('rel' => 'next',
+ 'href' => common_local_url($action, $args, $pargs),
+ 'title' => _('Next')));
+ }
+ // "previous" is equivalent to "before"
+ if ($have_previous=true) { // FIXME
+ $pargs = array('page' => $page+1);
+ $this->element('link', array('rel' => 'prev',
+ 'href' => common_local_url($action, $args, $pargs),
+ 'title' => _('Previous')));
+ }
+ }
}
diff --git a/lib/error.php b/lib/error.php
index 526d9f81b..282682133 100644
--- a/lib/error.php
+++ b/lib/error.php
@@ -93,7 +93,7 @@ class ErrorAction extends Action
return $this->message;
}
- function isReadOnly()
+ function isReadOnly($args)
{
return true;
}
diff --git a/lib/galleryaction.php b/lib/galleryaction.php
index 8e21d7393..0484918ce 100644
--- a/lib/galleryaction.php
+++ b/lib/galleryaction.php
@@ -76,7 +76,7 @@ class GalleryAction extends Action
return true;
}
- function isReadOnly()
+ function isReadOnly($args)
{
return true;
}
diff --git a/lib/jsonsearchresultslist.php b/lib/jsonsearchresultslist.php
index 0cdcf0c51..f786c20a8 100644
--- a/lib/jsonsearchresultslist.php
+++ b/lib/jsonsearchresultslist.php
@@ -232,7 +232,7 @@ class ResultItem
$this->profile_image_url = ($avatar) ?
$avatar->displayUrl() : Avatar::defaultImage(AVATAR_STREAM_SIZE);
- $this->created_at = date('r', $this->notice->created);
+ $this->created_at = common_date_rfc2822($this->notice->created);
}
/**
diff --git a/lib/peoplesearchresults.php b/lib/peoplesearchresults.php
index f8ab7cf3b..d3f840852 100644
--- a/lib/peoplesearchresults.php
+++ b/lib/peoplesearchresults.php
@@ -67,7 +67,7 @@ class PeopleSearchResults extends ProfileList
return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text));
}
- function isReadOnly()
+ function isReadOnly($args)
{
return true;
}
diff --git a/lib/personal.php b/lib/personal.php
index e46350c63..f92732375 100644
--- a/lib/personal.php
+++ b/lib/personal.php
@@ -47,7 +47,7 @@ class PersonalAction extends Action
var $user = null;
- function isReadOnly()
+ function isReadOnly($args)
{
return true;
}
diff --git a/lib/popularnoticesection.php b/lib/popularnoticesection.php
index 0505f0fa9..a8d47ef54 100644
--- a/lib/popularnoticesection.php
+++ b/lib/popularnoticesection.php
@@ -50,17 +50,26 @@ class PopularNoticeSection extends NoticeSection
{
if (common_config('db', 'type') == 'pgsql') {
$weightexpr='sum(exp(-extract(epoch from (now() - fave.modified)) / %s))';
+ if (!empty($this->out->tag)) {
+ $tag = pg_escape_string($this->tag);
+ }
} else {
$weightexpr='sum(exp(-(now() - fave.modified) / %s))';
+ if (!empty($this->out->tag)) {
+ $tag = mysql_escape_string($this->out->tag);
+ }
}
-
- $qry = 'SELECT notice.*, '.
- $weightexpr . ' as weight ' .
- 'FROM notice JOIN fave ON notice.id = fave.notice_id ' .
- 'GROUP BY notice.id,notice.profile_id,notice.content,notice.uri,' .
- 'notice.rendered,notice.url,notice.created,notice.modified,' .
- 'notice.reply_to,notice.is_local,notice.source ' .
- 'ORDER BY weight DESC';
+ $qry = "SELECT notice.*, $weightexpr as weight ";
+ if(isset($tag)) {
+ $qry .= 'FROM notice_tag, notice JOIN fave ON notice.id = fave.notice_id ' .
+ "WHERE notice.id = notice_tag.notice_id and '$tag' = notice_tag.tag";
+ } else {
+ $qry .= 'FROM notice JOIN fave ON notice.id = fave.notice_id';
+ }
+ $qry .= ' GROUP BY notice.id,notice.profile_id,notice.content,notice.uri,' .
+ 'notice.rendered,notice.url,notice.created,notice.modified,' .
+ 'notice.reply_to,notice.is_local,notice.source ' .
+ 'ORDER BY weight DESC';
$offset = 0;
$limit = NOTICES_PER_SECTION + 1;
diff --git a/lib/profileaction.php b/lib/profileaction.php
index c81924e31..1f2e30994 100644
--- a/lib/profileaction.php
+++ b/lib/profileaction.php
@@ -179,6 +179,11 @@ class ProfileAction extends Action
$this->element('h2', null, _('Statistics'));
// Other stats...?
+ $this->elementStart('dl', 'entity_user-id');
+ $this->element('dt', null, _('User ID'));
+ $this->element('dd', null, $this->profile->id);
+ $this->elementEnd('dl');
+
$this->elementStart('dl', 'entity_member-since');
$this->element('dt', null, _('Member since'));
$this->element('dd', null, date('j M Y',
diff --git a/lib/searchaction.php b/lib/searchaction.php
index e7ad4affd..e74450e11 100644
--- a/lib/searchaction.php
+++ b/lib/searchaction.php
@@ -51,7 +51,7 @@ class SearchAction extends Action
*
* @return boolean true
*/
- function isReadOnly()
+ function isReadOnly($args)
{
return true;
}