PDA

View Full Version : Conditional Template Problem


NP Carling26
09-21-2010, 07:30 PM
Basically we are using a One touch spam and clean modification from this site to clear spam bots and other such members from our forum. As it is sometimes necessary to delete accounts with 0 posts for such things as spamming in private messages, I tried to add a conditional to fit the requirements which enables this hack.

So far this is what I have in the template of MEMBERINFO:

<if condition="is_member_of($bbuserinfo, 5,6,7)">
<if condition="$bbuserinfo['posts'] <= 50">
<li class="thead"><a href="misc.php?$session[sessionurl]do=spamcleanconfirm&amp;u=$userinfo[userid]">$vbphrase[spammer_ban_member]</a></li>
</if>
</if>

Basically the less than/equal to 50 posts doesn't work. It will either show the modification on everyone's page or not show it at all if I make it "<51" instead.

If anyone could give me a solution that would be fantastic! Also there is a condition that the user has to be registered 30 days or less and if you could help me with that it would be amazing, if not don't worry about it too much :)

Also if it's worth mentioning we are running 3.8.4 patch 2.

kh99
09-21-2010, 11:02 PM
Basically the less than/equal to 50 posts doesn't work. It will either show the modification on everyone's page or not show it at all if I make it "<51" instead.

I really don't know why <= 50 would do something different than <51, but I do think what you want is to check $userinfo['posts'], not $bbuserinfo.

"if" condition for "registered less than 30 days":


<if condition="TIMENOW - $userinfo['joindate'] < (30 * 86400)">

(86400 = seconds in one day)

NP Carling26
09-22-2010, 04:50 AM
Thank you so much it worked! I guess this thread can be destroyed or whatever :) Hopefully this can help others too :) Thanks again!