Umlaute im Topic-Titel verbieten

Allgemeiner Support zum phpBB 2 Board und phpBB 2 Modifikationen
Forumsregeln
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Benutzeravatar
HammerBe
Beiträge: 410
Registriert: Sa 14.Apr, 2007 04:31

Beitrag von HammerBe »

manchmal verstehen wir uns falsch :D ,der macht das bei titel schon, aber nicht bei extra infos.ich möchte beides.

Das Topic Description mod sieht so aus

Code: Alles auswählen

#
#-----[ OPEN ]---------------------------------------
#
includes/function_post.php

#
#-----[ FIND ]---------------------------------------
#
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)

#
#-----[ REPLACE WITH ]-------------------------------
#
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, &$t_desc)

#
#-----[ FIND ]---------------------------------------
#
		$sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";

#
#-----[ REPLACE WITH ]-------------------------------
#
		$sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote, topic_description) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote, '$t_desc')" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . ", topic_description = '$t_desc' WHERE topic_id = $topic_id";

#
#-----[ FIND ]---------------------------------------
#
	$sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '$post_subject', '$bbcode_uid', '$post_message')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$post_message',  bbcode_uid = '$bbcode_uid', post_subject = '$post_subject' WHERE post_id = $post_id";

#
#-----[ REPLACE WITH ]-------------------------------
#
	$sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text, post_description) VALUES ($post_id, '$post_subject', '$bbcode_uid', '$post_message', '$t_desc')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$post_message',  bbcode_uid = '$bbcode_uid', post_subject = '$post_subject', post_description = '$t_desc' WHERE post_id = $post_id";
Das Disallow Special Characters In Subject mod sieht so aus

Code: Alles auswählen

#
#-----[ OPEN ]----------------------------------------------------------------
#

includes/functions_post.php

#
#-----[ FIND ]----------------------------------------------------------------
#

	// Check subject
	if (!empty($subject))
	{

#
#-----[ AFTER, ADD ]----------------------------------------------------------
#

		// Disallow Special Characters In Subject
		$german_umlauts = ($board_config['allow_ger_umlauts_in_subject']) ? 'üÜäÄöÖß' : '';
		if (!preg_match('/^[A-Za-z0-9 '.$german_umlauts.str_replace('-', '\-', preg_quote($board_config['allowed_subject_special_chars'], '/')).']+$/', $subject ))
		{
			$error_msg .= (!empty($error_msg)) ? '<br /><br />' . $lang['found_forbidden_special_characters'] : $lang['found_forbidden_special_characters'];
			$error_msg .= '<br />' . sprintf($lang['allowed_special_characters_in_subject'], (($board_config['allow_ger_umlauts_in_subject']) ? $lang['german_umlauts'] : ''), $board_config['allowed_subject_special_chars']);
		}
		// Disallow Special Characters In Subject
Ich habe so gemacht

Code: Alles auswählen

	// Check Topic Desciption
	if ( !empty($topic_desc) )
   {
   // Disallow Special Characters In Subject
		$german_umlauts = ($board_config['allow_ger_umlauts_in_subject']) ? 'üÜäÄöÖß' : '';
		if (!preg_match('/^[A-Za-z0-9 '.$german_umlauts.str_replace('-', '\-', preg_quote($board_config['allowed_subject_special_chars'], '/')).']+$/', $topic_desc ))
		{
			$error_msg .= (!empty($error_msg)) ? '<br /><br />' . $lang['found_forbidden_special_characters'] : $lang['found_forbidden_special_characters'];
			$error_msg .= '<br />' . sprintf($lang['allowed_special_characters_in_subject'], (($board_config['allow_ger_umlauts_in_subject']) ? $lang['german_umlauts'] : ''), $board_config['allowed_subject_special_chars']);
		}
		// Disallow Special Characters In Subject
Geht leider nicht, weil der topic desc beim einbau dieses kode nicht hat

Code: Alles auswählen

// Check Topic Desciption
	if ( !empty($topic_desc) )
   {
Zuletzt geändert von HammerBe am Sa 10.Nov, 2007 11:51, insgesamt 2-mal geändert.
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Es heisst da ja auch "$t_desc" ;)
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
HammerBe
Beiträge: 410
Registriert: Sa 14.Apr, 2007 04:31

Beitrag von HammerBe »

Klapt auch nicht,

ich habe das von gefunden. der hat dieses befehl.werde mal den instalieren.

Code: Alles auswählen

## MOD Title: Topic Description
## MOD Author: Morpheus2matrix
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Klapt auch nicht,
???
Genau diese Variable wird aber nach dem MOD, von dem Du die Auszüge gepostet hattest, verwendet...
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
HammerBe
Beiträge: 410
Registriert: Sa 14.Apr, 2007 04:31

Beitrag von HammerBe »

ich habe mir das andere topic desc instaliert, mit dem ist ok.

Danke dir
Antworten