diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/authorizationplugin.php | 4 | ||||
-rw-r--r-- | lib/language.php | 15 | ||||
-rw-r--r-- | lib/mediafile.php | 2 | ||||
-rw-r--r-- | lib/noticeform.php | 14 | ||||
-rw-r--r-- | lib/profileaction.php | 12 | ||||
-rw-r--r-- | lib/util.php | 2 |
6 files changed, 35 insertions, 14 deletions
diff --git a/lib/authorizationplugin.php b/lib/authorizationplugin.php index 07da9b2d1..3790bccf4 100644 --- a/lib/authorizationplugin.php +++ b/lib/authorizationplugin.php @@ -67,7 +67,7 @@ abstract class AuthorizationPlugin extends Plugin //------------Below are the methods that connect StatusNet to the implementing Auth plugin------------\\ - function onStartSetUser(&$user) { + function onStartSetUser($user) { $loginAllowed = $this->loginAllowed($user); if($loginAllowed === true){ return; @@ -84,7 +84,7 @@ abstract class AuthorizationPlugin extends Plugin } } - function onStartSetApiUser(&$user) { + function onStartSetApiUser($user) { return $this->onStartSetUser($user); } diff --git a/lib/language.php b/lib/language.php index 64b59e739..76c788025 100644 --- a/lib/language.php +++ b/lib/language.php @@ -202,16 +202,19 @@ function _mdomain($backtrace) static $cached; $path = $backtrace[0]['file']; if (!isset($cached[$path])) { + $final = 'statusnet'; // assume default domain if (DIRECTORY_SEPARATOR !== '/') { $path = strtr($path, DIRECTORY_SEPARATOR, '/'); } - $cut = strpos($path, '/plugins/') + 9; - $cut2 = strpos($path, '/', $cut); - if ($cut && $cut2) { - $cached[$path] = substr($path, $cut, $cut2 - $cut); - } else { - return null; + $cut = strpos($path, '/plugins/'); + if ($cut) { + $cut += strlen('/plugins/'); + $cut2 = strpos($path, '/', $cut); + if ($cut && $cut2) { + $final = substr($path, $cut, $cut2 - $cut); + } } + $cached[$path] = $final; } return $cached[$path]; } diff --git a/lib/mediafile.php b/lib/mediafile.php index 10d90d008..1c96c42d7 100644 --- a/lib/mediafile.php +++ b/lib/mediafile.php @@ -171,7 +171,7 @@ class MediaFile return; } - if (!MediaFile::respectsQuota($user, $_FILES['attach']['size'])) { + if (!MediaFile::respectsQuota($user, $_FILES[$param]['size'])) { // Should never actually get here diff --git a/lib/noticeform.php b/lib/noticeform.php index 7278c41a9..a55839de0 100644 --- a/lib/noticeform.php +++ b/lib/noticeform.php @@ -189,10 +189,14 @@ class NoticeForm extends Form } if (common_config('attachments', 'uploads')) { - $this->out->element('label', array('for' => 'notice_data-attach'),_('Attach')); + $this->out->element('label', array('id' => 'notice_data-attach-label', + 'class' => 'attach-label', + 'for' => 'notice_data-attach'), + _('Attach')); $this->out->element('input', array('id' => 'notice_data-attach', + 'class' => 'attach', 'type' => 'file', - 'name' => 'attach', + 'name' => 'attach0', 'title' => _('Attach a file'))); $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota')); } @@ -212,8 +216,10 @@ class NoticeForm extends Form $this->out->checkbox('notice_data-geo', _('Share my location'), true); $this->out->elementEnd('div'); $this->out->inlineScript(' var NoticeDataGeo_text = {'. - 'ShareDisable: "'._('Do not share my location').'",'. - 'ErrorTimeout: "'._('Sorry, retrieving your geo location is taking longer than expected, please try again later').'"'. + 'ShareDisable: ' .json_encode(_('Do not share my location')).','. + 'ErrorTimeout: ' .json_encode(_('Sorry, retrieving your geo location is taking longer than expected, please try again later')). + '} ; var NoticeAttachment_text = {'. + 'AttachFile: ' . json_encode(_('Attach a file')) . '}'); } diff --git a/lib/profileaction.php b/lib/profileaction.php index 029c21845..072c024c7 100644 --- a/lib/profileaction.php +++ b/lib/profileaction.php @@ -169,6 +169,12 @@ class ProfileAction extends OwnerDesignAction $subbed_count = $this->profile->subscriberCount(); $notice_count = $this->profile->noticeCount(); $group_count = $this->user->getGroups()->N; + $age_days = (time() - strtotime($this->profile->created)) / 86400; + if ($age_days < 1) { + // Rather than extrapolating out to a bajillion... + $age_days = 1; + } + $daily_count = round($notice_count / $age_days); $this->elementStart('div', array('id' => 'entity_statistics', 'class' => 'section')); @@ -219,6 +225,12 @@ class ProfileAction extends OwnerDesignAction $this->element('dd', null, $notice_count); $this->elementEnd('dl'); + $this->elementStart('dl', 'entity_daily_notices'); + // TRANS: Average count of posts made per day since account registration + $this->element('dt', null, _('Daily average')); + $this->element('dd', null, $daily_count); + $this->elementEnd('dl'); + $this->elementEnd('div'); } diff --git a/lib/util.php b/lib/util.php index 795997868..f12cdd239 100644 --- a/lib/util.php +++ b/lib/util.php @@ -803,7 +803,7 @@ function common_linkify($url) { } if (!empty($f)) { - if ($f->getEnclosure()) { + if ($f->getEnclosure() || File_oembed::staticGet('file_id',$f->id)) { $is_attachment = true; $attachment_id = $f->id; |