From ed8d8eb5eeedf3caf7f38b5e03519dada24abee1 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 13 Aug 2010 11:44:26 -0700 Subject: hooks to allow changing RSS content --- lib/apiaction.php | 103 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 54 insertions(+), 49 deletions(-) (limited to 'lib') diff --git a/lib/apiaction.php b/lib/apiaction.php index 479a86ad8..cc98b9b6e 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -462,66 +462,71 @@ class ApiAction extends Action function twitterRssEntryArray($notice) { - $profile = $notice->getProfile(); - $entry = array(); - // We trim() to avoid extraneous whitespace in the output + if (Event::handle('StartRssEntryArray', array($notice, &$entry))) { - $entry['content'] = common_xml_safe_str(trim($notice->rendered)); - $entry['title'] = $profile->nickname . ': ' . common_xml_safe_str(trim($notice->content)); - $entry['link'] = common_local_url('shownotice', array('notice' => $notice->id)); - $entry['published'] = common_date_iso8601($notice->created); + $profile = $notice->getProfile(); - $taguribase = TagURI::base(); - $entry['id'] = "tag:$taguribase:$entry[link]"; + // We trim() to avoid extraneous whitespace in the output - $entry['updated'] = $entry['published']; - $entry['author'] = $profile->getBestName(); + $entry['content'] = common_xml_safe_str(trim($notice->rendered)); + $entry['title'] = $profile->nickname . ': ' . common_xml_safe_str(trim($notice->content)); + $entry['link'] = common_local_url('shownotice', array('notice' => $notice->id)); + $entry['published'] = common_date_iso8601($notice->created); - // Enclosures - $attachments = $notice->attachments(); - $enclosures = array(); - - foreach ($attachments as $attachment) { - $enclosure_o=$attachment->getEnclosure(); - if ($enclosure_o) { - $enclosure = array(); - $enclosure['url'] = $enclosure_o->url; - $enclosure['mimetype'] = $enclosure_o->mimetype; - $enclosure['size'] = $enclosure_o->size; - $enclosures[] = $enclosure; - } - } + $taguribase = TagURI::base(); + $entry['id'] = "tag:$taguribase:$entry[link]"; - if (!empty($enclosures)) { - $entry['enclosures'] = $enclosures; - } + $entry['updated'] = $entry['published']; + $entry['author'] = $profile->getBestName(); + + // Enclosures + $attachments = $notice->attachments(); + $enclosures = array(); + + foreach ($attachments as $attachment) { + $enclosure_o=$attachment->getEnclosure(); + if ($enclosure_o) { + $enclosure = array(); + $enclosure['url'] = $enclosure_o->url; + $enclosure['mimetype'] = $enclosure_o->mimetype; + $enclosure['size'] = $enclosure_o->size; + $enclosures[] = $enclosure; + } + } - // Tags/Categories - $tag = new Notice_tag(); - $tag->notice_id = $notice->id; - if ($tag->find()) { - $entry['tags']=array(); - while ($tag->fetch()) { - $entry['tags'][]=$tag->tag; + if (!empty($enclosures)) { + $entry['enclosures'] = $enclosures; } - } - $tag->free(); - // RSS Item specific - $entry['description'] = $entry['content']; - $entry['pubDate'] = common_date_rfc2822($notice->created); - $entry['guid'] = $entry['link']; + // Tags/Categories + $tag = new Notice_tag(); + $tag->notice_id = $notice->id; + if ($tag->find()) { + $entry['tags']=array(); + while ($tag->fetch()) { + $entry['tags'][]=$tag->tag; + } + } + $tag->free(); + + // RSS Item specific + $entry['description'] = $entry['content']; + $entry['pubDate'] = common_date_rfc2822($notice->created); + $entry['guid'] = $entry['link']; + + if (isset($notice->lat) && isset($notice->lon)) { + // This is the format that GeoJSON expects stuff to be in. + // showGeoRSS() below uses it for XML output, so we reuse it + $entry['geo'] = array('type' => 'Point', + 'coordinates' => array((float) $notice->lat, + (float) $notice->lon)); + } else { + $entry['geo'] = null; + } - if (isset($notice->lat) && isset($notice->lon)) { - // This is the format that GeoJSON expects stuff to be in. - // showGeoRSS() below uses it for XML output, so we reuse it - $entry['geo'] = array('type' => 'Point', - 'coordinates' => array((float) $notice->lat, - (float) $notice->lon)); - } else { - $entry['geo'] = null; + Event::handle('EndRssEntryArray', array($notice, &$entry)); } return $entry; -- cgit v1.2.3-54-g00ecf From 9b7536351b1efa5bf222fad1fb92b6dc9e33156f Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 13 Aug 2010 12:22:58 -0700 Subject: hide the Whats Up Nickname if notice title enabled --- lib/noticeform.php | 3 ++- plugins/NoticeTitle/NoticeTitlePlugin.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/noticeform.php b/lib/noticeform.php index 84c20a5b3..514066356 100644 --- a/lib/noticeform.php +++ b/lib/noticeform.php @@ -169,7 +169,8 @@ class NoticeForm extends Form function formData() { if (Event::handle('StartShowNoticeFormData', array($this))) { - $this->out->element('label', array('for' => 'notice_data-text'), + $this->out->element('label', array('for' => 'notice_data-text', + 'id' => 'notice_data-text-label'), sprintf(_('What\'s up, %s?'), $this->user->nickname)); // XXX: vary by defined max size $this->out->element('textarea', array('id' => 'notice_data-text', diff --git a/plugins/NoticeTitle/NoticeTitlePlugin.php b/plugins/NoticeTitle/NoticeTitlePlugin.php index 115e1c14c..18ffed4be 100644 --- a/plugins/NoticeTitle/NoticeTitlePlugin.php +++ b/plugins/NoticeTitle/NoticeTitlePlugin.php @@ -137,6 +137,7 @@ class NoticeTitlePlugin extends Plugin function onStartShowNoticeFormData($form) { + $form->out->element('style', null, 'label#notice_data-text-label { display: none }'); $form->out->element('input', array('type' => 'text', 'id' => 'notice_title', 'name' => 'notice_title', -- cgit v1.2.3-54-g00ecf From e687862ca126ef6483fe874303bce730f78feb5c Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 16 Aug 2010 13:26:27 +1200 Subject: fixed a %d that should be a %s in an error message --- lib/installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/installer.php b/lib/installer.php index ff2bed140..2eff2d85a 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -319,7 +319,7 @@ abstract class Installer $this->updateStatus(sprintf("Adding %s data to database...", $name)); $res = $this->runDbScript($scr.'.sql', $conn, 'pgsql'); if ($res === false) { - $this->updateStatus(sprintf("Can't run %d script.", $name), true); + $this->updateStatus(sprintf("Can't run %s script.", $name), true); return false; } } -- cgit v1.2.3-54-g00ecf From 7f9ab683b259fc93d507eb705c84af0cfd2fae5b Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 16 Aug 2010 13:26:27 +1200 Subject: fixed a %d that should be a %s in an error message --- lib/installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/installer.php b/lib/installer.php index ff2bed140..2eff2d85a 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -319,7 +319,7 @@ abstract class Installer $this->updateStatus(sprintf("Adding %s data to database...", $name)); $res = $this->runDbScript($scr.'.sql', $conn, 'pgsql'); if ($res === false) { - $this->updateStatus(sprintf("Can't run %d script.", $name), true); + $this->updateStatus(sprintf("Can't run %s script.", $name), true); return false; } } -- cgit v1.2.3-54-g00ecf From b2a5e0d09b6ef93c265fe4542725de4a7472b103 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 16 Aug 2010 10:09:33 -0700 Subject: StatusNet 0.9.4 "Orange Crush" --- README | 7 ++----- lib/common.php | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/README b/README index 93b63c2ac..e5cb2c933 100644 --- a/README +++ b/README @@ -2,8 +2,8 @@ README ------ -StatusNet 0.9.4beta2 -11 August 2010 +StatusNet 0.9.4 "Orange Crush" +16 August 2010 This is the README file for StatusNet, the Open Source microblogging platform. It includes installation instructions, descriptions of @@ -88,9 +88,6 @@ For best compatibility with client software and site federation, and a lot of bug fixes, it is highly recommended that all public sites upgrade to the new version. -Changes from 0.9.4beta1: -- fix for daemon config switching on multi-site setup - Notable changes this version: - OpenID and OAuth libraries patched for potential timing attack diff --git a/lib/common.php b/lib/common.php index 897d08b77..097f19268 100644 --- a/lib/common.php +++ b/lib/common.php @@ -22,7 +22,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } //exit with 200 response, if this is checking fancy from the installer if (isset($_REQUEST['p']) && $_REQUEST['p'] == 'check-fancy') { exit; } -define('STATUSNET_VERSION', '0.9.4beta2'); +define('STATUSNET_VERSION', '0.9.4'); define('LACONICA_VERSION', STATUSNET_VERSION); // compatibility define('STATUSNET_CODENAME', 'Orange Crush'); -- cgit v1.2.3-54-g00ecf