|
From: FlorinCB <ory...@us...> - 2009-07-28 18:43:04
|
Update of /cvsroot/mxbb/core/includes In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv1162 Modified Files: mx_functions_tools.php Log Message: update Index: mx_functions_tools.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_tools.php,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** mx_functions_tools.php 12 Jul 2009 05:13:00 -0000 1.54 --- mx_functions_tools.php 28 Jul 2009 18:42:16 -0000 1.55 *************** *** 3181,3185 **** $poll_length = ''; ! $error_die_function = ($error_die_function == '') ? "//mx_message_die" : $error_die_function; $current_time = ($current_time == 0) ? time() : $current_time; --- 3181,3185 ---- $poll_length = ''; ! $error_die_function = ($error_die_function == '') ? "mx_message_die" : $error_die_function; $current_time = ($current_time == 0) ? time() : $current_time; *************** *** 3254,3264 **** { //$mode = 'newtopic'; ! if ( $mode == 'newtopic' ) ! { ! // ! // Inserting new topic ! // ! $sql = "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$subject', " . $user_id . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)"; } else --- 3254,3343 ---- { //$mode = 'newtopic'; + if ($mode == 'newtopic') + { + switch (PORTAL_BACKEND) + { + case 'internal': + break; ! case 'phpbb2': ! // ! // Inserting new topic ! // ! $sql = "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$subject', " . $user_id . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)"; ! break; ! ! case 'phpbb3': ! ! if (!function_exists('submit_post')) ! { ! include_once($mx_root_path . 'includes/shared/phpbb3/includes/functions_posting.' . $phpEx); ! } ! ! $post_data = array(); ! ! // Determine some vars ! if (isset($user_id) && $user_id == ANONYMOUS) ! { ! $post_data['username'] = isset($username) ? $username : ''; ! } ! ! $post_data['post_edit_locked'] = (isset($post_data['post_edit_locked'])) ? (int) $post_data['post_edit_locked'] : 0; ! $post_data['post_subject'] = (in_array($mode, array('quote', 'edit'))) ? $post_data['post_subject'] : ((isset($post_data['topic_title'])) ? $post_data['topic_title'] : ''); ! $post_data['topic_time_limit'] = (isset($post_data['topic_time_limit'])) ? (($post_data['topic_time_limit']) ? (int) $post_data['topic_time_limit'] / 86400 : (int) $post_data['topic_time_limit']) : 0; ! $post_data['poll_length'] = (!empty($post_data['poll_length'])) ? (int) $post_data['poll_length'] / 86400 : 0; ! $post_data['poll_start'] = (!empty($post_data['poll_start'])) ? (int) $post_data['poll_start'] : 0; ! $post_data['icon_id'] = (!isset($post_data['icon_id']) || in_array($mode, array('quote', 'reply'))) ? 0 : (int) $post_data['icon_id']; ! $post_data['poll_options'] = array(); ! ! $post_data['post_subject'] = $subject; ! $post_data['topic_type'] = $topic_type; ! $poll = array(); ! ! $data = array( ! 'topic_title' => (empty($post_data['topic_title'])) ? $post_data['post_subject'] : $post_data['topic_title'], ! 'topic_first_post_id' => (isset($post_data['topic_first_post_id'])) ? (int) $post_data['topic_first_post_id'] : 0, ! 'topic_last_post_id' => (isset($post_data['topic_last_post_id'])) ? (int) $post_data['topic_last_post_id'] : 0, ! 'topic_time_limit' => (int) $post_data['topic_time_limit'], ! 'topic_attachment' => (isset($post_data['topic_attachment'])) ? (int) $post_data['topic_attachment'] : 0, ! 'post_id' => (int) $post_id, ! 'topic_id' => (int) $topic_id, ! 'forum_id' => (int) $forum_id, ! 'icon_id' => (int) $post_data['icon_id'], ! 'poster_id' => (int) $post_data['poster_id'], ! 'enable_sig' => (bool) $post_data['enable_sig'], ! 'enable_bbcode' => (bool) $post_data['enable_bbcode'], ! 'enable_smilies' => (bool) $post_data['enable_smilies'], ! 'enable_urls' => (bool) $post_data['enable_urls'], ! 'enable_indexing' => (bool) $post_data['enable_indexing'], ! 'message_md5' => (string) $message_md5, ! 'post_time' => (isset($post_data['post_time'])) ? (int) $post_data['post_time'] : $current_time, ! 'post_checksum' => (isset($post_data['post_checksum'])) ? (string) $post_data['post_checksum'] : '', ! 'post_edit_reason' => $post_data['post_edit_reason'], ! 'post_edit_user' => ($mode == 'edit') ? $user->data['user_id'] : ((isset($post_data['post_edit_user'])) ? (int) $post_data['post_edit_user'] : 0), ! 'forum_parents' => $post_data['forum_parents'], ! 'forum_name' => $post_data['forum_name'], ! 'notify' => $notify, ! 'notify_set' => $post_data['notify_set'], ! 'poster_ip' => (isset($post_data['poster_ip'])) ? $post_data['poster_ip'] : $user->ip, ! 'post_edit_locked' => (int) $post_data['post_edit_locked'], ! 'bbcode_bitfield' => $message_parser->bbcode_bitfield, ! 'bbcode_uid' => $message_parser->bbcode_uid, ! 'message' => $message_parser->message, ! 'attachment_data' => $message_parser->attachment_data, ! 'filename_data' => $message_parser->filename_data, ! ! 'topic_approved' => (isset($post_data['topic_approved'])) ? $post_data['topic_approved'] : false, ! 'post_approved' => (isset($post_data['post_approved'])) ? $post_data['post_approved'] : false, ! ); ! ! $update_message = ($mode == 'editpost') ? true : false; ! ! //$sql = "INSERT INTO " . TOPICS_TABLE . $db->sql_build_array('INSERT', $sql_data); ! ! //submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message); ! ! break; ! } } else *************** *** 3268,3276 **** // $sql = "UPDATE " . TOPICS_TABLE . " SET topic_title = '$subject', topic_type = $topic_type WHERE topic_id = $topic_id"; ! } ! if ( !$db->sql_query( $sql ) ) { ! $error_die_function( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); } --- 3347,3356 ---- // $sql = "UPDATE " . TOPICS_TABLE . " SET topic_title = '$subject', topic_type = $topic_type WHERE topic_id = $topic_id"; ! } ! ! if (!$db->sql_query($sql)) { ! $error_die_function(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql); } *************** *** 3298,3301 **** --- 3378,3382 ---- case 'phpbb2': $sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $user_id . ", '$username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $user_attach_sig)"; + break; *************** *** 3337,3346 **** SET post_username = '$username', enable_bbcode = $bbcode_on, enable_smilies = $smilies_on, enable_sig = $user_attach_sig" . $edited_sql . " WHERE post_id = $post_id"; //Temp fix - removed html_on } ! ! if ( !$db->sql_query($sql) ) { ! $error_die_function( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); ! } $post_id = $mode == 'newtopic' || $mode == 'reply' ? $db->sql_nextid() : $post_id; --- 3418,3428 ---- SET post_username = '$username', enable_bbcode = $bbcode_on, enable_smilies = $smilies_on, enable_sig = $user_attach_sig" . $edited_sql . " WHERE post_id = $post_id"; //Temp fix - removed html_on + } ! ! if (!$db->sql_query($sql)) { ! $error_die_function(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql); ! } $post_id = $mode == 'newtopic' || $mode == 'reply' ? $db->sql_nextid() : $post_id; *************** *** 3512,3516 **** return array( 'post_id' => $post_id, 'topic_id' => $topic_id, 'notify' => $message_tmp ); } ! /** * Delete a post/poll. --- 3594,3598 ---- return array( 'post_id' => $post_id, 'topic_id' => $topic_id, 'notify' => $message_tmp ); } ! /** * Delete a post/poll. |