|
From: FlorinCB <ory...@us...> - 2008-10-31 12:16:37
|
Update of /cvsroot/mxbb/core/includes In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv7523 Modified Files: mx_functions_tools.php Log Message: this will allow pafiledb to post phpbb3 comments, some to do torog Index: mx_functions_tools.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_tools.php,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** mx_functions_tools.php 14 Oct 2008 04:43:40 -0000 1.47 --- mx_functions_tools.php 31 Oct 2008 11:41:08 -0000 1.48 *************** *** 3125,3129 **** $smilies_on = 1) { ! global $db, $phpbb_root_path, $phpEx, $board_config, $user_ip, $portal_config, $lang, $userdata, $phpBB2; // --- 3125,3129 ---- $smilies_on = 1) { ! global $db, $phpbb_root_path, $phpEx, $board_config, $user_ip, $portal_config, $lang, $userdata, $mx_user, $phpbb_auth, $phpBB2, $mx_bbcode; // *************** *** 3245,3257 **** if ( $mode == 'newtopic' || $mode == 'reply' ) { ! $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)"; } else { $edited_sql = !$is_last_post ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : ""; ! $sql = "UPDATE " . POSTS_TABLE . " SET post_username = '$username', enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $user_attach_sig" . $edited_sql . " WHERE post_id = $post_id"; } ! if ( !$db->sql_query( $sql ) ) { $error_die_function( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); --- 3245,3297 ---- if ( $mode == 'newtopic' || $mode == 'reply' ) { ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! break; ! ! 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; ! ! case 'phpbb3': ! $sql_data = array( ! 'post_id' => (int) $post_id, ! 'topic_id' => (int) $topic_id, ! 'forum_id' => (int) $forum_id, ! 'poster_id' => (int) $mx_user->data['user_id'], ! 'icon_id' => (!empty($icon_id)) ? $icon_id : 0, ! 'poster_ip' => $mx_user->ip, ! 'post_time' => $current_time, ! 'post_approved' => (!$phpbb_auth->acl_get('f_noapprove', $forum_id) && !$phpbb_auth->acl_get('m_approve', $forum_id)) ? 0 : 1, ! 'enable_bbcode' => !empty($bbcode_on) ? $bbcode_on : 0, ! 'enable_smilies' => !empty($smilies_on) ? $smilies_on : 0, ! 'enable_magic_url' => !empty($bbcode_on) ? $bbcode_on : 0, ! 'enable_sig' => $user_attach_sig, ! 'post_username' => $username, ! 'post_subject' => $subject, ! 'post_text' => $mx_bbcode->bbcode_nl2br($message), ! 'post_checksum' => md5($message), ! 'post_attachment' => (!empty($attachment_data)) ? 1 : 0, ! 'bbcode_bitfield' => 'lNg=', ! 'bbcode_uid' => $bbcode_uid, ! 'post_postcount' => ($phpbb_auth->acl_get('f_postcount', $forum_id)) ? 1 : 0, ! 'post_edit_locked' => !empty($post_edit_locked) ? $post_edit_locked : 0 ! ); ! ! $sql = "INSERT INTO " . POSTS_TABLE . $db->sql_build_array('INSERT', $sql_data); ! break; ! } ! } else { $edited_sql = !$is_last_post ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : ""; ! ! $sql = "UPDATE " . POSTS_TABLE . " ! 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 ); *************** *** 3263,3278 **** // insert the actual post text for our new post // ! if ( $mode == 'newtopic' || $mode == 'reply' ) ! { ! $sql = "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '$subject', '$bbcode_uid', '$message')"; ! } ! else { ! $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$message', bbcode_uid = '$bbcode_uid', post_subject = '$subject' WHERE post_id = $post_id"; ! } ! if ( !$db->sql_query( $sql ) ) ! { ! $error_die_function( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); } --- 3303,3330 ---- // insert the actual post text for our new post // ! switch (PORTAL_BACKEND) { ! case 'internal': ! break; ! ! case 'phpbb2': ! if ( $mode == 'newtopic' || $mode == 'reply' ) ! { ! $sql = "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '$subject', '$bbcode_uid', '$message')"; ! } ! else ! { ! $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$message', bbcode_uid = '$bbcode_uid', post_subject = '$subject' WHERE post_id = $post_id"; ! } ! ! if ( !$db->sql_query( $sql ) ) ! { ! $error_die_function( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); ! } ! ! break; ! case 'phpbb3': ! break; } *************** *** 3323,3327 **** // add the search words for our new/edited post // ! add_search_words('single', $post_id, stripslashes($message), stripslashes($subject)); // --- 3375,3391 ---- // add the search words for our new/edited post // ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! break; ! ! case 'phpbb2': ! $phpBB2->add_search_words('single', $post_id, stripslashes($message), stripslashes($subject)); ! ! break; ! case 'phpbb3': ! //To do ! break; ! } // |