Compatability with Real Open Groups

You'll automatically gain access to this forum when you will post your first post in another forum. That way it will demonstrate how the Auto Group MOD works.
Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Compatability with Real Open Groups

Postby J. R. Miller on Fri 21. May, 2004 01:02

Hi, does anyone know if the Auto-group MOD is compatable with the Real Open Groups MOD 1.0.0 http://www.phpbbhacks.com/viewhack.php?id=1466 ?
I want open groups, but I don't want to mess up the Auto groups. the problem with knowing the answer is that this other MOD requires a db update, so I need to make sure the new db update wont mess with the Auto Group updates.
Anyone using both? Please let me know.
Thanks,
Joe
J. R. Miller
Poster
Poster
 
Posts: 22
Joined: Sat 20. Dec, 2003 00:42

Postby J. R. Miller on Sun 30. May, 2004 03:49

Here is the code. If anyone has used both or knows if there is a code conflict, please let me know. I see that there is at least one nested loop that has a potential conflict, but I don't have a test board to check against.
Thanks
Code: Select all
###############################################
##   Hack Title:      Real open groups
##   Hack Version:   1.0.0
##   Author:         Freakin' Booty ;-P
##   Description:   Choose whether you want the group moderator to validate users added to an open group or not.
##   Compatibility:   2.0.3 - 2.0.4
##
##   Installation Level: Easy
##   Installation Time: 10-15 minutes
##   Files To Edit: 4
##      groupcp.php
##      admin/admin_groups.php
##      language/lang_english/lang_main.php
##      templates/subSilver/admin/group_edit_body.tpl
##
##   Included Files: 1
##      db_update.php
##
##   History:
##      1.0.0   Initial release
##
##   Author Notes:
##      None
##
##   Support:      http://www.phpbbhacks.com/forums
##   Copyright:      Â©2003 Real open groups 1.0.0 - Freakin' Booty ;-P
##
###############################################
##   You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads.
##   Please visit http://www.phpbbhacks.com/forums for support.
###############################################
##
###############################################
##   This hack is released under the GPL License.
##   This hack can be freely used, but not distributed, without permission.
##   Intellectual Property is retained by the hack author(s) listed above.
###############################################

#
#-----[ COPY ]--------------------------------------------
#
db_update.php

#
#-----[ TO ]----------------------------------------------
#
# Run this file once as an administrator and then delete it immediately
#
db_update.php

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

#
#-----[ FIND ]--------------------------------------------
#
   $sql = "SELECT ug.user_id, g.group_type
      FROM " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g
      WHERE g.group_id = $group_id
         AND g.group_type <> " . GROUP_HIDDEN . "
         AND ug.group_id = g.group_id";

#
#-----[ INLINE, FIND ]------------------------------------
#
, g.group_type

#
#-----[ AFTER, ADD ]--------------------------------------
#
, g.group_validate

#
#-----[ FIND ]--------------------------------------------
#
      if ( $row['group_type'] == GROUP_OPEN )
      {
         do
         {

#
#-----[ AFTER, ADD ]--------------------------------------
#
            $group_validate = ( isset($row['group_validate']) ) ? intval($row['group_validate']) : 1;

#
#-----[ FIND ]--------------------------------------------
#
   $sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending)
      VALUES ($group_id, " . $userdata['user_id'] . ", 1)";

#
#-----[ BEFORE, ADD ]-------------------------------------
#
   if( !$group_validate )
   {
      $sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending)
         VALUES ($group_id, " . $userdata['user_id'] . ", 0)";
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, "Error inserting user group subscription", "", __LINE__, __FILE__, $sql);
      }
   }
   else
   {

#
#-----[ FIND ]--------------------------------------------
#
      'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id&validate=true")
   );
   $emailer->send();
   $emailer->reset();

#
#-----[ AFTER, ADD ]--------------------------------------
#
   }

