Autor Tópico: Colorize Author's Postsbackground  (Lida 15754 vezes)

0 Membros e 1 Visitante estão a ver este tópico.

Online candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5073
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Colorize Author's Postsbackground
« em: 01 de Março de 2011, 07:05 »
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

Código: [Seleccione]
$subActions = array(
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',

Código: [Seleccione]
'clrzauth' => 'ModifyClrzAuthSettings',

Código: [Seleccione]
'layout' => array(
'title' => $txt['mods_cat_layout'],
'href' => $scripturl . '?action=featuresettings;sa=layout;sesc=' . $context['session_id'],
),

Código: [Seleccione]
'clrzauth' => array(
'title' => $txt['mods_cat_clrzauth'],
'href' => $scripturl . '?action=featuresettings;sa=clrzauth;sesc=' . $context['session_id'],
),

Código: [Seleccione]
require_once($sourcedir . '/ManageServer.php');

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

Código: [Seleccione]
'clrzauth' => 'ModifyClrzAuthSettings',
Código: [Seleccione]
?>
Código: [Seleccione]
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

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

Código: [Seleccione]
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

Código: [Seleccione]
?>
Código: [Seleccione]
$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';


Código: [Seleccione]
.authorbg
{
color: #000000;
background-color: #87CEEB;
}