The developer takes a few days off for Summer vacation...
...and will be back with charged battery!
From 1st August to 10th August, 2026 included
During this period, assistance from developer will not be provided.
NEWS: iCagenda 4.1.0-alpha1 will be available for testing for users with a PRO subscription
by the end of August!
<!--div class="title-cat">
<i class="icTip icon-folder-3 caticon <?php echo $CATEGORY_FONTCOLOR; ?>" style="background:<?php echo $CATEGORY_COLOR; ?>" title="<?php echo $CATEGORY_TITLE; ?>"></i> <?php echo $CATEGORY_TITLE; ?>
</div--><?php // Code can be added at Bottom of calendar ?>
<div class="title-cat">
<?php echo "Légende : " , $item->startDate ?> <i class="icTip icon-folder-3 caticon <?php echo $CATEGORY_FONTCOLOR; ?>" style="background:<?php echo $CATEGORY_COLOR; ?>" title="<?php echo $CATEGORY_TITLE; ?>"></i>
</div>Please Log in or Create an account to join the conversation.
<?php // Code can be added at Bottom of calendar
// Function to convert font color, depending on category color
function fontColor($color){
$RGB='$RGB';
$RGBa=$RGB[0];
$RGBb=$RGB[1];
$RGBc=$RGB[2];
$hex_R = substr($color,1,2);
$hex_G = substr($color,3,2);
$hex_B = substr($color,5,2);
$RGBhex = hexdec($hex_R).",".hexdec($hex_G).",".hexdec($hex_B);
$RGB = explode(",",$RGBhex);
$RGBa=$RGB[0];
$RGBb=$RGB[1];
$RGBc=$RGB[2];
// $a = array($RGBa, $RGBb, $RGBc);
// $somme = array_sum($a);
$somme = ($RGBa + $RGBb + $RGBc);
if ($somme > '600') {
$fcolor = 'black';
} else {
$fcolor = 'white';
}
return $fcolor;
}
// Preparing connection to db
$db = JFactory::getDbo();
// Preparing the query
$query = $db->getQuery(true);
$query->select('c.color AS color, c.title AS title')->from('#__icagenda_category AS c')->where("(c.state = 1)");
$db->setQuery($query);
$list = $db->loadObjectList();
$doc = JFactory::getDocument();
$style = '.caticon {'
. ' color: #FFFFFF;'
. ' font-weight: normal;'
. ' padding: 2px;'
. ' margin: 2px;'
. ' border-radius:3px;'
. ' box-shadow: 0px 0px 0px 1px rgba(0,0,0,0.25);'
. ' cursor: default;'
. '}'
. '.legend {'
. ' margin: 5px;'
. '}'
. '.white {'
. ' color: #FFFFFF;'
. '}'
. '.black {'
. ' color: #000000;'
. '}';
$doc->addStyleDeclaration( $style );
echo '<div class="legend">';
echo 'Légende : ';
foreach ($list as $cat)
{
echo '<i class="icTip icon-folder-3 caticon '.fontColor($cat->color).'" style="background:'.$cat->color.'" title="'.$cat->title.'"></i>';
}
echo '</div>';
?>
Please Log in or Create an account to join the conversation.
foreach ($list as $cat)
{
echo '<span class="icTip icon-folder-3 caticon '.fontColor($cat->color).'" style="background:'.$cat->color.'" ></span>';
echo $cat->title;
}<?php // Code can be added at Bottom of calendar
// Function to convert font color, depending on category color
function fontColor($color){
$RGB='$RGB';
$RGBa=$RGB[0];
$RGBb=$RGB[1];
$RGBc=$RGB[2];
$hex_R = substr($color,1,2);
$hex_G = substr($color,3,2);
$hex_B = substr($color,5,2);
$RGBhex = hexdec($hex_R).",".hexdec($hex_G).",".hexdec($hex_B);
$RGB = explode(",",$RGBhex);
$RGBa=$RGB[0];
$RGBb=$RGB[1];
$RGBc=$RGB[2];
// $a = array($RGBa, $RGBb, $RGBc);
// $somme = array_sum($a);
$somme = ($RGBa + $RGBb + $RGBc);
if ($somme > '600') {
$fcolor = 'black';
} else {
$fcolor = 'white';
}
return $fcolor;
}
// Preparing connection to db
$db = JFactory::getDbo();
// Preparing the query
$query = $db->getQuery(true);
$query->select('c.id AS num_cat, c.color AS color, c.title AS title')->from('#__icagenda_category AS c')->where("(c.state = 1)");
$db->setQuery($query);
$list = $db->loadObjectList();
echo '<div class="legend">';
echo 'Légende : ';
foreach ($list as $cat)
{
echo '<span class="legend_cat'.$cat->num_cat.' '.fontColor($cat->color).'" style="background:'.$cat->color.'" ></span>';
// echo $cat->title;
}
echo '</div>';
?>.legend {
margin: 5px;
}
.white {
color: #FFFFFF;
}
.black {
color: #000000;
}
.legend_cat1, .legend_cat2, .legend_cat3, .legend_cat4, .legend_cat5, .legend_cat6{
color: #FFFFFF;
font-weight: normal;
/*padding: 2px; */
margin: 2px;
border-radius:3px;
box-shadow: 0px 0px 0px 1px rgba(0,0,0,0.25);
cursor: default;
display: inline-block;
font-size: 9px;
}
.legend_cat1:after{
content: "Spectacles";
}
.legend_cat2:after{
content: "Expos";
}
.legend_cat3:after{
content: "Musique";
}
.legend_cat4:after{
content: "4 Saisons";
}
.legend_cat5:after{
content: "Beaux Dimanches";
}
.legend_cat6:after{
content: "Ville Ouverte";
}Please Log in or Create an account to join the conversation.
// Preparing connection to db
$db = JFactory::getDbo();
// Preparing the query
$query = $db->getQuery(true);
$query->select('c.id AS num_cat, c.color AS color, c.title AS title')->from('#__icagenda_category AS c')->where("(c.state = 1)");
$db->setQuery($query);
$list = $db->loadObjectList();
// Va charger la liste des catégories filtrées du module en cours
$categories = $params->get('mcatid');
// vérifie si la valeur est bien un array, sinon, converti en array (car si une seule catégorie, ou aucune sélectionnée, ça peut ne pas être un array)
if (!is_array($categories)) $categories = array($categories);
echo '<div class="legend">';
echo 'Légende : ';
foreach ($list as $cat)
{
// si catégorie de la requête dans la liste des catégories filtrées, ou si la liste des catégories filtrées est vide (dans ce cas, toutes les catégories seront affichées)
if (in_array($cat->id, $categories) OR $categories == array())
{
echo '<span class="legend_cat'.$cat->num_cat.' '.fontColor($cat->color).'" style="background:'.$cat->color.'" ></span>';
// echo $cat->title;
}
}
echo '</div>';
Please Log in or Create an account to join the conversation.
$categories = $params->get('mcatid');Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Lyr!C wrote: Si j'ai suivi, vous voulez afficher les catégories des évènements du mois affiché ?
Cyril
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.

