summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/all.php3
-rw-r--r--actions/avatarbynickname.php4
-rw-r--r--actions/avatarsettings.php32
-rw-r--r--actions/deletenotice.php15
-rw-r--r--actions/favorited.php3
-rw-r--r--actions/grouplogo.php22
-rw-r--r--actions/noticesearch.php24
-rw-r--r--actions/public.php3
-rw-r--r--actions/replies.php2
-rw-r--r--actions/showfavorites.php2
-rw-r--r--actions/showgroup.php2
-rw-r--r--actions/showstream.php4
-rw-r--r--actions/tag.php3
-rw-r--r--actions/tagother.php2
-rw-r--r--actions/tagrss.php16
-rw-r--r--actions/twittersettings.php4
-rw-r--r--classes/Avatar.php50
-rw-r--r--classes/Profile.php21
-rwxr-xr-xclasses/User_group.php10
-rw-r--r--db/laconica_pg.sql57
-rw-r--r--js/facebookapp.js10
-rw-r--r--lib/imagefile.php61
-rw-r--r--lib/jabber.php2
-rw-r--r--lib/mailbox.php6
-rw-r--r--lib/noticelist.php4
-rw-r--r--lib/noticesection.php2
-rw-r--r--lib/personal.php1
-rw-r--r--lib/profilelist.php2
-rw-r--r--lib/profileminilist.php2
-rw-r--r--lib/profilesection.php2
-rw-r--r--lib/rssaction.php4
-rw-r--r--lib/twitterapi.php2
-rw-r--r--lib/util.php80
-rwxr-xr-xscripts/enjitqueuehandler.php2
-rw-r--r--theme/base/css/display.css13
-rw-r--r--theme/default/css/display.css6
-rw-r--r--theme/identica/css/display.css6
37 files changed, 292 insertions, 192 deletions
diff --git a/actions/all.php b/actions/all.php
index b03ad7ec3..d75d1b946 100644
--- a/actions/all.php
+++ b/actions/all.php
@@ -42,6 +42,9 @@ class AllAction extends Action
if (!$this->page) {
$this->page = 1;
}
+
+ common_set_returnto($this->selfUrl());
+
return true;
}
diff --git a/actions/avatarbynickname.php b/actions/avatarbynickname.php
index 9bbdecefa..ca58c9653 100644
--- a/actions/avatarbynickname.php
+++ b/actions/avatarbynickname.php
@@ -90,9 +90,9 @@ class AvatarbynicknameAction extends Action
$url = $avatar->url;
} else {
if ($size == 'original') {
- $url = common_default_avatar(AVATAR_PROFILE_SIZE);
+ $url = Avatar::defaultImage(AVATAR_PROFILE_SIZE);
} else {
- $url = common_default_avatar($size+0);
+ $url = Avatar::defaultImage($size+0);
}
}
common_redirect($url, 302);
diff --git a/actions/avatarsettings.php b/actions/avatarsettings.php
index 0f8122c07..7dd53f6eb 100644
--- a/actions/avatarsettings.php
+++ b/actions/avatarsettings.php
@@ -75,7 +75,7 @@ class AvatarsettingsAction extends AccountSettingsAction
function getInstructions()
{
- return _('You can upload your personal avatar. The maximum file size is '.ImageFile::maxFileSize().'.');
+ return sprintf(_('You can upload your personal avatar. The maximum file size is %s.'), ImageFile::maxFileSize());
}
/**
@@ -155,7 +155,7 @@ class AvatarsettingsAction extends AccountSettingsAction
$this->element('input', array('name' => 'MAX_FILE_SIZE',
'type' => 'hidden',
'id' => 'MAX_FILE_SIZE',
- 'value' => ImageFile::maxFileSize(true)));
+ 'value' => ImageFile::maxFileSizeInt()));
$this->elementEnd('li');
$this->elementEnd('ul');
@@ -200,7 +200,7 @@ class AvatarsettingsAction extends AccountSettingsAction
'class' => 'avatar_view'));
$this->element('h2', null, _("Original"));
$this->elementStart('div', array('id'=>'avatar_original_view'));
- $this->element('img', array('src' => common_avatar_url($this->filedata['filename']),
+ $this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => $this->filedata['width'],
'height' => $this->filedata['height'],
'alt' => $user->nickname));
@@ -212,7 +212,7 @@ class AvatarsettingsAction extends AccountSettingsAction
'class' => 'avatar_view'));
$this->element('h2', null, _("Preview"));
$this->elementStart('div', array('id'=>'avatar_preview_view'));
- $this->element('img', array('src' => common_avatar_url($this->filedata['filename']),
+ $this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => AVATAR_PROFILE_SIZE,
'height' => AVATAR_PROFILE_SIZE,
'alt' => $user->nickname));
@@ -281,12 +281,12 @@ class AvatarsettingsAction extends AccountSettingsAction
$cur = common_current_user();
- $filename = common_avatar_filename($cur->id,
- image_type_to_extension($imagefile->type),
- null,
- 'tmp'.common_timestamp());
+ $filename = Avatar::filename($cur->id,
+ image_type_to_extension($imagefile->type),
+ null,
+ 'tmp'.common_timestamp());
- $filepath = common_avatar_path($filename);
+ $filepath = Avatar::path($filename);
move_uploaded_file($imagefile->filepath, $filepath);
@@ -373,12 +373,14 @@ class AvatarsettingsAction extends AccountSettingsAction
{
parent::showScripts();
- $jcropPack = common_path('js/jcrop/jquery.Jcrop.pack.js');
- $jcropGo = common_path('js/jcrop/jquery.Jcrop.go.js');
+ if ($this->mode == 'crop') {
+ $jcropPack = common_path('js/jcrop/jquery.Jcrop.pack.js');
+ $jcropGo = common_path('js/jcrop/jquery.Jcrop.go.js');
- $this->element('script', array('type' => 'text/javascript',
- 'src' => $jcropPack));
- $this->element('script', array('type' => 'text/javascript',
- 'src' => $jcropGo));
+ $this->element('script', array('type' => 'text/javascript',
+ 'src' => $jcropPack));
+ $this->element('script', array('type' => 'text/javascript',
+ 'src' => $jcropGo));
+ }
}
}
diff --git a/actions/deletenotice.php b/actions/deletenotice.php
index d4b8e50e5..16e2df889 100644
--- a/actions/deletenotice.php
+++ b/actions/deletenotice.php
@@ -103,17 +103,18 @@ class DeletenoticeAction extends DeleteAction
function showContent()
{
- $this->elementStart('form', array('id' => 'notice_delete_form',
+ $this->elementStart('form', array('id' => 'form_notice_delete',
+ 'class' => 'form_settings',
'method' => 'post',
'action' => common_local_url('deletenotice')));
+ $this->elementStart('fieldset');
+ $this->element('legend', null, _('Delete notice'));
$this->hidden('token', common_session_token());
$this->hidden('notice', $this->trimmed('notice'));
- $this->elementStart('p');
- $this->element('span', array('id' => 'confirmation_text'),
- _('Are you sure you want to delete this notice?'));
- $this->submit('yes', _('Yes'));
- $this->submit('no', _('No'));
- $this->elementEnd('p');
+ $this->element('p', null, _('Are you sure you want to delete this notice?'));
+ $this->submit('form_action-yes', _('Yes'), 'submit form_action-primary', 'yes');
+ $this->submit('form_action-no', _('No'), 'submit form_action-secondary', 'no');
+ $this->elementEnd('fieldset');
$this->elementEnd('form');
}
diff --git a/actions/favorited.php b/actions/favorited.php
index 4155b3a23..fd5ff413c 100644
--- a/actions/favorited.php
+++ b/actions/favorited.php
@@ -104,6 +104,9 @@ class FavoritedAction extends Action
{
parent::prepare($args);
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
+
+ common_set_returnto($this->selfUrl());
+
return true;
}
diff --git a/actions/grouplogo.php b/actions/grouplogo.php
index 473303373..499db4ae8 100644
--- a/actions/grouplogo.php
+++ b/actions/grouplogo.php
@@ -152,7 +152,7 @@ class GrouplogoAction extends Action
function getInstructions()
{
- return _('You can upload a logo image for your group. The maximum file size is '.ImageFile::maxFileSize().'.');
+ return sprintf(_('You can upload a logo image for your group. The maximum file size is %s.'), ImageFile::maxFileSize());
}
/**
@@ -229,7 +229,7 @@ class GrouplogoAction extends Action
$this->element('input', array('name' => 'MAX_FILE_SIZE',
'type' => 'hidden',
'id' => 'MAX_FILE_SIZE',
- 'value' => ImageFile::maxFileSize(true)));
+ 'value' => ImageFile::maxFileSizeInt()));
$this->elementEnd('li');
$this->elementEnd('ul');
@@ -263,7 +263,7 @@ class GrouplogoAction extends Action
'class' => 'avatar_view'));
$this->element('h2', null, _("Original"));
$this->elementStart('div', array('id'=>'avatar_original_view'));
- $this->element('img', array('src' => common_avatar_url($this->filedata['filename']),
+ $this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => $this->filedata['width'],
'height' => $this->filedata['height'],
'alt' => $this->group->nickname));
@@ -275,7 +275,7 @@ class GrouplogoAction extends Action
'class' => 'avatar_view'));
$this->element('h2', null, _("Preview"));
$this->elementStart('div', array('id'=>'avatar_preview_view'));
- $this->element('img', array('src' => common_avatar_url($this->filedata['filename']),
+ $this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => AVATAR_PROFILE_SIZE,
'height' => AVATAR_PROFILE_SIZE,
'alt' => $this->group->nickname));
@@ -343,12 +343,12 @@ class GrouplogoAction extends Action
return;
}
- $filename = common_avatar_filename($this->group->id,
- image_type_to_extension($imagefile->type),
- null,
- 'group-temp-'.common_timestamp());
+ $filename = Avatar::filename($this->group->id,
+ image_type_to_extension($imagefile->type),
+ null,
+ 'group-temp-'.common_timestamp());
- $filepath = common_avatar_path($filename);
+ $filepath = Avatar::path($filename);
move_uploaded_file($imagefile->filepath, $filepath);
@@ -382,7 +382,7 @@ class GrouplogoAction extends Action
$this->serverError(_('Lost our file data.'));
return;
}
-
+
// If image is not being cropped assume pos & dimentions of original
$dest_x = $this->arg('avatar_crop_x') ? $this->arg('avatar_crop_x'):0;
$dest_y = $this->arg('avatar_crop_y') ? $this->arg('avatar_crop_y'):0;
@@ -390,7 +390,7 @@ class GrouplogoAction extends Action
$dest_h = $this->arg('avatar_crop_h') ? $this->arg('avatar_crop_h'):$filedata['height'];
$size = min($dest_w, $dest_h);
$size = ($size > MAX_ORIGINAL) ? MAX_ORIGINAL:$size;
-
+
$imagefile = new ImageFile($this->group->id, $filedata['filepath']);
$filename = $imagefile->resize($size, $dest_x, $dest_y, $dest_w, $dest_h);
diff --git a/actions/noticesearch.php b/actions/noticesearch.php
index a0d723b12..a5f01350c 100644
--- a/actions/noticesearch.php
+++ b/actions/noticesearch.php
@@ -48,6 +48,16 @@ require_once INSTALLDIR.'/lib/searchaction.php';
*/
class NoticesearchAction extends SearchAction
{
+
+ function prepare($args)
+ {
+ parent::prepare($args);
+
+ common_set_returnto($this->selfUrl());
+
+ return true;
+ }
+
/**
* Get instructions
*
@@ -154,8 +164,9 @@ class NoticesearchAction extends SearchAction
$this->elementStart('div', 'entry-title');
$this->elementStart('span', 'vcard author');
$avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
- $this->elementStart('a', array('href' => $profile->profileurl));
- $this->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE),
+ $this->elementStart('a', array('href' => $profile->profileurl,
+ 'class' => 'url'));
+ $this->element('img', array('src' => ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_STREAM_SIZE),
'class' => 'avatar photo',
'width' => AVATAR_STREAM_SIZE,
'height' => AVATAR_STREAM_SIZE,
@@ -223,15 +234,6 @@ class NoticesearchAction extends SearchAction
$this->elementEnd('a');
$this->elementEnd('dd');
$this->elementEnd('dl');
-
- $this->elementStart('a',
- array('href' => common_local_url('newnotice',
- array('replyto' => $profile->nickname)),
- 'onclick' => 'doreply("'.$profile->nickname.'"); return false',
- 'title' => _('reply'),
- 'class' => 'replybutton'));
- $this->hidden('posttoken', common_session_token());
- $this->elementEnd('a');
$this->elementEnd('div');
$this->elementEnd('li');
}
diff --git a/actions/public.php b/actions/public.php
index cfdc99bb3..cc6537f74 100644
--- a/actions/public.php
+++ b/actions/public.php
@@ -73,6 +73,9 @@ class PublicAction extends Action
{
parent::prepare($args);
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
+
+ common_set_returnto($this->selfUrl());
+
return true;
}
diff --git a/actions/replies.php b/actions/replies.php
index 9ec373a96..7eff74a66 100644
--- a/actions/replies.php
+++ b/actions/replies.php
@@ -83,6 +83,8 @@ class RepliesAction extends Action
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
+ common_set_returnto($this->selfUrl());
+
return true;
}
diff --git a/actions/showfavorites.php b/actions/showfavorites.php
index bb68f8d94..31479e1a7 100644
--- a/actions/showfavorites.php
+++ b/actions/showfavorites.php
@@ -112,6 +112,8 @@ class ShowfavoritesAction extends Action
$this->page = 1;
}
+ common_set_returnto($this->selfUrl());
+
return true;
}
diff --git a/actions/showgroup.php b/actions/showgroup.php
index 468990e7b..7bc68fbc6 100644
--- a/actions/showgroup.php
+++ b/actions/showgroup.php
@@ -129,6 +129,8 @@ class ShowgroupAction extends Action
return false;
}
+ common_set_returnto($this->selfUrl());
+
return true;
}
diff --git a/actions/showstream.php b/actions/showstream.php
index 4b1679969..28bb8453f 100644
--- a/actions/showstream.php
+++ b/actions/showstream.php
@@ -110,6 +110,8 @@ class ShowstreamAction extends Action
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
+ common_set_returnto($this->selfUrl());
+
return true;
}
@@ -240,7 +242,7 @@ class ShowstreamAction extends Action
$this->elementStart('dl', 'entity_depiction');
$this->element('dt', null, _('Photo'));
$this->elementStart('dd');
- $this->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE),
+ $this->element('img', array('src' => ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE),
'class' => 'photo avatar',
'width' => AVATAR_PROFILE_SIZE,
'height' => AVATAR_PROFILE_SIZE,
diff --git a/actions/tag.php b/actions/tag.php
index 803026e62..4401f892a 100644
--- a/actions/tag.php
+++ b/actions/tag.php
@@ -37,6 +37,9 @@ class TagAction extends Action
}
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
+
+ common_set_returnto($this->selfUrl());
+
return true;
}
diff --git a/actions/tagother.php b/actions/tagother.php
index cbace5b6b..3e8a12fd6 100644
--- a/actions/tagother.php
+++ b/actions/tagother.php
@@ -80,7 +80,7 @@ class TagotherAction extends Action
$this->elementStart('dl', 'entity_depiction');
$this->element('dt', null, _('Photo'));
$this->elementStart('dd');
- $this->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE),
+ $this->element('img', array('src' => ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE),
'class' => 'photo avatar',
'width' => AVATAR_PROFILE_SIZE,
'height' => AVATAR_PROFILE_SIZE,
diff --git a/actions/tagrss.php b/actions/tagrss.php
index b4c2dcdff..a77fa12c9 100644
--- a/actions/tagrss.php
+++ b/actions/tagrss.php
@@ -25,12 +25,12 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
class TagrssAction extends Rss10Action
{
+ var $tag;
- function init()
- {
- $tag = $this->trimmed('tag');
+ function prepare($args) {
+ parent::prepare($args);
+ $tag = common_canonical_tag($this->trimmed('tag'));
$this->tag = Notice_tag::staticGet('tag', $tag);
-
if (!$this->tag) {
$this->clientError(_('No such tag.'));
return false;
@@ -39,7 +39,7 @@ class TagrssAction extends Rss10Action
}
}
- function get_notices($limit=0)
+ function getNotices($limit=0)
{
$tag = $this->tag;
@@ -48,7 +48,6 @@ class TagrssAction extends Rss10Action
}
$notice = Notice_tag::getStream($tag->tag, 0, ($limit == 0) ? NOTICES_PER_PAGE : $limit);
-
while ($notice->fetch()) {
$notices[] = clone($notice);
}
@@ -56,10 +55,9 @@ class TagrssAction extends Rss10Action
return $notices;
}
- function get_channel()
+ function getChannel()
{
- $tag = $this->tag->tag;
-
+ $tagname = $this->tag->tag;
$c = array('url' => common_local_url('tagrss', array('tag' => $tagname)),
'title' => $tagname,
'link' => common_local_url('tagrss', array('tag' => $tagname)),
diff --git a/actions/twittersettings.php b/actions/twittersettings.php
index b3bf67dc3..2d41469bb 100644
--- a/actions/twittersettings.php
+++ b/actions/twittersettings.php
@@ -250,8 +250,8 @@ class TwittersettingsAction extends ConnectSettingsAction
$avatar = $other->getAvatar(AVATAR_MINI_SIZE);
$avatar_url = ($avatar) ?
- common_avatar_display_url($avatar) :
- common_default_avatar(AVATAR_MINI_SIZE);
+ $avatar->displayUrl() :
+ Avatar::defaultImage(AVATAR_MINI_SIZE);
$this->element('img', array('src' => $avatar_url,
'width' => AVATAR_MINI_SIZE,
diff --git a/classes/Avatar.php b/classes/Avatar.php
index 6a9ea7686..db9d78e47 100644
--- a/classes/Avatar.php
+++ b/classes/Avatar.php
@@ -4,18 +4,18 @@
*/
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
-class Avatar extends Memcached_DataObject
+class Avatar extends Memcached_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
public $__table = 'avatar'; // table name
public $profile_id; // int(4) primary_key not_null
- public $original; // tinyint(1)
+ public $original; // tinyint(1)
public $width; // int(4) primary_key not_null
public $height; // int(4) primary_key not_null
public $mediatype; // varchar(32) not_null
- public $filename; // varchar(255)
+ public $filename; // varchar(255)
public $url; // varchar(255) unique_key
public $created; // datetime() not_null
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
@@ -33,13 +33,51 @@ class Avatar extends Memcached_DataObject
{
$filename = $this->filename;
if (parent::delete()) {
- @unlink(common_avatar_path($filename));
+ @unlink(Avatar::path($filename));
}
}
-
- function &pkeyGet($kv)
+
+ function &pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('Avatar', $kv);
}
+ // where should the avatar go for this user?
+
+ static function filename($id, $extension, $size=null, $extra=null)
+ {
+ if ($size) {
+ return $id . '-' . $size . (($extra) ? ('-' . $extra) : '') . $extension;
+ } else {
+ return $id . '-original' . (($extra) ? ('-' . $extra) : '') . $extension;
+ }
+ }
+
+ static function path($filename)
+ {
+ return INSTALLDIR . '/avatar/' . $filename;
+ }
+
+ static function url($filename)
+ {
+ return common_path('avatar/'.$filename);
+ }
+
+ function displayUrl()
+ {
+ $server = common_config('avatar', 'server');
+ if ($server) {
+ return 'http://'.$server.'/'.$this->filename;
+ } else {
+ return $this->url;
+ }
+ }
+
+ static function defaultImage($size)
+ {
+ static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
+ AVATAR_STREAM_SIZE => 'stream',
+ AVATAR_MINI_SIZE => 'mini');
+ return theme_path('default-avatar-'.$sizenames[$size].'.png');
+ }
}
diff --git a/classes/Profile.php b/classes/Profile.php
index 5be632f87..f3bfe299c 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -71,7 +71,7 @@ class Profile extends Memcached_DataObject
function setOriginal($filename)
{
- $imagefile = new ImageFile($this->id, common_avatar_path($filename));
+ $imagefile = new ImageFile($this->id, Avatar::path($filename));
$avatar = new Avatar();
$avatar->profile_id = $this->id;
@@ -80,22 +80,22 @@ class Profile extends Memcached_DataObject
$avatar->mediatype = image_type_to_mime_type($imagefile->type);
$avatar->filename = $filename;
$avatar->original = true;
- $avatar->url = common_avatar_url($filename);
+ $avatar->url = Avatar::url($filename);
$avatar->created = DB_DataObject_Cast::dateTime(); # current time
# XXX: start a transaction here
if (!$this->delete_avatars() || !$avatar->insert()) {
- @unlink(common_avatar_path($filename));
+ @unlink(Avatar::path($filename));
return null;
}
foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) {
# We don't do a scaled one if original is our scaled size
if (!($avatar->width == $size && $avatar->height == $size)) {
-
+
$scaled_filename = $imagefile->resize($size);
-
+
//$scaled = DB_DataObject::factory('avatar');
$scaled = new Avatar();
$scaled->profile_id = $this->id;
@@ -104,7 +104,7 @@ class Profile extends Memcached_DataObject
$scaled->original = false;
$scaled->mediatype = image_type_to_mime_type($imagefile->type);
$scaled->filename = $scaled_filename;
- $scaled->url = common_avatar_url($scaled_filename);
+ $scaled->url = Avatar::url($scaled_filename);
$scaled->created = DB_DataObject_Cast::dateTime(); # current time
if (!$scaled->insert()) {
@@ -194,4 +194,13 @@ class Profile extends Memcached_DataObject
}
}
+ function avatarUrl($size=AVATAR_PROFILE_SIZE)
+ {
+ $avatar = $this->getAvatar($size);
+ if ($avatar) {
+ return $avatar->displayUrl();
+ } else {
+ return Avatar::defaultImage($size);
+ }
+ }
}
diff --git a/classes/User_group.php b/classes/User_group.php
index 340d7f67a..d152f9d56 100755
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -90,13 +90,13 @@ class User_group extends Memcached_DataObject
function setOriginal($filename)
{
- $imagefile = new ImageFile($this->id, common_avatar_path($filename));
+ $imagefile = new ImageFile($this->id, Avatar::path($filename));
$orig = clone($this);
- $this->original_logo = common_avatar_url($filename);
- $this->homepage_logo = common_avatar_url($imagefile->resize(AVATAR_PROFILE_SIZE));
- $this->stream_logo = common_avatar_url($imagefile->resize(AVATAR_STREAM_SIZE));
- $this->mini_logo = common_avatar_url($imagefile->resize(AVATAR_MINI_SIZE));
+ $this->original_logo = Avatar::url($filename);
+ $this->homepage_logo = Avatar::url($imagefile->resize(AVATAR_PROFILE_SIZE));
+ $this->stream_logo = Avatar::url($imagefile->resize(AVATAR_STREAM_SIZE));
+ $this->mini_logo = Avatar::url($imagefile->resize(AVATAR_MINI_SIZE));
common_debug(common_log_objstring($this));
return $this->update($orig);
}
diff --git a/db/laconica_pg.sql b/db/laconica_pg.sql
index c3efd9daa..9882d091a 100644
--- a/db/laconica_pg.sql
+++ b/db/laconica_pg.sql
@@ -50,7 +50,7 @@ create table "user" (
emailnotifyfav integer default 1 /* comment 'Notify by email of favorites' */,
emailnotifynudge integer default 1 /* comment 'Notify by email of nudges' */,
emailnotifymsg integer default 1 /* comment 'Notify by email of direct messages' */,
-emailmicroid integer default 1 /* comment 'whether to publish email microid' */,
+ emailmicroid integer default 1 /* comment 'whether to publish email microid' */,
language varchar(50) /* comment 'preferred language' */,
timezone varchar(50) /* comment 'timezone' */,
emailpost integer default 1 /* comment 'Post by email' */,
@@ -146,7 +146,6 @@ create table fave (
notice_id integer not null /* comment 'notice that is the favorite' */ references notice (id),
user_id integer not null /* comment 'user who likes this notice' */ references "user" (id) ,
modified timestamp not null /* comment 'date this record was modified' */,
-
primary key (notice_id, user_id)
);
@@ -288,6 +287,7 @@ create table foreign_link (
credentials varchar(255) /* comment 'authc credentials, typically a password' */,
noticesync int not null default 1 /* comment 'notice synchronisation, bit 1 = sync outgoing, bit 2 = sync incoming, bit 3 = filter local replies' */,
friendsync int not null default 2 /* comment 'friend synchronisation, bit 1 = sync outgoing, bit 2 = sync incoming */,
+ profilesync int not null default 1 /* comment 'profile synchronization, bit 1 = sync outgoing, bit 2 = sync incoming' */,
created timestamp not null /* comment 'date this record was created' */,
modified timestamp not null /* comment 'date this record was modified' */,
@@ -367,6 +367,59 @@ create table profile_block (
);
+create table user_group (
+
+ id serial primary key /* comment 'unique identifier' */,
+
+ nickname varchar(64) unique /* comment 'nickname for addressing' */,
+ fullname varchar(255) /* comment 'display name' */,
+ homepage varchar(255) /* comment 'URL, cached so we dont regenerate' */,
+ description varchar(140) /* comment 'descriptive biography' */,
+ location varchar(255) /* comment 'related physical location, if any' */,
+
+ original_logo varchar(255) /* comment 'original size logo' */,
+ homepage_logo varchar(255) /* comment 'homepage (profile) size logo' */,
+ stream_logo varchar(255) /* comment 'stream-sized logo' */,
+ mini_logo varchar(255) /* comment 'mini logo' */,
+
+ created timestamp not null /* comment 'date this record was created' */,
+ modified timestamp /* comment 'date this record was modified' */
+
+);
+create index user_group_nickname_idx on user_group using btree(nickname);
+
+create table group_member (
+
+ group_id integer not null /* comment 'foreign key to user_group' */ references user_group (id),
+ profile_id integer not null /* comment 'foreign key to profile table' */ references profile (id),
+ is_admin integer default 0 /* comment 'is this user an admin?' */,
+
+ created timestamp not null /* comment 'date this record was created' */,
+ modified timestamp /* comment 'date this record was modified' */,
+
+ primary key (group_id, profile_id)
+);
+
+create table related_group (
+
+ group_id integer not null /* comment 'foreign key to user_group' */ references user_group (id) ,
+ related_group_id integer not null /* comment 'foreign key to user_group' */ references user_group (id),
+
+ created timestamp not null /* comment 'date this record was created' */,
+
+ primary key (group_id, related_group_id)
+
+);
+
+create table group_inbox (
+ group_id integer not null /* comment 'group receiving the message' references user_group (id) */,
+ notice_id integer not null /* comment 'notice received' references notice (id) */,
+ created timestamp not null /* comment 'date the notice was created' */,
+
+ primary key (group_id, notice_id)
+);
+create index group_inbox_created_idx on group_inbox using btree(created);
+
/* Textsearch stuff */
create index textsearch_idx on profile using gist(textsearch);
diff --git a/js/facebookapp.js b/js/facebookapp.js
index 8ef9aa532..f0696c19e 100644
--- a/js/facebookapp.js
+++ b/js/facebookapp.js
@@ -19,10 +19,12 @@
var max = 140;
var noticeBox = document.getElementById('notice_data-text');
-noticeBox.addEventListener('keyup', keypress);
-noticeBox.addEventListener('keydown', keypress);
-noticeBox.addEventListener('keypress', keypress);
-noticeBox.addEventListener('change', keypress);
+if (noticeBox) {
+ noticeBox.addEventListener('keyup', keypress);
+ noticeBox.addEventListener('keydown', keypress);
+ noticeBox.addEventListener('keypress', keypress);
+ noticeBox.addEventListener('change', keypress);
+}
// Do our the countdown
function keypress(evt) {
diff --git a/lib/imagefile.php b/lib/imagefile.php
index 74c3d14f0..db344db8f 100644
--- a/lib/imagefile.php
+++ b/lib/imagefile.php
@@ -58,7 +58,7 @@ class ImageFile
{
$this->id = $id;
$this->filepath = $filepath;
-
+
$info = @getimagesize($this->filepath);
$this->type = ($info) ? $info[2]:$type;
$this->width = ($info) ? $info[0]:$width;
@@ -72,7 +72,7 @@ class ImageFile
break;
case UPLOAD_ERR_INI_SIZE:
case UPLOAD_ERR_FORM_SIZE:
- throw new Exception(_('That file is too big. The maximum file size is '.$this->maxFileSize().'.'));
+ throw new Exception(sprintf(_('That file is too big. The maximum file size is %d.'), $this->maxFileSize()));
return;
case UPLOAD_ERR_PARTIAL:
@unlink($_FILES[$param]['tmp_name']);
@@ -82,19 +82,19 @@ class ImageFile
throw new Exception(_('System error uploading file.'));
return;
}
-
+
$info = @getimagesize($_FILES[$param]['tmp_name']);
-
+
if (!$info) {
@unlink($_FILES[$param]['tmp_name']);
throw new Exception(_('Not an image or corrupt file.'));
return;
}
-
+
if ($info[2] !== IMAGETYPE_GIF &&
$info[2] !== IMAGETYPE_JPEG &&
$info[2] !== IMAGETYPE_PNG) {
-
+
@unlink($_FILES[$param]['tmp_name']);
throw new Exception(_('Unsupported image file format.'));
return;
@@ -102,7 +102,7 @@ class ImageFile
return new ImageFile(null, $_FILES[$param]['tmp_name']);
}
-
+
function resize($size, $x = 0, $y = 0, $w = null, $h = null)
{
$w = ($w === null) ? $this->width:$w;
@@ -129,36 +129,36 @@ class ImageFile
}
$image_dest = imagecreatetruecolor($size, $size);
-
+
if ($this->type == IMAGETYPE_GIF || $this->type == IMAGETYPE_PNG) {
$transparent_idx = imagecolortransparent($image_src);
-
+
if ($transparent_idx >= 0) {
-
+
$transparent_color = imagecolorsforindex($image_src, $transparent_idx);
$transparent_idx = imagecolorallocate($image_dest, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);
imagefill($image_dest, 0, 0, $transparent_idx);
imagecolortransparent($image_dest, $transparent_idx);
-
+
} elseif ($this->type == IMAGETYPE_PNG) {
-
+
imagealphablending($image_dest, false);
$transparent = imagecolorallocatealpha($image_dest, 0, 0, 0, 127);
imagefill($image_dest, 0, 0, $transparent);
imagesavealpha($image_dest, true);
-
+
}
}
imagecopyresampled($image_dest, $image_src, 0, 0, $x, $y, $size, $size, $w, $h);
- $outname = common_avatar_filename($this->id,
+ $outname = Avatar::filename($this->id,
image_type_to_extension($this->type),
$size,
common_timestamp());
- $outpath = common_avatar_path($outname);
+ $outpath = Avatar::path($outname);
switch ($this->type) {
case IMAGETYPE_GIF:
@@ -182,23 +182,32 @@ class ImageFile
{
@unlink($this->filename);
}
-
- static function maxFileSize($return_bytes = false)
+
+ static function maxFileSize()
{
- $limit = min(ImageFile::strToInt(ini_get('post_max_size')), ImageFile::strToInt(ini_get('upload_max_filesize')), ImageFile::strToInt(ini_get('memory_limit')));
-
- if ($return_bytes) {
- return $limit;
+ $value = ImageFile::maxFileSizeInt();
+
+ if ($value > 1024 * 1024) {
+ return ($value/(1024*1024)).'Mb';
+ } else if ($value > 1024) {
+ return ($value/(1024)).'kB';
+ } else {
+ return $value;
}
-
- return ($limit/(1024*1024)).'MB';
}
-
+
+ static function maxFileSizeInt()
+ {
+ return min(ImageFile::strToInt(ini_get('post_max_size')),
+ ImageFile::strToInt(ini_get('upload_max_filesize')),
+ ImageFile::strToInt(ini_get('memory_limit')));
+ }
+
static function strToInt($str)
{
$unit = substr($str, -1);
$num = substr($str, 0, -1);
-
+
switch(strtoupper($unit)){
case 'G':
$num *= 1024;
@@ -207,7 +216,7 @@ class ImageFile
case 'K':
$num *= 1024;
}
-
+
return $num;
}
} \ No newline at end of file
diff --git a/lib/jabber.php b/lib/jabber.php
index f1be57768..f41d984d6 100644
--- a/lib/jabber.php
+++ b/lib/jabber.php
@@ -178,7 +178,7 @@ function jabber_format_entry($profile, $notice)
$entry .= "<link href='" . htmlspecialchars($profile->profileurl) . "'/>\n";
$entry .= "<link rel='self' type='application/rss+xml' href='" . $self_url . "'/>\n";
$entry .= "<author><name>" . $profile->nickname . "</name></author>\n";
- $entry .= "<icon>" . common_profile_avatar_url($profile, AVATAR_PROFILE_SIZE) . "</icon>\n";
+ $entry .= "<icon>" . $profile->avatarUrl(AVATAR_PROFILE_SIZE) . "</icon>\n";
$entry .= "</source>\n";
$entry .= "<title>" . htmlspecialchars($msg) . "</title>\n";
$entry .= "<summary>" . htmlspecialchars($msg) . "</summary>\n";
diff --git a/lib/mailbox.php b/lib/mailbox.php
index 8d5d44e49..d77234549 100644
--- a/lib/mailbox.php
+++ b/lib/mailbox.php
@@ -63,6 +63,8 @@ class MailboxAction extends PersonalAction
$this->page = 1;
}
+ common_set_returnto($this->selfUrl());
+
return true;
}
@@ -181,8 +183,8 @@ class MailboxAction extends PersonalAction
'class' => 'url'));
$avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
$this->element('img', array('src' => ($avatar) ?
- common_avatar_display_url($avatar) :
- common_default_avatar(AVATAR_STREAM_SIZE),
+ $avatar->displayUrl() :
+ Avatar::defaultImage(AVATAR_STREAM_SIZE),
'class' => 'photo avatar',
'width' => AVATAR_STREAM_SIZE,
'height' => AVATAR_STREAM_SIZE,
diff --git a/lib/noticelist.php b/lib/noticelist.php
index 3ef6691af..9fc0126b3 100644
--- a/lib/noticelist.php
+++ b/lib/noticelist.php
@@ -285,8 +285,8 @@ class NoticeListItem extends Widget
$avatar = $this->profile->getAvatar($avatar_size);
$this->out->element('img', array('src' => ($avatar) ?
- common_avatar_display_url($avatar) :
- common_default_avatar($avatar_size),
+ $avatar->displayUrl() :
+ Avatar::defaultImage($avatar_size),
'class' => 'avatar photo',
'width' => $avatar_size,
'height' => $avatar_size,
diff --git a/lib/noticesection.php b/lib/noticesection.php
index aa8e03229..97b517529 100644
--- a/lib/noticesection.php
+++ b/lib/noticesection.php
@@ -82,7 +82,7 @@ class NoticeSection extends Section
$profile->nickname,
'href' => $profile->profileurl,
'class' => 'url'));
- $this->out->element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)),
+ $this->out->element('img', array('src' => (($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_MINI_SIZE)),
'width' => AVATAR_MINI_SIZE,
'height' => AVATAR_MINI_SIZE,
'class' => 'avatar photo',
diff --git a/lib/personal.php b/lib/personal.php
index 900df0257..e46350c63 100644
--- a/lib/personal.php
+++ b/lib/personal.php
@@ -55,7 +55,6 @@ class PersonalAction extends Action
function handle($args)
{
parent::handle($args);
- common_set_returnto($this->selfUrl());
}
}
diff --git a/lib/profilelist.php b/lib/profilelist.php
index 6e14c0b69..4d924b039 100644
--- a/lib/profilelist.php
+++ b/lib/profilelist.php
@@ -97,7 +97,7 @@ class ProfileList extends Widget
$avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE);
$this->out->elementStart('a', array('href' => $this->profile->profileurl,
'class' => 'url'));
- $this->out->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE),
+ $this->out->element('img', array('src' => ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_STREAM_SIZE),
'class' => 'photo avatar',
'width' => AVATAR_STREAM_SIZE,
'height' => AVATAR_STREAM_SIZE,
diff --git a/lib/profileminilist.php b/lib/profileminilist.php
index 81cd7aed5..0d466bba8 100644
--- a/lib/profileminilist.php
+++ b/lib/profileminilist.php
@@ -74,7 +74,7 @@ class ProfileMiniList extends ProfileList
'rel' => 'contact member',
'class' => 'url'));
$avatar = $this->profile->getAvatar(AVATAR_MINI_SIZE);
- $this->out->element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)),
+ $this->out->element('img', array('src' => (($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_MINI_SIZE)),
'width' => AVATAR_MINI_SIZE,
'height' => AVATAR_MINI_SIZE,
'class' => 'avatar photo',
diff --git a/lib/profilesection.php b/lib/profilesection.php
index 3642ae164..8ed290e03 100644
--- a/lib/profilesection.php
+++ b/lib/profilesection.php
@@ -86,7 +86,7 @@ class ProfileSection extends Section
'rel' => 'contact member',
'class' => 'url'));
$avatar = $profile->getAvatar(AVATAR_MINI_SIZE);
- $this->out->element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)),
+ $this->out->element('img', array('src' => (($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_MINI_SIZE)),
'width' => AVATAR_MINI_SIZE,
'height' => AVATAR_MINI_SIZE,
'class' => 'avatar photo',
diff --git a/lib/rssaction.php b/lib/rssaction.php
index 2bd7f1f19..131e8ac65 100644
--- a/lib/rssaction.php
+++ b/lib/rssaction.php
@@ -199,7 +199,7 @@ class Rss10Action extends Action
$this->element('dc:date', null, common_date_w3dtf($notice->created));
$this->element('dc:creator', null, ($profile->fullname) ? $profile->fullname : $profile->nickname);
$this->element('sioc:has_creator', array('rdf:resource' => $creator_uri));
- $this->element('laconica:postIcon', array('rdf:resource' => common_profile_avatar_url($profile)));
+ $this->element('laconica:postIcon', array('rdf:resource' => $profile->avatarUrl()));
$this->element('cc:licence', array('rdf:resource' => common_config('license', 'url')));
$this->elementEnd('item');
$this->creators[$creator_uri] = $profile;
@@ -216,7 +216,7 @@ class Rss10Action extends Action
$this->element('foaf:name', null, $profile->fullname);
}
$this->element('sioc:id', null, $id);
- $avatar = common_profile_avatar_url($profile);
+ $avatar = $profile->avatarUrl();
$this->element('sioc:avatar', array('rdf:resource' => $avatar));
$this->elementEnd('sioc:User');
}
diff --git a/lib/twitterapi.php b/lib/twitterapi.php
index da8b8b1e5..a4d183fcd 100644
--- a/lib/twitterapi.php
+++ b/lib/twitterapi.php
@@ -43,7 +43,7 @@ class TwitterapiAction extends Action
$avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
- $twitter_user['profile_image_url'] = ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE);
+ $twitter_user['profile_image_url'] = ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_STREAM_SIZE);
$twitter_user['protected'] = 'false'; # not supported by Laconica yet
$twitter_user['url'] = ($profile->homepage) ? $profile->homepage : null;
diff --git a/lib/util.php b/lib/util.php
index 35a9d0bd4..7ce4e229e 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -409,15 +409,15 @@ function common_replace_urls_callback($text, $callback) {
)
#ix';
preg_match_all($regex, $text, $matches);
-
+
// Then clean up what the regex left behind
$offset = 0;
foreach($matches[0] as $url) {
$url = htmlspecialchars_decode($url);
-
+
// Make sure we didn't pick up an email address
if (preg_match('#^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$#i', $url)) continue;
-
+
// Remove trailing punctuation
$url = rtrim($url, '.?!,;:\'"`');
@@ -436,48 +436,48 @@ function common_replace_urls_callback($text, $callback) {
// Remove trailing punctuation again (in case there were some inside parens)
$url = rtrim($url, '.?!,;:\'"`');
-
+
// Make sure we didn't capture part of the next sentence
preg_match('#((?:[^.\s/]+\.)+)(museum|travel|[a-z]{2,4})#i', $url, $url_parts);
-
+
// Were the parts capitalized any?
$last_part = (mb_strtolower($url_parts[2]) !== $url_parts[2]) ? true:false;
$prev_part = (mb_strtolower($url_parts[1]) !== $url_parts[1]) ? true:false;
-
+
// If the first part wasn't cap'd but the last part was, we captured too much
if ((!$prev_part && $last_part)) {
$url = substr_replace($url, '', mb_strpos($url, '.'.$url_parts[2], 0));
}
-
+
// Capture the new TLD
preg_match('#((?:[^.\s/]+\.)+)(museum|travel|[a-z]{2,4})#i', $url, $url_parts);
-
+
$tlds = array('ac', 'ad', 'ae', 'aero', 'af', 'ag', 'ai', 'al', 'am', 'an', 'ao', 'aq', 'ar', 'arpa', 'as', 'asia', 'at', 'au', 'aw', 'ax', 'az', 'ba', 'bb', 'bd', 'be', 'bf', 'bg', 'bh', 'bi', 'biz', 'bj', 'bm', 'bn', 'bo', 'br', 'bs', 'bt', 'bv', 'bw', 'by', 'bz', 'ca', 'cat', 'cc', 'cd', 'cf', 'cg', 'ch', 'ci', 'ck', 'cl', 'cm', 'cn', 'co', 'com', 'coop', 'cr', 'cu', 'cv', 'cx', 'cy', 'cz', 'de', 'dj', 'dk', 'dm', 'do', 'dz', 'ec', 'edu', 'ee', 'eg', 'er', 'es', 'et', 'eu', 'fi', 'fj', 'fk', 'fm', 'fo', 'fr', 'ga', 'gb', 'gd', 'ge', 'gf', 'gg', 'gh', 'gi', 'gl', 'gm', 'gn', 'gov', 'gp', 'gq', 'gr', 'gs', 'gt', 'gu', 'gw', 'gy', 'hk', 'hm', 'hn', 'hr', 'ht', 'hu', 'id', 'ie', 'il', 'im', 'in', 'info', 'int', 'io', 'iq', 'ir', 'is', 'it', 'je', 'jm', 'jo', 'jobs', 'jp', 'ke', 'kg', 'kh', 'ki', 'km', 'kn', 'kp', 'kr', 'kw', 'ky', 'kz', 'la', 'lb', 'lc', 'li', 'lk', 'lr', 'ls', 'lt', 'lu', 'lv', 'ly', 'ma', 'mc', 'md', 'me', 'mg', 'mh', 'mil', 'mk', 'ml', 'mm', 'mn', 'mo', 'mobi', 'mp', 'mq', 'mr', 'ms', 'mt', 'mu', 'museum', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'name', 'nc', 'ne', 'net', 'nf', 'ng', 'ni', 'nl', 'no', 'np', 'nr', 'nu', 'nz', 'om', 'org', 'pa', 'pe', 'pf', 'pg', 'ph', 'pk', 'pl', 'pm', 'pn', 'pr', 'pro', 'ps', 'pt', 'pw', 'py', 'qa', 're', 'ro', 'rs', 'ru', 'rw', 'sa', 'sb', 'sc', 'sd', 'se', 'sg', 'sh', 'si', 'sj', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'st', 'su', 'sv', 'sy', 'sz', 'tc', 'td', 'tel', 'tf', 'tg', 'th', 'tj', 'tk', 'tl', 'tm', 'tn', 'to', 'tp', 'tr', 'travel', 'tt', 'tv', 'tw', 'tz', 'ua', 'ug', 'uk', 'us', 'uy', 'uz', 'va', 'vc', 've', 'vg', 'vi', 'vn', 'vu', 'wf', 'ws', 'ye', 'yt', 'yu', 'za', 'zm', 'zw');
if (!in_array($url_parts[2], $tlds)) continue;
-
+
// Call user specified func
$modified_url = $callback($url);
-
+
// Replace it!
$start = mb_strpos($text, $url, $offset);
$text = mb_substr($text, 0, $start).$modified_url.mb_substr($text, $start + mb_strlen($url), mb_strlen($text));
$offset = $start + mb_strlen($modified_url);
}
-
+
return $text;
}
function common_linkify($url) {
$display = $url;
$url = (!preg_match('#^([a-z]+://|(mailto|aim|tel):)#i', $url)) ? 'http://'.$url:$url;
-
+
if ($longurl = common_longurl($url)) {
$longurl = htmlentities($longurl, ENT_QUOTES, 'UTF-8');
$title = "title=\"$longurl\"";
}
else $title = '';
-
+
return "<a href=\"$url\" $title class=\"extlink\">$display</a>";
}
@@ -667,48 +667,6 @@ function common_relative_profile($sender, $nickname, $dt=null)
return null;
}
-// where should the avatar go for this user?
-
-function common_avatar_filename($id, $extension, $size=null, $extra=null)
-{
- global $config;
-
- if ($size) {
- return $id . '-' . $size . (($extra) ? ('-' . $extra) : '') . $extension;
- } else {
- return $id . '-original' . (($extra) ? ('-' . $extra) : '') . $extension;
- }
-}
-
-function common_avatar_path($filename)
-{
- global $config;
- return INSTALLDIR . '/avatar/' . $filename;
-}
-
-function common_avatar_url($filename)
-{
- return common_path('avatar/'.$filename);
-}
-
-function common_avatar_display_url($avatar)
-{
- $server = common_config('avatar', 'server');
- if ($server) {
- return 'http://'.$server.'/'.$avatar->filename;
- } else {
- return $avatar->url;
- }
-}
-
-function common_default_avatar($size)
-{
- static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
- AVATAR_STREAM_SIZE => 'stream',
- AVATAR_MINI_SIZE => 'mini');
- return theme_path('default-avatar-'.$sizenames[$size].'.png');
-}
-
function common_local_url($action, $args=null, $fragment=null)
{
$url = null;
@@ -750,6 +708,8 @@ function common_fancy_url($action, $args=null)
return common_path("api/statuses/public_timeline.atom");
case 'publicxrds':
return common_path('xrds');
+ case 'tagrss':
+ return common_path('tag/' . $args['tag'] . '/rss');
case 'featuredrss':
return common_path('featuredrss');
case 'favoritedrss':
@@ -1523,16 +1483,6 @@ function common_markup_to_html($c)
return Markdown($c);
}
-function common_profile_avatar_url($profile, $size=AVATAR_PROFILE_SIZE)
-{
- $avatar = $profile->getAvatar($size);
- if ($avatar) {
- return common_avatar_display_url($avatar);
- } else {
- return common_default_avatar($size);
- }
-}
-
function common_profile_uri($profile)
{
if (!$profile) {
diff --git a/scripts/enjitqueuehandler.php b/scripts/enjitqueuehandler.php
index 3a4f8315d..40f60da5d 100755
--- a/scripts/enjitqueuehandler.php
+++ b/scripts/enjitqueuehandler.php
@@ -74,7 +74,7 @@ class EnjitQueueHandler extends QueueHandler
$atom .= "<link href='" . $profile->profileurl . "'/>\n";
$atom .= "<link rel='self' type='application/rss+xml' href='" . common_local_url('userrss', array('nickname' => $profile->nickname)) . "'/>\n";
$atom .= "<author><name>" . $profile->nickname . "</name></author>\n";
- $atom .= "<icon>" . common_profile_avatar_url($profile, AVATAR_PROFILE_SIZE) . "</icon>\n";
+ $atom .= "<icon>" . $profile->avatarUrl(AVATAR_PROFILE_SIZE) . "</icon>\n";
$atom .= "</source>\n";
$atom .= "<title>" . htmlspecialchars($msg) . "</title>\n";
$atom .= "<summary>" . htmlspecialchars($msg) . "</summary>\n";
diff --git a/theme/base/css/display.css b/theme/base/css/display.css
index 60eaa8f22..f6e3c0fc7 100644
--- a/theme/base/css/display.css
+++ b/theme/base/css/display.css
@@ -152,7 +152,8 @@ font-weight:bold;
#form_remote_subscribe legend,
#form_openid_login legend,
#form_search legend,
-#form_invite legend {
+#form_invite legend,
+#form_notice_delete legend {
display:none;
}
@@ -179,6 +180,7 @@ float:left;
width:90%;
}
+
#form_login p.form_guide,
#form_register #settings_rememberme p.form_guide,
#form_openid_login #settings_rememberme p.form_guide,
@@ -194,12 +196,16 @@ border-radius:4px;
padding:0 7px;
}
+
+.form_settings input.form_action-secondary {
+margin-left:29px;
+padding:0;
+}
+
#form_search .submit {
margin-left:11px;
}
-
-
address {
float:left;
margin-bottom:18px;
@@ -1169,3 +1175,4 @@ clear:both;
margin-bottom:0;
}
+
diff --git a/theme/default/css/display.css b/theme/default/css/display.css
index da1ba6717..854202956 100644
--- a/theme/default/css/display.css
+++ b/theme/default/css/display.css
@@ -34,6 +34,9 @@ border-color:#aaa;
border-color:#97BFD1;
}
+.form_settings input.form_action-secondary {
+background:none;
+}
input.submit,
#form_notice.warning #notice_text-count,
@@ -59,7 +62,8 @@ div.notice-options input,
.form_user_unblock input.submit,
.entity_send-a-message a,
.form_user_nudge input.submit,
-.entity_nudge p {
+.entity_nudge p,
+.form_settings input.form_action-secondary {
color:#002E6E;
}
diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css
index 6fcd730a9..9f6499013 100644
--- a/theme/identica/css/display.css
+++ b/theme/identica/css/display.css
@@ -34,6 +34,9 @@ border-color:#aaa;
border-color:#ddd;
}
+.form_settings input.form_action-secondary {
+background:none;
+}
input.submit,
#form_notice.warning #notice_text-count,
@@ -59,7 +62,8 @@ div.notice-options input,
.form_user_unblock input.submit,
.entity_send-a-message a,
.form_user_nudge input.submit,
-.entity_nudge p {
+.entity_nudge p,
+.form_settings input.form_action-secondary {
color:#002E6E;
}