<?php
/**
* Module CompteARebour v 1.0 Fr
* Philippe ANTOINE - 21 septembre 2007
* mod_comptearebour est une adapation francisée de mod_countdown 0.6 (Joomgets)
* La francisation porte sur l'affichage du module dans le frontend
* ainsi que dans le backend pour le paramétrage.
* L'adaptation apporte les nouveautés suivantes :
* - choix de la couleur du texte
* - ajout possible d'un message
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined( '_VALID_MOS' ) or
die( 'Directly access to file not permited.' ) ;
$ev_txtcolor = @$params->get('ev_txtcolor');
$ev_displaytitle = @$params->get('ev_dtitle');
$ev_title = @$params->get('ev_tit');
$ev_displaydate = @$params->get('ev_ddate');
$ev_day = @$params->get('ev_d');
$ev_month = @$params->get('ev_m');
$ev_year = @$params->get('ev_y');
$ev_displayhour = @$params->get('ev_dhour');
$ev_hour = @$params->get('ev_h');
$ev_minutes = @$params->get('ev_min');
$ev_displayURL = @$params->get('ev_dlink');
$ev_URLtitle = @$params->get('ev_ltitle');
$ev_URL = @$params->get('ev_l');
$ev_offset = @$params->get('ev_offset') ? @$params->get('Offset') : '0' ;
$ev_affichermessage = @$params->get('ev_affichermessage');
$ev_message = @$params->get('ev_message');
$eventdown =
mktime($ev_hour,
$ev_minutes,
0,
$ev_month,
$ev_day,
$ev_year,
-1);
$today =
time() +
3600*
$ev_offset ;
$difference = $eventdown - $today ;
if ($difference < 0) $difference = 0 ;
$days_down =
floor($difference/
60/
60/
24) ;
if ($days_down<10) {
$days_down =
strval("0".
$days_down);
} else {
$days_down =
strval($days_down);
}
$day_a = $days_down{0};
$day_b = $days_down{1};
$day_c = $days_down{2};
$hours_left =
floor(($difference -
$days_down*
60*
60*
24)/
60/
60) ;
if ($hours_left<10) {
$hours_left = "0".$hours_left;
}
$minutes_left =
floor(($difference -
$days_down*
60*
60*
24 -
$hours_left*
60*
60)/
60) ;
?>
<?php
echo '<div style="color:'.
$ev_txtcolor.
'">';?>
<div align="center" style="border:1px solid #cdcdcd;padding:10px;margin-top:10px;margin-bottom:10px;">
<div style=
"font-size:16px;font-weight:bold;"><?php
if ($ev_displaytitle) { echo $ev_title;
} ?></div>
<div><?php
if ($ev_displaydate) { echo $ev_day.
'/'.
$ev_month.
'/'.
$ev_year;
} ?></div>
<div style=
"font-size:20px;font-weight:bold;margin:0px;padding:0px;line-height:normal;"><?php
echo 'dans'?></div>
<div style=
"font-size:60px;font-weight:bold;margin:0px;padding:0px;line-height:normal;"><?php
echo $day_a.
$day_b.
$day_c; ?></div>
<div style=
"font-size:20px;font-weight:bold;margin:0px;padding:0px;line-height:normal;"><?php
echo 'jours'?></div>
<div><?php
if ($ev_displayhour) { echo $hours_left.
'h : '.
$minutes_left.
'min';
} ?></div>
<?php if($ev_displayURL) {?>
<div><?php
echo '<HR><div><a href="'.
$ev_URL.
'">'.
$ev_URLtitle.
'</a>';?></div>
<?php } ?>
<?php if($ev_affichermessage) { ?>
<div style=
"font-size:20px;font-weight:bold;margin:0px;padding:0px;line-height:normal;"><?php
echo '<HR>'.
$ev_message;?></div>
<?php } ?>
</div>