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


sailnet 02-20-2012 10:11 PM

tried this to no avail...

PHP Code:

if ($vbulletin->options['apboupc_global_enable'] AND ($vbulletin->options['apboupc_pm_amount']>0) AND (THIS_SCRIPT=='private'))
{
    
$min_days 7;
    
$days_registered floor((TIMENOW $vbulletin->userinfo['joindate']) / 86400);
    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'])))       )  
    ||  (
$days_registered <= $min_days
    {
        
$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']);
    }



kh99 02-20-2012 11:38 PM

That looks like maybe it would work but I think you have a paren problem. I think that one by itself under the word "split" should go down one line so that $min_days has two after it.

Edit: except one other thing...if you were to set $vbulletin->options['apboupc_pm_amount'] option to 0 it wouldn't kick in even if they days registered was too low.

sailnet 02-21-2012 12:03 AM

thanks - but I don't think so....unless I'm really missing something here:

here's the standard code - I did not change the original condition in the if statement with the ANDS, I just spread it out to make it more readable.

PHP Code:

        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']);
            }
        } 

and here's my modded code:

PHP Code:

if ($vbulletin->options['apboupc_global_enable'] AND ($vbulletin->options['apboupc_pm_amount']>0) AND (THIS_SCRIPT=='private'))
{
    
$min_days 7;
    
$days_registered floor((TIMENOW $vbulletin->userinfo['joindate']) / 86400);
    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']))) 
       )  
    or (
$days_registered <= $min_days
    {
        
$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']);
    }



you wrote: Edit: except one other thing...if you were to set $vbulletin->options['apboupc_pm_amount'] option to 0 it wouldn't kick in even if they days registered was too low.

you are correct - I have it set to 15 and I'm the only person who touches the admin panel so this is not a concern of mine.

ps: thank you for you help thus far - it is much appreciated.

kh99 02-21-2012 12:08 AM

Well, it's obvious something's wrong with the parens just from looking at these lines:

Code:

    or ($days_registered <= $min_days)
    {


For it to be correct, the closing paren for the very first opening one after 'if' has to be the last thing before the '{', and you can see that it's not.

sailnet 02-21-2012 12:22 AM

thanks for the fast reply. I fail to see what I'm missing for instance:

PHP Code:

if (  (b) and (d) and (f) )  // condition 1
or 
  (
h)  // condition 2
{
   do 
something;   // get's executed if condition 1 is true or condition 2 is true


this is how I read the above code.

kh99 02-21-2012 12:35 AM

Quote:

Originally Posted by sailnet (Post 2301758)
thanks for the fast reply. I fail to see what I'm missing for instance:

PHP Code:

if (  (b) and (d) and (f) )  // condition 1
or 
  (
h)  // condition 2
{
   do 
something;   // get's executed if condition 1 is true or condition 2 is true


this is how I read the above code.


That's not correct syntax. An if statement has to be

Code:

if (expr)
    statement


so all parts of the expression have to be inside the outer set of parentheses. What you have is

Code:

if (expr) or (expr)
    statement


sailnet 02-21-2012 12:14 PM

kh99 - thank you for all your help. trying to insert the code into the mod was taking too long so I just added a few lines to code to private.php - not my first choice of how to do things but it works for now and perhaps 4.0 has a mod I can use when I upgrade soon.

brandon515 07-20-2012 07:29 PM

This mod is awesome...thanks for you work on this!

Quick question: Can I use this mod in conjunction with VB paid subscriptions? I only allow new threads to be created if a user has X number of posts (this mod works great for that). But if a member chooses to do so, they can pay to be bumped up to a usergroup that is allowed to create new threads.

Just I guess I'm really asking which of the two overrides the other....usergroups vs. Cyb-Advanced Perms

Thx
Brandon

chefy 08-22-2012 04:29 PM

I have identified 2 bugs on this product. Hope Valter or any other programmer could share with us the patch instructions:

[BUG 1] If you have enabled the restriction "Post Links/Images/emails" with a minimum post count of X (we'll use X=5 in this example) then a member with less than 5 posts is in fact unable to post any link. But what happens when he wants to report a post? The system will allow him to send the report, however it will not get posted on the moderators forum. Guess why? Yes, because the reports contain links in their body and since this member has lees than 5 posts the system will prevent his report from being posted. Instead of posting the report on the predefined forum it is being sent to all the moderators through email which isn't the expected behavior.

[BUG 2] If you have enabled the restriction "Post Links/Images/emails" with a minimum post count of X (we'll use X=5 in this example) then a member with less than 5 posts is in fact unable to post any image. But what happens if our smart member makes use of "https" in their image link instead of "http"? Something like this: https://vborg.vbsupport.ru/. Answer is easy: the image will get posted bypassing the restriction of the 5 minimum posts to post images.

Unfortunately 4.4 is the latest vB 3.x version of this mod. The current version is 5.2.1 but only available for vB 4.x series. I don't know if version 5.2.1 still have these bugs but maybe the programmer want to check.

Please fix these bugs and share with us the patch instructions.

chefy 08-27-2012 03:53 PM

Valter or any other programmer could fix those bugs please?

OHVUI.ORG 05-13-2013 05:19 PM

thanks for sharing this mod

financegav 04-04-2014 07:13 AM

The stop links for users is exactly what I've been looking for! I've tried numerous different ones on http://www.saverscene.com.au/forum.php - but they all flash up the message so fast unless you know what it says no one has time to read it and real users tried posting and then just left.

With this mod they actually know what's happening and real users stay around, spam bots get blocked.

Perfect!!!

metrika 07-24-2014 08:02 AM

Hi, is there any similar product for VB 4.x ? Thanks

ozzy47 07-24-2014 09:12 AM

Quote:

Originally Posted by metrika (Post 2508068)
Hi, is there any similar product for VB 4.x ? Thanks

Sure, https://vborg.vbsupport.ru/showthread.php?t=233979

HM666 09-09-2014 09:54 AM

How would I go about adding iTrader? I want it where a user cannot use iTrader before they have at least 10 posts.

kartik786 09-17-2014 04:46 PM

can we do a pay with a tweet / pay with a like integration?

Allow users to download only after they tweet or like it?

digif 09-21-2014 03:32 PM

It would be great if there is an option for inactive users, who had many posts earlier but now inactive. So, that you can put restrictions on those who have less than 1 post per week for example, and restrict them for a day.

m7sen 11-02-2014 12:50 AM

can u please add option
Usergroup can not creat new thread or post before *** hourse of last post
in some forums

another option

Usergroup less than **** post they can not be creat new thread or post before approved by management in some forums

any upgrade for 3.8.8

marysnow786 02-08-2018 10:31 AM

i think its available for vBulletin 4.x.x also can someone provide me link and its fully compatible with latest version ?

MarkFL 02-08-2018 03:55 PM

Quote:

Originally Posted by marysnow786 (Post 2592779)
i think its available for vBulletin 4.x.x also can someone provide me link and its fully compatible with latest version ?

VSa - Advanced Permissions Based on Post Count

MaKayWeB 01-02-2019 10:51 AM

thanks forewer vBulletin :)


All times are GMT. The time now is 04:33 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.01584 seconds
  • Memory Usage 1,887KB
  • 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
  • (5)bbcode_code_printable
  • (7)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (31)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