Quote:
Originally Posted by HMBeaty
To shorten that up, I believe you could also use something like this:
PHP Code:
if($vbulletin->userinfo['posts'] < 30 AND $vbulletin->userinfo['joindate'] < TIMENOW - (86400 * 30)) { standard_error(fetch_error('YOUR_ERROR_PHRASE')); }
And go to Add New Phrase > Error Phrase > input your varname, text, etc. and change YOUR_ERROR_PHRASE to the varname you defined
|
Hello,
I found I am having an issue with some users being able to post even though they do not have both requirements: at least 30 posts and have been a member for 30 days. After reviewing the code, it appears that it is currently presented as:
"If you have less than 30 posts AND have been a member for less than 30 days, you receive an error message."
What I would like it to be is:
"If you have less than 30 posts OR have been a member for less than 30 days, you receive an error message."
This will require that users meet both a minimum post requirement and join date requirement, not that they only have to meet one or the other. To accomplish this, can I simply change the "AND" to "OR" in my current code, copied below?
PHP Code:
if($vbulletin->userinfo['posts'] < 30 AND $vbulletin->userinfo['joindate'] < TIMENOW - (86400 * 30))
{
$errormessage = "You do not have permission to create a thread in the Personal Marketplace because you need a post count of at least 30 and to have been a member for at least 30 days to create a thread here.";
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
}