|
From: FlorinCB <ory...@us...> - 2008-10-04 07:45:04
|
Update of /cvsroot/mxbb/mx_contact/admin In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31768/admin Modified Files: admin_contact.php admin_contact_log.php Log Message: upgrade Index: admin_contact_log.php =================================================================== RCS file: /cvsroot/mxbb/mx_contact/admin/admin_contact_log.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** admin_contact_log.php 13 Jul 2008 19:32:48 -0000 1.2 --- admin_contact_log.php 4 Oct 2008 07:44:53 -0000 1.3 *************** *** 32,38 **** $module_root_path = "./../"; $phpEx = substr(strrchr(__FILE__, '.'), 1); ! require( $mx_root_path . '/admin/pagestart.' . $phpEx ); ! include_once( $module_root_path . 'includes/contact_constants.' . $phpEx ); // ********************************************************************** --- 32,39 ---- $module_root_path = "./../"; $phpEx = substr(strrchr(__FILE__, '.'), 1); ! require($mx_root_path . 'admin/pagestart.' . $phpEx); ! include_once($module_root_path . 'includes/contact_constants.' . $phpEx); ! include_once($module_root_path . 'includes/functions_newsletter.' . $phpEx); // ********************************************************************** *************** *** 50,63 **** } ! $start = (isset($HTTP_GET_VARS['start']) || isset($HTTP_POST_VARS['start'])) ? intval($HTTP_GET_VARS['start']) : 0; $pagination = ''; $total_pag_items = 1; ! $confirm = (isset($HTTP_POST_VARS['confirm'])) ? true : false; ! $delete = (isset($HTTP_POST_VARS['delete'])) ? true : false; ! if(isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode'])) { ! $mode = (isset($HTTP_POST_VARS['mode'])) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; $mode = htmlspecialchars($mode); } --- 51,64 ---- } ! $start = (isset($_GET['start']) || isset($_POST['start'])) ? intval($_GET['start']) : 0; $pagination = ''; $total_pag_items = 1; ! $confirm = (isset($_POST['confirm'])) ? true : false; ! $delete = (isset($_POST['delete'])) ? true : false; ! if(isset($_POST['mode']) || isset($_GET['mode'])) { ! $mode = (isset($_POST['mode'])) ? $_POST['mode'] : $_GET['mode']; $mode = htmlspecialchars($mode); } *************** *** 74,78 **** } ! if(isset($HTTP_POST_VARS['cancel'])) { $mode = ''; --- 75,79 ---- } ! if(isset($_POST['cancel'])) { $mode = ''; *************** *** 84,98 **** { $redirect = 'admin/admin_contact_log.'.$phpEx; ! redirect(append_sid($redirect, true)); } if(!$confirm) { ! $msg_ids = $HTTP_POST_VARS['msgid']; ! if(empty($HTTP_POST_VARS['msgid'])) { $redirect = 'admin/admin_contact_log.'.$phpEx; ! redirect(append_sid($redirect, true)); } --- 85,99 ---- { $redirect = 'admin/admin_contact_log.'.$phpEx; ! redirect(mx_append_sid($redirect, true)); } if(!$confirm) { ! $msg_ids = $_POST['msgid']; ! if(empty($_POST['msgid'])) { $redirect = 'admin/admin_contact_log.'.$phpEx; ! redirect(mx_append_sid($redirect, true)); } *************** *** 104,108 **** $template->set_filenames(array( ! 'body' => 'admin/confirm_body.tpl') ); --- 105,109 ---- $template->set_filenames(array( ! 'body' => 'admin/confirm_body.'.$tplEx) ); *************** *** 114,118 **** 'L_NO' => $lang['No'], ! 'S_CONFIRM_ACTION' => append_sid('admin_contact_log.'.$phpEx.'?mode=delete'), 'S_HIDDEN_FIELDS' => $hidden_fields) ); --- 115,119 ---- 'L_NO' => $lang['No'], ! 'S_CONFIRM_ACTION' => mx_append_sid('admin_contact_log.'.$phpEx.'?mode=delete'), 'S_HIDDEN_FIELDS' => $hidden_fields) ); *************** *** 122,126 **** else { ! $msg_ids = (isset($HTTP_POST_VARS['msgid'])) ? $HTTP_POST_VARS['msgid'] : array($msgid); $del_msg_sql = ''; --- 123,127 ---- else { ! $msg_ids = (isset($_POST['msgid'])) ? $_POST['msgid'] : array($msgid); $del_msg_sql = ''; *************** *** 135,139 **** if(!$result = $db->sql_query($sql)) { ! message_die(GENERAL_ERROR, 'Could not delete message(s)', '', __LINE__, __FILE__, $sql); } --- 136,140 ---- if(!$result = $db->sql_query($sql)) { ! mx_message_die(GENERAL_ERROR, 'Could not delete message(s)', '', __LINE__, __FILE__, $sql); } *************** *** 141,149 **** { $redirect = 'admin/admin_contact_log.'.$phpEx; ! redirect(append_sid($redirect, true)); } ! $message = $lang['Msg_del_success'] . "<br /><br />" . sprintf($lang['Click_return_msglog'], "<a href=\"" . append_sid("admin_contact_log.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); ! message_die(GENERAL_MESSAGE, $message); } } --- 142,150 ---- { $redirect = 'admin/admin_contact_log.'.$phpEx; ! redirect(mx_append_sid($redirect, true)); } ! $message = $lang['Msg_del_success'] . "<br /><br />" . sprintf($lang['Click_return_msglog'], "<a href=\"" . mx_append_sid("admin_contact_log.$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); } } *************** *** 158,162 **** if(!$result = $db->sql_query($sql)) { ! message_die(CRITICAL_ERROR, 'Could not query config information', '', __LINE__, __FILE__, $sql); } while ($row = $db->sql_fetchrow($result)) --- 159,163 ---- if(!$result = $db->sql_query($sql)) { ! mx_message_die(CRITICAL_ERROR, 'Could not query config information', '', __LINE__, __FILE__, $sql); } while ($row = $db->sql_fetchrow($result)) *************** *** 165,178 **** } ! $file_id = (!empty($HTTP_POST_VARS['file'])) ? $HTTP_POST_VARS['file'] : $HTTP_GET_VARS['file']; ! $msg_id = (!empty($HTTP_POST_VARS['id'])) ? $HTTP_POST_VARS['id'] : $HTTP_GET_VARS['id']; $msg_id = intval($msg_id); ! $confirm = isset($HTTP_POST_VARS['confirm']); if($confirm) { ! $filename = $HTTP_POST_VARS['file']; if(file_exists($filename)) --- 166,179 ---- } ! $file_id = (!empty($_POST['file'])) ? $_POST['file'] : $_GET['file']; ! $msg_id = (!empty($_POST['id'])) ? $_POST['id'] : $_GET['id']; $msg_id = intval($msg_id); ! $confirm = isset($_POST['confirm']); if($confirm) { ! $filename = $_POST['file']; if(file_exists($filename)) *************** *** 187,195 **** if(!$result = $db->sql_query($sql)) { ! message_die(GENERAL_ERROR, 'Could not update Contact table', '', __LINE__, __FILE__, $sql); } ! $message = $lang['File_del_success'] . "<br /><br />" . sprintf($lang['Click_return_msglog'], "<a href=\"" . append_sid("admin_contact_log.$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 --- 188,196 ---- if(!$result = $db->sql_query($sql)) { ! mx_message_die(GENERAL_ERROR, 'Could not update Contact table', '', __LINE__, __FILE__, $sql); } ! $message = $lang['File_del_success'] . "<br /><br />" . sprintf($lang['Click_return_msglog'], "<a href=\"" . mx_append_sid("admin_contact_log.$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); } else *************** *** 203,211 **** if(!$result = $db->sql_query($sql)) { ! message_die(GENERAL_ERROR, 'Could not update Contact table', '', __LINE__, __FILE__, $sql); } ! $message = $lang['File_Not_Here'] . "<br /><br />" . sprintf($lang['Click_return_msglog'], "<a href=\"" . append_sid("admin_contact_log.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); ! message_die(GENERAL_ERROR, $message); } } --- 204,212 ---- if(!$result = $db->sql_query($sql)) { ! mx_message_die(GENERAL_ERROR, 'Could not update Contact table', '', __LINE__, __FILE__, $sql); } ! $message = $lang['File_Not_Here'] . "<br /><br />" . sprintf($lang['Click_return_msglog'], "<a href=\"" . mx_append_sid("admin_contact_log.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . mx_append_sid("index.$phpEx?pane=right") . "\">", "</a>"); ! mx_message_die(GENERAL_ERROR, $message); } } *************** *** 213,217 **** { $template->set_filenames(array( ! 'body' => 'admin/confirm_body.tpl') ); --- 214,218 ---- { $template->set_filenames(array( ! 'body' => 'admin/confirm_body.'.$tplEx) ); *************** *** 225,229 **** 'L_NO' => $lang['No'], ! 'S_CONFIRM_ACTION' => append_sid("admin_contact_log.$phpEx"), 'S_HIDDEN_FIELDS'=> $hidden_fields) ); --- 226,230 ---- 'L_NO' => $lang['No'], ! 'S_CONFIRM_ACTION' => mx_mx_append_sid("admin_contact_log.$phpEx"), 'S_HIDDEN_FIELDS'=> $hidden_fields) ); *************** *** 235,243 **** if($mode == 'full') { ! $msg_id = (!empty($HTTP_POST_VARS['id'])) ? $HTTP_POST_VARS['id'] : $HTTP_GET_VARS['id']; $msg_id = intval($msg_id); $template->set_filenames(array( ! 'body' => 'admin/contact_fullmsg.tpl') ); --- 236,244 ---- if($mode == 'full') { ! $msg_id = (!empty($_POST['id'])) ? $_POST['id'] : $_GET['id']; $msg_id = intval($msg_id); $template->set_filenames(array( ! 'body' => 'admin/contact_fullmsg.'.$tplEx) ); *************** *** 248,252 **** if(!$result = $db->sql_query($sql)) { ! message_die(GENERAL_ERROR, 'Could not obtain message from database', '', __LINE__, __FILE__, $sql); } --- 249,253 ---- if(!$result = $db->sql_query($sql)) { ! mx_message_die(GENERAL_ERROR, 'Could not obtain message from database', '', __LINE__, __FILE__, $sql); } *************** *** 269,273 **** if(!$result = $db->sql_query($sql)) { ! message_die(GENERAL_ERROR, 'Couldnt obtain messages from database', '', __LINE__, __FILE__, $sql); } --- 270,274 ---- if(!$result = $db->sql_query($sql)) { ! mx_message_die(GENERAL_ERROR, 'Couldnt obtain messages from database', '', __LINE__, __FILE__, $sql); } *************** *** 275,279 **** $template->set_filenames(array( ! 'body' => 'admin/contact_msgs.tpl') ); --- 276,280 ---- $template->set_filenames(array( ! 'body' => 'admin/contact_msgs.'.$tplEx) ); *************** *** 285,288 **** --- 286,290 ---- 'L_USER' => $lang['Username'], 'L_NAME' => $lang['Real_name'], + 'L_NEWS' => $lang['Newsletter_intro'] ? $lang['Newsletter_intro'] : 'News', 'L_EMAIL' => $lang['E-mail'], 'L_MESSAGE' => $lang['Comments'], *************** *** 294,298 **** 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_MSG_ACTION' => append_sid("admin_contact_log.$phpEx")) ); --- 296,300 ---- 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_MSG_ACTION' => mx_append_sid("admin_contact_log.$phpEx")) ); *************** *** 321,325 **** { $id = $messages[$i]['msg_id']; ! $full_msg = "... [<a href=" . append_sid("admin_contact_log.$phpEx?mode=full&id=$id") . " onclick=\"window.open('" . append_sid("admin_contact_log.$phpEx?mode=full&id=$id") . "', 'Message', 'left=100,top=100,height=300,width=300,resizable=yes,scrollbars=yes'); return false;\">" . $lang['more'] . "</a>]"; $preview = substr($messages[$i]['message'], 0, 100); $from = strlen($lang['more'])+6; --- 323,327 ---- { $id = $messages[$i]['msg_id']; ! $full_msg = "... [<a href=" . mx_append_sid("admin_contact_log.$phpEx?mode=full&id=$id") . " onclick=\"window.open('" . mx_append_sid("admin_contact_log.$phpEx?mode=full&id=$id") . "', 'Message', 'left=100,top=100,height=300,width=300,resizable=yes,scrollbars=yes'); return false;\">" . $lang['more'] . "</a>]"; $preview = substr($messages[$i]['message'], 0, 100); $from = strlen($lang['more'])+6; *************** *** 336,342 **** 'USER' => $messages[$i]['username'], 'NAME' => $messages[$i]['realname'], 'EMAIL' => $messages[$i]['email'], 'MESSAGE' => ($preview) ? $preview : $messages[$i]['message'], ! 'IP' => decode_ip($messages[$i]['ip']), 'FILE' => $messages[$i]['upfile'], --- 338,345 ---- 'USER' => $messages[$i]['username'], 'NAME' => $messages[$i]['realname'], + 'NEWS' => $messages[$i]['newsletter'] ? $lang['Yes'] : $lang['No'], 'EMAIL' => $messages[$i]['email'], 'MESSAGE' => ($preview) ? $preview : $messages[$i]['message'], ! 'IP' => contact_decode_ip($messages[$i]['ip']), 'FILE' => $messages[$i]['upfile'], *************** *** 347,352 **** 'U_GET_FILE' => (empty($messages[$i]['upfile'])) ? '' : sprintf($lang['Contact_get'], "<a href=\"" . $phpbb_root_path . $messages[$i]['upfile'] . "\">", "</a>"), ! 'U_REMOVE_FILE' => (empty($messages[$i]['upfile'])) ? '' : sprintf($lang['Contact_remove'], "<a href=\"" . append_sid("admin_contact_log.$phpEx?mode=remove&id=" . $messages[$i]['msg_id'] . "&file=" . $phpbb_root_path . $messages[$i]['upfile']) . "\">", "</a>"), ! 'U_MSG_DELETE' => append_sid("admin_contact_log.$phpEx?mode=delete")) ); } --- 350,355 ---- 'U_GET_FILE' => (empty($messages[$i]['upfile'])) ? '' : sprintf($lang['Contact_get'], "<a href=\"" . $phpbb_root_path . $messages[$i]['upfile'] . "\">", "</a>"), ! 'U_REMOVE_FILE' => (empty($messages[$i]['upfile'])) ? '' : sprintf($lang['Contact_remove'], "<a href=\"" . mx_append_sid("admin_contact_log.$phpEx?mode=remove&id=" . $messages[$i]['msg_id'] . "&file=" . $phpbb_root_path . $messages[$i]['upfile']) . "\">", "</a>"), ! 'U_MSG_DELETE' => mx_append_sid("admin_contact_log.$phpEx?mode=delete")) ); } *************** *** 357,361 **** if(!$result = $db->sql_query($sql)) { ! message_die(GENERAL_ERROR, 'Error getting total', '', __LINE__, __FILE__, $sql); } --- 360,364 ---- if(!$result = $db->sql_query($sql)) { ! mx_message_die(GENERAL_ERROR, 'Error getting total', '', __LINE__, __FILE__, $sql); } *************** *** 365,369 **** { $total_pag_items = $total['total']; ! $pagination = generate_pagination("admin_contact_log.$phpEx?mode=$mode", $total_pag_items, (isset($board_config['topics_per_page']) ? $board_config['topics_per_page'] : 15), $start); } } --- 368,372 ---- { $total_pag_items = $total['total']; ! $pagination = phpBB2::generate_pagination("admin_contact_log.$phpEx?mode=$mode", $total_pag_items, (isset($board_config['topics_per_page']) ? $board_config['topics_per_page'] : 15), $start); } } Index: admin_contact.php =================================================================== RCS file: /cvsroot/mxbb/mx_contact/admin/admin_contact.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_contact.php 12 Dec 2007 18:41:34 -0000 1.1 --- admin_contact.php 4 Oct 2008 07:44:53 -0000 1.2 *************** *** 49,53 **** if(!$result = $db->sql_query($sql)) { ! message_die(CRITICAL_ERROR, 'Could not query contact config information', '', __LINE__, __FILE__, $sql); } else --- 49,53 ---- if(!$result = $db->sql_query($sql)) { ! mx_message_die(CRITICAL_ERROR, 'Could not query contact config information', '', __LINE__, __FILE__, $sql); } else *************** *** 63,67 **** $new[$config_name] = (isset($HTTP_POST_VARS[$config_name])) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name]; ! if(isset($HTTP_POST_VARS['submit'])) { $sql = "UPDATE " . CONTACT_CONFIG_TABLE . " --- 63,67 ---- $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 . " *************** *** 71,83 **** if(!$db->sql_query($sql)) { ! message_die(GENERAL_ERROR, 'Failed to update general configuration for $config_name', '', __LINE__, __FILE__, $sql); } } } ! if(isset($HTTP_POST_VARS['submit'])) { ! $message = $lang['Contact_updated'] . "<br /><br />" . sprintf($lang['Click_return_contact'], "<a href=\"" . append_sid("admin_contact.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); ! message_die(GENERAL_MESSAGE, $message); } } --- 71,83 ---- 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); } } *************** *** 145,149 **** $template->set_filenames(array( ! 'body' => 'admin/contact_config_body.tpl') ); --- 145,149 ---- $template->set_filenames(array( ! 'body' => 'admin/contact_config_body.'.$tplEx) ); *************** *** 247,251 **** 'COPYRIGHT' => $lang['Copyright'], ! 'S_CONFIG_ACTION' => append_sid('admin_contact.'.$phpEx), 'S_FORM_ENABLE_YES' => $form_enable_yes, --- 247,251 ---- 'COPYRIGHT' => $lang['Copyright'], ! 'S_CONFIG_ACTION' => mx_append_sid("admin_contact.$phpEx"), 'S_FORM_ENABLE_YES' => $form_enable_yes, |