|
From: FlorinCB <ory...@us...> - 2008-12-25 18:19:11
|
Update of /cvsroot/mxbb/mx_contact/includes In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15597/includes Modified Files: contact_constants.php Log Message: new version Index: contact_constants.php =================================================================== RCS file: /cvsroot/mxbb/mx_contact/includes/contact_constants.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** contact_constants.php 4 Oct 2008 07:44:53 -0000 1.2 --- contact_constants.php 25 Dec 2008 18:19:06 -0000 1.3 *************** *** 46,48 **** --- 46,90 ---- @define('MAIL_NORMAL_PRIORITY', 3); @define('MAIL_HIGH_PRIORITY', 2); + + // + // Pull all config data + // + $sql = "SELECT * + FROM " . CONTACT_CONFIG_TABLE; + + if(!$result = $db->sql_query($sql)) + { + mx_message_die(CRITICAL_ERROR, 'Could not query contact config information', '', __LINE__, __FILE__, $sql); + } + else + { + while($row = $db->sql_fetchrow($result)) + { + $contact_config[$row['config_name']] = $row['config_value']; + $config_name = $row['config_name']; + $config_value = $row['config_value']; + + $default_config[$config_name] = isset($HTTP_POST_VARS['submit']) ? str_replace("'", "\'", $config_value) : $config_value; + + $new[$config_name] = (isset($HTTP_POST_VARS[$config_name])) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name]; + + if ($mx_request_vars->is_post('submit')) + { + $sql = "UPDATE " . CONTACT_CONFIG_TABLE . " + SET config_value = '" . str_replace("\'", "''", $new[$config_name]) . "' + WHERE config_name = '$config_name'"; + + if(!$db->sql_query($sql)) + { + mx_message_die(GENERAL_ERROR, 'Failed to update general configuration for $config_name', '', __LINE__, __FILE__, $sql); + } + } + } + + if ($mx_request_vars->is_post('submit')) + { + $message = $lang['Contact_updated'] . "<br /><br />" . sprintf($lang['Click_return_contact'], "<a href=\"" . mx_append_sid("admin_contact.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . mx_append_sid("index.$phpEx?pane=right") . "\">", "</a>"); + mx_message_die(GENERAL_MESSAGE, $message); + } + } ?> \ No newline at end of file |