Comme je ne suis pas fort pour faire des mods propres et que mon code peut certainement être amélioré, je propose la modification ici. Oui, j'ai déjà fait la mod, elle utilise en partie les informations affichée en bas du forum, à vous de dire ce que vous en pensez :
Ouvrez main/online.php
Après
if ($row['c_approve'] || Fsb::$session->is_authorized('approve_event') || Fsb::$session->id() == $row['u_id'])
{
$timestamp_begin = ($row['c_begin'] < $begin_timestamp) ? $begin_timestamp : $row['c_begin'];
$timestamp_end = ($row['c_end'] > $end_timestamp) ? $end_timestamp : $row['c_end'];
for ($timestamp = $timestamp_begin; $timestamp <= $timestamp_end; $timestamp += ONE_DAY)
{
$events[date('j', $timestamp)][] = array(
'type' => 'event',
'lang' => $row['c_title'],
);
}
}
}
Fsb::$db->free($result);
Ajouter :
Fsb::$tpl->set_switch('index');
for ($i = $begin_timestamp; $i <= $end_timestamp; $i += ONE_DAY)
{
$jour = date('j', $i);
$total_events = 0;
if (isset($events[$jour]))
{
$total_events = count($events[$jour]);
}
Fsb::$tpl->set_blocks('day', array(
'NB' => date ('j', $i),
'JOUR' => Fsb::$session->lang('week_day_' . strtolower(date ('D', $i))),
'FILL' => TRUE,
'CURRENT' => ($jour == date('j', CURRENT_TIME)) ? TRUE : FALSE,
'HAVE_EVENT' => ($total_events) ? TRUE : FALSE,
'U_EVENT' => ($total_events) ? sid(ROOT . 'index.' . PHPEXT . '?p=calendar&mode=event&time=' . mktime(0, 0, 0, date('n', $i), $jour)) : '',
));
if ($total_events)
{
if ($total_events <= 3)
{
foreach ($events[$jour] AS $data)
{
$realname = $name = $data['lang'];
if ($total_events > 1 && strlen($name) > 20)
{
$name = substr($name, 0, 20) . '..';
}
Fsb::$tpl->set_blocks('day.event', array(
'IS_BIRTHDAY' => ($data['type'] == 'birthday') ? TRUE : FALSE,
'NAME' => htmlspecialchars($name),
'TITLE' => htmlspecialchars($realname),
));
}
}
else
{
$is_birthday = TRUE;
foreach ($events[$jour] AS $data)
{
if ($data['type'] != 'birthday')
{
$is_birthday = FALSE;
break;
}
}
$name = sprintf(Fsb::$session->lang('calendar_total_events'), $total_events);
Fsb::$tpl->set_blocks('day.event', array(
'IS_BIRTHDAY' => $is_birthday,
'NAME' => $name,
'TITLE' => $name,
));
}
}
}
Ouvez tpl/WhiteSummer/files/header.html
Chercher :
<switch name="ac_mods_calendar & have_auth_calendar_read">- <a href="{U_CALENDAR}" title="{LG_FORUM_MENU_CALENDAR_EXPLAIN}">{LG_FORUM_MENU_CALENDAR}</a>
<b>»</b>
</div>
Après ajouter :
<>
<switch name="ac_mods_calendar & have_auth_calendar_read & index">
<div class="round">
<div id="calendar_link"><a href="{U_CALENDAR}" title="{LG_FORUM_MENU_CALENDAR_EXPLAIN}">{LG_FORUM_MENU_CALENDAR}</a></div>
<table class="index_calendar">
<tr>
<block name="day"><th>{day.JOUR} {day.NB}</th></block>
</tr>
<tr>
<block name="day">
<if content="$day.FILL">
<td <if content="$day.CURRENT">class="now"</if>>
<ul class="event">
<block name="day.event">
<li><a href="{day.U_EVENT}" title="{day.event.TITLE}" class="<if content="$day.event.IS_BIRTHDAY">short_calendar_birthday<else>short_calendar_normal</if>">{day.event.NAME}</a></li>
</block>
</ul>
</td>
<else>
<td class="empty"> </td>
</if>
</block>
</tr>
</table>
</div>
</switch>
Ouvrir lang/fr/common.php
Chercher :
'fopen_error' => 'Impossible d\'ouvrir ou de créer le fichier "%s", vérifiez les droits d\'écriture sur ce fichier ou sur le dossier.',
Après ajouter :
'week_day_mon' => 'Lundi',
'week_day_tue' => 'Mardi',
'week_day_wed' => 'Mercredi',
'week_day_thu' => 'Jeudi',
'week_day_fri' => 'Vendredi',
'week_day_sat' => 'Samedi',
'week_day_sun' => 'Dimanche',
Ouvrir tpl/WhiteSummer/calendar.css
A la fin ajouter :
Voilà, améliorer si vous voulez, c'est juste le code du forum repris et adapté pour avoir ce système. Si alors vous souhaitez désactivé les events de bas de page, commentez la zone concernée dans le fichier online.html.
Normalement ça donne ça :
www.forum.lesdisciplesdebaal.com
PS : il y a un léger défaut d'affichage sous IE que je n'arrive pas à rélger, si quelqu'un à la réponse ...