Darathor
Citation :
But : Ajoute des flocons défilant sur le forum. Ces flocons sont activables pour tout le monde ou seulement les membres. De plus, un champ du profil peut être selectionné pour permettre aux membres de changer leur image ou de les désactiver.
Inspiration : Le javascript présenté là.
Prérequis :
- [Sous-MOD] Get table fields (1.0)
- (faultatif) [MOD] Extended profile (1.0)
Auteur : Darathor (darathor@free.fr)
Version : 1.0 DEV - F (08/10/2006)
Compatibilité phpBB : 2.0.21
SQL (mise à jour depuis TEST - C uniquement) :
Code :
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocons_taille_field', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocons_nombre_field', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocons_vitesse_field', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocons_angle_field', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocon_img_taille', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocon_vitesse', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocon_angle', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocon_nombre', '' );
SQL (nouvelle installation uniquement) :
Code :
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_desactive_flocons_field', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocons_img_field', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocons_taille_field', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocons_nombre_field', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocons_vitesse_field', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocons_angle_field', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_desactive_flocons_visiteurs', '1' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocon_img_address', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocon_img_taille', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocon_vitesse', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocon_angle', '' );
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'FlDe_flocon_nombre', '' );
Importation :
Code :
$imported_mods_data[] = array('mod_id' => '7', 'unique_id' => '1160320712_efcb1bf47fe430f6028f63a585018c15a4c11cb8dcdfd2a31110ed0100b8bd4c60dfd04289ecf518443e02289a0cd633', 'mod_activated' => '1', 'mod_name' => '[MOD] Flocons défilants', 'mod_description' => 'Permet de faire défiler des images par dessus le forum (par défaut des flocons de neige).', 'mod_version' => '1.0', 'mod_author' => 'Darathor', 'mod_author_email' => 'darathor@free.fr', 'mod_support' => 'http://admforum.edforum.net/');
$imported_added_fields_data[] = array('field_id' => '15', 'unique_id' => '1160320960_efcb1bf47fe430f6028f63a585018c1592a7f2f6eeb28de24fc8dafc30f04591681edca905f93d0d1ddd5f82b0385bae', 'field_mod' => '1160320712_efcb1bf47fe430f6028f63a585018c15a4c11cb8dcdfd2a31110ed0100b8bd4c60dfd04289ecf518443e02289a0cd633', 'field_position' => '6', 'field_type' => 'boolean_field', 'field_configuration' => '', 'field_name' => 'FlDe_choose_field_profile', 'field_description' => 'FlDe_choose_field_profile_explain', 'field_needed' => '0', 'field_visibility' => 'all', 'field_contexts' => 'admin_edit|profile_edit', 'field_reference' => '0', 'field_alias' => '', 'field_name_key' => '1', 'field_description_key' => '1', 'field_text' => '', 'field_text_key' => '0');
$imported_added_fields_data[] = array('field_id' => '16', 'unique_id' => '1160321471_efcb1bf47fe430f6028f63a585018c15c0db72965663778a2f4a80df742cd78560dfd04289ecf518443e02289a0cd633', 'field_mod' => '1160320712_efcb1bf47fe430f6028f63a585018c15a4c11cb8dcdfd2a31110ed0100b8bd4c60dfd04289ecf518443e02289a0cd633', 'field_position' => '7', 'field_type' => 'link_field', 'field_configuration' => '', 'field_name' => 'FlDe_choose_field_img_profile', 'field_description' => 'FlDe_choose_field_img_profile_explain', 'field_needed' => '0', 'field_visibility' => 'all', 'field_contexts' => 'admin_edit|profile_edit', 'field_reference' => '0', 'field_alias' => '', 'field_name_key' => '1', 'field_description_key' => '1', 'field_text' => '', 'field_text_key' => '0');
$imported_added_fields_data[] = array('field_id' => '17', 'unique_id' => '1160322108_efcb1bf47fe430f6028f63a585018c15c2ffdb5ab372d0c37a1ac9a0b245d7d6b4067f8aa165e643477e6c2eaf8e978c', 'field_mod' => '1160320712_efcb1bf47fe430f6028f63a585018c15a4c11cb8dcdfd2a31110ed0100b8bd4c60dfd04289ecf518443e02289a0cd633', 'field_position' => '8', 'field_type' => 'integer_field', 'field_configuration' => 'min=0', 'field_name' => 'FlDe_choose_field_taille_profile', 'field_description' => 'FlDe_choose_field_taille_profile_explain', 'field_needed' => '0', 'field_visibility' => 'all', 'field_contexts' => 'admin_edit|profile_edit', 'field_reference' => '0', 'field_alias' => '', 'field_name_key' => '1', 'field_description_key' => '1', 'field_text' => '', 'field_text_key' => '0');
$imported_added_fields_data[] = array('field_id' => '18', 'unique_id' => '1160322128_efcb1bf47fe430f6028f63a585018c15558a406412012f20348c30e8bd83250639d50f6c9228b8f3c8830c18b8f91ab2', 'field_mod' => '1160320712_efcb1bf47fe430f6028f63a585018c15a4c11cb8dcdfd2a31110ed0100b8bd4c60dfd04289ecf518443e02289a0cd633', 'field_position' => '9', 'field_type' => 'integer_field', 'field_configuration' => 'max=50|min=0', 'field_name' => 'FlDe_choose_field_nombre_profile', 'field_description' => 'FlDe_choose_field_nombre_profile_explain', 'field_needed' => '0', 'field_visibility' => 'all', 'field_contexts' => 'admin_edit|profile_edit', 'field_reference' => '0', 'field_alias' => '', 'field_name_key' => '1', 'field_description_key' => '1', 'field_text' => '', 'field_text_key' => '0');
$imported_added_fields_data[] = array('field_id' => '19', 'unique_id' => '1160322151_efcb1bf47fe430f6028f63a585018c15db57d4fbec286a89233ae5af5d0c22e405da33eab200f4c5b5ba3ed05beb2ec5', 'field_mod' => '1160320712_efcb1bf47fe430f6028f63a585018c15a4c11cb8dcdfd2a31110ed0100b8bd4c60dfd04289ecf518443e02289a0cd633', 'field_position' => '10', 'field_type' => 'integer_field', 'field_configuration' => 'max=10|min=0', 'field_name' => 'FlDe_choose_field_vitesse_profile', 'field_description' => 'FlDe_choose_field_vitesse_profile_explain', 'field_needed' => '0', 'field_visibility' => 'all', 'field_contexts' => 'admin_edit|profile_edit', 'field_reference' => '0', 'field_alias' => '', 'field_name_key' => '1', 'field_description_key' => '1', 'field_text' => '', 'field_text_key' => '0');
$imported_added_fields_data[] = array('field_id' => '20', 'unique_id' => '1160322168_efcb1bf47fe430f6028f63a585018c157a4a0a5f58b096ae0a793c781b5566ad60dfd04289ecf518443e02289a0cd633', 'field_mod' => '1160320712_efcb1bf47fe430f6028f63a585018c15a4c11cb8dcdfd2a31110ed0100b8bd4c60dfd04289ecf518443e02289a0cd633', 'field_position' => '11', 'field_type' => 'integer_field', 'field_configuration' => '', 'field_name' => 'FlDe_choose_field_angle_profile', 'field_description' => 'FlDe_choose_field_angle_profile_explain', 'field_needed' => '0', 'field_visibility' => 'all', 'field_contexts' => 'admin_edit|profile_edit', 'field_reference' => '0', 'field_alias' => '', 'field_name_key' => '1', 'field_description_key' => '1', 'field_text' => '', 'field_text_key' => '0');
Dans "admin/admin_board.php" :
Code :
#
# Trouver
#
"L_RESET" => $lang['Reset'],
#
# Ajouter après
#
// FIN MOD Flocons défilants
"L_RUBRIQUE_FLOCONS" => $lang['FlDe_rubrique_flocons'],
"L_DESACTIVE_FLOCONS_VISITEURS" => $lang['FlDe_desactive_flocons_visiteurs'],
"L_DESACTIVE_FLOCONS_VISITEURS_EXPLAIN" => $lang['FlDe_desactive_flocons_visiteurs_explain'],
"L_DESACTIVE_FLOCONS_FIELD" => $lang['FlDe_choose_field'],
"L_DESACTIVE_FLOCONS_FIELD_EXPLAIN" => $lang['FlDe_choose_field_explain'],
"L_FLOCONS_IMG_ADDRESS" => $lang['FlDe_flocon_img_address'],
"L_FLOCONS_IMG_ADDRESS_EXPLAIN" => $lang['FlDe_flocon_img_address_explain'],
"L_FLOCONS_IMG_FIELD" => $lang['FlDe_choose_field_img'],
"L_FLOCONS_IMG_FIELD_EXPLAIN" => $lang['FlDe_choose_field_img_explain'],
"L_FLOCONS_IMG_TAILLE" => $lang['FlDe_flocon_img_taille'],
"L_FLOCONS_IMG_TAILLE_EXPLAIN" => $lang['FlDe_flocon_img_taille_explain'],
"L_FLOCONS_IMG_TAILLE_FIELD" => $lang['FlDe_choose_field_taille'],
"L_FLOCONS_IMG_TAILLE_FIELD_EXPLAIN" => $lang['FlDe_choose_field_taille_explain'],
"L_FLOCONS_NOMBRE" => $lang['FlDe_flocon_nombre'],
"L_FLOCONS_NOMBRE_EXPLAIN" => $lang['FlDe_flocon_nombre_explain'],
"L_FLOCONS_NOMBRE_FIELD" => $lang['FlDe_choose_field_nombre'],
"L_FLOCONS_NOMBRE_FIELD_EXPLAIN" => $lang['FlDe_choose_field_nombre_explain'],
"L_FLOCONS_VITESSE" => $lang['FlDe_flocon_vitesse'],
"L_FLOCONS_VITESSE_EXPLAIN" => $lang['FlDe_flocon_vitesse_explain'],
"L_FLOCONS_VITESSE_FIELD" => $lang['FlDe_choose_field_vitesse'],
"L_FLOCONS_VITESSE_FIELD_EXPLAIN" => $lang['FlDe_choose_field_vitesse_explain'],
"L_FLOCONS_ANGLE" => $lang['FlDe_flocon_angle'],
"L_FLOCONS_ANGLE_EXPLAIN" => $lang['FlDe_flocon_angle_explain'],
"L_FLOCONS_ANGLE_FIELD" => $lang['FlDe_choose_field_angle'],
"L_FLOCONS_ANGLE_FIELD_EXPLAIN" => $lang['FlDe_choose_field_angle_explain'],
// FIN MOD Flocons défilants
#
# Trouver
#
"COPPA_MAIL" => $new['coppa_mail'],
#
# Ajouter après
#
// FIN MOD Flocons défilants
"DESACTIVE_FLOCONS_FIELD" => get_table_fields(USERS_TABLE, 'FlDe_desactive_flocons_field', $new['FlDe_desactive_flocons_field'], TRUE),
"FLOCONS_IMG_FIELD" => get_table_fields(USERS_TABLE, 'FlDe_flocons_img_field', $new['FlDe_flocons_img_field'], TRUE),
"FLOCONS_IMG_TAILLE_FIELD" => get_table_fields(USERS_TABLE, 'FlDe_flocons_taille_field', $new['FlDe_flocons_taille_field'], TRUE),
"FLOCONS_NOMBRE_FIELD" => get_table_fields(USERS_TABLE, 'FlDe_flocons_nombre_field', $new['FlDe_flocons_nombre_field'], TRUE),
"FLOCONS_VITESSE_FIELD" => get_table_fields(USERS_TABLE, 'FlDe_flocons_vitesse_field', $new['FlDe_flocons_vitesse_field'], TRUE),
"FLOCONS_ANGLE_FIELD" => get_table_fields(USERS_TABLE, 'FlDe_flocons_angle_field', $new['FlDe_flocons_angle_field'], TRUE),
"DESACTIVE_FLOCONS_VISITEURS_YES" => ($new['FlDe_desactive_flocons_visiteurs']) ? "checked=\"checked\"" : "",
"DESACTIVE_FLOCONS_VISITEURS_NO" => (!$new['FlDe_desactive_flocons_visiteurs']) ? "checked=\"checked\"" : "",
"FLOCONS_IMG_ADDRESS" => $new['FlDe_flocon_img_address'],
"FLOCONS_IMG_TAILLE" => $new['FlDe_flocon_img_taille'],
"FLOCONS_NOMBRE" => $new['FlDe_flocon_nombre'],
"FLOCONS_VITESSE" => $new['FlDe_flocon_vitesse'],
"FLOCONS_ANGLE" => $new['FlDe_flocon_angle'],
// FIN MOD Flocons défilants
Dans "include/page_header.php" :
Code :
#
# Trouver
#
//
// Login box?
#
# Ajouter avant
#
// DEBUT MOD Flocons défilants
if (function_exists('FlDe_activate_images_defilantes'))
{
FlDe_activate_images_defilantes();
}
// FIN MOD Flocons défilants
Dans "templates/subSilver/admin/board_config_body.tpl" :
Code :
#
# Trouver
#
<tr>
<th class="thHead" colspan="2">{L_COPPA_SETTINGS}</th>
</tr>
#
# Ajouter avant
#
<!-- DEBUT MOD Flocons défilants -->
<tr>
<th class="thHead" colspan="2">{L_RUBRIQUE_FLOCONS}</th>
</tr>
<tr>
<td class="row1">{L_DESACTIVE_FLOCONS_VISITEURS}<br /><span class="gensmall">{L_DESACTIVE_FLOCONS_VISITEURS_EXPLAIN}</span></td>
<td class="row2"><input type="radio" name="FlDe_desactive_flocons_visiteurs" value="1" {DESACTIVE_FLOCONS_VISITEURS_YES} /> {L_YES} <input type="radio" name="FlDe_desactive_flocons_visiteurs" value="0" {DESACTIVE_FLOCONS_VISITEURS_NO} /> {L_NO}</td>
</tr>
<tr>
<td class="row1">{L_DESACTIVE_FLOCONS_FIELD}<br /><span class="gensmall">{L_DESACTIVE_FLOCONS_FIELD_EXPLAIN}</span></td>
<td class="row2">{DESACTIVE_FLOCONS_FIELD}</td>
</tr>
<tr>
<td class="row1">{L_FLOCONS_IMG_ADDRESS}<br /><span class="gensmall">{L_FLOCONS_IMG_ADDRESS_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="40" maxlength="250" name="FlDe_flocon_img_address" value="{FLOCONS_IMG_ADDRESS}" /></td>
</tr>
<tr>
<td class="row1">{L_FLOCONS_IMG_FIELD}<br /><span class="gensmall">{L_FLOCONS_IMG_FIELD_EXPLAIN}</span></td>
<td class="row2">{FLOCONS_IMG_FIELD}</td>
</tr>
<tr>
<td class="row1">{L_FLOCONS_IMG_TAILLE}<br /><span class="gensmall">{L_FLOCONS_IMG_TAILLE_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="40" maxlength="250" name="FlDe_flocon_img_taille" value="{FLOCONS_IMG_TAILLE}" /></td>
</tr>
<tr>
<td class="row1">{L_FLOCONS_IMG_TAILLE_FIELD}<br /><span class="gensmall">{L_FLOCONS_IMG_TAILLE_FIELD_EXPLAIN}</span></td>
<td class="row2">{FLOCONS_IMG_TAILLE_FIELD}</td>
</tr>
<tr>
<td class="row1">{L_FLOCONS_NOMBRE}<br /><span class="gensmall">{L_FLOCONS_NOMBRE_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="40" maxlength="250" name="FlDe_flocon_nombre" value="{FLOCONS_NOMBRE}" /></td>
</tr>
<tr>
<td class="row1">{L_FLOCONS_NOMBRE_FIELD}<br /><span class="gensmall">{L_FLOCONS_NOMBRE_FIELD_EXPLAIN}</span></td>
<td class="row2">{FLOCONS_NOMBRE_FIELD}</td>
</tr>
</tr>
<tr>
<td class="row1">{L_FLOCONS_VITESSE}<br /><span class="gensmall">{L_FLOCONS_VITESSE_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="40" maxlength="250" name="FlDe_flocon_vitesse" value="{FLOCONS_VITESSE}" /></td>
</tr>
<tr>
<td class="row1">{L_FLOCONS_VITESSE_FIELD}<br /><span class="gensmall">{L_FLOCONS_VITESSE_FIELD_EXPLAIN}</span></td>
<td class="row2">{FLOCONS_VITESSE_FIELD}</td>
</tr>
</tr>
<tr>
<td class="row1">{L_FLOCONS_ANGLE}<br /><span class="gensmall">{L_FLOCONS_ANGLE_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="40" maxlength="250" name="FlDe_flocon_angle" value="{FLOCONS_ANGLE}" /></td>
</tr>
<tr>
<td class="row1">{L_FLOCONS_ANGLE_FIELD}<br /><span class="gensmall">{L_FLOCONS_ANGLE_FIELD_EXPLAIN}</span></td>
<td class="row2">{FLOCONS_ANGLE_FIELD}</td>
</tr>
<!-- FIN MOD Flocons défilants -->
Dans "templates/subSilver/overall_header.tpl" :
Code :
#
# Trouver
#
</head>
#
# Ajouter avant
#
<!-- BEGIN switch_flocons -->
<script language="Javascript" type="text/javascript">
<!--
var sym = "{switch_flocons.U_FLOCON_IMG}"; // Adresse du flocon.
var intensite = {switch_flocons.NOMBRE_FLOCONS}; // Nombre de flocons.
var imgTaille = {switch_flocons.TAILLE_FLOCONS}; // Taille d'un flocon.
var speed = {switch_flocons.VITESSE_FLOCONS}; // Vitesse des flocons.
var angle = ({switch_flocons.ANGLE_FLOCONS}*Math.PI)/180; // Angle de chute en radians.
var drops = intensite;
var movex = Math.sin(angle)*speed;
var movey = Math.cos(angle)*speed;
var count = 0;
var drop = new Array();
var xx = new Array();
var yy = new Array();
var mvx = new Array();
var mvy = new Array();
var zoneflocons;
//-->
</script>
<script language="Javascript" type="text/javascript" src="templates/flocons.js"></script>
<!-- END switch_flocons -->
#
# Trouver
#
<td class="bodyline"><table width="100%" cellspacing="0" cellpadding="0" border="0">
#
# Remplacer par
#
<td class="bodyline" id="zoneflocons">
<!-- BEGIN switch_flocons -->
<script language="Javascript" type="text/javascript"><!-- initPrecipitation(); --></script>
<!-- END switch_flocons -->
<table width="100%" cellspacing="0" cellpadding="0" border="0">
Uploader à l'emplacement suivant le fichier contenus dans ce zip :
- templates/flocons.js
- language/lang_french/lang_back/lang_back_falling_flakes.php
- includes/functions_front/functions_front_falling_flakes.php