mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-12-23 00:30:21 +00:00
Fix errors
This commit is contained in:
parent
43c71412e4
commit
82ed43f507
3 changed files with 9 additions and 10 deletions
|
@ -29,10 +29,10 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti
|
||||||
$now = new DateTime();
|
$now = new DateTime();
|
||||||
|
|
||||||
if (!is_null($cached)) {
|
if (!is_null($cached)) {
|
||||||
$cdate = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'curweather', 'last');
|
$cdate = (int) DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'curweather', 'last');
|
||||||
$cached = unserialize($cached);
|
$cached = unserialize($cached);
|
||||||
|
|
||||||
if ($cdate + $cachetime > $now->getTimestamp()) {
|
if ($cdate + (int) $cachetime > $now->getTimestamp()) {
|
||||||
return $cached;
|
return $cached;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,7 @@ class qqFileUploader {
|
||||||
|
|
||||||
private function toBytes(string $str): int
|
private function toBytes(string $str): int
|
||||||
{
|
{
|
||||||
$val = trim($str);
|
$val = (int) trim($str);
|
||||||
$last = strtolower($str[strlen($str) - 1]);
|
$last = strtolower($str[strlen($str) - 1]);
|
||||||
|
|
||||||
switch($last) {
|
switch($last) {
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
* Status: Unsupported
|
* Status: Unsupported
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\App;
|
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
|
@ -19,7 +18,7 @@ function membersince_install()
|
||||||
|
|
||||||
function membersince_display(array &$b)
|
function membersince_display(array &$b)
|
||||||
{
|
{
|
||||||
if (DI::app()->getCurrentTheme() == 'frio') {
|
if (DI::appHelper()->getCurrentTheme() == 'frio') {
|
||||||
// Works in Frio.
|
// Works in Frio.
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
$doc->loadHTML(mb_convert_encoding($b, 'HTML-ENTITIES', 'UTF-8'));
|
$doc->loadHTML(mb_convert_encoding($b, 'HTML-ENTITIES', 'UTF-8'));
|
||||||
|
@ -39,7 +38,7 @@ function membersince_display(array &$b)
|
||||||
$label->setAttribute('class', 'col-lg-4 col-md-4 col-sm-4 col-xs-12 profile-label-name text-muted');
|
$label->setAttribute('class', 'col-lg-4 col-md-4 col-sm-4 col-xs-12 profile-label-name text-muted');
|
||||||
|
|
||||||
// The div for the register date of the profile owner.
|
// The div for the register date of the profile owner.
|
||||||
$entry = $doc->createElement('div', DateTimeFormat::local(DI::app()->profile['register_date']));
|
$entry = $doc->createElement('div', DateTimeFormat::local(DI::appHelper()->profile['register_date']));
|
||||||
$entry->setAttribute('class', 'col-lg-8 col-md-8 col-sm-8 col-xs-12 profile-entry');
|
$entry->setAttribute('class', 'col-lg-8 col-md-8 col-sm-8 col-xs-12 profile-entry');
|
||||||
|
|
||||||
$div->appendChild($hr);
|
$div->appendChild($hr);
|
||||||
|
@ -50,6 +49,6 @@ function membersince_display(array &$b)
|
||||||
$b = $doc->saveHTML();
|
$b = $doc->saveHTML();
|
||||||
} else {
|
} else {
|
||||||
// Works in Vier.
|
// Works in Vier.
|
||||||
$b = preg_replace('/<\/dl>/', "</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" . DI::l10n()->t('Member since:') . "</dt>\n<dd>" . DateTimeFormat::local(DI::app()->profile['register_date']) . "</dd>\n</dl>", $b, 1);
|
$b = preg_replace('/<\/dl>/', "</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" . DI::l10n()->t('Member since:') . "</dt>\n<dd>" . DateTimeFormat::local(DI::appHelper()->profile['register_date']) . "</dd>\n</dl>", $b, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue