Problem beim Schreiben in Tabelle bei Move Mesage MOD

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
Benutzeravatar
n4426
Mitglied
Beiträge: 3
Registriert: 16.08.2007 16:16

Problem beim Schreiben in Tabelle bei Move Mesage MOD

Beitrag von n4426 »

Hallo,

ich hab den MOD Move Message in mein Forum eingebaut.

Wenn ich jetzt einen beitrag verschieben will, bekomm ich folgende Error-Meldung.
Could not insert data into moved table

DEBUG MODE

INSERT INTO phpbb_topic_moved (moved_topic_id, moved_oldtopic_id, moved_type, moved_parent, moved_target, moved_mod, moved_time, last_post_id) VALUES ('12', '', 'move', '8', '2', '3', '1188328825', '14')

Line : 37
File : move_message_mod.php
Ähnlich siehts beim Sperren aus.
Could not insert data into moved table

DEBUG MODE

SQL Error : 1366 Incorrect integer value: '' for column 'moved_oldtopic_id' at row 1

INSERT INTO phpbb_topic_moved (moved_topic_id, moved_oldtopic_id, moved_type, moved_parent, moved_target, moved_mod, moved_time, last_post_id) VALUES ('12', '', 'lock', '', '', '3', '1188328889', '14')

Line : 37
File : move_message_mod.php
Hier noch die datei move_message_mod.php

Code: Alles auswählen

<?php
if (!defined('IN_PHPBB'))
{
	die('Hacking attempt');
}

function move_message_mod($moved_topic_id, $moved_oldtopic_id, $type, $moved_parent, $moved_target, $moved_mod)
{
	global $db;

  if($type == 'split')
  {
    $where = "WHERE topic_id = '$moved_oldtopic_id'";
  }
  else
  {
    $where = "WHERE topic_id = '$moved_topic_id'";
  }
     
  $sql = "SELECT topic_last_post_id
  FROM ". TOPICS_TABLE ."
  $where";
	if(!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, 'Could not get topic_last_post_id', '', __LINE__, __FILE__, $sql);
	}
  $row = $db->sql_fetchrow($result);
	$last_post_id = $row['topic_last_post_id'];
	$time = time();
	

	$sql = "INSERT INTO ". MOVED_TABLE ." (moved_topic_id, moved_oldtopic_id, moved_type, moved_parent, moved_target, moved_mod, moved_time, last_post_id)
		VALUES ('$moved_topic_id', '$moved_oldtopic_id', '$type', '$moved_parent', '$moved_target', '$moved_mod', '$time', '$last_post_id')";

	if(!($db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not insert data into moved table', '', __LINE__, __FILE__, $sql);
	}
	
	$sql = "UPDATE ". POSTS_TABLE ." SET
		post_move = '1'
		WHERE post_id = '$last_post_id'";
	if(!($db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not update posts table', '', __LINE__, __FILE__, $sql);
	}
}

function delete_topic($topic_id)
{
 global $db;
 
  $sql = "DELETE FROM ". MOVED_TABLE ."
  WHERE moved_topic_id = '$topic_id'";
  if(!$db->sql_query($sql) )
  {
  	message_die(GENERAL_ERROR, 'Could not delete move message', '', __LINE__, __FILE__, $sql);
  } 
}
?>
Weis einer von euch an was das liegt?

PS: Ich hab schon rausbekommen, das es beim Verschieben daran liegt, das der Parameter $moved_oldtopic_id nicht mit '' in die Tabelle geschrieben werden kann.

Vielen Dank im Voraus. :wink:

mfg
n4426
Antworten

Zurück zu „phpBB 2.0: Mod Support“