помогите это переписать для конкретного юзера с конкретным числом ограничения сообщений в сутки 15, спасибо я так понимаю эту конструкцию надо будет в пост.пхп засунут if ( $flood )
{
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
'from' => 'message_topics',
'where' => "mt_owner_id={$member_id}",
'order' => 'mt_date DESC',
'limit' => array(0,1) ) );
$this->ipsclass->DB->simple_exec();
$last_pm = $this->ipsclass->DB->fetch_row();
if ( $last_pm['mt_date'] + ($flood * 60) > time() )
{
return array('key' => 'error', 'lang' => 'pm_flood', 'extra' => "{$flood}");
}
}
if ( $limit )
{
$time_range = time() - 86400;
$this->ipsclass->DB->simple_construct( array( 'select' => 'count(mt_id) as cnt',
'from' => 'message_topics',
'where' => "mt_owner_id={$member_id} AND mt_date > {$time_range}",
) );
$this->ipsclass->DB->simple_exec();
$quota_sent = $this->ipsclass->DB->fetch_row();
if ( $quota_sent['cnt'] + 1 > $limit )
{
return array('key' => 'error', 'lang' => 'pm_flood_max', 'extra' => "{$limit}");
}
}
return FALSE;
}