Seite 1 von 1

Welche Variable fehlt da?

Verfasst: 21.02.2003 14:08
von Pengu
Hi Group!

In unserem Forum ist Posten nur registrierten Usern erlaubt. Wenn man unangemeldet posten will, erscheint richtigerweise eine entsprechende Meldung, nur bei uns steht dann dort:
"Sorry, aber es können nur Beiträge in diesem Forum posten."
Zwischen 'nur' und 'Beiträge' fehlt also was... Nur was?

In der lang_main steht dort %s , aber ich habe keine Ahnung, auf was sich das bezieht...

Was muss ich tun, damit dort der richtige Term steht (vermutlich 'registrierte User' oder sowas...?

Vielen Dank schon mal, und Grüße aus Hamburg

Pengu

Verfasst: 21.02.2003 14:16
von PhilippK
Pengu,

such mal in den PHP-Dateien nach der entsprechenden Variable. Diese sollte dann in einer sprintf-Funktion enthalten sein. Die weiteren Parameter stellen dann die Variablen dar, deren Inhalt statt dem %s eingefügt wird.

Gruß, Philipp

Verfasst: 21.02.2003 15:17
von Pengu
Hi Philipp!

Danke für die schnelle Antwort!

Aber ich versteh' nicht ganz, wie du das meinst... Das %s steht in der lang_main ja an sehr vielen Stellen, z.B. für die Variable 'Sorry_auth_post'. Diese aber findet sich in keiner einzigen php-Datei...! Dort finde ich nur z.B. 'f.auth_post' - Kann das damit zusammenhängen.? Also, dass in der lang_main eine Zuweisung steht, die es in meinen PHPs gar nicht gibt...?

Grüße

Pengu

Verfasst: 21.02.2003 15:29
von PhilippK
Prüf doch mal, ob die Zeilen

Code: Alles auswählen

	if ( $userdata['session_logged_in'] )
	{
		message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_' . $is_auth_type], $is_auth[$is_auth_type . "_type"]));
	}
in der posting.php existieren und diese Variablen in der lang_main.php definiert sind:

Code: Alles auswählen

//
// Auth related entries
//
// Note the %s will be replaced with one of the following 'user' arrays
$lang['Sorry_auth_announce'] = 'Sorry, but only %s can post announcements in this forum.';
$lang['Sorry_auth_sticky'] = 'Sorry, but only %s can post sticky messages in this forum.'; 
$lang['Sorry_auth_read'] = 'Sorry, but only %s can read topics in this forum.'; 
$lang['Sorry_auth_post'] = 'Sorry, but only %s can post topics in this forum.'; 
$lang['Sorry_auth_reply'] = 'Sorry, but only %s can reply to posts in this forum.';
$lang['Sorry_auth_edit'] = 'Sorry, but only %s can edit posts in this forum.'; 
$lang['Sorry_auth_delete'] = 'Sorry, but only %s can delete posts in this forum.';
$lang['Sorry_auth_vote'] = 'Sorry, but only %s can vote in polls in this forum.';

// These replace the %s in the above strings
$lang['Auth_Anonymous_Users'] = '<b>anonymous users</b>';
$lang['<a href="phpBB2/viewtopic.php">Auth_Registered_Users</a>'] = '<b>registered users</b>';
$lang['Auth_Users_granted_access'] = '<b>users granted special access</b>';
$lang['Auth_Moderators'] = '<b>moderators</b>';
$lang['Auth_Administrators'] = '<b>administrators</b>';

$lang['Not_Moderator'] = 'You are not a moderator of this forum.';
$lang['Not_Authorised'] = 'Not Authorised';

$lang['You_been_banned'] = 'You have been banned from this forum.<br />Please contact the webmaster or board administrator for more information.';
(dies jetzt die Englische Variante, aber in der Deutschen müssen zumindest die Variablen auch existieren)

Gruß, Philipp[/code]

Verfasst: 21.02.2003 17:10
von Pengu
Hi Philipp!

Das in der posting.php ist drin, allerdings steht das 'message_die' bei mir am Ende...:

Code: Alles auswählen

if( !$userdata['session_logged_in'] )
	{
		switch( $mode )
		{
			case 'newtopic':
				$redirect = "mode=newtopic&" . POST_FORUM_URL . "=$forum_id";
				break;
			case 'reply':
			case 'topicreview':
				$redirect = "mode=reply&" . POST_TOPIC_URL . "=$topic_id";
				break;
			case 'quote':
				$redirect = "mode=quote&" . POST_POST_URL ."=$post_id";
				break;
			case 'editpost':
				$redirect = "mode=editpost&" . POST_POST_URL ."=$post_id&" . POST_TOPIC_URL . "=$topic_id";
				break;
		}

		header("Location: " . append_sid("login.$phpEx?redirect=posting.$phpEx&" . $redirect, true));

	}
	else
	{
		$message = sprintf($lang['Sorry_' . $is_auth_type], $is_auth[$is_auth_type . "_type"]);
	}

	message_die(GENERAL_MESSAGE, $message);
Der part mit den 'Auth related entries' ist wie von dir geposted in meiner lang_main.

Irgendwie sieht das logisch auch OK aus, nur wird eben offenbar %s eben nicht ersetzt...??

Grüße

Sigi

BTW: phpBB 2.0 RC-2 © 2001 phpBB Group, keine Mods, wenige optische Veränderungen.

Verfasst: 21.02.2003 18:51
von PhilippK
Ersetz mal bitte testweise

Code: Alles auswählen

      $message = sprintf($lang['Sorry_' . $is_auth_type], $is_auth[$is_auth_type . "_type"]);
durch

Code: Alles auswählen

//      $message = sprintf($lang['Sorry_' . $is_auth_type], $is_auth[$is_auth_type . "_type"]); 
      $message = $is_auth_type;
und teste danach, was dann angezeigt wird.

Gruß, Philipp

Verfasst: 22.02.2003 00:27
von Pengu
Hi Philipp!

Danke für deine Antwort!! Ich werde aber erst morgen zum Ausprobieren kommen.

Wollte nur, dass du nicht denkst, ich krieg' 'ne Lösung und mach' mich dann wortlos vom Acker... ;-)

Grüße

Pengu