Mais cette version n'est pas encore validée et peut contenir des bugs.
Ce sujet sera mis à jour lorsqu'elle sera validée.
Bien à toi,
Modérateur: Equipe


littleworm a écrit:Ok, merci Théonaute, impécable !![]()
Où puis-je trouver la version 1.0.1 ?



INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('load_cbgm_default', '1', 1);
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('cbgm_admin_color', 'F6DEE1', 1);
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('cbgm_mod_color', 'DEF6E4', 1);
ALTER TABLE phpbb_posts ADD enable_cbgm TINYINT(1) DEFAULT 0; $bbcode_status = ($config['allow_bbcode'] && $auth->acl_get('f_bbcode', $forum_id)) ? true : false; // Begin : Colored background messages for admin and moderators
$cbgm_status = (($config['load_cbgm_admin'] && $auth->acl_get('a_')) || ($config['load_cbgm_mod'] && $auth->acl_get('m_', $forum_id))) ? true : false;
// End : Colored background messages for admin and moderators $post_data['enable_bbcode'] = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true; // Begin : Colored background messages for admin and moderators
$post_data['enable_cbgm'] = (isset($_POST['enable_cbgm'])) ? true : false;
// End : Colored background messages for admin and moderators 'post_approved' => (isset($post_data['post_approved'])) ? $post_data['post_approved'] : false, // Begin : Colored background messages for admin and moderators
'enable_cbgm' => (bool) $post_data['enable_cbgm'],
// End : Colored background messages for admin and moderators $bbcode_checked = (isset($post_data['enable_bbcode'])) ? !$post_data['enable_bbcode'] : (($config['allow_bbcode']) ? !$user->optionget('bbcode') : 1); // Begin : Colored background messages for admin and moderators
$cbgm_checked = (isset($post_data['enable_cbgm'])) ? $post_data['enable_cbgm'] : (($config['load_cbgm_default']) ? $config['load_cbgm_default'] : 0);
// End : Colored background messages for admin and moderators 'S_BBCODE_ALLOWED' => $bbcode_status, // Begin : Colored background messages for admin and moderators
'S_CBGM_ALLOWED' => $cbgm_status,
'S_CBGM_CHECKED' => ($cbgm_checked) ? ' checked="checked"' : '',
// End : Colored background messages for admin and moderators 'foe' => $row['foe'], // Begin : Colored background messages for admin and moderators
'enable_cbgm' => $row['enable_cbgm'],
// End : Colored background messages for admin and moderators 'S_POSTER_IS_ADMIN' => ($config['load_cbgm_admin']) ? $poster_is_admin : false,
'S_POSTER_IS_MOD' => ($config['load_cbgm_mod']) ? $poster_is_mod : false 'S_POSTER_IS_ADMIN' => ($config['load_cbgm_admin'] && $row['enable_cbgm']) ? $poster_is_admin : false,
'S_POSTER_IS_MOD' => ($config['load_cbgm_mod'] && $row['enable_cbgm']) ? $poster_is_mod : false 'T_THEME_PATH' => "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme', //Begin : Colored background messages for admin and moderators
'CBGM_ADMIN_COLOR' => $config['cbgm_admin_color'],
'CBGM_MOD_COLOR' => $config['cbgm_mod_color'],
//End : Colored background messages for admin and moderators 'enable_bbcode' => $data['enable_bbcode'], //Begin : Colored background messages for admin and moderators
'enable_cbgm' => $data['enable_cbgm'],
//End : Colored background messages for admin and moderators 'enable_bbcode' => $data['enable_bbcode'], //Begin : Colored background messages for admin and moderators
'enable_cbgm' => $data['enable_cbgm'],
//End : Colored background messages for admin and moderators //Begin : Colored background messages for admin and moderators
'load_cbgm_admin' => array('lang' => 'LOAD_CBGM_ADMINS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_cbgm_mod' => array('lang' => 'LOAD_CBGM_MODOS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
//End : Colored background messages for admin and moderators //Begin : Colored background messages for admin and moderators
'legend3' => 'ACP_LOAD_CBGM',
'load_cbgm_default' => array('lang' => 'LOAD_CBGM_DEFAULT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_cbgm_admin' => array('lang' => 'LOAD_CBGM_ADMINS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'cbgm_admin_color' => array('lang' => 'CBGM_ADMINS_COLOR', 'validate' => 'string', 'type' => 'text:6:6', 'explain' => false),
'load_cbgm_mod' => array('lang' => 'LOAD_CBGM_MODS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'cbgm_mod_color' => array('lang' => 'CBGM_MODS_COLOR', 'validate' => 'string', 'type' => 'text:6:6', 'explain' => false),
//End : Colored background messages for admin and moderators //Begin : Colored background messages for admin and moderators
$lang = array_merge($lang, array(
'ENABLE_CBGM' => 'Change background color for this post',
));
//End : Colored background messages for admin and moderators //Begin : Colored background messages for admin and moderators
$lang = array_merge($lang, array(
'LOAD_CBGM_ADMINS' => 'Change background color for administrators\' posts.',
'LOAD_CBGM_ADMINS_EXPLAIN' => 'When reading a topic, administrators\' background color posts is change.',
'LOAD_CBGM_MODOS' => 'Change background color for moderators\' posts.',
'LOAD_CBGM_MODOS_EXPLAIN' => 'When reading a topic, moderator\' background color posts is change, if moderators have moderators\' permissions in the current forum.',
));
//End : Colored background messages for admin and moderators //Begin : Colored background messages for admin and moderators
$lang = array_merge($lang, array(
'ACP_LOAD_CBGM' => 'Colored background for admins and modos MOD settings',
'LOAD_CBGM_DEFAULT' => 'Enable colored background by default',
'LOAD_CBGM_DEFAULT_EXPLAIN' => 'If you enable this option, the MOD will be enabled by defaut : the checkbox in posting.php will be checked by default.',
'LOAD_CBGM_ADMINS' => 'Change background color for administrators\' posts',
'CBGM_ADMINS_COLOR' => 'Administrators\' messages color',
'LOAD_CBGM_ADMINS_EXPLAIN' => 'When reading a topic, administrators\' background color posts is change.',
'LOAD_CBGM_MODS' => 'Change background color for moderators\' posts',
'CBGM_MODS_COLOR' => 'Moderators\' messages color',
'LOAD_CBGM_MODS_EXPLAIN' => 'When reading a topic, moderators\' background color posts is change, if moderators have moderators\' permissions in the current forum.',
));
//End : Colored background messages for admin and moderators //Begin : Colored background messages for admin and moderators
$lang = array_merge($lang, array(
'ENABLE_CBGM' => 'Changer la couleur du fond du message',
));
//End : Colored background messages for admin and moderators //Begin : Colored background messages for admin and moderators
$lang = array_merge($lang, array(
'LOAD_CBGM_ADMINS' => 'Modifier la couleur de fond des messages des administrateurs.',
'LOAD_CBGM_ADMINS_EXPLAIN' => 'Lors de la lecture d\'un sujet, la couleur de fond des messages des administrateurs est modifiée.',
'LOAD_CBGM_MODOS' => 'Modifier la couleur de fond des messages des modérateurs.',
'LOAD_CBGM_MODOS_EXPLAIN' => 'Lors de la lecture d\'un sujet, la couleur de fond des messages des modérateurs ayant des pouvoirs dans le forum en cours de lecture, est modifiée.',
));
//End : Colored background messages for admin and moderators //Begin : Colored background messages for admin and moderators
$lang = array_merge($lang, array(
'ACP_LOAD_CBGM' => 'Paramètres du MOD de colorisation des messages pour admins et modos',
'LOAD_CBGM_DEFAULT' => 'Activer la colorisation des messages par défaut',
'LOAD_CBGM_DEFAULT_EXPLAIN' => 'Si vous activez cette option, les messages des administrateurs et des modérateurs seront colorés par défaut : la case à cocher sera cochée par défaut dans posting.php',
'LOAD_CBGM_ADMINS' => 'Modifier la couleur de fond des messages des administrateurs',
'CBGM_ADMINS_COLOR' => 'Couleur des messages des administrateurs',
'LOAD_CBGM_ADMINS_EXPLAIN' => 'Lors de la lecture d\'un sujet, la couleur de fond des messages des administrateurs est modifiée.',
'LOAD_CBGM_MODS' => 'Modifier la couleur de fond des messages des modérateurs',
'CBGM_MODS_COLOR' => 'Couleur des messages des modérateurs',
'LOAD_CBGM_MODS_EXPLAIN' => 'Lors de la lecture d\'un sujet, la couleur de fond des messages des modérateurs ayant des pouvoirs dans le forum en cours de lecture, est modifiée.',
));
//End : Colored background messages for admin and moderators <title>{SITENAME} • <!-- IF S_IN_MCP -->{L_MCP} • <!-- ELSEIF S_IN_UCP -->{L_UCP} • <!-- ENDIF -->{PAGE_TITLE}</title> <style type="text/css">
/* Begin : Colored background messages for admin and moderators */
.cbgm_admin { background-color: #{CBGM_ADMIN_COLOR};}
.cbgm_mod { background-color: #{CBGM_MOD_COLOR};}
/* End : Colored background messages for admin and moderators */
</style> <!-- IF S_BBCODE_ALLOWED -->
<div><label for="disable_bbcode"><input type="checkbox" name="disable_bbcode" id="disable_bbcode"{S_BBCODE_CHECKED} /> {L_DISABLE_BBCODE}</label></div>
<!-- ENDIF --> <!-- IF S_CBGM_ALLOWED -->
<div><label for="enable_cbgm"><input type="checkbox" name="enable_cbgm" id="enable_cbgm"{S_CBGM_CHECKED} /> {L_ENABLE_CBGM}</label></div>
<!-- ENDIF --> <div id="p{postrow.POST_ID}" class="post <!-- IF postrow.S_POSTER_IS_ADMIN -->cbgm_admin<!-- ELSEIF postrow.S_POSTER_IS_MOD -->cbgm_modo<!-- ELSE --><!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_ONLINE --> online<!-- ENDIF -->"> <div id="p{postrow.POST_ID}" class="post <!-- IF postrow.S_POSTER_IS_ADMIN -->cbgm_admin<!-- ELSEIF postrow.S_POSTER_IS_MOD -->cbgm_mod<!-- ELSE --><!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_ONLINE --> online<!-- ENDIF -->"> .bg3 { background-color: #cadceb; }
/* Begin : Colored background messages for admin and moderators */
.cbgm_admin { background-color: #F6DEE1; }
.cbgm_modo { background-color: #DEF6E4; }
/* End : Colored background messages for admin and moderators */ .bg3 { background-color: #cadceb; } <link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" /> <style type="text/css">
/* Begin : Colored background messages for admin and moderators */
.cbgm_admin { background-color: #{CBGM_ADMIN_COLOR};}
.cbgm_mod { background-color: #{CBGM_MOD_COLOR};}
/* End : Colored background messages for admin and moderators */
</style> <!-- IF S_BBCODE_ALLOWED -->
<tr>
<td><input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} /></td>
<td class="gen">{L_DISABLE_BBCODE}</td>
</tr>
<!-- ENDIF --> <!-- IF S_CBGM_ALLOWED -->
<tr>
<td><input type="checkbox" class="radio" name="enable_cbgm"{S_CBGM_CHECKED} /></td>
<td class="gen">{L_ENABLE_CBGM}</td>
</tr>
<!-- ENDIF --> <!-- IF postrow.S_POSTER_IS_ADMIN --><tr class="cbgm_admin"><!-- ELSEIF postrow.S_POSTER_IS_MOD --><tr class="cbgm_modo"><!-- ELSE --><!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --><!-- ENDIF --> <!-- IF postrow.S_POSTER_IS_ADMIN --><tr class="cbgm_admin"><!-- ELSEIF postrow.S_POSTER_IS_MOD --><tr class="cbgm_mod"><!-- ELSE --><!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --><!-- ENDIF --> <!-- IF postrow.S_POSTER_IS_ADMIN --><tr class="cbgm_admin"><!-- ELSEIF postrow.S_POSTER_IS_MOD --><tr class="cbgm_modo"><!-- ELSE --><!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --><!-- ENDIF --> <!-- IF postrow.S_POSTER_IS_ADMIN --><tr class="cbgm_admin"><!-- ELSEIF postrow.S_POSTER_IS_MOD --><tr class="cbgm_mod"><!-- ELSE --><!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --><!-- ENDIF --> <!-- IF postrow.S_POSTER_IS_ADMIN --><tr class="cbgm_admin"><!-- ELSEIF postrow.S_POSTER_IS_MOD --><tr class="cbgm_modo"><!-- ELSE --><!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --><!-- ENDIF --> <!-- IF postrow.S_POSTER_IS_ADMIN --><tr class="cbgm_admin"><!-- ELSEIF postrow.S_POSTER_IS_MOD --><tr class="cbgm_mod"><!-- ELSE --><!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --><!-- ENDIF --> .row2 {
background-color: #DCE1E5;
padding: 4px;
}
/* Begin : Colored background messages for admin and moderators */
.cbgm_admin {
background-color: #F6DEE1;
padding: 4px;
}
.cbgm_modo {
background-color: #DEF6E4;
padding: 4px;
}
/* End : Colored background messages for admin and moderators */ .row2 {
background-color: #DCE1E5;
padding: 4px;
} 











ErnadoO a écrit:
romeo, on vous a dit il y a pas 10 minutes que ce n'était pas possible en une requête, il faut sélectionner les messages des admins et modos, sinon tous les messages vont se retrouver colorés, vous ne croyez pas ce qu'on vous dit?![]()
ErnadoO a écrit:
A moins que Théonaute modifie le code pour qu'à l'affichage, un vérification soit faite sur le message, pour n'activer la coloration que si le message a été posté par un admin ou modo

UPDATE phpbb_posts SET enable_cbgm=1; 


Retourner vers MODs indépendants de la base
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 5 invités