summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/authorizationplugin.php4
-rw-r--r--lib/language.php19
-rw-r--r--lib/mediafile.php2
-rw-r--r--lib/profileaction.php12
-rw-r--r--lib/util.php2
5 files changed, 28 insertions, 11 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..8009adc9b 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];
}
@@ -286,6 +289,7 @@ function get_nice_language_list()
*/
function get_all_languages() {
return array(
+ 'af' => array('q' => 0.8, 'lang' => 'af', 'name' => 'Afrikaans', 'direction' => 'ltr'),
'ar' => array('q' => 0.8, 'lang' => 'ar', 'name' => 'Arabic', 'direction' => 'rtl'),
'arz' => array('q' => 0.8, 'lang' => 'arz', 'name' => 'Egyptian Spoken Arabic', 'direction' => 'rtl'),
'bg' => array('q' => 0.8, 'lang' => 'bg', 'name' => 'Bulgarian', 'direction' => 'ltr'),
@@ -301,7 +305,8 @@ function get_all_languages() {
'fi' => array('q' => 1, 'lang' => 'fi', 'name' => 'Finnish', 'direction' => 'ltr'),
'fa' => array('q' => 1, 'lang' => 'fa', 'name' => 'Persian', 'direction' => 'rtl'),
'fr-fr' => array('q' => 1, 'lang' => 'fr', 'name' => 'French', 'direction' => 'ltr'),
- 'ga' => array('q' => 0.5, 'lang' => 'ga', 'name' => 'Galician', 'direction' => 'ltr'),
+ 'ga' => array('q' => 0.5, 'lang' => 'ga', 'name' => 'Irish', 'direction' => 'ltr'),
+ 'gl' => array('q' => 0.8, 'lang' => 'gl', 'name' => 'Galician', 'direction' => 'ltr'),
'he' => array('q' => 0.5, 'lang' => 'he', 'name' => 'Hebrew', 'direction' => 'rtl'),
'hsb' => array('q' => 0.8, 'lang' => 'hsb', 'name' => 'Upper Sorbian', 'direction' => 'ltr'),
'ia' => array('q' => 0.8, 'lang' => 'ia', 'name' => 'Interlingua', 'direction' => 'ltr'),
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/profileaction.php b/lib/profileaction.php
index 82e0224af..504b77566 100644
--- a/lib/profileaction.php
+++ b/lib/profileaction.php
@@ -174,6 +174,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'));
@@ -224,6 +230,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 6905df839..c120fa376 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;