URGENT HELP NEEDED please

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 !

URGENT HELP NEEDED please

Postby MonsterDK on Sun 04. Dec, 2005 20:29

I have a big forum and after installed the Auto group hack
The user is not added to the Group automatically.

I have set the following...

Number of required posts: 1
Number of max posts: 99999999
Users automatic added when posting = ticked
Group is: Closed type

When the user posts they are NOT added automatically. They are having to go into the Group and add themselves manually by clicking the button.

Anyone can help me please?

Regards.
MonsterDK
Poster
Poster
 
Posts: 21
Joined: Sat 03. Dec, 2005 14:05

Postby Niels on Mon 05. Dec, 2005 00:50

verify the changes it the file function_post.php, this is where the user gets added...
also verify that the settings are actual stored for the usergroup (autogroup settings)
(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 MonsterDK on Mon 05. Dec, 2005 20:49

Niels wrote:verify that the settings are actual stored for the usergroup (autogroup settings)


What do you mean by auto group settings?

hmm, I'm lost there.

Please help further,, TIA!
MonsterDK
Poster
Poster
 
Posts: 21
Joined: Sat 03. Dec, 2005 14:05

Postby MonsterDK on Mon 05. Dec, 2005 20:57

Below is my edited file part. (just part not the full file)


Code: Select all
   if ($topic_update_sql != '')
   {
      $sql = "UPDATE " . TOPICS_TABLE . " SET
         $topic_update_sql
         WHERE topic_id = $topic_id";
      if (!$db->sql_query($sql))
      {
         message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
      }
   }

   if ($mode != 'poll_delete')
   {
      $sql = "UPDATE " . USERS_TABLE . "
         SET user_posts = user_posts $sign
         WHERE user_id = $user_id";
      if (!$db->sql_query($sql, END_TRANSACTION))
      {
         message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
      }
   }

   $sql = "SELECT ug.user_id, g.group_id as g_id, u.user_posts, g.group_count, g.group_count_max FROM " . GROUPS_TABLE . " g, ".USERS_TABLE." u
      LEFT JOIN ". USER_GROUP_TABLE." ug ON g.group_id=ug.group_id AND ug.user_id=$user_id
      WHERE u.user_id=$user_id
      AND g.group_single_user=0
      AND g.group_count_enable=1
      AND g.group_moderator<>$user_id";
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Error geting users post stat', '', __LINE__, __FILE__, $sql);
   }
   while ($group_data = $db->sql_fetchrow($result))
   {
$user_already_added = (empty($group_data['user_id'])) ? FALSE : TRUE;
$user_add = ($group_data['group_count'] == $group_data['user_posts'] && $user_id!=ANONYMOUS) ? TRUE : FALSE;
$user_remove = ($group_data['group_count'] > $group_data['user_posts'] || $group_data['group_count_max'] < $group_data['user_posts']) ? TRUE : FALSE;
      if ($user_add && !$user_already_added)
      {
         //user join a autogroup
         $sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending)
            VALUES (".$group_data['g_id'].", $user_id, '0')";
         if ( !($db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Error insert users, group count', '', __LINE__, __FILE__, $sql);
         }
      } else
      if ( $user_already_added && $user_remove)
      {
         //remove user from auto group
         $sql = "DELETE FROM " . USER_GROUP_TABLE . "
            WHERE group_id=".$group_data['g_id']."
            AND user_id=$user_id";
         if ( !($db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not remove users, group count', '', __LINE__, __FILE__, $sql);
         }
      }
   }

   return;
}

//
// Delete a post/poll
//
MonsterDK
Poster
Poster
 
Posts: 21
Joined: Sat 03. Dec, 2005 14:05

Postby Niels on Mon 05. Dec, 2005 21:30

when you modify e.g. min / max postcount for a usergroup (inside ACP) then verify that the postcount are actual storred - e.g. by looking up the usergroup again, and see that the min / max values are still present
(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 MonsterDK on Mon 05. Dec, 2005 22:01

Niels wrote:when you modify e.g. min / max postcount for a usergroup (inside ACP) then verify that the postcount are actual storred - e.g. by looking up the usergroup again, and see that the min / max values are still present


If I put the ticks in all 3 boxes...

Users automatic added when posting = remains ticked
Add/Update new users = Won't stay ticked
Delete/Update old users = Won't stay ticked
MonsterDK
Poster
Poster
 
Posts: 21
Joined: Sat 03. Dec, 2005 14:05


Return to Auto group [2.0.8/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron