Seite 1 von 1

CMX News MOD Install Problem

Verfasst: 13.11.2005 15:46
von Rookie79
wenn ich ein neues thema "absenden" möchte, passiert folgendes

Code: Alles auswählen

Allgemeiner Fehler 
  
Error in posting

DEBUG MODE

SQL Error : 1136 Anzahl der Spalten stimmt nicht mit der Anzahl der Werte in Zeile 1 überein

INSERT INTO phpbb_topics (topic_title, topic_poster, topic_time, forum_id, news_id, topic_status, topic_type, topic_calendar_time, topic_calendar_duration, topic_vote) VALUES ('Test', 2, 1131892506, 1, 00, 0, 0, 0, 0)

Line : 304
File : functions_post.php 
und hier meine funtions_post.php (Zeile 235 - 305)

Code: Alles auswählen

//
// Post a new topic/reply/poll or edit existing post/poll
//
//-- mod : calendar --------------------------------------------------------------------------------
// here we have added
//	, $topic_calendar_time = 0, $topic_calendar_duration = 0
//-- modify
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length, $topic_calendar_time = 0, $topic_calendar_duration = 0, &$news_category)
//-- fin mod : calendar ----------------------------------------------------------------------------
{
	global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
	global $userdata, $user_ip;
	
	// BEGIN cmx_slash_news_mod
	if( isset( $news_category ) && is_numeric( $news_category ) )
	{
		$news_id = intval( $news_category );
	}
	else
	{
		$news_id = 0;
	}
	// END cmx_slash_news_mod

	include($phpbb_root_path . 'includes/functions_search.'.$phpEx);

	$current_time = time();

	if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost') 
	{
		//
		// Flood control
		//
		$where_sql = ($userdata['user_id'] == ANONYMOUS) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['user_id'];
		$sql = "SELECT MAX(post_time) AS last_post_time
			FROM " . POSTS_TABLE . "
			WHERE $where_sql";
		if ($result = $db->sql_query($sql))
		{
			if ($row = $db->sql_fetchrow($result))
			{
				if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) < intval($board_config['flood_interval']))
				{
					message_die(GENERAL_MESSAGE, $lang['Flood_Error']);
				}
			}
		}
	}

	if ($mode == 'editpost')
	{
		remove_search_post($post_id);
	}

	if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))
	{
		$topic_vote = (!empty($poll_title) && count($poll_options) >= 2) ? 1 : 0;

//-- mod : calendar --------------------------------------------------------------------------------
// here we have added
//	, topic_calendar_time, topic_calendar_duration
//	, $topic_calendar_time, $topic_calendar_duration
// and
//	, topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration
//-- modify
		$sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, news_id, topic_status, topic_type, topic_calendar_time, topic_calendar_duration, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, $news_id" . TOPIC_UNLOCKED . ", $topic_type, $topic_calendar_time, $topic_calendar_duration, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', news_id = $news_id, topic_type = $topic_type, topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";
//-- fin mod : calendar ----------------------------------------------------------------------------
		if (!$db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
		}

Verfasst: 13.11.2005 16:40
von Rookie79
[Eigenkritik] Wer lesen kann ist klar im Vorteil!!! [/Eigenkritik]

Code: Alles auswählen

#
#-----[ IN-LINE FIND ]---------------------------------------------
# around line 268 (directly in that line)
$current_time, $forum_id,

#
#-----[ IN-LINE AFTER, ADD ]---------------------------------------
#
 $news_id,
Das Komma nach $news_id doch tatsächlich vergessen.