WBCE CMS – Way Better Content Editing.
Du bist nicht angemeldet.
Hallo,
ich muss eine Terminliste realisieren. Ein Kalender wie procalendar ist ausdrücklich nicht gewünscht (zu viel), sondern lediglich eine Liste/Tabelle, wo die Termine nach Zeit sortiert angezeigt werden.
Bereits verstrichene Termine sollten automatisch ausgeblendet werden.
Habt ihr eine Idee, wie man das möglichst einfach realisieren kann?
Vielen Dank schon Mal!
Beitrag geändert von wb_user82 (11.05.2016 15:17:26)
Offline
An sich geht das mit Topics. Aber da wird dir das Backend auch zu üppig sein.
Um die 2 Editoren auszuschalten, kannst du unter Optionen -> Weiters ->Höhe der Editoren: jeweils "0" angeben.
Unter Seiteneinstellung eben Eventkalender.
Danke für die schnelle Antwort, aber topics ist für meinen Fall denke ich zu umfangreich. Ich brauche wirklich nur ein Backend, in dem der User Datum und Terminname eingibt, und dass dann im Frontend entsprechend dargestellt wird.
Offline
Schau Dir mal das Modul "Concert Calendar" an, das müsste sich mit vergleichsweise wenig Aufwand (im Zweifelsfalle nur die languages/de.php des Moduls anpassen) entsprechend hinbiegen lassen und läuft auch noch mit WBCE.
Offline
wenn der Kalender per Outlook oder Thunderbird Lightning gepflegt werden soll, habe ich ein solches Modul geschrieben, das jetzt auch im Addons-Repo verfügbar ist:
http://addons.wbce.org/pages/addons.php?do=item&item=47
Einfachste Realisierung ist ein ical-File, das man einfach online liegen hat. Wenn man zu mehreren dran arbeitet, braucht man jedoch einen caldav-Server (der aber zur Not auch irgendwo bei einem Fremdanbieter liegen kann....)
Offline
Hallo,
möchte nur kurz mitteilen, dass ich das Problem mithilfe des Droplets Eventlist und dem Procalender gelöst habe. Wichtig ist, die Eventlist wie folgt aufzurufen:
[[eventlist_simple?section_id=76&startnow=1&days=100&kat=2]]Das startnow muss auf 1 stehen. Wenn man die gewöhnungbedürftige Tabelle nicht möchte, kann man sich das Droplet auch umschreiben, so wird zum Beispiel eine einfache Liste erzeugt:
[== PHP ==]
// usage: [[eventlist?section_id=<xx>&max=<xx>&kat=<xx>,<xx>&days=<xx>&year=<xx>&month=<xx>&startnow=1]]
// parameters:
// section_id : Section id from procalendar module
// on default all events of the current month are shown but you can custumize by using options:
// max (integer) : limits event list to max items (if no other limit is reached already)
// kat (integer) : only show defined kategories, kat ids can be found in prcalendar backend options
// more than one kategorie can be used by seperating ids with commas (no spaces)
// days (integer) : limits event list to items for <days> (if no other limit is reached already)
// year (integer) : year of start date
// month (integer) : month of start date
// dateformat (string): fomat of date representation as described in http://www.php.net/manual/en/function.date.php#refsect1-function.date-parameters
// startnow (0/1) : 0 or not set = show calendar month, 1 = start at current day
// archive (integer): if set, elapsed events are shown for $days, backward form now
// showtime (0/1) : show time
global $database;
require_once(WB_PATH."/modules/procalendar/functions.php");
$startnow = isset($startnow) ? intval($startnow) : 0;
if (isset($showtime) == false) $showtime=0;
$max = isset($max) ? intval($max) : 10000;
$fixdays = isset($days);
$days = isset($days) ? intval($days) : 31;
$year = isset($year) ? intval ($year) : date('Y');
$month = isset($month) ? intval($month) : date('n');
$section_id = isset($section_id) ? intval($section_id) : 0 ;
// Set dateformat to suit your needs, add timeformat if needed
$dateformat = isset($dateformat) ? $dateformat : 'd.m.Y'; // Standard php date formats
// Fetch base page link
$page_id = 0;
$page_link ='';
if ($section_id<>0) {
$sql = "SELECT link FROM ".TABLE_PREFIX."sections AS s, ".TABLE_PREFIX."pages AS p WHERE s.section_id = '".$section_id."' AND s.page_id = p.page_id";
$page_link = WB_URL.PAGES_DIRECTORY.$database->get_one($sql).PAGE_EXTENSION;
}
// Set start- and end date for query
$datestart = $startnow ? date('Y-n-j') : "$year-$month-1";
$dateend = $startnow ? date('Y-n-j', strtotime("+".($days-1)." day")) : $fixdays ? date('Y-n-j', strtotime($datestart." + ".($days-1)." day")) : "$year-$month-".($days < cal_days_in_month(CAL_GREGORIAN, $month,$year) ? $days : cal_days_in_month(CAL_GREGORIAN, $month,$year));
if (isset($archive)) {
$dateend = date('Y-n-j');
$datestart = date('Y-n-j', strtotime("-".($days-1)." day"));
}
$mod_list = '<ul>';
// Fetch the items
if (!isset($actions) || empty($actions))
$actions = fillActionArray($datestart, $dateend, $section_id);
if (is_array($actions)){
foreach($actions as $row){
if ($max > 0) {
if (!isset($kat) || (isset($kat) && in_array($row["acttype"], explode(',',$kat)))) {
$max--;
$ds = $row['date_start']." ".substr($row['time_start'],0,5);
$de = $row['date_end']." ".substr($row['time_end'],0,5);
// Build url like : pages/kalendar.php?year=1900&month=01&day=03&id=2&detail=1
$page_url = $page_link.'?year='.(substr($ds,0,4)).'&month='.(substr($ds,5,2)).'&day='.(substr($ds,8,2)).'&id='.$row['id'].'&detail=1';
$datetime_start = mktime(substr($ds,11,2),substr($ds,14,2),0,substr($ds,5,2),substr($ds,8,2),substr($ds,0,4));
$datetime_end = mktime(substr($de,11,2),substr($de,14,2),0,substr($de,5,2),substr($de,8,2),substr($de,0,4));
if (($row['time_start'] <> "00:00:00") && ($showtime==1))
{
$clock_start = ' '.substr($row['time_start'], 0,5).' Uhr';
}
else $clock_start = '';
if ($row['time_end'] <> "00:00:00" && $showtime==1)
{
$clock_end = ' '.substr($row['time_end'], 0,5).' Uhr';
}
else $clock_end = '';
/*if ($datetime_start<> $datetime_end) {
if ($row['date_start'] == $row['date_end'])
{
$mod_list .= '<li><strong>'.date($dateformat,$datetime_start).$clock_start.' bis'.$clock_end.'</strong>';
}
else $mod_list .= '<li><strong>'.date($dateformat,$datetime_start).$clock_start.' - '.date($dateformat,$datetime_end).$clock_end.'</strong>';
} else {*/
$mod_list .= '<li><strong>'.date($dateformat,$datetime_start).$clock_start.'</strong>';
//}
$mod_list .= ' <a href="'.$page_url.'">'.$row["name"].'</a>';
//$mod_list .= '<td><div class="c_desc">'.$row["custom1"].'</div></td>';
//$mod_list .= '</table>';
}
}
}
}
return $mod_list.'</ul>';Beitrag geändert von wb_user82 (11.05.2016 15:17:03)
Offline
Ein Kalender wie procalendar ist ausdrücklich nicht gewünscht
...
mithilfe des Droplets Eventlist und dem Procalender
(o_O)
Offline
Ja manchmal ändert man halt seine Einstellung
Der springende Punkt ist, dass es mit dem Procalender am Ende einfacher als gedacht ging. Wenn das Ding einmal eingerichtet ist, dann kann man einfach die Termine eingeben und es funktioniert.
Offline
Naja, um so besser... ;-)
Übrigens stand ich vor einer ähnlichen Herausforderung, habe daher das eventlist-droplet noch etwas aufgebohrt. Mit dem nachfolgenden Code
- gibt es die Termine entweder tabellarisch (...&listtype=table) oder als Bullet-Liste aus
- bis zum St.-Nimmerleinstag und nicht nur für den laufenden Monat
- je nach Bedarf mit oder ohne Enddatum /-uhrzeit
- eigenes Feld 1 (wird dort als Veranstaltungsort genutzt) wird auch noch mit ausgegeben
//
// Shows an event list from procalendar >= 1.3
// usage: [[eventlist?section_id=<xx>&max=<xx>&kat=<xx>,<xx>&days=<xx>&year=<xx>&month=<xx>&startnow=1&listtype=<table>]]
// parameters:
// section_id : Section id from procalendar module
// on default all events of the current month are shown but you can custumize by using options:
// max (integer) : limits event list to max items (if no other limit is reached already)
// kat (integer) : only show defined kategories, kat ids can be found in prcalendar backend options
// more than one kategorie can be used by seperating ids with commas (no spaces)
// days (integer) : limits event list to items for <days> (if no other limit is reached already)
// year (integer) : year of start date
// month (integer) : month of start date
// dateformat (string): fomat of date representation as described in http://www.php.net/manual/en/function.date.php#refsect1-function.date-parameters
// startnow (0/1) : 0 or not set = show calendar month, 1 = start at current day
// archive (integer): if set, elapsed events are shown for $days, backward form now
// listtype: display as table when 'table', default: ul-list
global $database;
require_once(WB_PATH."/modules/procalendar/functions.php");
if (LANGUAGE_LOADED) {
if(file_exists(WB_PATH."/modules/procalendar/languages/".LANGUAGE.".php")) {
require_once(WB_PATH."/modules/procalendar/languages/".LANGUAGE.".php");
} else {
require_once(WB_PATH."/modules/procalendar/languages/EN.php");
}
}
$startnow = isset($startnow) ? intval($startnow) : 0;
$max = isset($max) ? intval($max) : 10000;
$fixdays = isset($days);
$days = isset($days) ? intval($days) : 31;
$year = isset($year) ? intval ($year) : date('Y');
$month = isset($month) ? intval($month) : date('n');
$section_id = isset($section_id) ? intval($section_id) : 0 ;
$listtype = isset($listtype) ? $listtype : 'table';
// Set dateformat to suit your needs, add timeformat if needed
$dateformat = isset($dateformat) ? $dateformat : 'd.m.Y'; // Standard php date formats
// Fetch base page link
$page_id = 0;
$page_link ='';
if ($section_id<>0) {
$sql = "SELECT link FROM ".TABLE_PREFIX."sections AS s, ".TABLE_PREFIX."pages AS p WHERE s.section_id = '".$section_id."' AND s.page_id = p.page_id";
$page_link = WB_URL.PAGES_DIRECTORY.$database->get_one($sql).PAGE_EXTENSION;
}
// Set start- and end date for query
$datestart = $startnow ? date('Y-n-j') : "$year-$month-1";
// $dateend = $startnow ? date('Y-n-j', strtotime("+".($days-1)." day")) : $fixdays ? date('Y-n-j', strtotime($datestart." + ".($days-1)." day")) : "$year-$month-".($days < cal_days_in_month(CAL_GREGORIAN, $month,$year) ? $days : cal_days_in_month(CAL_GREGORIAN, $month,$year));
$dateend = date('2099-12-31, 23:59:59');
if (isset($archive)) {
$dateend = date('Y-n-j');
$datestart = date('Y-n-j', strtotime("-".($days-1)." day"));
}
$mod_list = '<link href="'.WB_URL.'/modules/procalendar/frontend.css" rel="stylesheet" type="text/css" media="screen" />';
$mod_list .= '<div class="actionlist">';
if ($listtype=='table') {
$mod_list .='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="actionlist">';
$mod_list .='<tr class="actionlist_header">';
$mod_list .='<td valign="top" class="actionlist_date">'.$CALTEXT['DATE'].'</td>';
if ($usetime) {
$mod_list .= '<td valign="top" class="actionlist_time">'.$CALTEXT['FROM'].'</td>';
$mod_list .= '<td valign="top" class="actionlist_time">'.$CALTEXT['DEADLINE'].'</td>';
}
$mod_list .= '<td valign="top" class="actionlist_name">'.$CALTEXT['NAME'].'</td>';
$mod_list .= '<td valign="top" class="actionlist_loc">'. $CALTEXT['LOCATION'].'</td>';
$mod_list .= '</tr>';
$entryOpen = "<tr><td>";
$entrySeperator = "</td><td>";
$entryClose="</td></tr>";
$entryLastSeperator = "</td>";
} else {
$mod_list .='<ul class="eventlist">';
$entryOpen = "<li>";
$entrySeperator = "<br />";
$entryLastSeperator = "<br />";
$entryClose="</li>";
}
// Fetch the items
if (!isset($actions) || empty($actions))
$actions = fillActionArray($datestart, $dateend, $section_id);
if (is_array($actions)){
foreach($actions as $row){
if ($max > 0) {
if (!isset($kat) || (isset($kat) && in_array($row["acttype"], explode(',',$kat)))) {
$max--;
$ds = $row['date_start']." ".substr($row['time_start'],0,5);
$de = $row['date_end']." ".substr($row['time_end'],0,5);
// Build url like : pages/kalendar.php?year=1900&month=01&day=03&id=2&detail=1
$page_url = $page_link.'?year='.(substr($ds,0,4)).'&month='.(substr($ds,5,2)).'&day='.(substr($ds,8,2)).'&id='.$row['id'].'&detail=1';
$datetime_start = mktime(substr($ds,11,2),substr($ds,14,2),0,substr($ds,5,2),substr($ds,8,2),substr($ds,0,4));
$datetime_end = mktime(substr($de,11,2),substr($de,14,2),0,substr($de,5,2),substr($de,8,2),substr($de,0,4));
if ($datetime_start<> $datetime_end) {
if (date($dateformat,$datetime_start)!==date($dateformat,$datetime_end)) {
if (substr($row['time_start'],0,5)!=="00:00") {
$mod_list .= $entryOpen.'<span class="datetime">'.date($dateformat,$datetime_start).', '.substr($row['time_start'],0,5).' Uhr - '.date($dateformat,$datetime_end).', '.substr($row['time_end'],0,5).' Uhr</span>'.$entrySeperator;
} else {
$mod_list .= $entryOpen.'<span class="datetime">'.date($dateformat,$datetime_start).' - '.date($dateformat,$datetime_end).'</span>'.$entrySeperator;
}
} else {
if (substr($row['time_start'],0,5)!=="00:00") {
$mod_list .= $entryOpen.'<span class="datetime">'.date($dateformat,$datetime_start).', '.substr($row['time_start'],0,5).' - '.substr($row['time_end'],0,5).' Uhr</span>'.$entrySeperator;
} else {
$mod_list .= $entryOpen.'<span class="datetime">'.date($dateformat,$datetime_start).'</span>'.$entrySeperator;
}
}
} else {
$mod_list .= $entryOpen.date($dateformat,$datetime_start).', '.substr($row['time_start'],0,5).' Uhr'.$entrySeperator;
}
$mod_list .= '<a href="'.$page_url.'"><strong>'.$row["name"].'</strong></a>'.$entrySeperator;
$mod_list .= $row["custom1"].$entryLastSeperator.$entryClose;
}
}
}
}
if ($listtype=='table') {
$listFinish = "</table>";
} else {
$listFinish = "</ul>";
}
return $mod_list.$listFinish.'</div>';Beitrag geändert von florian (11.05.2016 15:27:54)
Offline