[Submit] Moderator group cannot change statut group

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
FX
Registered User
Posts: 254
Joined: Thu Aug 01, 2002 9:29 pm
Location: France
Contact:

[Submit] Moderator group cannot change statut group

Post by FX » Thu Jun 19, 2003 9:07 pm

Hello, this my mod number 2

In adminpannel you have the possibility to create a group with a diffenret statut : hidden, close, open but your group moderator have the possibility to change this. If you install thismod you can choice if you want to autorize your group moderator to change the statut of the group.

Code: Select all

##############################################################
## MOD Title: Moderator group cannot change statut group
## MOD Author: FX <FX@2037.org> (FX) http://www.phpbb.biz
## MOD Description: Enable or disable the statut group change for group moderator
## MOD Version: 1.0.0
##
## Installation Level: easy
## Installation Time: 15 Minutes
## Files To Edit: (5)
##      groupcp.php,
##   admin/admin_groups.php,
##   includes/constants.php
##   language/lang_french/lang_admin.php,
##   templates/subSilver/admin/groupgroupe_edit_body.tpl,
##       
## Included Files: n/a
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##	- Insert 1 row of data into phpbb_groups table.
##
##############################################################
## MOD History:
##
##   2005-10-20 - Version 1.0.0
##      - MOD release
##
##############################################################
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ SQL ]-----
#
# Note:  Replace phpbb_ with whatever forum prefix you use.
#
ALTER TABLE phpbb_groups ADD group_statut TINYINT DEFAULT '0' NOT NULL AFTER group_type;



#
#-----[ OPEN ]------------------------------------------------
#
includes/constants.php

#
#-----[ FIND ]-----
#
// Group settings
define('GROUP_OPEN', 0);
define('GROUP_CLOSED', 1);
define('GROUP_HIDDEN', 2);

#
#-----[ AFTER, ADD ]-----
#
// Statut Group
define('STATUT_MODO', 0);
define('STATUT_ADMIN', 1);

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]-----
#
?>

#
#-----[ BEFORE, ADD ]-----
#
// Statut group
$lang['modo_status'] = 'Modifiable statute by';
$lang['statut_admin'] ='Administrateors';
$lang['statut_modo'] = 'Moderator';

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/admin/group_edit_body.tpl

#
#-----[ FIND ]-----
#
   <tr>
     <td class="row1" width="38%"><span class="gen">{L_GROUP_STATUS}:</span></td>
     <td class="row2" width="62%">
      <input type="radio" name="group_type" value="{S_GROUP_OPEN_TYPE}" {S_GROUP_OPEN_CHECKED} /> {L_GROUP_OPEN} &nbsp;&nbsp;<input type="radio" name="group_type" value="{S_GROUP_CLOSED_TYPE}" {S_GROUP_CLOSED_CHECKED} />   {L_GROUP_CLOSED} &nbsp;&nbsp;<input type="radio" name="group_type" value="{S_GROUP_HIDDEN_TYPE}" {S_GROUP_HIDDEN_CHECKED} />   {L_GROUP_HIDDEN}</td>
   </tr>

#
#-----[ AFTER, ADD ]-----
#
<tr>
     <td class="row1" width="38%"><span class="gen">{L_MODO_STATUS}:</span></td>
     <td class="row2" width="62%">
      <input type="radio" name="group_statut" value="{S_STATUT_ADMIN}" {S_STATUT_ADMIN_CHECKED} /> {L_STATUT_ADMIN} <input type="radio" name="group_statut" value="{S_STATUT_MODO}" {S_STATUT_MODO_CHECKED} />   {L_STATUT_MODO} </td>
   </tr>

#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_groups.php

