Debug mode: Move topic

Hulp nodig bij een modificaties of op zoek naar een MOD? Bekijk ons archief. Support wordt helaas niet meer verleend.
Forumregels

Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
phpBB2.0.x
Gesloten
Gebruikersavatar
soulcreeper
Berichten: 106
Lid geworden op: 26 jan 2005, 09:35
Locatie: Breda
Contacteer:

Debug mode: Move topic

Bericht door soulcreeper » 24 aug 2005, 13:54

wat is er verkeerd gegaan in de MySQL als ik deze error krijg:

Code: Selecteer alles

Could not update topics table

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near ') AND forum_id = 7 AND topic_moved_id = 0' at line 2

SELECT * FROM phpbb_topics WHERE topic_id IN () AND forum_id = 7 AND topic_moved_id = 0

Line : 520
File : modcp.php
plz, help me!
Ik ben gewoon goed in het goed zijn ®

Gebruikersavatar
soulcreeper
Berichten: 106
Lid geworden op: 26 jan 2005, 09:35
Locatie: Breda
Contacteer:

Bericht door soulcreeper » 28 aug 2005, 16:04

any one? :?
Ik ben gewoon goed in het goed zijn ®

Gebruikersavatar
Bee
Berichten: 13403
Lid geworden op: 29 aug 2004, 10:30

Bericht door Bee » 28 aug 2005, 16:10

Aanpassingen gemaakt?
... Maar ik modereer (nog) niet.

Gebruikersavatar
soulcreeper
Berichten: 106
Lid geworden op: 26 jan 2005, 09:35
Locatie: Breda
Contacteer:

Bericht door soulcreeper » 28 aug 2005, 16:17

niet dat ik weet iig. k heb net op phpbb.com een lijst ingevuld. ik post hem hier ook wel even...
SoulCreeper schreef:URL: forum.soulcreeper.net
Template(s) used: Eos - modified to own style
Any and all MODs: Prune User Posts, Attach Mod, Close topic after X posts, Customizable 1.2.2, Disable Board Message, Merge Topics, Move topics when locked, Post icons, Pseudo subforums 1.06, Quick reply 1.15 by Smartor, Redirection suite, Resizefix
Do you use a port of phpBB: ?
Version of phpBB: 2.0.17
Version of PHP: ?
Which database server and version: MySQL 3.23.58
Host: flexwebhosting.nl
Did someone install this for you/who: no, did it myself
Is this an upgrade/from what to what: not that i know of
Is this a conversion/from what to what: not that i know of
Have you searched for your problem: yes, without any useable result
If so, what terms did you try: the complete text which the error created
State the nature of your problem: whenever i have moved a topic, after the move, this error occurs. the topic has been moved, but the error is just bothering me
Do you have a test account for us: no
Ik ben gewoon goed in het goed zijn ®

Gebruikersavatar
soulcreeper
Berichten: 106
Lid geworden op: 26 jan 2005, 09:35
Locatie: Breda
Contacteer:

Bericht door soulcreeper » 28 aug 2005, 16:29

k heb het nog es ff uitgezocht en ik denk dat het met deze mod heeft te maken: Move topics when locked.
want de error verwijst naar het bestand modcp.php
klopt alles wel gewoon in deze code?

Code: Selecteer alles

#
#-----[ OPEN ]------------------------------------------
#
modcp.php

#
#-----[ FIND ]------------------------------------------
#
		$sql = "UPDATE " . TOPICS_TABLE . " 
			SET topic_status = " . TOPIC_LOCKED . "
			WHERE topic_id IN ($topic_id_sql) 
				AND forum_id = $forum_id
				AND topic_moved_id = 0";
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
		}

