WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

Du bist nicht angemeldet.

#1 10.05.2017 15:20:51

jonny
Mitglied

Tabelle verschoben

Bei meinem Droplet [[eventlist_1_3?section_id=28&max=100&startnow=1&listtype=table]] erscheinen die Texte versetzt zum Linktext.
Ist das ein CSS fehler oder wie liesse sich dies beheben?

Liebe Grüsse

Jonny

Beitrag geändert von jonny (10.05.2017 15:21:46)


Wer noch etwas Dummheit will soll sich hinten anstellen..

Offline

#2 10.05.2017 15:29:39

florian
Administrator

Re: Tabelle verschoben

In der Tabelle werden irgendwelche <spans> um die Einträge generiert und ein &nbsp; eingefügt. Die Zellen selbst haben keine Festlegung für die vertikale Ausrichtung, und wenn wie beim 26.08.2017 viele breit laufende Zahlen in der Datumszeile sind, wird diese auf zwei Zeilen vergrößert und die Beschreibungszeile daran mittig (Standard) ausgerichtet.

Du könntest schauen, wo die spans und &nbsp; herkommen, der Tabelle eine KLasse, z.b. "homepagevents" mitgeben, und dann im Stylesheet angeben:

table.homepagevents td {
vertical-align:top;
}


Code allein macht nicht glücklich. Jetzt spenden!

Offline

#3 10.05.2017 15:30:12

florian
Administrator

Re: Tabelle verschoben

Ach so: Vorher eine Sicherungskopie des Droplets anlegen!


Code allein macht nicht glücklich. Jetzt spenden!

Offline

#4 10.05.2017 20:13:35

jonny
Mitglied

Re: Tabelle verschoben

Dachte mir das es etwas schwerer wird, habe es etwas probiert aber ich glaube eher das ich das Droplet vollständig zerstöre.

Das ist mir leider etwas zu hoch vom "Stil" des codes her hmm

//
// 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]]
// 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
	
global $database;
require_once(WB_PATH."/modules/procalendar/functions.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 ;

// 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');

if (isset($archive)) { 
  $dateend = date('Y-n-j');
  $datestart = date('Y-n-j', strtotime("-".($days-1)." day"));
} 

$mod_list = '<table style="border-collapse: collapse;">';

// 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'].'&amp;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) {  
			      $mod_list .= '<tr style="background-color: '.$row["act_format"].'"><td><span class="c_date">'.date($dateformat,$datetime_start).' - '.date($dateformat,$datetime_end) .'</span> &nbsp;</td> ';
			   } else {
			      $mod_list .= '<tr style="background-color: '.$row["act_format"].'"><td><span class="c_date">'.date($dateformat,$datetime_start).'</span> &nbsp;</td> ';
			   }	
			   $mod_list .= '<td><a href="'.$page_url.'"><span class="c_name"><b>'.$row["name"].'</b></span></a></td>';
			   $mod_list .= '<td><div class="c_desc">'.$row["custom1"].'</div></td>';
			   $mod_list .= "</tr>";
			}
		}
	}
}
return $mod_list."</table>";

Wer noch etwas Dummheit will soll sich hinten anstellen..

Offline

#5 10.05.2017 22:24:51

florian
Administrator

Re: Tabelle verschoben

Na, so schwierig ist das nicht.

Du brauchst nur diese Zeile

$mod_list = '<table style="border-collapse: collapse;">';

anzupassen.


Code allein macht nicht glücklich. Jetzt spenden!

Offline

Fußzeile des Forums

up