#
#-----[ FIND ]-----
#
   else if ( isset($HTTP_POST_VARS['new']) )
   {
      $group_info = array (
#
#-----[ AFTER, ADD ]-----
#
'group_statut' => STATUT_MODO,

#
#-----[ FIND ]-----
#
$group_open = ' checked="checked"';

#
#-----[ BEFORE, ADD ]-----
#
$statut_modo = ' checked="checked"';

#
#-----[ FIND ]-----
#
   $group_open = ( $group_info['group_type'] == GROUP_OPEN ) ? ' checked="checked"' : '';
   $group_closed = ( $group_info['group_type'] == GROUP_CLOSED ) ? ' checked="checked"' : '';
   $group_hidden = ( $group_info['group_type'] == GROUP_HIDDEN ) ? ' checked="checked"' : '';

#
#-----[ AFTER, ADD ]-----
#
$statut_admin = ( $group_info['group_statut'] == STATUT_ADMIN ) ? ' checked="checked"' : '';
   $statut_modo = ( $group_info['group_statut'] == STATUT_MODO ) ? ' checked="checked"' : '';

#
#-----[ FIND ]-----
#
'L_GROUP_STATUS' => $lang['group_status'],

#
#-----[ AFTER, ADD ]-----
#
'L_MODO_STATUS' => $lang['modo_status'],

#
#-----[ FIND ]-----
#
'L_GROUP_HIDDEN' => $lang['group_hidden'],

#
#-----[ AFTER, ADD ]-----
#
'L_STATUT_ADMIN' => $lang['statut_admin'],
'L_STATUT_MODO' => $lang['statut_modo'],

#
#-----[ FIND ]-----
#
'S_GROUP_HIDDEN_TYPE' => GROUP_HIDDEN,

#
#-----[ AFTER, ADD ]-----
#
'S_STATUT_ADMIN' => STATUT_ADMIN,
      'S_STATUT_MODO' => STATUT_MODO,

#
#-----[ FIND ]-----
#
'S_GROUP_HIDDEN_CHECKED' => $group_hidden,

#
#-----[ AFTER, ADD ]-----
#
'S_STATUT_ADMIN_CHECKED' => $statut_admin,
      'S_STATUT_MODO_CHECKED' => $statut_modo,

#
#-----[ FIND ]-----
#
else
   {
      $group_type = isset($HTTP_POST_VARS['group_type']) ? intval($HTTP_POST_VARS['group_type']) : GROUP_OPEN;

#
#-----[ AFTER, ADD ]-----
#
$group_statut = isset($HTTP_POST_VARS['group_statut']) ? intval($HTTP_POST_VARS['group_statut']) : STATUT_MODO;

#
#-----[ FIND ]-----
#
$sql = "UPDATE " . GROUPS_TABLE . "
            SET group_type = $group_type,
#
#-----[ IN-LINE FIND ]-----
#
group_type = $group_type,

#
#-----[ IN-LINE AFTER, ADD ]-----
#
group_statut = $group_statut,

#
#-----[ FIND ]-----
#
else if( $mode == 'newgroup' )
      {
         $sql = "INSERT INTO " . GROUPS_TABLE . " (group_type,

#
#-----[ IN-LINE FIND ]-----
#
 (group_type,

#
#-----[ IN-LINE AFTER, ADD ]-----
#
group_statut,

#
#-----[ FIND ]-----
#
VALUES ($group_type,

#
#-----[ IN-LINE FIND ]-----
#
$group_type,

#
#-----[ IN-LINE AFTER, ADD ]-----
#
$group_statut,

#
#-----[ OPEN ]------------------------------------------------
#
groupcp.php

#
#-----[ FIND ]-----
#
if ( $is_moderator )
         {
            $template->assign_block_vars('member_row.switch_mod_option', array());
         }

#
#-----[ REPLACE WITH ]------------------------------------------
#
if ( $userdata['user_level'] == ADMIN || $group_info['group_statut'] == STATUT_MODO)
         {
            $template->assign_block_vars('member_row.switch_mod_option', array());
         }

#
#-----[ FIND ]-----
#
if ( $is_moderator )
   {
      $template->assign_block_vars('switch_mod_option', array());
      $template->assign_block_vars('switch_add_member', array());
   }

#
#-----[ REPLACE WITH ]------------------------------------------
#
if ( $is_moderator )
   {
      if ( $userdata['user_level'] == ADMIN || $group_info['group_statut'] == STATUT_MODO)
      {
         $template->assign_block_vars('switch_mod_option', array());
      }
      $template->assign_block_vars('switch_add_member', array());
   }

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM 
Last edited by FX on Thu Oct 20, 2005 5:58 am, edited 1 time in total.

User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3476
Joined: Wed Oct 27, 2004 11:35 pm
Name: William
Contact:

Post by bonelifer » Wed Oct 19, 2005 1:14 pm

I've updated this to be EasyMod Friendly. I've installed it on phpBB 2.0.17. It works. Here's the code:

Code: Select all

##############################################################
## Mod Title: Moderator group cannot change statut group
## MOD Author: FX aka Burning Sneakers < FX@2037.biz > (François-Xavier) http://www.phpbb.biz
## MOD Description: enable or disable the statut group change for group moderator
## Mod Version: 0.0.1
##
## Installation Level: easy
## Installation Time: 15 Minutes
## Files To Edit: (5)
##      groupcp.php,
##   admin/admin_groups.php,
##   includes/constants.php
##   language/lang_french/lang_admin.php,
##   templates/subSilver/admin/groupgroupe_edit_body.tpl,
##       
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
## Author Note:
##     Insert 1 row of data into phpbb_groups table.
##
## Change History:
##
##     0.0.1    :    Beta.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ SQL ]-----
#
# Note:  Replace phpbb_ with whatever forum prefix you use.
#
ALTER TABLE phpbb_groups ADD group_statut TINYINT DEFAULT '0' NOT NULL AFTER group_type;



#
#-----[ OPEN ]------------------------------------------------
#
includes/constants.php

#
#-----[ FIND ]-----
#
// Group settings
define('GROUP_OPEN', 0);
define('GROUP_CLOSED', 1);
define('GROUP_HIDDEN', 2);

#
#-----[ AFTER, ADD ]-----
#
// Statut Group
define('STATUT_MODO', 0);
define('STATUT_ADMIN', 1);

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]-----
#
?>

#
#-----[ BEFORE, ADD ]-----
#
// Statut group
$lang['modo_status'] = 'Modifiable statute by';
$lang['statut_admin'] ='Administrateors';
$lang['statut_modo'] = 'Moderator';

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/admin/group_edit_body.tpl

#
#-----[ FIND ]-----
#
	<tr> 
	  <td class="row1" width="38%"><span class="gen">{L_GROUP_STATUS}:</span></td>
	  <td class="row2" width="62%"> 
		<input type="radio" name="group_type" value="{S_GROUP_OPEN_TYPE}" {S_GROUP_OPEN_CHECKED} /> {L_GROUP_OPEN} &nbsp;&nbsp;<input type="radio" name="group_type" value="{S_GROUP_CLOSED_TYPE}" {S_GROUP_CLOSED_CHECKED} />	{L_GROUP_CLOSED} &nbsp;&nbsp;<input type="radio" name="group_type" value="{S_GROUP_HIDDEN_TYPE}" {S_GROUP_HIDDEN_CHECKED} />	{L_GROUP_HIDDEN}</td> 
	</tr>

#
#-----[ AFTER, ADD ]-----
#
<tr>
     <td class="row1" width="38%"><span class="gen">{L_MODO_STATUS}:</span></td>
     <td class="row2" width="62%">
      <input type="radio" name="group_statut" value="{S_STATUT_ADMIN}" {S_STATUT_ADMIN_CHECKED} /> {L_STATUT_ADMIN} <input type="radio" name="group_statut" value="{S_STATUT_MODO}" {S_STATUT_MODO_CHECKED} />   {L_STATUT_MODO} </td>
   </tr>

#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_groups.php

#
#-----[ FIND ]-----
#
	else if ( isset($HTTP_POST_VARS['new']) )
	{
		$group_info = array (
#
#-----[ AFTER, ADD ]-----
#
'group_statut' => STATUT_MODO,

#
#-----[ FIND ]-----
#
$group_open = ' checked="checked"';

#
#-----[ BEFORE, ADD ]-----
#
$statut_modo = ' checked="checked"';

#
#-----[ FIND ]-----
#
	$group_open = ( $group_info['group_type'] == GROUP_OPEN ) ? ' checked="checked"' : '';
	$group_closed = ( $group_info['group_type'] == GROUP_CLOSED ) ? ' checked="checked"' : '';
	$group_hidden = ( $group_info['group_type'] == GROUP_HIDDEN ) ? ' checked="checked"' : '';

#
#-----[ AFTER, ADD ]-----
#
$statut_admin = ( $group_info['group_statut'] == STATUT_ADMIN ) ? ' checked="checked"' : '';
   $statut_modo = ( $group_info['group_statut'] == STATUT_MODO ) ? ' checked="checked"' : '';

#
#-----[ FIND ]-----
#
'L_GROUP_STATUS' => $lang['group_status'],

#
#-----[ AFTER, ADD ]-----
#
'L_MODO_STATUS' => $lang['modo_status'],

#
#-----[ FIND ]-----
#
'L_GROUP_HIDDEN' => $lang['group_hidden'],

#
#-----[ AFTER, ADD ]-----
#
'L_STATUT_ADMIN' => $lang['statut_admin'],
'L_STATUT_MODO' => $lang['statut_modo'],

#
#-----[ FIND ]-----
#
'S_GROUP_HIDDEN_TYPE' => GROUP_HIDDEN,

#
#-----[ AFTER, ADD ]-----
#
'S_STATUT_ADMIN' => STATUT_ADMIN,
      'S_STATUT_MODO' => STATUT_MODO,

#
#-----[ FIND ]-----
#
'S_GROUP_HIDDEN_CHECKED' => $group_hidden,

#
#-----[ AFTER, ADD ]-----
#
'S_STATUT_ADMIN_CHECKED' => $statut_admin,
      'S_STATUT_MODO_CHECKED' => $statut_modo,

#
#-----[ FIND ]-----
#
else
   {
      $group_type = isset($HTTP_POST_VARS['group_type']) ? intval($HTTP_POST_VARS['group_type']) : GROUP_OPEN;

#
#-----[ AFTER, ADD ]-----
#
$group_statut = isset($HTTP_POST_VARS['group_statut']) ? intval($HTTP_POST_VARS['group_statut']) : STATUT_MODO;

#
#-----[ FIND ]-----
#
$sql = "UPDATE " . GROUPS_TABLE . "
            SET group_type = $group_type,
#
#-----[ IN-LINE FIND ]-----
#
group_type = $group_type,

#
#-----[ IN-LINE AFTER, ADD ]-----
#
group_statut = $group_statut,

#
#-----[ FIND ]-----
#
else if( $mode == 'newgroup' )
      {
         $sql = "INSERT INTO " . GROUPS_TABLE . " (group_type,

#
#-----[ IN-LINE FIND ]-----
#
 (group_type,

#
#-----[ IN-LINE AFTER, ADD ]-----
#
group_statut,

#
#-----[ FIND ]-----
#
VALUES ($group_type,

#
#-----[ IN-LINE FIND ]-----
#
$group_type,

#
#-----[ IN-LINE AFTER, ADD ]-----
#
$group_statut,

#
#-----[ OPEN ]------------------------------------------------
#
groupcp.php

#
#-----[ FIND ]-----
#
if ( $is_moderator )
         {
            $template->assign_block_vars('member_row.switch_mod_option', array());
         }

#
#-----[ REPLACE WITH ]------------------------------------------
#
if ( $userdata['user_level'] == ADMIN || $group_info['group_statut'] == STATUT_MODO)
         {
            $template->assign_block_vars('member_row.switch_mod_option', array());
         }

#
#-----[ FIND ]-----
#
if ( $is_moderator )
   {
      $template->assign_block_vars('switch_mod_option', array());
      $template->assign_block_vars('switch_add_member', array());
   }

#
#-----[ REPLACE WITH ]------------------------------------------
#
if ( $is_moderator )
   {
      if ( $userdata['user_level'] == ADMIN || $group_info['group_statut'] == STATUT_MODO)
      {
         $template->assign_block_vars('switch_mod_option', array());
      }
      $template->assign_block_vars('switch_add_member', array());
   }

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM 
Knowledge Base | phpBB Board Rules | Search Customisation Database
Image
Please don't contact me via PM or email for phpBB support .

FX
Registered User
Posts: 254
Joined: Thu Aug 01, 2002 9:29 pm
Location: France
Contact:

Post by FX » Thu Oct 20, 2005 5:39 am

Thank you for this update, I will submit this MOD.

User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3476
Joined: Wed Oct 27, 2004 11:35 pm
Name: William
Contact:

Post by bonelifer » Thu Oct 20, 2005 8:48 pm

Thanks for this mod. This mod along with LifeIsPain's Group Deny Leave and Antony Baileys Group Add on Register mod I'm able to have a default USER(member) group.
Knowledge Base | phpBB Board Rules | Search Customisation Database
Image
Please don't contact me via PM or email for phpBB support .

Post Reply

Return to “[2.0.x] MODs in Development”