#
#-----[ FIND ]--------------------------------------------
#
   $message = $lang['Group_joined'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');

#
#-----[ REPLACE WITH ]------------------------------------
#
   $message = ( ( $group_validate ) ? $lang['Group_joined'] : $lang['Group_joined_no_validate'] ) . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');

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

#
#-----[ FIND ]--------------------------------------------
#
         'group_moderator' => '',

#
#-----[ AFTER, ADD ]--------------------------------------
#
         'group_validate' => 1,

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

#
#-----[ AFTER, ADD ]--------------------------------------
#
   $group_validate_yes = ( $group_info['group_validate'] ) ? ' checked="checked"' : '';
   $group_validate_no = ( !$group_info['group_validate'] ) ? ' checked="checked"' : '';

#
#-----[ FIND ]--------------------------------------------
#
      'GROUP_MODERATOR' => $group_moderator,

#
#-----[ AFTER, ADD ]--------------------------------------
#
      'GROUP_VALIDATE_YES' => $group_validate_yes,
      'GROUP_VALIDATE_NO' => $group_validate_no,

#
#-----[ FIND ]--------------------------------------------
#
      'L_GROUP_DELETE_CHECK' => $lang['group_delete_check'],

#
#-----[ AFTER, ADD ]--------------------------------------
#
      'L_GROUP_VALIDATE' => $lang['admin_group_validate'],
      'L_GROUP_VALIDATE_EXPLAIN' => $lang['admin_group_validate_explain'],
      'L_NO' => $lang['No'],

#
#-----[ FIND ]--------------------------------------------
#
      $delete_old_moderator = isset($HTTP_POST_VARS['delete_old_moderator']) ? true : false;

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

#
#-----[ FIND ]--------------------------------------------
#
         $sql = "UPDATE " . GROUPS_TABLE . "
            SET group_type = $group_type, group_name = '" . str_replace("\'", "''", $group_name) . "', group_description = '" . str_replace("\'", "''", $group_description) . "', group_moderator = $group_moderator

#
#-----[ INLINE, FIND ]------------------------------------
#
, group_moderator = $group_moderator

#
#-----[ AFTER, ADD ]--------------------------------------
#
, group_validate = $group_validate

#
#-----[ FIND ]--------------------------------------------
#
         $sql = "INSERT INTO " . GROUPS_TABLE . " (group_type, group_name, group_description, group_moderator, group_single_user)
            VALUES ($group_type, '" . str_replace("\'", "''", $group_name) . "', '" . str_replace("\'", "''", $group_description) . "', $group_moderator,   '0')";

#
#-----[ INLINE, FIND ]------------------------------------
#
, group_moderator

#
#-----[ AFTER, ADD ]--------------------------------------
#
, group_validate

#
#-----[ INLINE, FIND ]------------------------------------
#
, $group_moderator

#
#-----[ AFTER, ADD ]--------------------------------------
#
, $group_validate

#
#-----[ OPEN ]--------------------------------------------
#
# Make sure to edit this file for every language installed
#
language/lang_english/lang_main.php

#
#-----[ FIND ]--------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------

#
#-----[ AFTER, ADD ]--------------------------------------
#
//
// Real open groups
//
$lang['Group_joined_no_validate'] = 'You have successfully subscribed to this group.';
$lang['admin_group_validate'] = 'Enable group validation';
$lang['admin_group_validate_explain'] = 'This option only works for open groups. Enabling this will make the group moderator have to validate users adding themselves to the group.';

#
#-----[ OPEN ]--------------------------------------------
#
# Make sure to edit this file for every template installed
#
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_GROUP_VALIDATE}:</span><br /><span class="gensmall">{L_GROUP_VALIDATE_EXPLAIN}</span></td>
     <td class="row2" width="62%">
      <input type="radio" name="group_validate" value="1"{GROUP_VALIDATE_YES} /> {L_YES} &nbsp;&nbsp;<input type="radio" name="group_validate" value="0"{GROUP_VALIDATE_NO} /> {L_NO}</td>
   </tr>

#
#-----[ SAVE & CLOSE ALL FILES ]--------------------------
#
J. R. Miller
Poster
Poster
 
Posts: 22
Joined: Sat 20. Dec, 2003 00:42

Postby Niels on Mon 07. Jun, 2004 09:55

it seam like both mods try modify some of the same lines of code - witch makes them incompatible...
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby J. R. Miller on Thu 17. Jun, 2004 01:58

argh :cry: that is what I feared. they are two great mods though. If anyone knows how to make them work together, please let me know! :D
J. R. Miller
Poster
Poster
 
Posts: 22
Joined: Sat 20. Dec, 2003 00:42


Return to Auto group [2.0.8/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron