Clone wiki

q2a-temporary-user-block-public / Home

TUB - Temporary User Block

Table of contents


TUB is a Question2Answer plugin that allows users to be blocked for a period of time and then be automatically unblocked.



  • Allows users to be blocked either permanently or temporarily
  • Users are able to include a reason for the block that is displayed in the user profile
  • Both kind of blocks can send a block email notification to the blocked user
  • Temporary blocks can be configured in hours and days
  • A countdown is displayed in the user profile showing the user how much time left they have before getting unblocked
  • Once the countdown reaches zero, the temporary blocked user is unblocked
  • Admin options allow to set the block reason length as well as whether to show user profile fields or not
  • LTR and RTL support
  • Upgrade system support: the plugin is able to properly upgrade from previous versions
  • Internationalization support (Spanish translation included)
  • Does not require any core hack and does not modify the core tables in any way (structure and data)


These are the technical requirements for the plugin to work properly:

  • Q2A core version 1.7.*, 1.8.*


  • This plugin does not support external users.


  1. Copy the pupi-tub directory into the qa-plugin directory (replace any already existing directory).
  2. If you are using a Q2A core version greater or equal to 1.8.*, then navigate to admin/plugins and enable the Temporary User Block plugin.
  3. Perform a database initialization by navigating to admin/plugins and following the steps, if prompted.

Sample usage and screenshots

The usage of the plugin is really straightforward. When an admin clicks on the Block button, a popup appears:

User block

The popup contains the following fields:

  • Period type of the block: combobox that can have the following values:
    • Hours: this will set a temporary block and the units will be interpreted as hours.
    • Days: this will set a temporary block and the units will be interpreted as days.
    • Permanent: this will set a permanent block.
  • Period unit of the block: text input that controls the amount of hours or days, depending on the period type field, to block the user.
  • Reason for the block: text input used to explain the reason why the user is being blocked.
  • Notify user by email: checkbox that controls if the blocked user should receive an email notification informing them they were blocked.

It is possible to display two fields in the user profile section that provide some information about the block:

User profile

  • Remaining block time:
    • For temporary blocks, it represents the amount of hours, minutes and seconds that need to pass in order for the user to become unblocked again. It is calculated based on the period type and units input when the user was blocked.
    • For permanent blocks, it displays that the block is permanent.
  • Block reason: the reason for the block input when the user was blocked.

Once the timer runs out, the user is unblocked.

Admin section

Here is a screenshot of the admin section:

Admin section

Here is a description of the main settings the admin can change:

  • Minimum block reason length: minimum amount of characters that need to be input in the block reason field when blocking a user. If this value is set to 0 then the reason field becomes optional.
  • Minimum show remaining block time user permit: minimum user level that will be allowed to see the remaining block time in the user profile.
  • Minimum show block reason user permit: minimum user level that will be allowed to see the blockreason in the user profile.


If you need to uninstall this plugin all you need to do is:

  1. Remove the pupi-tub directory.
  2. Drop all tables starting with the ^pupi_tub_ prefix where ^ stands for your Q2A config.php settings (which is qa_ by default).
  3. Remove all rows from the ^options table that start with pupi_tub_.


Technical support must all go through the issues section on this site and be in English.

  • Bugs: if you find a bug or error in the plugin, create a bug issue detailing the steps needed to be performed in order to reproduce the issue. Provide the steps from scratch, i.e., starting just after a clean Q2A setup. Attaching screenshots might be useful too. Also include your PHP, MySQL, Q2A and plugin versions. Make sure you have no other plugin in the qa-plugin directory while reproducing it.
  • New features: feel free to request features using the issues section. Select the enhancement kind in the combobox and explain in detail the feature and why you consider it would be useful to others.
  • Questions and other technical support: create a task issue explaining the situation in detail.

Administrative (all non-technical) issues should go through private message to my profile in the Q2A site. Make sure to provide your email address.


  • Do you give refunds in case I end up not liking the plugin?

    No. The reason for this is that not only this wiki is quite descriptive but also the plugin can be seen and interacted with live in the demo site. You can fully test the plugin before buying.

  • Is there any additional installation step that need to be performed?

    No, the installation steps listed in this wiki are all it is needed.

  • Will this plugin work in my theme?

    This is impossible to tell. If your theme only modifies CSS, most likely, it will. However, you might need to make this plugin's CSS match your theme. No support will be given on that. This plugin works well with the SnowFlat theme released with Q2A 1.8.0.

  • Are bug fixes charged separately?

    No. Bug fixes are already included in the price. New features, however, might not be free.

  • Would you mind doing some customizations to this plugin?

    Sure. Feel free to get in touch as explained in the Support section.

Get the plugin

Click here to buy the plugin using PayPal. Make sure to use the PayPal's email address in which you would like to receive the plugin. You will receive it to your email address in the following 48 hs after buying it. Bear in mind the email address will be your client identification in the future, in case any support is needed.