Error when trying to create a new group

Makes it posble for admin to specify witch type of users may mass PM any usergroup
Also PM users can be a list of usernames, so PM can be sendt to any number of users

Moderator: Moderators

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 !

Error when trying to create a new group

Postby planneroftowns on Mon 01. Nov, 2004 22:51

When trying to create a new group I get the following error message:

Code: Select all
General Error
Could not insert new group

DEBUG MODE

SQL Error : 1136 Column count doesn't match value count at row 1

INSERT INTO forum_groups (group_type, group_name, group_description, group_moderator, group_allow_pm, group_single_user) VALUES (1, 'test', 'test2', 2, '5' '0')

Line : 385
File : [path to server]/forum/admin/admin_groups.php


Here is the relevant section of admin_groups.php:

Code: Select all
         $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, group_allow_pm = '$group_allow_pm'
            WHERE group_id = $group_id";
         if ( !$db->sql_query($sql) )
         {
            message_die(GENERAL_ERROR, 'Could not update group', '', __LINE__, __FILE__, $sql);
         }
   
         $message = $lang['Updated_group'] . '<br /><br />' . sprintf($lang['Click_return_groupsadmin'], '<a href="' . append_sid("admin_groups.$phpEx") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');;

         message_die(GENERAL_MESSAGE, $message);
      }
      else if( $mode == 'newgroup' )
      {
         $sql = "INSERT INTO " . GROUPS_TABLE . " (group_type, group_name, group_description, group_moderator, group_allow_pm, group_single_user)
            VALUES ($group_type, '" . str_replace("\'", "''", $group_name) . "', '" . str_replace("\'", "''", $group_description) . "', $group_moderator, '$group_allow_pm'   '0')";
         if ( !$db->sql_query($sql) )
         {
            message_die(GENERAL_ERROR, 'Could not insert new group', '', __LINE__, __FILE__, $sql);
         }
         $new_group_id = $db->sql_nextid();

         $sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending)
            VALUES ($new_group_id, $group_moderator, 0)";
         if ( !$db->sql_query($sql) )
         {
            message_die(GENERAL_ERROR, 'Could not insert new user-group info', '', __LINE__, __FILE__, $sql);
         }
         
         $message = $lang['Added_new_group'] . '<br /><br />' . sprintf($lang['Click_return_groupsadmin'], '<a href="' . append_sid("admin_groups.$phpEx") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');;

         message_die(GENERAL_MESSAGE, $message);

      }
      else
      {
         message_die(GENERAL_MESSAGE, $lang['No_group_action']);


Note: line 385 itself is the
Code: Select all
            message_die(GENERAL_ERROR, 'Could not insert new group', '', __LINE__, __FILE__, $sql);

line, but I assume it refers to the instruction before that.

I also have the calendar pro mod installed (which adds a 'group_calendar_perm' field to the forum_groups table), but have talked with the author who was sure it was not a fault with the calendar mod.

Any help to solve this problem would be very much appreciated.

Thank you in advance.
---
planneroftowns.
planneroftowns
Poster
Poster
 
Posts: 2
Joined: Tue 22. Jun, 2004 16:26

Postby planneroftowns on Mon 08. Nov, 2004 13:51

Okay, then - perhaps someone with this mod working correctly could email me their admin_groups.php file please so that I might examine where I have gone wrong.

Please send to khyams@tiscali.co.uk with phpbb somewhere in the subject line.

Thank you.
planneroftowns
Poster
Poster
 
Posts: 2
Joined: Tue 22. Jun, 2004 16:26

Postby kimberlyteed on Thu 30. Jun, 2005 02:54

Did you ever figure this out ... I'm getting this now :(
Web Site Designer + Host
my board > http://www.kimberlyteed.com/213
... always an original design, never a template :)
kimberlyteed
Poster
Poster
 
Posts: 10
Joined: Thu 16. Jun, 2005 17:43

Postby kimberlyteed on Thu 30. Jun, 2005 03:28

I found it :D

In > admin_groups

This line >
VALUES ($group_type, '" . str_replace("\'", "''", $group_name) . "', '" . str_replace("\'", "''", $group_description) . "', $group_moderator, '$group_allow_email' '0')";

Add a comma >

VALUES ($group_type, '" . str_replace("\'", "''", $group_name) . "', '" . str_replace("\'", "''", $group_description) . "', $group_moderator, '$group_allow_email', '0')";
Web Site Designer + Host
my board > http://www.kimberlyteed.com/213
... always an original design, never a template :)
kimberlyteed
Poster
Poster
 
Posts: 10
Joined: Thu 16. Jun, 2005 17:43


Return to Custom mass PM [2.0.6/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron