public static $which = '';
public static $profile = 0;
- public static function init()
+ public static function init(array $parameters = [])
{
$a = self::getApp();
}
}
- public static function rawContent()
+ public static function rawContent(array $parameters = [])
{
if (ActivityPub::isRequest()) {
$user = DBA::selectFirst('user', ['uid'], ['nickname' => self::$which]);
}
}
- public static function content($update = 0)
+ public static function content(array $parameters = [], $update = 0)
{
$a = self::getApp();
// site block
if (!$blocked && !$userblock) {
- $keywords = str_replace(['#', ',', ' ', ',,'], ['', ' ', ',', ','], defaults($a->profile, 'pub_keywords', ''));
+ $keywords = str_replace(['#', ',', ' ', ',,'], ['', ' ', ',', ','], $a->profile['pub_keywords'] ?? '');
if (strlen($keywords)) {
$a->page['htmlhead'] .= '<meta name="keywords" content="' . $keywords . '" />' . "\n";
}
$category = $datequery = $datequery2 = '';
+ /** @var DateTimeFormat $dtFormat */
+ $dtFormat = self::getClass(DateTimeFormat::class);
+
if ($a->argc > 2) {
for ($x = 2; $x < $a->argc; $x ++) {
- if (is_a_date_arg($a->argv[$x])) {
+ if ($dtFormat->isYearMonth($a->argv[$x])) {
if ($datequery) {
$datequery2 = Strings::escapeHtml($a->argv[$x]);
} else {
}
if (empty($category)) {
- $category = defaults($_GET, 'category', '');
+ $category = $_GET['category'] ?? '';
}
- $hashtags = defaults($_GET, 'tag', '');
+ $hashtags = $_GET['tag'] ?? '';
if (Config::get('system', 'block_public') && !local_user() && !Session::getRemoteContactID($a->profile['profile_uid'])) {
return Login::form();
}
if (!$update) {
- $tab = Strings::escapeTags(trim(defaults($_GET, 'tab', '')));
+ $tab = Strings::escapeTags(trim($_GET['tab'] ?? ''));
$o .= ProfileModel::getTabs($a, $tab, $is_owner, $a->profile['nickname']);
$items = DBA::toArray($items_stmt);
+ if ($pager->getStart() == 0) {
+ $pinned_items = Item::selectPinned($a->profile['profile_uid'], ['uri']);
+ $pinned = Item::inArray($pinned_items);
+ $items = array_merge($items, $pinned);
+ }
+
$o .= conversation($a, $items, $pager, 'profile', $update, false, 'received', $a->profile['profile_uid']);
if (!$update) {