The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
A simple alteration of an if statement
My problem is that in searching the forum I wasn't able to find the variable name for a thread/post author's post count. I want to append an if statement to also test for author's post count. Something like:
AND ($bbuserinfo['posts'] < 10) How far off am I? Thanks |
#2
|
|||
|
|||
Code:
<if condition="$post[posts] < 10"> |
#3
|
|||
|
|||
Thank you Kerry-Anne, but I should've been more specific. This is not coded within a template but a plugin. Would the variable be the same? Or must it be prefaced by $vbulletin-> ?
|
#4
|
||||
|
||||
PHP Code:
|
#5
|
|||
|
|||
Thanks; I still can't get it to test for postcount. Here's the entire 1st if statement;
if (str_replace(explode(',', $this->registry->options['automodkeywords']), '', strtolower($this->fetch_field('pagetext','post'))) != strtolower($this->fetch_field('pagetext','post')) AND !can_moderate() AND ($post['posts']< 10)) I also tried without the extra parens Thanks for your assistance. |
#6
|
||||
|
||||
What hook are you using ?
|
#7
|
|||
|
|||
It's actually in a product, it's a mod of the spam filter I found on this site. The filter works fine, I just wanted to append the test to exclude users with more than 10 posts. If need be I suppose I could create another default reg. user group and a promotion for 10 posts, then test for usergroup, but with 30 forums that's a whole lot of work.
edit: I went into the xml and found the hook, it's threadfpdata_presave. Is it possible that variable isn't populated on that hook? |
#8
|
|||
|
|||
I need to get this sorted. The spam filter is blocking too many legit posts and the keywords list is as trimmed down as can be. Anyone know how I can add a test for post count to this if statement? Thanks
|
#9
|
|||
|
|||
Never mind, found another filter here with that functionality included.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|