I need conditional for this please:
(If user post count = current user post count) or how to check if the post count remained the same for x days?
What about this one???
(TIME_NOW-$thread['lastpost']) >= 86400)
This is always true: (If user post count = current user post count)
Can't understand what you need...
Sorry I need to check with a conditional if the user has made at least one post during X days!
It's impossible with conditional only, need to query.
$lastpostdate = $db->fetch_field($db->simple_select('posts', 'dateline', 'uid='.intval($mybb->user['uid']), array('order_by' => 'dateline', 'order_dir' => 'DESC', 'limit' => 1)), 'dateline');
if(TIME_NOW - $lastpostdate >= 86400)
{
// do something
}
This can be added to global hook and will of course check for current user.
EDIT: nvm, the lastpost dateline is saved in users table too. So can simply check:
if(TIME_NOW - $mybb->user['lastpost'] >= 86400)
{
// do something
}
Thanks D666 very much please check you PM I will show you what I came up with!
Good catch, noticed it too after I had written my post, but would be better if you post your code in public... We share code with you, so we expect the same from your side. That's how support community should work.
D666 thanks very much you're the man from now on I will share my code here thanks man!
So I should change my code to yours or what?
<if (TIME_NOW - $memprofile['lastactive'] >= 604800 || TIME_NOW - $memprofile['lastpost'] >= 604800) then><else>
</if>
No. Your code is for xxx's profile and my is global for the user viewing page. Don't need the () wrap though.
Thanks for understanding and sharing.
NP thank you, do I need both conditionals or just this one?
TIME_NOW - $memprofile['lastpost'] >= 604800