--- /dev/null
+## How to install GNU social
+
+There are two ways to install GNU social -- from git, or from a snapshot.
+
+### Install from git
+
+0. Make sure you have all the things you need installed:
+
+ sudo locale-gen en_US en_US.UTF-8
+ sudo dpkg-reconfigure locales
+ sudo apt-get update -q
+ sudo apt-get dist-upgrade -y
+ sudo apt-get install -y pound varnish php5 rsync htop emacs23-nox apache2 php5-mysql dtrx mysql-server exim4
+
+1. SSH to your server
+
+ ssh mattl@mattl.io
+
+2. Make a directory for your installation and let the webserver write to it.
+
+ mkdir www/mattl.io -p
+ chown www-data:www-data www/mattl.io
+
+3. Check out GNU social into your directory.
+
+ cd www/mattl.io
+ git clone git://gitorious.org/social/mainline.git .
+
+4. Make a database.
+
+ mysql -u root -p
+ create database social;
+ exit
+
+5. Visit your website and enter your name, database details, etc.
+
+6. You're all set!
+++ /dev/null
-------
-README
-------
-
-StatusNet 1.1.1
-16 July 2013
-
-This is the README file for StatusNet, the Open Source social
-networking platform. It includes general information about the
-software and the project.
-
-Some other files to review:
-
-- INSTALL: instructions on how to install the software.
-- UPGRADE: upgrading from earlier versions
-- CONFIGURE: configuration options in gruesome detail.
-- PLUGINS.txt: how to install and configure plugins.
-- EVENTS.txt: events supported by the plugin system
-- COPYING: full text of the software license
-
-Information on using StatusNet can be found in the "doc" subdirectory
-or in the "help" section on-line.
-
-About
-=====
-
-StatusNet is a Free and Open Source social networking platform. It
-helps people in a community, company or group to exchange short status
-updates, do polls, announce events, or other social activities (and
-you can add more!). Users can choose which people to "follow" and
-receive only their friends' or colleagues' status messages. It
-provides a similar service to sites like Twitter, Google+, Facebook or
-Yammer, but is much more awesome.
-
-With a little work, status messages can be sent to mobile phones,
-instant messenger programs (GTalk/Jabber), and specially-designed
-desktop clients that support the Twitter API.
-
-StatusNet supports an open standard called OStatus
-<http://ostatus.org/> that lets users in different networks follow
-each other. It enables a distributed social network spread all across
-the Web.
-
-StatusNet was originally developed for the Open Software Service,
-Identi.ca <http://identi.ca/>. It is shared with you in hope that you
-too make an Open Software Service available to your users. To learn
-more, please see the Open Software Service Definition 1.1:
-
- http://www.opendefinition.org/ossd
-
-StatusNet, Inc. <http://status.net/> also offers this software as a
-Web service, requiring no installation on your part. See
-<http://status.net/signup> for details. The software run
-on status.net is identical to the software available for download, so
-you can move back and forth between a hosted version or a version
-installed on your own servers.
-
-A commercial software subscription is available from StatusNet Inc. It
-includes 24-hour technical support and developer support. More
-information at http://status.net/contact or email sales@status.net.
-
-License
-=======
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU Affero General Public License as
-published by the Free Software Foundation, either version 3 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Affero General Public License for more details.
-
-You should have received a copy of the GNU Affero General Public
-License along with this program, in the file "COPYING". If not, see
-<http://www.gnu.org/licenses/>.
-
- IMPORTANT NOTE: The GNU Affero General Public License (AGPL) has
- *different requirements* from the "regular" GPL. In particular, if
- you make modifications to the StatusNet source code on your server,
- you *MUST MAKE AVAILABLE* the modified version of the source code
- to your users under the same license. This is a legal requirement
- of using the software, and if you do not wish to share your
- modifications, *YOU MAY NOT INSTALL STATUSNET*.
-
-Documentation in the /doc-src/ directory is available under the
-Creative Commons Attribution 3.0 Unported license, with attribution to
-"StatusNet". See http://creativecommons.org/licenses/by/3.0/ for details.
-
-CSS and images in the /theme/ directory are available under the
-Creative Commons Attribution 3.0 Unported license, with attribution to
-"StatusNet". See http://creativecommons.org/licenses/by/3.0/ for details.
-
-Our understanding and intention is that if you add your own theme that
-uses only CSS and images, those files are not subject to the copyleft
-requirements of the Affero General Public License 3.0. See
-http://wordpress.org/news/2009/07/themes-are-gpl-too/ . This is not
-legal advice; consult your lawyer.
-
-Additional library software has been made available in the 'extlib'
-directory. All of it is Free Software and can be distributed under
-liberal terms, but those terms may differ in detail from the AGPL's
-particulars. See each package's license file in the extlib directory
-for additional terms.
-
-New this version
-================
-
-This is a security fix and bug fix release since 1.1.0,
-released 2 July 2012. All 1.1.0 sites should upgrade to this version.
-
-It includes the following changes:
-
-- Fixes for SQL injection errors in profile lists.
-- Improved ActivityStreams JSON representation of activities and objects.
-- Upgrade to the Twitter 1.1 API.
-- More robust handling of errors in distribution.
-- Fix error in OStatus subscription for remote groups.
-- Fix error in XMPP distribution.
-
-A full changelog is available at http://status.net/wiki/StatusNet_1.1.1.
-
-Troubleshooting
-===============
-
-The primary output for StatusNet is syslog, unless you configured a
-separate logfile. This is probably the first place to look if you're
-getting weird behaviour from StatusNet.
-
-If you're tracking the unstable version of StatusNet in the git
-repository (see below), and you get a compilation error ("unexpected
-T_STRING") in the browser, check to see that you don't have any
-conflicts in your code.
-
-Unstable version
-================
-
-If you're adventurous or impatient, you may want to install the
-development version of StatusNet. To get it, use the git version
-control tool <http://git-scm.com/> like so:
-
- git clone git@gitorious.org:statusnet/mainline.git
-
-This is the version of the software that runs on Identi.ca and the
-status.net hosted service. Using it is a mixed bag. On the positive
-side, it usually includes the latest security and bug fix patches. On
-the downside, it may also include changes that require admin
-intervention (like running a script or even raw SQL!) that may not be
-documented yet. It may be a good idea to test this version before
-installing it on your production machines.
-
-To keep it up-to-date, use 'git pull'. Watch for conflicts!
-
-Further information
-===================
-
-There are several ways to get more information about StatusNet.
-
-* There is a mailing list for StatusNet developers and admins at
- http://mail.status.net/mailman/listinfo/statusnet-dev
-* The #statusnet IRC channel on freenode.net <http://www.freenode.net/>.
-* The StatusNet wiki, http://status.net/wiki/
-* The StatusNet blog, http://status.net/blog/
-* The StatusNet status update, <http://status.status.net/> (!)
-
-Feedback
-========
-
-* Messages to http://support.status.net/ are very welcome.
-* The group http://identi.ca/group/statusnet is a good
- place to discuss the software.
-* StatusNet has a bug tracker for any defects you may find, or ideas for
- making things better. http://status.net/open-source/issues
-* The StatusNet forum is at http://forum.status.net/.
-
-Credits
-=======
-
-The following is an incomplete list of developers who've worked on
-StatusNet. Apologies for any oversight; please let evan@status.net know
-if anyone's been overlooked in error.
-
-* Evan Prodromou, founder and lead developer, StatusNet, Inc.
-* Zach Copley, StatusNet, Inc.
-* Earle Martin, StatusNet, Inc.
-* Marie-Claude Doyon, designer, StatusNet, Inc.
-* Sarven Capadisli, StatusNet, Inc.
-* Robin Millette, StatusNet, Inc.
-* Ciaran Gultnieks
-* Michael Landers
-* Ori Avtalion
-* Garret Buell
-* Mike Cochrane
-* Matthew Gregg
-* Florian Biree
-* Erik Stambaugh
-* 'drry'
-* Gina Haeussge
-* Tryggvi Björgvinsson
-* Adrian Lang
-* Ori Avtalion
-* Meitar Moscovitz
-* Ken Sheppardson (Trac server, man-about-town)
-* Tiago 'gouki' Faria (i18n manager)
-* Sean Murphy
-* Leslie Michael Orchard
-* Eric Helgeson
-* Ken Sedgwick
-* Brian Hendrickson
-* Tobias Diekershoff
-* Dan Moore
-* Fil
-* Jeff Mitchell
-* Brenda Wallace
-* Jeffery To
-* Federico Marani
-* Craig Andrews
-* mEDI
-* Brett Taylor
-* Brigitte Schuster
-* Siebrand Mazeland and the amazing volunteer translators at translatewiki.net
-* Brion Vibber, StatusNet, Inc.
-* James Walker, StatusNet, Inc.
-* Samantha Doherty, designer, StatusNet, Inc.
-
-Thanks also to the developers of our upstream library code and to the
-thousands of people who have tried out Identi.ca, installed StatusNet,
-told their friends, and built the Open Microblogging network to what
-it is today.
+++ /dev/null
-This is GNU social, a free software, decentralized social network,
-based on StatusNet.
-
-Developers
-==========
-
-Matt Lee
-Rob Myers
-Sean Corbett
-Ian Denhardt
-Steve DuBois
-Mike Sheldon
-
-With help from
-==============
-
-Bradley M. Kuhn
-
-Special help from
-=================
-
-Craig Andrews
-
--- /dev/null
+# GNU social 1.1.2 (alpha)
+August 2014
+
+(c) Free Software Foundation, Inc
+(c) StatusNet, Inc
+
+This is the README file for GNU social, the free
+software social networking platform. It includes
+general information about the software and the
+project.
+
+Some other files to review:
+
+- INSTALL: instructions on how to install the software.
+- UPGRADE: upgrading from earlier versions
+- CONFIGURE: configuration options in gruesome detail.
+- PLUGINS.txt: how to install and configure plugins.
+- EVENTS.txt: events supported by the plugin system
+- COPYING: full text of the software license
+
+Information on using GNU social can be found in
+the "doc" subdirectory or in the "help" section
+on-line, or you can catch us on IRC in #social on
+the freenode network.
+
+## About
+
+GNU social is a free social networking
+platform. It helps people in a community, company
+or group to exchange short status updates, do
+polls, announce events, or other social activities
+(and you can add more!). Users can choose which
+people to "follow" and receive only their friends'
+or colleagues' status messages. It provides a
+similar service to sites like Twitter, Google+ or
+Facebook, but is much more awesome.
+
+With a little work, status messages can be sent to
+mobile phones, instant messenger programs (using
+XMPP), and specially-designed desktop clients that
+support the Twitter API.
+
+GNU social supports an open standard called
+OStatus <http://ostatus.org/> that lets users in
+different networks follow each other. It enables a
+distributed social network spread all across the
+Web.
+
+GNU social was originally developed for the
+service, Identi.ca <http://identi.ca/>.
+
+It is shared with you in hope that you too make an
+service available to your users. To learn more,
+please see the Open Software Service Definition
+1.1:
+
+ http://www.opendefinition.org/ossd
+
+### License
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public
+License along with this program, in the file "COPYING". If not, see
+<http://www.gnu.org/licenses/>.
+
+ IMPORTANT NOTE: The GNU Affero General Public License (AGPL) has
+ *different requirements* from the "regular" GPL. In particular, if
+ you make modifications to the GNU social source code on your server,
+ you *MUST MAKE AVAILABLE* the modified version of the source code
+ to your users under the same license. This is a legal requirement
+ of using the software, and if you do not wish to share your
+ modifications, *YOU MAY NOT INSTALL GNU SOCIAL*.
+
+Documentation in the /doc-src/ directory is available under the
+Creative Commons Attribution 3.0 Unported license, with attribution to
+"GNU social". See http://creativecommons.org/licenses/by/3.0/ for details.
+
+CSS and images in the /theme/ directory are available under the
+Creative Commons Attribution 3.0 Unported license, with attribution to
+"GNU social". See http://creativecommons.org/licenses/by/3.0/ for details.
+
+Our understanding and intention is that if you add your own theme that
+uses only CSS and images, those files are not subject to the copyleft
+requirements of the Affero General Public License 3.0. See
+http://wordpress.org/news/2009/07/themes-are-gpl-too/ . This is not
+legal advice; consult your lawyer.
+
+Additional library software has been made available in the 'extlib'
+directory. All of it is Free Software and can be distributed under
+liberal terms, but those terms may differ in detail from the AGPL's
+particulars. See each package's license file in the extlib directory
+for additional terms.
+
+## New this version
+
+This is a security fix and bug fix release since 1.1.0,
+released 2 July 2012. All 1.1.0 sites should upgrade to this version.
+
+It includes the following changes:
+
+- Fixes for SQL injection errors in profile lists.
+- Improved ActivityStreams JSON representation of activities and objects.
+- Upgrade to the Twitter 1.1 API.
+- More robust handling of errors in distribution.
+- Fix error in OStatus subscription for remote groups.
+- Fix error in XMPP distribution.
+
+### Troubleshooting
+
+The primary output for GNU social is syslog,
+unless you configured a separate logfile. This is
+probably the first place to look if you're getting
+weird behaviour from GNU social.
+
+If you're tracking the unstable version of
+GNU social in the git repository (see below), and you
+get a compilation error ("unexpected T_STRING") in
+the browser, check to see that you don't have any
+conflicts in your code.
+
+### Unstable version
+
+If you're adventurous or impatient, you may want
+to install the development version of
+StatusNet. To get it, use the git version control
+tool <http://git-scm.com/> like so:
+
+ git clone git@gitorious.org:social/mainline.git
+
+Using it is a mixed bag. On the positive side, it
+usually includes the latest security and bug fix
+patches. On the downside, it may also include
+changes that require admin intervention (like
+running a script or even raw SQL!) that may not be
+documented yet. It may be a good idea to test this
+version before installing it on your production
+machines.
+
+To keep it up-to-date, use 'git pull'. Watch for
+conflicts!
+
+## Further information
+
+There are several ways to get more information
+about GNU social.
+
+* The #social IRC channel on freenode.net <http://www.freenode.net/>.
+* The GNU social website
+* Following us on GNU social -- http://quitter.se/gnusocial
+* Following us on Twitter -- https://twitter.com/gnusocial
+
+* GNU social has a bug tracker for any defects you may find, or ideas for
+ making things better. http://bugz.foocorp.net/
+
+Credits
+=======
+
+The following is an incomplete list of developers
+who've worked on GNU social, or its predecessors
+StatusNet and Free Social. Apologies for any
+oversight; please let mattl@gnu.org know if
+anyone's been overlooked in error.
+
+## Project Founders
+
+* Matt Lee (GNU social)
+* Evan Prodromou (StatusNet)
+* Mikael Nordfeldth (Free Social)
+
+Thanks to all of the StatusNet developers:
+
+* Zach Copley, StatusNet, Inc.
+* Earle Martin, StatusNet, Inc.
+* Marie-Claude Doyon, designer, StatusNet, Inc.
+* Sarven Capadisli, StatusNet, Inc.
+* Robin Millette, StatusNet, Inc.
+* Ciaran Gultnieks
+* Michael Landers
+* Ori Avtalion
+* Garret Buell
+* Mike Cochrane
+* Matthew Gregg
+* Florian Biree
+* Erik Stambaugh
+* 'drry'
+* Gina Haeussge
+* Tryggvi Björgvinsson
+* Adrian Lang
+* Ori Avtalion
+* Meitar Moscovitz
+* Ken Sheppardson (Trac server, man-about-town)
+* Tiago 'gouki' Faria (i18n manager)
+* Sean Murphy
+* Leslie Michael Orchard
+* Eric Helgeson
+* Ken Sedgwick
+* Brian Hendrickson
+* Tobias Diekershoff
+* Dan Moore
+* Fil
+* Jeff Mitchell
+* Brenda Wallace
+* Jeffery To
+* Federico Marani
+* mEDI
+* Brett Taylor
+* Brigitte Schuster
+* Siebrand Mazeland and the amazing volunteer translators at translatewiki.net
+* Brion Vibber, StatusNet, Inc.
+* James Walker, StatusNet, Inc.
+* Samantha Doherty, designer, StatusNet, Inc.
+
+### Extra special thanks to the GNU socialites
+
+* Craig Andrews
+* Donald Robertson
+* Deb Nicholson
+* Ian Denhart
+* Steven DuBois
+* Blaine Cook
+* Henry Story
+* Melvin Carvalho
+
+Thanks also to the developers of our upstream
+library code and to the thousands of people who
+have tried out GNU social, told their friends, and
+built the fediverse network to what it is today.
+
+### License help from
+
+* Bradley M. Kuhn
+
{
var $notices = null;
+ var $next_id = null;
+
/**
* Take arguments for running
*
$suplink = common_local_url('sup', null, null, $this->target->id);
header('X-SUP-ID: ' . $suplink);
+
+ // paging links
+ $nextUrl = !empty($this->next_id)
+ ? common_local_url('ApiTimelineUser',
+ array('format' => $this->format,
+ 'id' => $this->target->id),
+ array('max_id' => $this->next_id))
+ : null;
+ $lastNotice = $this->notices[0];
+ $lastId = $lastNotice->id;
+ $prevUrl = common_local_url('ApiTimelineUser',
+ array('format' => $this->format,
+ 'id' => $this->target->id),
+ array('since_id' => $lastId));
+ $firstUrl = common_local_url('ApiTimelineUser',
+ array('format' => $this->format,
+ 'id' => $this->target->id));
+
switch($this->format) {
case 'xml':
$this->showXmlTimeline($this->notices);
// change too quickly!
if (!empty($this->next_id)) {
- $nextUrl = common_local_url('ApiTimelineUser',
- array('format' => 'atom',
- 'id' => $this->target->id),
- array('max_id' => $this->next_id));
-
$atom->addLink($nextUrl,
array('rel' => 'next',
'type' => 'application/atom+xml'));
}
if (($this->page > 1 || !empty($this->max_id)) && !empty($this->notices)) {
-
- $lastNotice = $this->notices[0];
- $lastId = $lastNotice->id;
-
- $prevUrl = common_local_url('ApiTimelineUser',
- array('format' => 'atom',
- 'id' => $this->target->id),
- array('since_id' => $lastId));
-
$atom->addLink($prevUrl,
array('rel' => 'prev',
'type' => 'application/atom+xml'));
}
if ($this->page > 1 || !empty($this->since_id) || !empty($this->max_id)) {
-
- $firstUrl = common_local_url('ApiTimelineUser',
- array('format' => 'atom',
- 'id' => $this->target->id));
-
$atom->addLink($firstUrl,
array('rel' => 'first',
'type' => 'application/atom+xml'));
$doc->addLink($link, 'alternate', 'text/html');
$doc->addItemsFromNotices($this->notices);
- // XXX: Add paging extension?
+ if (!empty($this->next_id)) {
+ $doc->addLink($nextUrl,
+ array('rel' => 'next',
+ 'type' => ActivityStreamJSONDocument::CONTENT_TYPE));
+ }
+
+ if (($this->page > 1 || !empty($this->max_id)) && !empty($this->notices)) {
+ $doc->addLink($prevUrl,
+ array('rel' => 'prev',
+ 'type' => ActivityStreamJSONDocument::CONTENT_TYPE));
+ }
+
+ if ($this->page > 1 || !empty($this->since_id) || !empty($this->max_id)) {
+ $doc->addLink($firstUrl,
+ array('rel' => 'first',
+ 'type' => ActivityStreamJSONDocument::CONTENT_TYPE));
+ }
$this->raw($doc->asString());
break;
$feed->addNamespace('media',
'http://purl.org/syndication/atommedia');
+ $feed->addNamespace('georss',
+ 'http://www.georss.org/georss');
+
$feed->id = $url;
$feed->setUpdated('now');
function getEnclosure(){
$enclosure = (object) array();
- $enclosure->title=$this->title;
- $enclosure->url=$this->url;
- $enclosure->title=$this->title;
- $enclosure->date=$this->date;
- $enclosure->modified=$this->modified;
- $enclosure->size=$this->size;
- $enclosure->mimetype=$this->mimetype;
-
- if (!isset($this->filename)) {
- $notEnclosureMimeTypes = array(null,'text/html','application/xhtml+xml');
- $mimetype = $this->mimetype;
- if($mimetype != null){
- $mimetype = strtolower($this->mimetype);
- }
- $semicolon = strpos($mimetype,';');
- if($semicolon){
- $mimetype = substr($mimetype,0,$semicolon);
- }
- if (in_array($mimetype, $notEnclosureMimeTypes)) {
- Event::handle('FileEnclosureMetadata', array($this, &$enclosure));
- }
+ foreach (array('title', 'url', 'date', 'modified', 'size', 'mimetype') as $key) {
+ $enclosure->$key = $this->$key;
+ }
+
+ $needMoreMetadataMimetypes = array(null, 'text/html', 'application/xhtml+xml');
+
+ if (!isset($this->filename) && in_array(common_bare_mime($enclosure->mimetype), $needMoreMetadataMimetypes)) {
+ // This fetches enclosure metadata for non-local links with unset/HTML mimetypes,
+ // which may be enriched through oEmbed or similar (implemented as plugins)
+ Event::handle('FileEnclosureMetadata', array($this, &$enclosure));
}
- if (empty($enclosure->mimetype)) {
- // This means we don't know what it is, so it can't be an enclosure!
+ if (empty($enclosure->mimetype) || in_array(common_bare_mime($enclosure->mimetype), $needMoreMetadataMimetypes)) {
+ // This means we either don't know what it is, so it can't
+ // be shown as an enclosure, or it is an HTML link which
+ // does not link to a resource with further metadata.
throw new ServerException('Unknown enclosure mimetype, not enough metadata');
}
return $enclosure;
// And finally remove the entry from the database
return parent::delete($useWhere);
}
+
+ public function getTitle()
+ {
+ $title = $this->title ?: $this->filename;
+
+ return $title ?: null;
+ }
}
$object->id = $this->getUri();
$object->title = $this->getBestName();
$object->link = $this->getUrl();
+ $object->summary = $this->getDescription();
try {
$avatar = Avatar::getUploaded($this);
return $this->nickname;
}
+ public function getDescription()
+ {
+ return $this->bio;
+ }
+
/**
* Returns the best URI for a profile. Plugins may override.
*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?p=$1 [L,QSA]
+
+ ## You can also use PATHINFO by using this RewriteRule instead:
+ # RewriteRule (.*) index.php/$1 [L,QSA]
</IfModule>
<FilesMatch "\.(ini)">
+ # For mod_access_compat in Apache <2.4
Order allow,deny
-</FilesMatch>
+ # Use this instead for Apache >2.4 (mod_authz_host)
+ # Require all denied
+</FilesMatch>
var $since_id = null;
var $source = null;
var $callback = null;
+ var $format = null;
var $access = self::READ_ONLY; // read (default) or read-write
*/
function show()
{
- $att = $this->notice->attachments();
- if (empty($att)) return 0;
+ $attachments = $this->notice->attachments();
+ $representable = false;
+ foreach ($attachments as $key=>$att) {
+ // Only show attachments representable with a title
+ if ($att->getTitle() === null) {
+ unset($attachments[$key]);
+ }
+ }
+ if (!count($attachments)) {
+ return 0;
+ }
+
$this->showListStart();
- foreach ($att as $n=>$attachment) {
- $item = $this->newListItem($attachment);
+ foreach ($attachments as $att) {
+ $item = $this->newListItem($att);
$item->show();
}
$this->showListEnd();
- return count($att);
+ return count($attachments);
}
function showListStart()
}
function title() {
- return $this->attachment->title ?: $this->attachment->filename;
+ return $this->attachment->getTitle();
}
function linkTitle() {
define('GNUSOCIAL_ENGINE_URL', 'https://www.gnu.org/software/social/');
define('GNUSOCIAL_BASE_VERSION', '1.1.1');
-define('GNUSOCIAL_LIFECYCLE', 'alpha1'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
+define('GNUSOCIAL_LIFECYCLE', 'alpha2'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
define('GNUSOCIAL_VERSION', GNUSOCIAL_BASE_VERSION . '-' . GNUSOCIAL_LIFECYCLE);
{
function showListStart()
{
- $this->out->elementStart('div', array('class' => 'attachments'));
- }
-
- function showListEnd()
- {
- $this->out->elementEnd('div');
+ $this->out->element('h2', null, _('Attachments'));
+ parent::showListStart();
}
/**
class InlineAttachmentListItem extends AttachmentListItem
{
function showLink() {
- $this->out->elementStart('a', $this->linkAttr());
+ $this->out->element('a', $this->linkAttr(), $this->title());
$this->showRepresentation();
- $this->out->elementEnd('a');
- }
-
- /**
- * Build HTML attributes for the link
- * @return array
- */
- function linkAttr()
- {
- $attr = parent::linkAttr();
- $attr['class'] = 'attachment-thumbnail';
- return $attr;
}
/**
{
// XXX: RDFa
// TODO: add notice_type class e.g., notice_video, notice_image
- $this->out->elementStart('span', array('class' => 'inline-attachment'));
+ $this->out->elementStart('li', array('class' => 'inline-attachment'));
}
/**
*/
function showEnd()
{
- $this->out->elementEnd('span');
+ $this->out->elementEnd('li');
}
}
'core' => self::corePlugins(),
'default' => array_merge(self::defaultPlugins(), array(
'MobileProfile' => array(),
- 'TwitterBridge' => array(),
- 'FacebookBridge' => array(),
)),
'disable-Directory' => 1,
),
return strtolower($tmp[0]);
}
+function common_bare_mime($mimetype)
+{
+ $mimetype = mb_strtolower($mimetype);
+ if ($semicolon = mb_strpos($mimetype, ';')) {
+ $mimetype = mb_substr($mimetype, 0, $semicolon);
+ }
+ return $mimetype;
+}
+
function common_mime_type_match($type, $avail)
{
if(array_key_exists($type, $avail)) {
static function fromNotice(Notice $notice)
{
- return RSVP::getKV('uri', $notice->uri);
+ $rsvp = new RSVP();
+ $rsvp->uri = $notice->uri;
+ if (!$rsvp->find(true)) {
+ throw new NoResultException($rsvp);
+ }
+ return $rsvp;
}
static function forEvent(Happening $event)
{
$script = parent::_updateInitialize($timeline, $user_id);
$ours = sprintf("MeteorUpdater.init(%s, %s, %s, %s);",
- json_encode($this->webserver),
- json_encode($this->webport),
- json_encode($this->protocol),
- json_encode($timeline));
+ json_encode($this->webserver),
+ json_encode($this->webport),
+ json_encode($this->protocol),
+ json_encode($timeline));
return $script." ".$ours;
}
return array(self::POLL_OBJECT, self::POLL_RESPONSE_OBJECT);
}
+
+ function adaptNoticeListItem($nli) {
+ return new PollListItem($nli);
+ }
+
/**
* When a notice is deleted, delete the related Poll
*
}
}
-
- function showNoticeContent(Notice $notice, HTMLOutputter $out)
- {
- switch ($notice->object_type) {
- case self::POLL_OBJECT:
- return $this->showNoticePoll($notice, $out);
- case self::POLL_RESPONSE_OBJECT:
- return $this->showNoticePollResponse($notice, $out);
- default:
- // TRANS: Exception thrown when performing an unexpected action on a poll.
- // TRANS: %s is the unexpected object type.
- throw new Exception(sprintf(_m('Unexpected type for poll plugin: %s.'), $notice->object_type));
- }
- }
-
- function showNoticePoll(Notice $notice, $out)
- {
- $user = common_current_user();
-
- // @hack we want regular rendering, then just add stuff after that
- $nli = new NoticeListItem($notice, $out);
- $nli->showNotice();
-
- $out->elementStart('div', array('class' => 'e-content poll-content'));
- $poll = Poll::getByNotice($notice);
- if ($poll) {
- if ($user) {
- $profile = $user->getProfile();
- $response = $poll->getResponse($profile);
- if ($response) {
- // User has already responded; show the results.
- $form = new PollResultForm($poll, $out);
- } else {
- $form = new PollResponseForm($poll, $out);
- }
- $form->show();
- }
- } else {
- // TRANS: Error text displayed if no poll data could be found.
- $out->text(_m('Poll data is missing'));
- }
- $out->elementEnd('div');
-
- // @fixme
- $out->elementStart('div', array('class' => 'e-content'));
- }
-
- function showNoticePollResponse(Notice $notice, $out)
- {
- $user = common_current_user();
-
- // @hack we want regular rendering, then just add stuff after that
- $nli = new NoticeListItem($notice, $out);
- $nli->showNotice();
-
- // @fixme
- $out->elementStart('div', array('class' => 'e-content'));
- }
-
function entryForm($out)
{
return new NewPollForm($out);
--- /dev/null
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Adapter to show polls in a nicer way
+ *
+ * PHP version 5
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category Poll
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+ // This check helps protect against security problems;
+ // your code file can't be executed directly from the web.
+ exit(1);
+}
+
+/**
+ * An adapter to show polls in a nicer way
+ *
+ * @category Poll
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+class PollListItem extends NoticeListItemAdapter
+{
+ // @fixme which domain should we use for these namespaces?
+ const POLL_OBJECT = 'http://activityschema.org/object/poll';
+ const POLL_RESPONSE_OBJECT = 'http://activityschema.org/object/poll-response';
+
+ function showNotice(Notice $notice, $out)
+ {
+ switch ($notice->object_type) {
+ case self::POLL_OBJECT:
+ return $this->showNoticePoll($notice, $out);
+ case self::POLL_RESPONSE_OBJECT:
+ return $this->showNoticePollResponse($notice, $out);
+ default:
+ // TRANS: Exception thrown when performing an unexpected action on a poll.
+ // TRANS: %s is the unexpected object type.
+ throw new Exception(sprintf(_m('Unexpected type for poll plugin: %s.'), $notice->object_type));
+ }
+ }
+
+ function showNoticePoll(Notice $notice, $out)
+ {
+ $user = common_current_user();
+
+ // @hack we want regular rendering, then just add stuff after that
+ $nli = new NoticeListItem($notice, $out);
+ $nli->showNotice();
+
+ $out->elementStart('div', array('class' => 'e-content poll-content'));
+ $poll = Poll::getByNotice($notice);
+ if ($poll) {
+ if ($user) {
+ $profile = $user->getProfile();
+ $response = $poll->getResponse($profile);
+ if ($response) {
+ // User has already responded; show the results.
+ $form = new PollResultForm($poll, $out);
+ } else {
+ $form = new PollResponseForm($poll, $out);
+ }
+ $form->show();
+ }
+ } else {
+ // TRANS: Error text displayed if no poll data could be found.
+ $out->text(_m('Poll data is missing'));
+ }
+ $out->elementEnd('div');
+
+ // @fixme
+ $out->elementStart('div', array('class' => 'e-content'));
+ }
+
+ function showNoticePollResponse(Notice $notice, $out)
+ {
+ $user = common_current_user();
+
+ // @hack we want regular rendering, then just add stuff after that
+ $nli = new NoticeListItem($notice, $out);
+ $nli->showNotice();
+
+ // @fixme
+ $out->elementStart('div', array('class' => 'e-content'));
+ }
+}
return true;
}
- /**
- * Custom HTML output for our notices
- *
- * @param Notice $notice
- * @param HTMLOutputter $out
- */
- function showNoticeContent(Notice $notice, $out)
- {
- switch ($notice->object_type) {
- case QnA_Question::OBJECT_TYPE:
- return $this->showNoticeQuestion($notice, $out);
- case QnA_Answer::OBJECT_TYPE:
- return $this->showNoticeAnswer($notice, $out);
- default:
- throw new Exception(
- // TRANS: Exception thrown when performing an unexpected action on a question.
- // TRANS: %s is the unpexpected object type.
- sprintf(_m('Unexpected type for QnA plugin: %s.'),
- $notice->object_type
- )
- );
- }
- }
-
- function showNoticeQuestion(Notice $notice, $out)
- {
- $user = common_current_user();
-
- // @hack we want regular rendering, then just add stuff after that
- $nli = new NoticeListItem($notice, $out);
- $nli->showNotice();
-
- $out->elementStart('div', array('class' => 'e-content question-description'));
-
- $question = QnA_Question::getByNotice($notice);
-
- if (!empty($question)) {
-
- $form = new QnashowquestionForm($out, $question);
- $form->show();
-
- } else {
- // TRANS: Error message displayed when question data is not present.
- $out->text(_m('Question data is missing.'));
- }
- $out->elementEnd('div');
-
- // @fixme
- $out->elementStart('div', array('class' => 'e-content'));
- }
-
/**
* Output the HTML for this kind of object in a list
*
$out = $nli->out;
$notice = $nli->notice;
- $this->showNotice($notice, $out);
+ $nli->showNotice($notice, $out);
$nli->showNoticeLink();
$nli->showNoticeSource();
$nli->showContext();
$nli->showRepeat();
- $out->elementEnd('div');
-
$nli->showNoticeOptions();
if ($notice->object_type == QnA_Question::OBJECT_TYPE) {
return false;
}
- function showNoticeAnswer(Notice $notice, $out)
- {
- $user = common_current_user();
-
- $answer = QnA_Answer::getByNotice($notice);
- $question = $answer->getQuestion();
-
- $nli = new NoticeListItem($notice, $out);
- $nli->showNotice();
-
- $out->elementStart('div', array('class' => 'e-content answer-content'));
-
- if (!empty($answer)) {
- $form = new QnashowanswerForm($out, $answer);
- $form->show();
- } else {
- // TRANS: Error message displayed when answer data is not present.
- $out->text(_m('Answer data is missing.'));
- }
-
- $out->elementEnd('div');
-
- // @todo FIXME
- $out->elementStart('div', array('class' => 'e-content'));
+ function adaptNoticeListItem($nli) {
+ return new QnAListItem($nli);
}
static function shorten($content, $notice)
--- /dev/null
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Adapter to show QnA in a nicer way
+ *
+ * PHP version 5
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category QnA
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+ // This check helps protect against security problems;
+ // your code file can't be executed directly from the web.
+ exit(1);
+}
+
+/**
+ * An adapter to show QnA in a nicer way
+ *
+ * @category QnA
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+class QnAListItem extends NoticeListItemAdapter
+{
+ /**
+ * Custom HTML output for our notices
+ *
+ * @param Notice $notice
+ * @param HTMLOutputter $out
+ */
+ function showNotice(Notice $notice, $out)
+ {
+ switch ($notice->object_type) {
+ case QnA_Question::OBJECT_TYPE:
+ return $this->showNoticeQuestion($notice, $out);
+ case QnA_Answer::OBJECT_TYPE:
+ return $this->showNoticeAnswer($notice, $out);
+ default:
+ throw new Exception(
+ // TRANS: Exception thrown when performing an unexpected action on a question.
+ // TRANS: %s is the unpexpected object type.
+ sprintf(_m('Unexpected type for QnA plugin: %s.'),
+ $notice->object_type
+ )
+ );
+ }
+ }
+
+ function showNoticeQuestion(Notice $notice, $out)
+ {
+ $user = common_current_user();
+
+ // @hack we want regular rendering, then just add stuff after that
+ $nli = new NoticeListItem($notice, $out);
+ $nli->showNotice();
+
+ $out->elementStart('div', array('class' => 'e-content question-description'));
+
+ $question = QnA_Question::getByNotice($notice);
+
+ if (!empty($question)) {
+
+ $form = new QnashowquestionForm($out, $question);
+ $form->show();
+
+ } else {
+ // TRANS: Error message displayed when question data is not present.
+ $out->text(_m('Question data is missing.'));
+ }
+ $out->elementEnd('div');
+
+ // @fixme
+ $out->elementStart('div', array('class' => 'e-content'));
+ }
+
+ function showNoticeAnswer(Notice $notice, $out)
+ {
+ $user = common_current_user();
+
+ $answer = QnA_Answer::getByNotice($notice);
+ $question = $answer->getQuestion();
+
+ $nli = new NoticeListItem($notice, $out);
+ $nli->showNotice();
+
+ $out->elementStart('div', array('class' => 'e-content answer-content'));
+
+ if (!empty($answer)) {
+ $form = new QnashowanswerForm($out, $answer);
+ $form->show();
+ } else {
+ // TRANS: Error message displayed when answer data is not present.
+ $out->text(_m('Answer data is missing.'));
+ }
+
+ $out->elementEnd('div');
+
+ // @todo FIXME
+ $out->elementStart('div', array('class' => 'e-content'));
+ }
+}
exit(1);
}
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once __DIR__ . '/twitter.php';
/**
* Plugin for sending and importing Twitter statuses
exit(1);
}
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
/**
* Class for doing OAuth authentication against Twitter
exit(1);
}
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
/**
* Page for logging in with Twitter
exit(1);
}
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
/**
* Settings for Twitter integration
END_OF_TRIM_HELP;
require_once INSTALLDIR . '/scripts/commandline.inc.php';
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
/**
* Daemon to sync local friends with Twitter friends
require_once INSTALLDIR . '/scripts/commandline.inc.php';
require_once INSTALLDIR . '/lib/common.php';
require_once INSTALLDIR . '/lib/daemon.php';
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
/**
* Fetch statuses from Twitter
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
/**
* Queue handler to deal with incoming Twitter status updates, as retrieved by
exit(1);
}
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
/**
* Encapsulation of the Twitter status -> notice incoming bridge import.
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
class TwitterQueueHandler extends QueueHandler
{
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once __DIR__ . '/twitter.php';
/**
* Queue handler to deal with incoming Twitter status updates, as retrieved by
ENDOFHELP;
-// No error reporting to avoid invalid daemon names
-error_reporting(0);
+// No unnecessary error reporting to avoid invalid daemon names
+error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE);
require_once INSTALLDIR.'/scripts/commandline.inc.php';
min-height: 1em;
}
-#shownotice .notice .h-entry {,
+#shownotice .notice .h-entry {
font-size:2.2em;
min-height:123px;
font-size: 1.6em;
top: 1em;
}
+.notice.h-entry .attachments .inline-attachment * {
+ max-width: 100%;
+}
+.notice.h-entry .attachments .inline-attachment > a {
+ font-size: 0.88em;
+ line-height: 16px;
+ height: 16px;
+}
+
#attachments {
clear:both;
float:left;
#profile_search_results {
display:block;
border-radius:4px;
--moz-border-radius:4px;
--webkit-border-radius:4px;
max-height:800px;
margin:10px 0;
padding: 5px;
padding: 6px;
margin: 4px 0px 0px 4px;
border-top-left-radius: 7px;
- -moz-border-radius-topleft: 7px;
- -webkit-border-top-left-radius: 7px;
}
.oauth-desktop-mode fieldset {
list-style-type: none;
}
-/*end of @media screen, projection, tv*/
+}/*end of @media screen, projection, tv*/
@media print {
border: 1px solid #aaa;
border-radius: 4px;
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.4);
- position: relative;
}
.notice-options .form_repeat.dialogbox legend {