vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   A simple alteration of an if statement (https://vborg.vbsupport.ru/showthread.php?t=137522)

JPnyc 01-25-2007 08:18 PM

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

peterska2 01-25-2007 08:49 PM

Code:

<if condition="$post[posts] < 10">
is what you want

JPnyc 01-25-2007 08:54 PM

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-> ?

sebbe 01-25-2007 11:45 PM

PHP Code:

if ($post['posts'] < 10)
{
    
//code


Needs to go inside a postbit hook.

JPnyc 01-26-2007 11:03 AM

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.

Paul M 01-26-2007 12:06 PM

What hook are you using ?

JPnyc 01-26-2007 01:13 PM

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?

JPnyc 01-27-2007 02:15 PM

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

JPnyc 01-28-2007 03:32 PM

Never mind, found another filter here with that functionality included.


All times are GMT. The time now is 04:07 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01003 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete