vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Miscellaneous Hacks - Cyb - Advanced Permissions Based on Post Count (https://vborg.vbsupport.ru/showthread.php?t=201285)

Ghostt 12-13-2011 09:35 PM

i will try

/edit.
yes enabling the view forum restriction option fixed it!

thank you very much.

Black Tiger 12-13-2011 09:45 PM

You're welcome.;)

angeljs 12-18-2011 09:15 PM

Fab...just what I need. I've had an influx of spammers join lately posting rubbish. This should slow them down a little.

OmerE 02-05-2012 04:37 PM

There are a few issues with the PM limitations part of this add-on (they are trivial to circumvent), please see my post here:
https://vborg.vbsupport.ru/showpost....&postcount=178

sailnet 02-20-2012 01:14 PM

due to a rash of spammers showing up recently and sending PM's to my membrs are they've met their posts count requirements I'd like to extend this mod to also include a minimum number of days that someone must be a forum member before they can send PM's.

can someone give me some guidance as to how to add this code?

thanks in advance.

kh99 02-20-2012 03:44 PM

Quote:

Originally Posted by sailnet (Post 2301548)
due to a rash of spammers showing up recently and sending PM's to my membrs are they've met their posts count requirements I'd like to extend this mod to also include a minimum number of days that someone must be a forum member before they can send PM's.

can someone give me some guidance as to how to add this code?

thanks in advance.

You (of course) need to add a check for days registered wherever the posts are checked. You could do something like:

Code:

$min_days = 3;
$days_registered = floor((TIMENOW - $vbulletin->userinfo['joindate']) / 86400);


Then add "AND ($days_registered >= $min_days)" in the appropriate places. You could also create a new option and use it to set $min_days (or in place of $min_days) instead of using a constant.

sailnet 02-20-2012 04:38 PM

Quote:

Originally Posted by kh99 (Post 2301583)
You (of course) need to add a check for days registered wherever the posts are checked. You could do something like:

Code:

$min_days = 3;
$days_registered = floor((TIMENOW - $vbulletin->userinfo['joindate']) / 86400);


Then add "AND ($days_registered >= $min_days)" in the appropriate places. You could also create a new option and use it to set $min_days (or in place of $min_days) instead of using a constant.

thank you very much! - any leads on which module in the cyb mod I would put this type of code in? I'm modify the notice message to the user telling them their have no been registered long enough or do not have enough posts to be entitled to send PM's to other users.

thanks in advance.

kh99 02-20-2012 08:34 PM

Quote:

Originally Posted by sailnet (Post 2301600)
thank you very much! - any leads on which module in the cyb mod I would put this type of code in? I'm modify the notice message to the user telling them their have no been registered long enough or do not have enough posts to be entitled to send PM's to other users.

thanks in advance.

Are you adding this check to the mod or creating a different one? If you're adding it, then look at each plugin and find everywhere $vbulletin->userdata[posts] is checked and add this (there were multiple places when I glanced at the code). If you want to have two separate notices then you may have to copy an 'if' block and duplicate it. (It might be easier to change the message to say "and/or you haven't been registered long enough", but that's up to you of course).

I don't want to post the entire solution because I've been told some mod authors don't like that.

sailnet 02-20-2012 08:44 PM

well I did find this module that looks like the once that needs to be modifed

PHP Code:

    <plugin active="1" product="fsvpboupc">
        <
title><![CDATA[Cyb APBOUPC P5 (SR)]]></title>
        <
hookname>parse_templates</hookname>
        <
phpcode><![CDATA[
        if (
$vbulletin->options['apboupc_global_enable'] AND ($vbulletin->options['apboupc_pm_amount']>0) AND (THIS_SCRIPT=='private'))
        {
            if ((
$vbulletin->options['apboupc_pm_amount'] !='0') AND ($vbulletin->options['apboupc_pm_amount'] > $vbulletin->userinfo[posts]) AND (!is_member_of($vbulletin->userinfosplit(','$vbulletin->options['apboupc_pm_excludedgroups']))))
            {
                
$apboupc_pmsnote construct_phrase($vbphrase['apboupc_pm_note'], $vbulletin->options['apboupc_pm_amount']);
                
$vbulletin->templatecache['pm_newpm'] = str_replace('$vbphrase[separate_multiple_names]''$vbphrase[separate_multiple_names]<br /><br />$apboupc_pmsnote'$vbulletin->templatecache['pm_newpm']);
            }
        }]]></
phpcode>
    </
plugin


kh99 02-20-2012 09:59 PM

OK, if you create a new options called apboupc_pm_days and a new phrase called apboupc_pm_note_days, you might do something like this:

PHP Code:


    
<plugin active="1" product="fsvpboupc">
        <
title><![CDATA[Cyb APBOUPC P5 (SR)]]></title>
        <
hookname>parse_templates</hookname>
        <
phpcode><![CDATA[
        if (
$vbulletin->options['apboupc_global_enable'] AND (THIS_SCRIPT=='private') AND (!is_member_of($vbulletin->userinfosplit(','$vbulletin->options['apboupc_pm_excludedgroups']))))
        {
            if (
$vbulletin->options['apboupc_pm_days'] > 0)
            {
                
$days_registered floor((TIMENOW $vbulletin->userinfo['joindate']) / 86400);
                if (
$days_registered >= $vbulletin->options['apboupc_pm_days'])
                {
                    
$apboupc_pmsnote construct_phrase($vbphrase['apboupc_pm_note_days'], $vbulletin->options['apboupc_pm_daye']);
                    
$vbulletin->templatecache['pm_newpm'] = str_replace('$vbphrase[separate_multiple_names]''$vbphrase[separate_multiple_names]<br /><br />$apboupc_pmsnote'$vbulletin->templatecache['pm_newpm']);
                }                    
            }
            if ((
$vbulletin->options['apboupc_pm_amount'] !='0') AND ($vbulletin->options['apboupc_pm_amount'] > $vbulletin->userinfo[posts]))
            {
                
$apboupc_pmsnote construct_phrase($vbphrase['apboupc_pm_note'], $vbulletin->options['apboupc_pm_amount']);
                
$vbulletin->templatecache['pm_newpm'] = str_replace('$vbphrase[separate_multiple_names]''$vbphrase[separate_multiple_names]<br /><br />$apboupc_pmsnote'$vbulletin->templatecache['pm_newpm']);
            }
        }]]></
phpcode>
    </
plugin



All times are GMT. The time now is 07:57 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.01449 seconds
  • Memory Usage 1,782KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete