namespace Friendica\Content;
-use Friendica\Core\Addon;
use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
*/
public static function follow(string $value = ''): string
{
- return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/follow.tpl'), array(
+ return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/follow.tpl'), [
'$connect' => DI::l10n()->t('Add New Contact'),
- '$desc' => DI::l10n()->t('Enter address or web location'),
- '$hint' => DI::l10n()->t('Example: bob@example.com, http://example.com/barbara'),
- '$value' => $value,
- '$follow' => DI::l10n()->t('Connect')
- ));
+ '$desc' => DI::l10n()->t('Enter address or web location'),
+ '$hint' => DI::l10n()->t('Example: bob@example.com, http://example.com/barbara'),
+ '$value' => $value,
+ '$follow' => DI::l10n()->t('Connect')
+ ]);
}
/**
}
}
- $nv = [];
- $nv['findpeople'] = DI::l10n()->t('Find People');
- $nv['desc'] = DI::l10n()->t('Enter name or interest');
- $nv['label'] = DI::l10n()->t('Connect/Follow');
- $nv['hint'] = DI::l10n()->t('Examples: Robert Morgenstein, Fishing');
- $nv['findthem'] = DI::l10n()->t('Find');
- $nv['suggest'] = DI::l10n()->t('Friend Suggestions');
- $nv['similar'] = DI::l10n()->t('Similar Interests');
- $nv['random'] = DI::l10n()->t('Random Profile');
- $nv['inv'] = DI::l10n()->t('Invite Friends');
- $nv['directory'] = DI::l10n()->t('Global Directory');
- $nv['global_dir'] = OpenWebAuth::getZrlUrl($global_dir, true);
+ $nv = [];
+ $nv['findpeople'] = DI::l10n()->t('Find People');
+ $nv['desc'] = DI::l10n()->t('Enter name or interest');
+ $nv['label'] = DI::l10n()->t('Connect/Follow');
+ $nv['hint'] = DI::l10n()->t('Examples: Robert Morgenstein, Fishing');
+ $nv['findthem'] = DI::l10n()->t('Find');
+ $nv['suggest'] = DI::l10n()->t('Friend Suggestions');
+ $nv['similar'] = DI::l10n()->t('Similar Interests');
+ $nv['random'] = DI::l10n()->t('Random Profile');
+ $nv['inv'] = DI::l10n()->t('Invite Friends');
+ $nv['directory'] = DI::l10n()->t('Global Directory');
+ $nv['global_dir'] = OpenWebAuth::getZrlUrl($global_dir, true);
$nv['local_directory'] = DI::l10n()->t('Local Directory');
- $aside = [];
+ $aside = [];
$aside['$nv'] = $nv;
return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/peoplefind.tpl'), $aside);
private static function filter(string $type, string $title, string $desc, string $all, string $baseUrl, array $options, string $selected = null): string
{
$queryString = parse_url($baseUrl, PHP_URL_QUERY);
- $queryArray = [];
+ $queryArray = [];
if ($queryString) {
parse_str($queryString, $queryArray);
return '';
}
- $networks = self::unavailableNetworks();
- $query = "`uid` = ? AND NOT `deleted` AND `network` != '' AND NOT `network` IN (" . substr(str_repeat("?, ", count($networks)), 0, -2) . ")";
+ $networks = self::unavailableNetworks();
+ $query = "`uid` = ? AND NOT `deleted` AND `network` != '' AND NOT `network` IN (" . substr(str_repeat("?, ", count($networks)), 0, -2) . ")";
$condition = array_merge([$query], array_merge([DI::userSession()->getLocalUserId()], $networks));
$r = DBA::select('contact', ['network'], $condition, ['group_by' => ['network'], 'order' => ['network']]);
$ret = [];
$cachekey = 'Widget::postedByYear' . $uid . '-' . (int)$wall;
- $dthen = DI::cache()->get($cachekey);
+ $dthen = DI::cache()->get($cachekey);
if (empty($dthen)) {
$dthen = Item::firstPostDate($uid, $wall);
DI::cache()->set($cachekey, $dthen, Duration::HOUR);
if ($dthen) {
// Set the start and end date to the beginning of the month
$cutoffday = $dthen;
- $thisday = substr($dnow, 4);
- $nextday = date('Y-m-d', strtotime($dnow . ' + 1 day'));
- $nextday = substr($nextday, 4);
- $dnow = substr($dnow, 0, 8) . '01';
- $dthen = substr($dthen, 0, 8) . '01';
+ $thisday = substr($dnow, 4);
+ $nextday = date('Y-m-d', strtotime($dnow . ' + 1 day'));
+ $nextday = substr($nextday, 4);
+ $dnow = substr($dnow, 0, 8) . '01';
+ $dthen = substr($dthen, 0, 8) . '01';
/*
* Starting with the current month, get the first and last days of every
* month down to and including the month of the first post
*/
while (substr($dnow, 0, 7) >= substr($dthen, 0, 7)) {
- $dyear = intval(substr($dnow, 0, 4));
- $dstart = substr($dnow, 0, 8) . '01';
- $dend = substr($dnow, 0, 8) . Temporal::getDaysInMonth(intval($dnow), intval(substr($dnow, 5)));
+ $dyear = intval(substr($dnow, 0, 4));
+ $dstart = substr($dnow, 0, 8) . '01';
+ $dend = substr($dnow, 0, 8) . Temporal::getDaysInMonth(intval($dnow), intval(substr($dnow, 5)));
$start_month = DateTimeFormat::utc($dstart, 'Y-m-d');
- $end_month = DateTimeFormat::utc($dend, 'Y-m-d');
- $str = DI::l10n()->getDay(DateTimeFormat::utc($dnow, 'F'));
+ $end_month = DateTimeFormat::utc($dend, 'Y-m-d');
+ $str = DI::l10n()->getDay(DateTimeFormat::utc($dnow, 'F'));
if (empty($ret[$dyear])) {
$ret[$dyear] = [];
}
$ret[$dyear][] = [$str, $end_month, $start_month];
- $dnow = DateTimeFormat::utc($dnow . ' -1 month', 'Y-m-d');
+ $dnow = DateTimeFormat::utc($dnow . ' -1 month', 'Y-m-d');
}
}
}
$cutoff_year = intval(DateTimeFormat::localNow('Y')) - $visible_years;
- $cutoff = array_key_exists($cutoff_year, $ret);
+ $cutoff = array_key_exists($cutoff_year, $ret);
$o = Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/posted_date.tpl'), [
- '$title' => DI::l10n()->t('Archives'),
- '$size' => $visible_years,
+ '$title' => DI::l10n()->t('Archives'),
+ '$size' => $visible_years,
'$cutoff_year' => $cutoff_year,
- '$cutoff' => $cutoff,
- '$url' => $url,
- '$dates' => $ret,
- '$showless' => DI::l10n()->t('show less'),
- '$showmore' => DI::l10n()->t('show more'),
- '$onthisdate' => DI::l10n()->t('On this date'),
- '$thisday' => $thisday,
- '$nextday' => $nextday,
- '$cutoffday' => $cutoffday
+ '$cutoff' => $cutoff,
+ '$url' => $url,
+ '$dates' => $ret,
+ '$showless' => DI::l10n()->t('show less'),
+ '$showmore' => DI::l10n()->t('show more'),
+ '$onthisdate' => DI::l10n()->t('On this date'),
+ '$thisday' => $thisday,
+ '$nextday' => $nextday,
+ '$cutoffday' => $cutoffday
]);
return $o;