Plakat(10, 20, 30); } function createHtml($ids, $showYear = false) { if (!is_array($ids)) { $ids = array($ids); } $this->data = array(); $this->drawPage($ids, IMAGE_WIDTH, count($ids) * IMAGE_HEIGHT, 500, 0, 0, count($ids) * 3, 1, $showYear, true); // save the last item to the data array $this->_nextItem(); $output=''; /*css is in file now*/ /* $output = ''; */ $output .= '
'; $output .= "\n"; foreach ($this->data as $concertId => $item) { reset($item); list($firstKey, $firstItem) = each($item); if ($firstItem == 'line') { $title = '
'; } else { $title = '

'.$firstItem[0]['text'].'

'; } unset($item[$firstKey]); $groups = array(); $groupIdx = -1; $lastY = -1000; foreach ($item as $y => $line) { if ($y - $lastY > 50) { $groupIdx++; } $lineSize = -1; foreach ($line as $x => $part) { if ($lineSize < 0 || $lineSize == $part['size']) { $lineSize = $part['size']; } else { // add "follow" flag for all parts that are not the same size // as the first part of the same line. This means it will // follow immediately the previous text without going into // a new cell $line[$x]['follow'] = true; } } $lastY = $y; $groups[$groupIdx][$y] = $line; } $output .= ''; $output .= ''; $output .= '
'.$title.'
'; $output .= '
'; //$this->debug($groups); foreach ($groups as $g => $group) { if ($g > 0) { $output .= '
'; } $output .= ''; //$this->debug($group); $xPositions = array(); $xPositions[] = 0; // ensure a column at position 0 $grid = array(); foreach ($group as $y => $line) { foreach ($line as $x => $cell) { if (!isset($cell['follow'])) { $grid[$y][$x]['texts'][] = $cell; $grid[$y][$x]['size'] = $cell['size']; $prevX = $x; if (!in_array($x, $xPositions)) { $xPositions[] = $x; } } else { $grid[$y][$prevX]['texts'][] = $cell; $grid[$y][$prevX]['multisize'] = true; } //$this->debug(array('x' => $x, 'y' => $y, 'cell' => $cell)); } } sort($xPositions); //$this->debug($xPositions); //$this->debug($grid); foreach ($grid as $y => $line) { $colSpan = 0; $lastX = 100; for ($i = count($xPositions) - 1; $i >= 0; $i--) { $x = $xPositions[$i]; $colSpan++; if (isset($grid[$y][$x])) { $grid[$y][$x]['span'] = $colSpan; //$grid[$y][$x]['width'] = ($lastX - $x).'%'; $colSpan = 0; $lastX = $x; } } if ($colSpan > 0) { $grid[$y][$xPositions[0]] = array('span' => $colSpan, 'size' => 10); } ksort($grid[$y]); $output .= ''; foreach ($grid[$y] as $x => $cell) { // $cell = {texts?, size?, multisize?, span} $multiSize = @$cell['multisize']; $cellSize = @$cell['size']; $output .= ''; } $output .= ''; } $output .= '
1) { $output .= ' colspan="'.$cell['span'].'"'; } if (!$multiSize && $cellSize) { $output .= ' class="kk'.$cellSize.'"'; } $output .= '>'; //$this->debug($cell['lines']); if (isset($cell['texts'])) { foreach ($cell['texts'] as $part) { //var_dump($output); //$this->debug($part); if ($multiSize) { $output .= ''; } # $output .= str_replace('(tel)', '☏'/*''*/, $part['text']); $output .= str_replace('(tel)', ''/*''*/, $part['text']); if ($multiSize) { $output .= ''; } } } else { $output .= '        '; } $output .= '
'; //$this->debug($grid); } $flyerFile = '/home/www/web60/html/admin/upload/'.$concertId.'.pdf'; $output .= ""; if (!isset($_SESSION['cug']) && file_exists($flyerFile)) { $fileSize = (int) (filesize($flyerFile) / 1024); $output .= "
Mehr Informationen (PDF, $fileSize kB)"; } $output .= "
\n"; $query = 'SELECT logo_url, logo_link FROM mk_vereine WHERE verein_id = ( SELECT konzert_verein FROM mk_konzerte WHERE konzert_id ='.$concertId.')'; $result = $this->db->safeQuery($query); while ($row = mysql_fetch_assoc($result)) { $logo_url=$row["logo_url"]; $logo_link=$row["logo_link"]; /*
*/ if ($logo_url!='' && $logo_link!='') { //echo '1
'; $output .= "
Share
"; //$output = ''; } /*
*/ //$this->debug($this->data); if ($logo_url!='' && $logo_link=='') { // echo '2
'; $output .= "
Share
"; //$output = ''; } /* if ($logo_url=='' && $logo_link=='') { //echo '3
'; $output .="
Share
"; } */ } } $output .= "
"; $output = $this->parseLinks($output); return $output; } function parseLinks($str) { $str = str_replace('www.', 'http://www.', $str); $str = preg_replace('|http://([a-zA-Z0-9-\./\?=_]+)|', '$1', $str); $str = preg_replace('/(([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6})/', '$1', $str); $str = preg_replace("/(