Colorize Author's Postsbackground

Started by candidosa2, 01 de March de 2011, 07:05

previous topic - next topic

0 Members and 1 Guest are viewing this topic.

Go Down

candidosa2

Link Mod:http://custom.simplemachines.org/mods/index.php?mod=1467
Modo Nome: Colorize Author's Postsbackground
Mod Autor: Duncan85
Versões compatíveis: 1.1.6, 1.1.7, 1.1.8, 1.1.10, 1.1.12, 2.0 Beta 4
Última versão: 1.1
Instalação Manual: SMFPT

./Sources/ModSettings.php

Code Select
$subActions = array(
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',


Code Select
'clrzauth' => 'ModifyClrzAuthSettings',


Code Select
'layout' => array(
'title' => $txt['mods_cat_layout'],
'href' => $scripturl . '?action=featuresettings;sa=layout;sesc=' . $context['session_id'],
),


Code Select
'clrzauth' => array(
'title' => $txt['mods_cat_clrzauth'],
'href' => $scripturl . '?action=featuresettings;sa=clrzauth;sesc=' . $context['session_id'],
),


Code Select
require_once($sourcedir . '/ManageServer.php');

$subActions = array(
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',


Code Select
'clrzauth' => 'ModifyClrzAuthSettings',

Code Select
?>

Code Select
function ModifyClrzAuthSettings()
{
global $txt, $scripturl, $context;

$config_vars = array(

array('check', 'enable_colorize_author_post'),
            array('check', 'enable_except_starterpost'),
array('text', 'boards_clrzpost_author_active', '20'),

);

if (isset($_GET['save']))
{
            checkSession();

saveDBSettings($config_vars);
            writeLog();

redirectexit('action=featuresettings;sa=clrzauth');

           
}

$context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=clrzauth';
$context['settings_title'] = $txt['mods_cat_clrzauth'];

prepareDBSettingContext($config_vars);
}




./Themes/default/Display.template.php

Code Select
echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr><td class="', $message['alternate'] == 0 ? 'windowbg' : 'windowbg2', '">';


Code Select
if (!empty($modSettings['boards_clrzpost_author_active']))
{
$boards_clrzpost_author_active = explode(",", preg_replace("/[^0-9,]/", "", $modSettings['boards_clrzpost_author_active']));
foreach ($boards_clrzpost_author_active as $key => $value) if ($value == "") unset($boards_clrzpost_author_active[$key]);
}
else $boards_clrzpost_author_active = array();
if(!empty($modSettings['enable_colorize_author_post']) && !empty($modSettings['enable_except_starterpost']) && in_array($context['current_board'], $boards_clrzpost_author_active))
{
echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr><td class="', (($message['member']['id'] == $context['topic_starter_id']) && ($message['id'] != $context['topic_first_message'])) ? 'authorbg' : ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2'), '">';
}
elseif(!empty($modSettings['enable_colorize_author_post']) && empty($modSettings['enable_except_starterpost']) && in_array($context['current_board'], $boards_clrzpost_author_active))
{
echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr><td class="', ($message['member']['id'] == $context['topic_starter_id']) ? 'authorbg' : ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2'), '">';
}
else
echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr><td class="', $message['alternate'] == 0 ? 'windowbg' : 'windowbg2', '">';



./Themes/default/languages/Modifications.teuidioma.php

Code Select
?>

Code Select
$txt['clrzauth'] = 'Fundo a Cor no Author de Postes';
$txt['mods_cat_clrzauth'] = 'Fundo a Cor no Author de Postes';
$txt['boards_clrzpost_author_active'] = 'Fundo a cor do Autor Postes no Quadro: <br /><i><b>Por Exemplo 1, 2, 3</b> <br />Para os quadros com ID 1 & 2 & 3</i>';
$txt['enable_colorize_author_post'] = 'Activar o fundo a cor do Autor Postes ' ;
$txt['enable_except_starterpost'] = 'Activar excluindo os primeiro topicos';



Code Select
.authorbg
{
color: #000000;
background-color: #87CEEB;
}



Go Up