#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// START OF THE MOVE TOPICS WHEN LOCKED MODIFICATION
// 
if($board_config['move_when_locked_stat'] != -1 && $board_config['move_when_locked_stat'] == 1)
{
$move_to_forum = $board_config['move_when_locked_id'];

//
// Let's check for special topics :)
//
$sql = "SELECT * FROM " . TOPICS_TABLE . " 
WHERE topic_id IN ($topic_id_sql) 
AND forum_id = $forum_id
AND topic_moved_id = 0";
if ( !($special_result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
}

while($row = $db->sql_fetchrow($special_result))
{
$move_topic_id_system = $row['topic_id'];

if(($board_config['leave_special_topic_stat'] == -1) || (($board_config['leave_special_topic_stat'] == 1) && (($row['topic_type'] == 1) || ($row['topic_type'] == 0))) || (($board_config['leave_special_topic_stat'] == 2) && ($row['topic_type'] == 0))) 
{

//
// Start moving topic and posts
//
		$sql = "UPDATE " . TOPICS_TABLE . " 
			SET forum_id = $move_to_forum
			WHERE topic_id = $move_topic_id_system
				AND forum_id = $forum_id
				AND topic_moved_id = 0";
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
		}

		$sql = "UPDATE " . POSTS_TABLE . " 
			SET forum_id = $move_to_forum
			WHERE topic_id = $move_topic_id_system
				AND forum_id = $forum_id";
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
		}
}
}
//
// Resync index :)
// 
				sync('forum', $forum_id);
				sync('forum', $move_to_forum);

}
//
// END OF THE MOVE TOPICS WHEN LOCKED MODIFICATION
//
Ik ben gewoon goed in het goed zijn ®

Gebruikersavatar
soulcreeper
Berichten: 106
Lid geworden op: 26 jan 2005, 09:35
Locatie: Breda
Contacteer:

Bericht door soulcreeper » 26 sep 2005, 11:59

hoe kan ik deze SQL query terugdraaien?

Code: Selecteer alles

INSERT INTO phpbb_config VALUES('move_when_locked_stat',-1);
INSERT INTO phpbb_config VALUES('move_when_locked_id',1);
INSERT INTO phpbb_config VALUES('leave_special_topic_stat',-1);
INSERT INTO phpbb_config VALUES('leave_global_topic_stat',-1);
Ik ben gewoon goed in het goed zijn ®

Gebruikersavatar
Bee
Berichten: 13403
Lid geworden op: 29 aug 2004, 10:30

Bericht door Bee » 26 sep 2005, 16:50

Code: Selecteer alles

DELETE FROM phpbb_config WHERE config_name = move_when_locked_stat; 
DELETE FROM phpbb_config WHERE config_name = move_when_locked_id; 
DELETE FROM phpbb_config WHERE config_name = leave_special_topic_stat; 
DELETE FROM phpbb_config WHERE config_name = leave_global_topic_stat;
... Maar ik modereer (nog) niet.

Gebruikersavatar
Paul
Beheerder
Beheerder
Berichten: 20316
Lid geworden op: 23 okt 2003, 11:38
Locatie: Utrecht
Contacteer:

Bericht door Paul » 26 sep 2005, 16:53

Geeft denk ik een sql fout, deze is sneller:

Code: Selecteer alles

DELETE FROM phpbb_config WHERE config_name = 'move_when_locked_stat' OR config_name = 'move_when_locked_id' OR config_name = 'leave_special_topic_stat' OR config_name =  'leave_global_topic_stat';

Gebruikersavatar
Bee
Berichten: 13403
Lid geworden op: 29 aug 2004, 10:30

Bericht door Bee » 26 sep 2005, 16:55

Waarom zou die van mij een SQL error geven? Een beetje onderbouwing is wel handig in dit geval.
... Maar ik modereer (nog) niet.

Gebruikersavatar
Paul
Beheerder
Beheerder
Berichten: 20316
Lid geworden op: 23 okt 2003, 11:38
Locatie: Utrecht
Contacteer:

Bericht door Paul » 26 sep 2005, 16:55

Niet tussen '. Volgens mij moet dat wel, alleen bij int niet.

Gebruikersavatar
Bee
Berichten: 13403
Lid geworden op: 29 aug 2004, 10:30

Bericht door Bee » 26 sep 2005, 16:57

paulus schreef:Niet tussen '. Volgens mij moet dat wel, alleen bij int niet.
Dat is een onzinopmerking. De aanhalingstekens zijn optioneel. Kijk maar bij het maken van een backup in phpMyAdmin, daar kan je de aanhalingstekens ook gewoon uitzetten 8)
... Maar ik modereer (nog) niet.

Gesloten