SMF Support > FAQ & Tutorials
[Tutorial] SMF [hide] BB Code
Klozi:
Dieses Tut ist sussschließlich nur für Versionen ab 1.0.3 bis 1.0.5 gedacht.
Ich werde mal nachschauen oder nachfragen ob es das schon für neuere Version gibt.
Wenn gibt es ja noch eine Modifkikation, die schon getestet?
Klozi:
Hier ein funktionierendes für SMF 1.1 Beta 3:
Suche:
--- Code: --- $codes = array(
--- End code ---
Folgenden Code anschließend einfügen:
--- Code: --- array(
'tag' => 'hide',
'type' => 'unparsed_content',
'content' => '<b>$1</b>',
'validate' => 'if ($hide_text !== false)
$data = $hide_text;',
),
--- End code ---
Suche:
--- Code: ---// Shall we take the time to cache this?
--- End code ---
Folgenden Code anschließend einfügen:
--- Code: ---// [hide]Guests cannot see this! Mwahaha![/hide]
global $ID_MEMBER, $db_prefix, $user_info;
if (!empty($context['current_topic']) && !$user_info['is_guest'])
{
$request = mysql_query("
SELECT ID_MSG FROM {$db_prefix}messages
WHERE ID_MEMBER = $ID_MEMBER
AND ID_TOPIC = $context[current_topic]
LIMIT 1");
if (mysql_num_rows($request))
$hide_text = false;
else
$hide_text = $txt['hide_tag_a'];
mysql_free_result($request);
}
else
$hide_text = $txt['hide_tag_b'];
$cache_id = '';
--- End code ---
Für SMF 1.1 RC 1
Öffne Sources/Subs.php und suche:
--- Code: --- $codes = array(
--- End code ---
Folgenden Code anschließend einfügen:
--- Code: --- array(
'tag' => 'hide',
'type' => 'unparsed_content',
'content' => '<b>$1</b>',
'validate' => create_function('&$tag, &$data, $disabled', '
global $context, $ID_MEMBER, $db_prefix, $user_info, $txt;
if (!empty($context[\'current_topic\']) && !$user_info[\'is_guest\'])
{
$request = mysql_query("
SELECT ID_MSG FROM {$db_prefix}messages
WHERE ID_MEMBER = $ID_MEMBER
AND ID_TOPIC = $context[current_topic]
LIMIT 1");
if (mysql_num_rows($request))
$data;
else
$data = $txt[\'hide_tag_a\'];
mysql_free_result($request);
}
elseif ($user_info[\'is_guest\'])
{
$data = $txt[\'hide_tag_b\'];
}
$cache_id = "";
'),
),
--- End code ---
Hoffe euch geholfen zuhaben. :)
ernomo98:
@klozi
Perfekt :D :D
Ich kann nur sagen, Vielen Dank
Klozi:
Kein Problem, habe ich gerne gemacht! :)
ernomo98:
@klozi
hast du eine Ahnung wie ich das machen kann, wenn ich anstelle der Text
--- Code: ---$txt['hide_tag_a'] = '<i>Antworte auf diesen Beitrag, um den versteckten Text sichtbar zu machen !</i>';
$txt['hide_tag_b'] = '<i>Gäste müssen sich registrieren oder einloggen und anschließend antworten, um den versteckten Text sichtbar
--- End code ---
ein Bild darstellen will?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version