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)
-   -   Administrative and Maintenance Tools - SSGTI - Visitor Message Throttle (https://vborg.vbsupport.ru/showthread.php?t=219392)

Omranic 07-23-2009 10:00 PM

SSGTI - Visitor Message Throttle
 
1 Attachment(s)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!.............. Sponsored by: PHP KingDom (www.phpkd.net) ..............!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




Please remember to click Mark as Installed if you use this modification.
Support questions from members who have not marked this as installed will be considered low priority.


Note: This product has been requested as a paid product, It has been completed & delivered few months ago. It's licensed under Creative Commons - Attribution-Noncommercial-Share Alike 3.0, I hope this product will be useful for all of you.


Name: Visitor Message Throttle - Version: 3.8.100

Description: This product allows administrators to cotrol visitor messages for each usergroup with a throttle permissions (required posts/maximum X posts in X time span).


Compatible with: All 3.7.x/3.8.x vBulletin versions.


Features:
  • Fully Phrased.
  • Fully Automated.
  • Fully Supported.
  • Accurate Processing.
  • Professionally Coded.
  • Doing all default vBulletin checks.
  • Compatible with AJAX & Normal modes.
  • Can configure Visitor Message throttle Permissions per usergroup:
    • Minimum posts required before posting visitor message.
    • Maximum visitor messages allowed to be posted, per X period of time.
    • X period of time in which the maximum Visitor messages will be limited.
    • Apply throttle limitations per user profile or over all profiles.
    • Include own profile or exclude it from throttle limitations.


Installation Procedure:
  1. Upload the "bitfield_ssgti_vm_throttle.xml" file to "/includes/xml/".
  2. Import product's XML file from AdminCP.
  3. Do the following small file edits:
    • Open the file "includes/class_dm_visitormessage.php" & search in it for the following code:
      Code:

      OR $this->is_duplicate()
      And put the following code after it directly (in the same line):
      Code:

      OR $this->is_throttled() OR $this->posts_check()




    • In the same file "includes/class_dm_visitormessage.php" search for the following code:
      Code:

      function is_duplicate()
      And put the following code under this function or above it (the function as a whole):
      Code:

              /**
              * Throttle Stuff
              *
              * @return      boolean whether this is a throttled post or not
              *
              */
              function is_throttled()
              {
                      if ($this->registry->userinfo['permissions']['ssgti_vm_throttle_hm'] AND $this->registry->userinfo['permissions']['ssgti_vm_throttle_ev'] AND ($this->fetch_field('userid') != $this->fetch_field('postuserid') OR ($this->fetch_field('userid') == $this->fetch_field('postuserid') AND ($this->registry->userinfo['permissions']['ssgti_vm_throttle'] & $this->registry->bf_ugp_ssgti_vm_throttle['ssgti_vm_throttle_own']))))
                      {
                              $ssgti_vm_throttle_ev = TIMENOW - ($this->registry->userinfo['permissions']['ssgti_vm_throttle_ev'] * 60);

                              $query_hook = "";
                              if ($this->registry->userinfo['permissions']['ssgti_vm_throttle'] & $this->registry->bf_ugp_ssgti_vm_throttle['ssgti_vm_throttle_each'])
                              {
                                      $query_hook = "AND vm.userid = " . $this->fetch_field('userid');
                              }
                             
                              if ($this->fetch_field('dateline') > $ssgti_vm_throttle_ev)
                              {
                                      // ### THROTTLE CHECK ###
                                      if ($ssgti_vm_throttles = $this->registry->db->query_read_slave("
                                              SELECT vm.userid, user.username
                                              FROM " . TABLE_PREFIX . "visitormessage AS vm
                                              LEFT JOIN " . TABLE_PREFIX . "user AS user USING (userid)
                                              WHERE vm.postuserid = " . $this->fetch_field('postuserid') . "
                                                      AND vm.dateline > " . $ssgti_vm_throttle_ev . "
                                                      $query_hook
                                              "))
                                      {
                                              // print_r($this->registry->db->fetch_array($ssgti_vm_throttles));
                                              if ($this->registry->db->num_rows($ssgti_vm_throttles) >= $this->registry->userinfo['permissions']['ssgti_vm_throttle_hm'])
                                              {
                                                      $this->error('ssgti_vm_throttle', $this->registry->userinfo['permissions']['ssgti_vm_throttle_hm'], $this->registry->userinfo['permissions']['ssgti_vm_throttle_ev']);
                                                      return true;
                                              }
                                      }
                              }
                              return false;
                      }
              }

              /**
              * Posts Check Stuff
              *
              * @return      boolean whether this user has required posts or not
              *
              */
              function posts_check()
              {
                      if ($this->registry->userinfo['permissions']['ssgti_vm_throttle_ps'])
                      {
                              if ($this->fetch_field('postuserid'))
                              {
                                      $user = fetch_userinfo($this->fetch_field('postuserid'));
                                      if ($user['posts'] < $this->registry->userinfo['permissions']['ssgti_vm_throttle_ps'])
                                      {
                                              $this->error('ssgti_vm_throttle_posts', $this->registry->userinfo['permissions']['ssgti_vm_throttle_ps'], $user['posts']);
                                              return true;
                                      }
                              }
                              return false;
                      }
              }

      Save the modified file "includes/class_dm_visitormessage.php" & upload it (Allow Overwrite).
  4. Done :).


Control:
  • vBulletin AdminCP -> Usergroups -> Usergroup Manager -> Visitor Message Permissions -> Throttle ... Perms


License:

Help with:
  • Suggestions to develop this product.
  • Contributing any updates, upgrades and/or any new features.
  • Translations to benefit more users (translation credits goes to their owners).
  • Spreading this product. Yes, you're free to re-distribute this product as it is.


Known Isues:
  • Nothing till now.


History:
  • v3.8.100 24/07/2009 10:00 PM UTC: First initial public release.


Screen Shots:
  • Available down there.


Notes:
  • English version only supported & supplied here, for any other localized release please contact me.


Technical Notes:
  • New Plugins: 0
  • New Phrases: 7
  • New Templates: 0
  • Template changes: 0
  • New Files: 1
  • File Changes: 2
  • New vBulletin Settings: 0
  • New Usergroup Permissions: 5
  • New Moderator Permissions: 0
  • New Administrator Permissions: 0
  • New Forum Options: 0
  • New DB Tables: 0
  • DB Alterations: 4
  • New Cron Jops: 0
    --------------------------------
  • Installation Level: Easy
  • Installation Time: 30~40 seconds


Donation?:
  • No, sorry. I appreciate your kindness. But if you need to help/support, then you can ask me for custom work. I'm ready for any custom work :).


Recent Products:

erel34 07-24-2009 11:36 PM

Teşekkürler

The4um 07-25-2009 09:44 PM

thank you, looks great

Almotmaiz.Net 07-25-2009 09:56 PM

installed !

nice one !

Omranic 08-14-2009 10:20 AM

Quote:

Originally Posted by erel34 (Post 1854905)
Teşekk?rler

Birşey değil.


Quote:

Originally Posted by The4um (Post 1855393)
thank you, looks great

You are welcome.


Quote:

Originally Posted by Almotmaiz.Net (Post 1855397)
installed !

nice one !

Sounds Great.

:)

Konstantinos 11-22-2009 07:37 AM

nice idea but doesnt work for me

arse error: syntax error, unexpected T_LOGICAL_OR in /home/.../includes/class_dm_visitormessage.php on line 150

alhatmy 01-19-2010 11:28 AM

I'm using 3.8.4

and I think there are some errors in some file edits.

can you check them again please ?
because any user can post any amount even I'm using your code

alhatmy 01-27-2010 10:41 AM

Still waiting .. !


All times are GMT. The time now is 06:56 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.01268 seconds
  • Memory Usage 1,760KB
  • 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
  • (4)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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