function content_headline($txt,$fs=25,$c='#008e83',$p='images/headlines/',$hNumber=1, $anchor=NULL,$width=655,$font="obl",$start=NULL) { if(empty($p)) { $p = 'images/headlines/'; } if (!empty($txt)) { if (empty($c)) $c='#008e83'; if ($font=="obl") $font ="UNIVERSLT-BOLD.TTF"; else $font = "UNIVERSLT-BOLD.TTF"; $file = $p.md5($txt.$fs.$c).'.gif'; $size = @getimagesize($file); if (!$size) { exec(BASE_IM."convert -background 'rgb(255,255,255)' -fill '".$c."' -font '".BASE.$font."' -pointsize ".$fs." -size ".$width."x caption:'".str_replace(array("'"),array("´"),stripslashes($txt))."' ".BASE.$file); @chmod(BASE.$file,0755); $size = @getimagesize($file); } $txt = htmlspecialchars($txt,ENT_COMPAT,'UTF-8'); $text = '
'; if (!is_null($anchor)) { $text .= ''; } return $text; } else { return false; } } function headline($txt,$fs=20,$c='#008e83',$bgc="",$font=1,$p='images/headlines/') { if(empty($p)) { $p = 'images/headlines/'; } if (!empty($txt)) { if (empty($c)) $c='#008e83'; if ($font==1) $font ="UNIVERSLT-BOLD.TTF"; elseif ($font==2) $font = "UNIVERSLT-BLACK.TTF"; else $font = "GARAMONDITCBYBT-BOOKCONDITALIC.TTF"; $file = $p.md5($txt.$fs.$c.$bgc.$font).'.png'; $size = @getimagesize($file); if (!$size) { exec(BASE_IM."convert -background '".(($bgc=="")?'none':$bgc)."' -fill '".$c."' -font '".BASE.$font."' -pointsize ".$fs." label:'".str_replace(array("'"),array("´"),stripslashes($txt))."' ".BASE.$file); @chmod(BASE.$file,0755); $size = @getimagesize($file); } $txt = htmlspecialchars($txt,ENT_COMPAT,'UTF-8'); $text = array(); $text['img'] = ''.$var.''; } elseif ($mode=='vd') { echo '
'; var_dump($var); echo ''; } else { if (gettype($var)=="string") { ob_start(); $var = explode("\n",$var); echo '
| '.($i+1).' | '.htmlspecialchars($var[$i], ENT_COMPAT, 'utf-8').' | '; } echo '
'; echo $out; echo ''; } if ($exit) exit; } } } ?> //Formularerstellung und -auswertung mit Fehlerausgabe //Grundlage bilden die zugewiesenen dynamischen Attribute einer Artikelkategorie //gleichzeitig werden bei Erfolg Arrays für einen SQL-Insert bzw. SQL-Update erstellt class marktFields { var $attr = array(); var $kat, $filter; var $sql, $pre; var $ausschluss = array(); var $length = 0; var $cur = 0; var $buffer = ''; var $insert = array(); var $update = array(); var $checkPost = false; var $isError = false; var $isActiveGroupButNotShow = false; public $pubErrors = array(); private $openTags = array(); private $inputSize, $textareaCols; function __construct($id = NULL, $inputSize=65, $textareaCols=49) { if(!isset($GLOBALS['mt_db'])) { $base = dirname(dirname(dirname(__FILE__))); include($base."/config/dbdaten.php"); require_once($base."/class/nwv_class/db.php"); $this->sql = new mt_db($db_hostname,$db_user,$db_passwort,$db_table); $this->pre = $db_table_surname."_"; } else { $this->sql = $GLOBALS['mt_db']; $this->pre = $GLOBALS['db_table_surname']."_"; } $this->read($id); $this->inputSize = $inputSize; $this->textareaCols = $textareaCols; if($this->length!=0) { if(isset($_POST['is_send']) && $_POST['is_send']=='yes') $this->checkPost = true; if($this->checkPost) { if(!isset($_POST['zeit']) || str_replace(":","",$_POST['zeit'])>=(time()-3) || str_replace(":","",$_POST['zeit'])+18000<=time()) { $this->isError = true; $this->pubErrors[]=$GLOBALS['dict']['formSpam1']; } if(!empty($_POST['email'])) { $this->isError = true; $this->pubErrors[]=$GLOBALS['dict']['formSpam2']; } } foreach($this->attr as $a) { if($a['type']=='headline') $this->formFieldset($a); elseif($a['type']=='group_start') $this->formGroupStart($a); elseif($a['type']=='group_stop') $this->formGroupStop($a); elseif($a['type']=='select') $this->formSelect($a); elseif($a['type']=='textarea') $this->formTextarea($a); elseif($a['type']=='hidden') $this->formHidden($a); else $this->formInput($a); if (!in_array($a['type'], array('group_stop','headline'))) { $this->cur++; } } $this->closeTag(); } } function convert_entities($str, $to='encode') { $ent = array( 'Á' => 'Á', 'á' => 'á', 'Ą' => 'Ą', 'ą' => 'ą', 'Ć' => 'Ć', 'ć' => 'ć', 'Č' => 'Č', 'č' => 'č', 'Ď' => 'Ď', 'ď' => 'ď', 'É' => 'É', 'é' => 'é', 'Ė' => 'Ė', 'ė' => 'ė', 'Ę' => 'Ę', 'ę' => 'ę', 'Ě' => 'Ě', 'ě' => 'ě', 'Ë' => 'Ë', 'ë' => 'ë', 'Í' => 'Í', 'í' => 'í', 'Ï' => 'Ï', 'ï' => 'ï', 'Ł' => 'Ł', 'ł' => 'ł', 'Ń' => 'Ń', 'ń' => 'ń', 'Ň' => 'Ň', 'ň' => 'ň', 'Ó' => 'Ó', 'ó' => 'ó', 'Ř' => 'Ř', 'ř' => 'ř', 'Ś' => 'Ś', 'ś' => 'ś', 'Š' => 'Š', 'š' => 'š', 'Ť' => 'Ť', 'ť' => 'ť', 'Ú' => 'Ú', 'ú' => 'ú', 'Ů' => 'Ů', 'ů' => 'ů', 'Ý' => 'Ý', 'ý' => 'ý', 'Ź' => 'Ź', 'ź' => 'ź', 'Ż' => 'Ż', 'ż' => 'ż', 'Ž' => 'Ž', 'ž' => 'ž' ); if ($to=='encode') { $str = str_replace(array_keys($ent), array_values($ent), $str); } else { $str = str_replace(array_values($ent), array_keys($ent), $str); } return $str; } function read($id = NULL, $field_id = NULL, $key = 0) { if(empty($field_id)) { $this->attr = $this->sortnrs = $this->idnrs = array(); } if(!empty($id)) $this->id = $id; if(!is_null($this->id)) { $attr_erg = $this->sql->mt_sql("SELECT * FROM ".$this->pre."forms_fields WHERE ".(empty($field_id)?"form_id=".$this->id:"id=".$field_id)." ORDER BY sortnr, id"); if($this->sql->mt_sql_row($attr_erg)!=0) { while($attr = $this->sql->mt_sql_erg($attr_erg)) { $this->attr[] = $attr; $this->length++; } } elseif(empty($field_id) && array_key_exists($key,$this->kat)) { $this->read($this->kat[$key]['uid'], NULL, $key+1); } } } public function closeTag($tag = NULL, $return = false) { $tmp = ''; if(count($this->openTags)!=0) { if(is_null($tag)) { while(count($this->openTags)!=0) { $tmp .= "".array_pop($this->openTags).">\n"; } $tmp .= ''; } elseif(in_array($tag, $this->openTags)) { while(count($this->openTags)!=0) { $currentTag = array_pop($this->openTags); $tmp .= "".$currentTag.">\n"; if($currentTag==$tag) break; } } } if(!$return) $this->buffer .= $tmp; else return $tmp; } //Überschrift für eine Gruppe von Formularelementen public function formFieldset($a) { $this->closeTag('fieldset'); $this->buffer .= "