Problems in modcp.php / groupcp.php

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 !

Problems in modcp.php / groupcp.php

Postby Over on Fri 08. Jul, 2005 10:33

##############################################################
## MOD Title: Auto group
## MOD Author: Niels < ncr@db9.dk > (Niels Chr. Rød) http://mods.db9.dk
## MOD Description: This mod will make it posible to add member
## to a user group, depending on there post count
## MOD Version: 1.2.2
## Compatibility: 2.0.5->2.0.6

I try to integrate this mod in my phpBB2 Plus 1.52 based on phpBB 2.0.16 inkl. Short URL´s

But there are 2 Problems:

Problem No.1:

Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
modcp.php
#
#-----[ FIND ]-------------------------------------------
#
$sql = "SELECT post_id

I find it here: (Line 332)
Code: Select all
         $sql = "SELECT post_id
            FROM " . POSTS_TABLE . "
            WHERE topic_id IN ($topic_id_sql)";
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not get post id information', '', __LINE__, __FILE__, $sql);
         }

         $post_id_sql = '';
         while ( $row = $db->sql_fetchrow($result) )
         {
            $post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . intval($row['post_id']);
         }
         $db->sql_freeresult($result);

and here: (Line 874)
Code: Select all
         $sql = "SELECT post_id
            FROM " . POSTS_TABLE . "
            WHERE post_id IN ($post_id_sql)
               AND forum_id = $forum_id";
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not get post id information', '', __LINE__, __FILE__, $sql);
         }

And here: (Line 890)
Code: Select all
         $sql = "SELECT post_id, poster_id, topic_id, post_time
            FROM " . POSTS_TABLE . "
            WHERE post_id IN ($post_id_sql)
            ORDER BY post_time ASC";
         if (!($result = $db->sql_query($sql)))
         {
            message_die(GENERAL_ERROR, 'Could not get post information', '', __LINE__, __FILE__, $sql);
         }


which is the right position ?

Problem No.2:
Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
groupcp.php
#

#-----[ FIND ]------------------------------------------
#
if ( $group_info['group_type'] == GROUP_CLOSED )
{
$group_details =  $lang['This_closed_group'];
$s_hidden_fields = '';
}
else if ( $group_info['group_type'] == GROUP_HIDDEN )
{
$group_details =  $lang['This_hidden_group'];
$s_hidden_fields = '';
}

#
#-----[ REPLACE WITH ]------------------------------------------
#
if ( $group_info['group_type'] == GROUP_CLOSED )
{
if ($is_autogroup_enable)
{
   $template->assign_block_vars('switch_subscribe_group_input', array());
   $group_details =  sprintf ($lang['This_closed_group'],$lang['Join_auto']);
   $s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
} else
{
   $group_details =  sprintf ($lang['This_closed_group'],$lang['No_more']);
   $s_hidden_fields = '';
}
      }
      else if ( $group_info['group_type'] == GROUP_HIDDEN )
      {
if ($is_autogroup_enable)
{
   $template->assign_block_vars('switch_subscribe_group_input', array());
   $group_details =  sprintf ($lang['This_hidden_group'],$lang['Join_auto']);
   $s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
} else
{
   $group_details =  sprintf ($lang['This_closed_group'],$lang['No_add_allowed']);
   $s_hidden_fields = '';
}
}


But I find there:
Code: Select all
      else if ( $group_info['group_type'] == GROUP_CLOSED )
      {
         $group_details =  $lang['This_closed_group'];
         $s_hidden_fields = '';
      }
      else if ( $group_info['group_type'] == GROUP_HIDDEN )
      {
         $group_details =  $lang['This_hidden_group'];
         $s_hidden_fields = '';
      }


What should I do with the "else if"

Many thanks in advance, Over
Over
Poster
Poster
 
Posts: 2
Joined: Thu 11. Sep, 2003 17:39

Postby Over on Thu 14. Jul, 2005 19:07

Nobody can help me ?

The problem still exist :cry:
Over
Poster
Poster
 
Posts: 2
Joined: Thu 11. Sep, 2003 17:39

Postby Been Told on Mon 26. Sep, 2005 09:42

Yes, it still exists. I would like to know what is happening with the modcp problem, because there is no way I will install this mod without knowing where to actually put that piece of code.
Been Told
Poster
Poster
 
Posts: 6
Joined: Sun 11. Sep, 2005 14:49

Postby Been Told on Mon 26. Sep, 2005 17:23

The problem with the modcp.php is solved. You use teh first occurance of the code. The other... I have no clue.
Been Told
Poster
Poster
 
Posts: 6
Joined: Sun 11. Sep, 2005 14:49

Postby Been Told on Mon 26. Sep, 2005 17:31

Here's my solution to the groupcp.php thing:
In the instructions file isntead of the if simply write elseif and that's it. That's what I did anyway.
Been Told
Poster
Poster
 
Posts: 6
Joined: Sun 11. Sep, 2005 14:49

Postby Been Told on Mon 26. Sep, 2005 20:05

Seems to be working ace! :D
Been Told
Poster
Poster
 
Posts: 6
Joined: Sun 11. Sep, 2005 14:49

Postby Niels on Sun 04. Dec, 2005 00:29

(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


Return to Auto group [2.0.8/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron