Improved text for multidate events announcements; bumped version to 0.5.1

This commit is contained in:
pezcurrel 2024-10-29 14:10:50 +01:00
parent da718747be
commit 9e82a10bf4

View file

@ -18,7 +18,7 @@
$SNAME='GancioF2F'; $SNAME='GancioF2F';
$ENAME=strtolower($SNAME); $ENAME=strtolower($SNAME);
$SVERS='0.5'; $SVERS='0.5.1';
require __DIR__.'/lib/ckmkeys.php'; require __DIR__.'/lib/ckmkeys.php';
require __DIR__.'/lib/gettlds.php'; require __DIR__.'/lib/gettlds.php';
@ -398,8 +398,10 @@ foreach ($feed as $item) {
$itemsToPost++; $itemsToPost++;
$postHead="{$item['title']}\n\n"; $postHead="{$item['title']}\n\n";
if ($item['multidate']) { if ($item['multidate']) {
$dfmt=datefmt_create($conf['posts_language'],0,0,$conf['timezone'],null,"eeee d MMMM '"._('alle')."' HH:mm"); $dfmt=datefmt_create($conf['posts_language'],0,0,$conf['timezone'],null,"eeee d MMMM");
$postHead.=_('Da').' '.datefmt_format($dfmt,$item['start_datetime']).' '._('a').' '.datefmt_format($dfmt,$item['end_datetime']); $postHead.=_('Tutti i giorni da').' '.datefmt_format($dfmt,$item['start_datetime']).' '._('a').' '.datefmt_format($dfmt,$item['end_datetime']).', ';
$dfmt=datefmt_create($conf['posts_language'],0,0,$conf['timezone'],null,"HH:mm");
$postHead.=_('dalle').' '.datefmt_format($dfmt,$item['start_datetime']).' '._('alle').' '.datefmt_format($dfmt,$item['end_datetime']);
} else { } else {
$dfmt=datefmt_create($conf['posts_language'],0,0,$conf['timezone'],null,"eeee d MMMM '"._('dalle')."' HH:mm"); $dfmt=datefmt_create($conf['posts_language'],0,0,$conf['timezone'],null,"eeee d MMMM '"._('dalle')."' HH:mm");
$postHead.=mb_ucfirst(datefmt_format($dfmt,$item['start_datetime'])); $postHead.=mb_ucfirst(datefmt_format($dfmt,$item['start_datetime']));
@ -408,9 +410,9 @@ foreach ($feed as $item) {
$postHead.=' '._('alle').' '.datefmt_format($dfmt,$item['end_datetime']); $postHead.=' '._('alle').' '.datefmt_format($dfmt,$item['end_datetime']);
} }
} }
// if (isset($item['parentId']))// this probably means it's a recurring event, but i see no way to check *when* it is recurring
$postHead.=', '._('presso')." {$item['place']['name']}, {$item['place']['address']}"; $postHead.=', '._('presso')." {$item['place']['name']}, {$item['place']['address']}";
if (is_array($item['online_locations']) && count($item['online_locations'])>0) $postHead.='; '._('e anche online su ').implode(' - ',$item['online_locations']); if (is_array($item['online_locations']) && count($item['online_locations'])>0) $postHead.='; '._('e anche online su ').implode(' - ',$item['online_locations']);
// if (isset($item['parentId']))// this probably means it's a recurring event, but i see no way to check *when* it is recurring
$postBody=''; $postBody='';
if (!is_null($item['description']) && $item['description']!='' && $item['description']!='<p></p>') $postBody.=html2text($item['description']); if (!is_null($item['description']) && $item['description']!='' && $item['description']!='<p></p>') $postBody.=html2text($item['description']);
if ($postBody!='') $postBody="\n\n{$postBody}"; if ($postBody!='') $postBody="\n\n{$postBody}";