} $update_sql = ''; foreach ($vars as $var => $param) { $update_sql .= (!empty($update_sql) ? ', ' : '') . $var . '=\'' . $param . '\''; } // User is in IM preferences table - UPDATE settings $sql = 'UPDATE ' . IM_PREFS_TABLE . ' SET ' . $update_sql . ' WHERE user_id = ' . $this_userdata['user_id']; if (!($result = $db->sql_query($sql))) { $msg = 'Could not update preferences table'; message_die(GENERAL_ERROR, $msg, '', __LINE__, __FILE__, $sql); } $message = $lang['Admin_user_updated']; $message .= '<br /><br />' . sprintf($lang['Click_return_useradmin'], '<a href="' . append_sid("admin_im_users.{$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 { $vars = im_prepare_vars($im_userdata); foreach ($vars as $var => $param) { ${$var} = $param; } } $s_hidden_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" /><input type="hidden" name="mode" value="save" /><input type="hidden" name="' . POST_USERS_URL . '" value="' . $this_userdata['user_id'] . '" />'; $show_controls = generic_select($show_controls, 'show_controls', 'Controls_select'); $list_all_online = generic_select($list_all_online, 'list_all_online', 'Online_Lists'); $network_user_list = generic_select($network_user_list, 'network_user_list', 'network_lists'); $default_mode = MAIN_MODE; $checked = 'checked="checked"'; $template->set_filenames(array('body' => 'imclient_user_body.tpl')); $template->assign_vars(array('S_PREFS_ACTION' => append_sid('admin_im_users.' . $phpEx), 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_PRILLIAN' => $lang['Prillian'], 'L_PREFS' => $lang['Preferences'], 'L_ALLOW_IMS' => $lang['Admin_allow_ims'], 'L_ALLOW_SHOUT' => $lang['Admin_allow_shout'], 'L_ALLOW_CHAT' => $lang['Admin_allow_chat'], 'L_ALWAYS_ADD_SIGNATURE' => $lang['Always_add_sig'], 'L_ALWAYS_ADD_SIGNATURE_EXPLAIN' => $lang['Always_add_sig_explain'], 'L_REFRESH_RATE' => $lang['Refresh_rate'], 'L_REFRESH_RATE_EXPLAIN' => $lang['Refresh_rate_explain1'], 'L_REFRESH_METHOD' => $lang['Refresh_method'], 'L_REFRESH_METHOD_EXPLAIN' => $lang['Refresh_method_explain'], 'L_JAVASCRIPT' => $lang['JavaScript'], 'L_META' => $lang['META_tag'], 'L_BOTH' => $lang['Use_both_methods'], 'L_AUTO_LAUNCH' => $lang['IM_user_auto_launch'], 'L_POPUP_IMS' => $lang['IM_auto_popup'], 'L_LIST_IMS' => $lang['IM_list_new'], 'L_SUCCESS_CLOSE' => $lang['Success_close'], 'L_SHOW_CONTROLS' => $lang['Show_controls'], 'L_WHO_TO_LIST' => $lang['Who_to_list'], 'L_CURRENT_SOUND' => $lang['Current_sound'], 'L_WIDTH' => $lang['Width'], 'L_HEIGHT' => $lang['Height'], 'L_SET_WINDOW_SIZES' => $lang['Set_window_sizes'], 'L_SET_WINDOW_SIZES_EXPLAIN' => $lang['Set_window_sizes_explain'], 'L_MAIN_WINDOW' => $lang['Main_Window'], 'L_SEND_WINDOW' => $lang['Send_Message'], 'L_READ_WINDOW' => $lang['Read_Message'], 'L_WIDE_WINDOW' => $lang['Wide_Client_Window'], 'L_AUTO_DELETE' => $lang['Auto_delete_ims'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_PLAY_SOUND' => $lang['IM_play_sound'], 'L_DEFAULT_SOUND' => $lang['Default_sound'], 'L_SOUND_NAME' => $lang['IM_sound_name'], 'L_IM_STYLE' => $lang['IM_style'], 'L_ALLOW_NETWORK' => $lang['Admin_allow_network'], 'L_NETWORK_USER_SELECT' => $lang['Network_user_list'], 'L_MINI_WINDOW' => $lang['Mini_Client_Window'], 'L_USE_FRAMES' => $lang['Use_frames'], 'L_USE_FRAMES_EXPLAIN' => $lang['Use_frames_explain'], 'L_DEFAULT_MODE' => $lang['Default_mode'], 'NETWORK_USER_SELECT' => $network_user_list, 'STYLE_SELECT' => style_select($im_userdata['themes_id'], 'themes_id'), 'AUTO_DELETE_YES' => $auto_delete ? $checked : '', 'AUTO_DELETE_NO' => !$auto_delete ? $checked : '', 'ALLOW_NETWORK_YES' => $admin_allow_network ? $checked : '', 'ALLOW_NETWORK_NO' => !$admin_allow_network ? $checked : '', 'ALLOW_IMS_YES' => $admin_allow_ims ? $checked : '', 'ALLOW_IMS_NO' => !$admin_allow_ims ? $checked : '', 'ALLOW_SHOUT_YES' => $admin_allow_shout ? $checked : '', 'ALLOW_SHOUT_NO' => !$admin_allow_shout ? $checked : '', 'ALLOW_CHAT_YES' => $admin_allow_chat ? $checked : '', 'ALLOW_CHAT_NO' => !$admin_allow_chat ? $checked : '', 'ALWAYS_ADD_SIGNATURE_YES' => $attach_sig ? $checked : '', 'ALWAYS_ADD_SIGNATURE_NO' => !$attach_sig ? $checked : '', 'REFRESH_RATE' => $refresh_rate, 'REFRESH_METHOD_YES' => $refresh_method == 1 ? $checked : '', 'REFRESH_METHOD_NO' => !$refresh_method ? $checked : '', 'REFRESH_METHOD_BOTH' => $refresh_method == 2 ? $checked : '', 'AUTO_LAUNCH_YES' => $auto_launch ? $checked : '', 'AUTO_LAUNCH_NO' => !$auto_launch ? $checked : '', 'POPUP_IMS_YES' => $popup_ims ? $checked : '', 'POPUP_IMS_NO' => !$popup_ims ? $checked : '', 'LIST_IMS_YES' => $list_ims ? $checked : '', 'LIST_IMS_NO' => !$list_ims ? $checked : '', 'PLAY_SOUND_YES' => $play_sound ? $checked : '', 'PLAY_SOUND_NO' => !$play_sound ? $checked : '', 'DEFAULT_SOUND_YES' => $default_sound ? $checked : '', 'DEFAULT_SOUND_NO' => !$default_sound ? $checked : '', 'SUCCESS_CLOSE_YES' => $success_close ? $checked : '', 'SUCCESS_CLOSE_NO' => !$success_close ? $checked : '', 'USE_FRAMES_YES' => $use_frames ? $checked : '', 'USE_FRAMES_NO' => !$use_frames ? $checked : '', 'DEFAULT_MODE_SELECT' => $default_mode, 'SHOW_CONTROLS' => $show_controls, 'LIST_ALL_ONLINE' => $list_all_online, 'MODE1_HEIGHT' => $mode1_height, 'MODE1_WIDTH' => $mode1_width, 'PREFS_HEIGHT' => $prefs_height, 'PREFS_WIDTH' => $prefs_width, 'READ_HEIGHT' => $read_height, 'READ_WIDTH' => $read_width, 'SEND_HEIGHT' => $send_height, 'SEND_WIDTH' => $send_width, 'SOUND_NAME' => !empty($sound_name) ? $sound_name : $lang['None'])); } else { if ($mode == 'lookup') { //
while (list($var, $param) = @each($vars)) { $update_sql .= (!empty($update_sql) ? ', ' : '') . $var . '=\'' . $param . '\''; } // User is in IM preferences table - UPDATE settings $sql = 'UPDATE ' . IM_PREFS_TABLE . ' SET ' . $update_sql . ' WHERE user_id = ' . $userdata['user_id']; if (!($result = $db->sql_query($sql))) { $msg = 'Could not update preferences table' . $lang['Close_window_link']; message_die(GENERAL_ERROR, $msg, '', __LINE__, __FILE__, $sql); } $message = sprintf($lang['Prillian_Profile_updated'], '<a href="' . append_sid("imclient.{$phpEx}?mode={$client_mode}&mode2={$client_mode2}") . '" target="prillian">', '</a>') . $lang['Close_window_link']; message_die(GENERAL_MESSAGE, $message); } } else { $vars = im_prepare_vars($im_userdata, false); while (list($var, $param) = @each($vars)) { ${$var} = $param; } } // // Basic preferences editor // $page_title = $lang['Preferences']; $template->set_filenames(array('prefs_tabs' => 'prillian/prefs_tabs.tpl')); $template->assign_vars(array('U_IM_PATH' => PRILL_PATH)); $template->assign_var_from_handle('PREFS_TABS', 'prefs_tabs'); $template->assign_block_vars('prefs_tabs_bottom', array()); include_once PRILL_PATH . 'prill_header.' . $phpEx; if ($error) { $template->set_filenames(array('reg_header' => 'error_body.tpl'));