mirror of
https://github.com/friendica/friendica
synced 2025-04-27 01:50:11 +00:00
Issue 9799: Ensure that the first post date is after the registration date
This commit is contained in:
parent
ab9090ede1
commit
6a4540e6f6
3 changed files with 34 additions and 3 deletions
|
@ -2177,9 +2177,15 @@ class Item
|
|||
|
||||
public static function firstPostDate($uid, $wall = false)
|
||||
{
|
||||
$condition = ['gravity' => GRAVITY_PARENT, 'uid' => $uid, 'wall' => $wall, 'deleted' => false, 'visible' => true];
|
||||
$user = User::getById($uid, ['register_date']);
|
||||
if (empty($user)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$condition = ["`uid` = ? AND `wall` = ? AND NOT `deleted` AND `visible` AND `received` >= ?",
|
||||
$uid, $wall, $user['register_date']];
|
||||
$params = ['order' => ['received' => false]];
|
||||
$thread = Post::selectFirst(['received'], $condition, $params);
|
||||
$thread = Post::selectFirstThread(['received'], $condition, $params);
|
||||
if (DBA::isResult($thread)) {
|
||||
$postdate = substr(DateTimeFormat::local($thread['received']), 0, 10);
|
||||
return $postdate;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue