Seite 1 von 1

Title Categorie 1.0.5

Verfasst: 22.07.2004 11:17
von Markocat
Hallo,

ich hab folgenden Hack von Ta Lun installiert und bekomme den nicht richtig zum laufen.
http://www.talun.de/data/phpbbhacks/cat ... ack105.txt

Anmergung: Ich hab den Mod auf einem phpBB Plus 1.52 (phpBB 2.0.10) Lokal auf meinem Rechner laufen da ich noch andere Mods installiere und installiert habe.

Das Problem ist wenn ich im ModCP einen Titel eintrage und auf Edit klicke nur "Kategorie(n) erfolgreich Aktualisiert" da steht aber es die Datenbank nicht aktualiesiert.

PS: Ich hab eine selbstständige änderung gemacht weil vorher sonst überhaupt nichts passiert ist.

ich hab folgende Zeile eingefügt

Code: Alles auswählen

$edit = ( isset($HTTP_POST_VARS['edit']) ) ? TRUE : FALSE;
unter

Code: Alles auswählen

$normalise = ( isset($HTTP_POST_VARS['normalise']) ) ? TRUE : FALSE;
ich glaube das der Fehler im folgenden Abschnitt liegt da es so aus sieht das es die stellen mit den sql überspringt.

Code: Alles auswählen

//kategorien
	case 'edit':
		$page_title = $lang['Mod_CP'];
		include($phpbb_root_path . 'includes/page_header.'.$phpEx);
		$total_kat= count($kategorie);
		$j=0;
		$i=0;
		while($j < $total_kat){
		$kategorie[$i]=addslashes($kategorie[$i]);
		$topic_id_sql = '';
		for($i = 0; $i < count($topics); $i++)
		$sql="Update " . TOPIC_KAT ." set kategorie='$kategorie[$i]' WHERE  k_id=" .$kat_old[$i];
		$j++;
		$i++;
		if ( !($result = $db->sql_query($sql)) )
		{
			
			
			message_die(GENERAL_ERROR, 'Could not update Category table', '', __LINE__, __FILE__, $sql);
		}
			
		}
		if(!empty($add_cat))	{
		$add_cat= addslashes($add_cat);
		$sql_k_u="INSERT INTO " . TOPIC_KAT ." (k_id, forum_id, kategorie) VALUES  ('', $forum_id, '$add_cat')";
		if ( !($result = $db->sql_query($sql_k_u)) )
		{
		echo $add_cat;
		echo $sql_k_u;
		message_die(GENERAL_ERROR, 'Could not Insert Category table', '', __LINE__, __FILE__, $sql);
		}
		}
		
		$c_del_k= count($kat_del);
		if($c_del_k){
		 
		$j=0;
		$i=0;
		while($j < $c_del_k){
		 
		    $sql_del="Delete  From " . TOPIC_KAT ." where k_id=" .$kat_del[$i];
		$j++;
		$i++;
		if ( !($result = $db->sql_query($sql_del)) )
		{
			
			message_die(GENERAL_ERROR, 'Could not Del Category ', '', __LINE__, __FILE__, $sql);
		}
		}
		}
		
			$redirect_page = "$PHP_SELF?f=$forum_id&sid=$sid";
			$message= $lang['akt_kat'];
			$message.="<br>";
			$message.="<a href=\"$redirect_page\">" . $lang['Previous']  . "</a>";
			message_die(GENERAL_MESSAGE, $message);		
	break;
	//kategorien
Anmergung 2: ich hab noch ein zweites Forum (phpbb 2.0.8) mit Mods und auch dem hier installiert wo der ohne Probleme läuft.

Kann mir vielleicht jemand Helfen wo der Fehler sein könnte da mir bei phpbb2.de noch niemand Helfen konnte.

PS: Der Topic Shadow Manager geht auch nicht in dem Forum

EDIT:
wenn ich einen Beitrag erstellen will bekomme ich auch noch folgenden Fehler.

Code: Alles auswählen

Error in posting

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1

INSERT INTO phpbb_topics (topic_title, topic_desc, topic_poster, topic_time, forum_id, news_id, topic_status, topic_type, topic_calendar_time, topic_calendar_duration, topic_icon, topic_announce_duration, topic_vote, k_id) VALUES ('test', '', 2, 1090493452, 1, 0, 0, 0, 0, 0, 0, 0, 0, )

Line : 470
File : C:\xampp\htdocs\phpBB\includes\functions_post.php

Verfasst: 22.07.2004 13:56
von Markocat
den zweiten Fehler wo die Fehlermeldung kommt konnte ich erstmal beheben.
Ich habs auch getestet in dem ich einen Eintrag manuell in die Datenbank gemacht habe damit ich beim Posting den Titel auswählen konnte.

Meine änderung

suche nach

Code: Alles auswählen

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_desc, $topic_announce_duration = 0, $post_icon = 0, $topic_calendar_time = 0, $topic_calendar_duration = 0, &$news_category, $k_id)
füge davor ein

Code: Alles auswählen

$k_id = forum_id;
danach kam kein Fehler mehr und es hat bei dem Topic z.B. die Forum ID 1 in die Datenbank geschrieben und im Beitrag stand dann auch der richtige Titel.

Frage: den Code kann ich doch nehmen ohne das der mir Probleme macht

wenn das Behoben ist dann habe ich nur noch das Problem mit der MODCP das es nicht in die Datenbank schreibt.