Modifikasyon Link'i --> http://www.smfturk.net/forum/index.php?topic=287.msg578#msg578Bu modifikasyon anlatımı SMF 1.1.X Sürümlerine göre yapılmıştır.
Bilgi: Default haricinde bir temada çalıştırmak isterseniz önce modifikasyonu kurunuz ve ardından sadece Tema'nızın XXX.template.php dosyalarına kodları ekleyiniz.
ModSettings.php
array('check', 'approveAccountDeletion'),
'',
array('check', 'hide_MUIswitch'),
array('text', 'hide_hiddentext'),
array('text', 'hide_hidecontentimages'),
array('text', 'hide_unhidecontnetimage'),
array('check', 'hide_onlyonetimeinfo'),
array('check', 'hide_adminshouldsee'),
array('check', 'hide_noinfoforguests'),
array('text', 'hide_autounhidegroups'),
array('int', 'hide_minpostunhide'),
array('int', 'hide_minpostautounhide'),
[logged]
Display.php
// Find the previous or next topic. Make a fuss if there are no more.
//Okay let's Check an prepare ;)
$context['user_post_avaible'] = 0; //Standard Show no hidden content ;)
//Only a Member Thing ;)
if (!$user_info['is_guest']) {
$check_for_hide = true;
//First Let's look through the groups and if the Admin see everything
if($user_info['is_admin'] && !empty($modSettings['hide_adminshouldsee'])) {
$check_for_hide = false;
$context['user_post_avaible'] = 1;
}
if($check_for_hide && !empty($modSettings['hide_autounhidegroups'])) {
//Okay Serach for it ;)
if(strpos($modSettings['hide_autounhidegroups'], ",") !== false)
$modSettings['hide_autounhidegroups'] = array_unique(explode(',', str_replace(' ', '', $modSettings['hide_autounhidegroups'])));
else
$modSettings['hide_autounhidegroups'] = array(str_replace(' ', '', $modSettings['hide_autounhidegroups']));
if(!empty($modSettings['hide_autounhidegroups']))
foreach($user_info['groups'] as $group_id)
if(in_array($group_id, $modSettings['hide_autounhidegroups'])) {
$check_for_hide = false;
$context['user_post_avaible'] = 1;
break; //One is enouph ;D
}
}
//Okay know let's look for the post minimum ;D
if($check_for_hide && (!empty($modSettings['hide_minpostunhide']) || !empty($modSettings['hide_minpostautounhide']))) {
//Load the posts data ;D
global $user_settings;
//Need a minimum post to unhide?
if(!empty($modSettings['hide_minpostunhide']) && $modSettings['hide_minpostunhide'] > 0 && $user_settings['posts'] < $modSettings['hide_minpostunhide'])
$check_for_hide = false;
//Auto Unhide????
if(!empty($modSettings['hide_minpostautounhide']) && $modSettings['hide_minpostautounhide'] > 0 && $user_settings['posts'] > $modSettings['hide_minpostautounhide']) {
$check_for_hide = false;
$context['user_post_avaible'] = 1;
}
}
// Find if there a post from you in this thread :) (For the hide tag)
if(empty($context['user_post_avaible']) && $check_for_hide) {
$request = db_query("
SELECT ID_MSG, ID_MEMBER
FROM {$db_prefix}messages
WHERE ID_TOPIC = $topic AND ID_MEMBER = $ID_MEMBER
LIMIT 1", __FILE__, __LINE__);
if (mysql_num_rows($request)) $context['user_post_avaible'] = 1;
else $context['user_post_avaible'] = 0;
mysql_free_result($request);
}
}
$memberContext[$message['ID_MEMBER']]['ip'] = $message['posterIP'];
// Do the censor thang.
censorText($message['body']);
censorText($message['subject']);
//Find Hidden Content
$message['hidden_content'] = preg_match("~\[hide\](.+?)\[\/hide\]~i", $message['body']);
'body' => $message['body'],
'new' => empty($message['isRead']),
'first_new' => isset($context['start_from']) && $context['start_from'] == $counter,
'hidden_content' => $message['hidden_content'],
Post.php
$form_message = preg_replace('~<br(?: /)?' . '>~i', "\n", $form_message);
//Lets change the HideTag ;) this is a secret and should be a secret :)
if (empty($modSettings['hide_hiddentext'])) $modSettings['hide_hiddentext'] = ' '; //A tiny little space =)
// The MUI Switch ;D
if (!empty($modSettings['hide_MUIswitch'])) $modSettings['hide_hiddentext'] = &$txt['hide_hiddentext'];
$form_message = preg_replace("~\[hide\](.+?)\[\/hide\]~i", $modSettings['hide_hiddentext'], $form_message);
$form_message = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), $modSettings['hide_hiddentext'], $form_message);
[/logged]
$row['body'] = preg_replace('~<br(?: /)?' . '>~i', "\n", $row['body']);
//Lets change the HideTag ;) this is a secret and should be a secret :)
if (empty($modSettings['hide_hiddentext'])) $modSettings['hide_hiddentext'] = ' '; //A tiny little space =)
// The MUI Switch ;D
if (!empty($modSettings['hide_MUIswitch'])) $modSettings['hide_hiddentext'] = &$txt['hide_hiddentext'];
$row['body'] = preg_replace("/\[hide\](.+?)\[\/hide\]/i", $modSettings['hide_hiddentext'], $row['body']);
$row['body'] = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), $modSettings['hide_hiddentext'], $row['body']);
Search.php
// Do the censor thang...
censorText($message['body']);
//Remove Hidden Text :x
//Lets change the HideTag ;) this is a secret and should be a secret :)
if (empty($modSettings['hide_hiddentext'])) $modSettings['hide_hiddentext'] = ' '; //A tiny little space =)
// The MUI Switch ;D
if (!empty($modSettings['hide_MUIswitch'])) $modSettings['hide_hiddentext'] = &$txt['hide_hiddentext'];
// Okay Guest should at least see nothing ;)
if($context['user']['is_guest'] && !empty($modSettings['hide_noinfoforguests']))
$modSettings['hide_hiddentext'] = ' ';
$message['body'] = preg_replace("/\[hide\](.+?)\[\/hide\]/i", $modSettings['hide_hiddentext'], $message['body']);
$message['body'] = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), $modSettings['hide_hiddentext'], $message['body']);
Subs.php
global $txt, $scripturl, $context, $modSettings, $user_info;
static $bbc_codes = array(), $itemcodes = array(), $no_autolink_tags = array();
static $disabled;
//Hide Mod.. i remove the code before i do anything...
//Built the correct hidden content informations :), or add a the one time infomration :)
if((empty($context['user_post_avaible']) || !isset($context['user_post_avaible'])) && $message !== false && !empty($message)) {
//Check you're a guest? Should i show this infomations?
if(empty($modSettings['hide_noinfoforguests']) || !$user_info['is_guest']) {
//Lets change the HideTag ;) this is a secret and should be a secret :)
if (empty($modSettings['hide_hiddentext'])) $modSettings['hide_hiddentext'] = ' '; //A tiny little space =)
// The MUI Switch ;D
if (!empty($modSettings['hide_MUIswitch'])) $modSettings['hide_hiddentext'] = &$txt['hide_hiddentext'];
// hmmmm should i use image insteat of text?
if (!empty($modSettings['hide_hidecontentimages'])) $modSettings['hide_hiddentext'] = '[br][img]'.str_replace('$language', $user_info['language'], $modSettings['hide_hidecontentimages']).'[/img][br]';
//One Time information?
if(!empty($modSettings['hide_onlyonetimeinfo'])) {
//Okay some more things to do, i must check if there a hidden content... without i need do nothing ;)
if(preg_match("/\[hide\](.+?)\[\/hide\]/i", $message) != 0 || preg_match("/\[hide(.+?)\](.+?)\[\/hide\]/i", $message) != 0) {
//Add the Hidden Text at the end of the post :)
$message .= '[br]'.$modSettings['hide_hiddentext'];
}
}
}
else
$modSettings['hide_hiddentext'] = ' ';
}
//Here i remove this content :) or show onetime unhide info :)
if((empty($context['user_post_avaible']) || !isset($context['user_post_avaible'])) && $message !== false) {
//Remove it ;D
$message = preg_replace("/\[hide\](.+?)\[\/hide\]/i", (empty($modSettings['hide_onlyonetimeinfo']) ? $modSettings['hide_hiddentext'] : " "), $message);
$message = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), (empty($modSettings['hide_onlyonetimeinfo']) ? $modSettings['hide_hiddentext'] : " "), $message);
}
elseif(!empty($context['user_post_avaible']) && $message !== false && !empty($modSettings['hide_onlyonetimeinfo']) && !empty($modSettings['hide_unhidecontnetimage'])) {
//Okay i need to add the un hidden image at the end of the post :)
if(preg_match("/\[hide\](.+?)\[\/hide\]/i", $message) != 0 || preg_match(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), $message) != 0) {
$message .= '[br][img]'.str_replace('$language', $user_info['language'], $modSettings['hide_unhidecontnetimage']).'[/img][br]';
}
}
array(
'tag' => 'white',
'before' => '<span style="color: white;">',
'after' => '</span>',
),
array(
'tag' => 'hide',
'before' => '<strong>',
'after' => '</strong>'.(!empty($modSettings['hide_unhidecontnetimage']) && empty($modSettings['hide_onlyonetimeinfo']) ? '<br /><img src="'.$modSettings['hide_unhidecontnetimage'].'" /><br />' : ''),
),
Display.template.php
<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? '
<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] && empty($message['hidden_content']) ? '