settings = ApgSettings::load_settings('user_settings'); $this->tt = ApgSettings::load_settings('tooltip'); $this->optionen = array( "header" => null, "footer" => null, "footer2" => null, "template" => null, "temp-head" => null, "name" => null, "btn_name" => null, "form_type" => null, "checked" => null, "username" => null, "disabled" => null, "select" => null, "data" => null, "notiz" => null, "placeholder" => null, "input-type" => 'text', "datum1" => null, "datum2" => null, "color" => null, "icon" => null, "th-2" => null, "th-3" => null, "th-4" => null, "th-5" => null, "th-6" => null, "th-7" => null, "th-8" => null, "th-9" => null, "th-10" => null, "th-11" => null, "th-12" => null, "td-1" => null, "td-2" => null, "td-3" => null, "td-4" => null, "td-5" => null, "td-6" => null, "td-7" => null, "td-8" => null, "td-9" => null, "td-10" => null, "td-11" => null, "td-12" => null, ); if ($optionen) { $this->optionen = $optionen + $this->optionen; } $this->return = $this->templates(); } private function templates(){ switch ($this->optionen['template']) { case 'galerie_details': $this->optionen['icon'] = ''; $this->optionen['header'] = '

Galerie details

 schließen

'; $a1 = array("method" =>"read_wp_db", "table" =>"art_galerie", "select" =>"*"); $dat = new DbHandle($a1); $data1=$dat->return; for($i = 1; $i <= $data1['count']; $i++) { $a3 = array("method" =>"read_wp_db", "table" =>"art_freigaben", "select" =>"*", "where" => " where galerie_id = %d", "search" => $data1['data'][$i -1]->id, "session" =>false); $dat3 = new DbHandle($a3); // $data3=$dat3->return; if(empty($data3['count'])){ $freigabe_count = ''.$data3['count'].''; }else{ $freigabe_count = ''.$data3['count'].''; } $btn_bearbeiten = '

 bearbeiten

'; $btn_new_freigabe ='

  neue freigabe

'; $btn_new_delete = '

 löschen

'; $date1 = new \DateTime($data2['data'][$i -1]->created_at); $datum1 = $date1->format('d.m.Y'); if(empty($data1['data'][$i -1]->last_update)){ $datum2='unbekannt'; }else{ $date2 = new \DateTime($data1['data'][$i -1]->last_update); $datum2 = $date2->format('d.m.Y'); } if(!empty($data1['data'][$i -1]->tags)){ $tags = 'ja' ; }else{ $tags = 'nein' ; } if(!empty($data1['data'][$i -1]->beschreibung)){ $beschreibung = 'ja' ; }else{ $beschreibung = 'nein' ; } $message = 0; if(!empty($data1['data'][$i -1]->message)){ $message++; } $a2 = array("method" =>"read_wp_db", "table" =>"art_images", "select" =>"*", "where" => " where galerie_name = %s", "search" => $data1['data'][$i -1]->galerie_name ); $dat2 = new DbHandle($a2); $data2=$dat2->return; $exif = 0; $gps = 0; for ($x = 1; $x <= $data2['count']; $x++) { $exifData = unserialize($data2['data'][$x -1]->exif); if(!empty($exifData['count'] )){ $exif_result = ''.$exif.''; $exif++; }else{ $exif_result = ''.$exif.''; } if(!empty($exifData['GPSLatitudeRef'])){ $gps_result = ''.$gps.''; $gps++; }else{ $gps_result = ''.$gps.''; } } $this->optionen['name'] = $data1['data'][$i -1]->galerie_name; $this->optionen['datum1'] = $datum1; $this->optionen['datum2'] = $datum2; $this->optionen['footer2'] = '     (freigabe user  ->  rot = nicht aktiv | grün = aktiv)'; $this->optionen['th1'] = 'ID'; $this->optionen['th2'] = 'Bilder'; $this->optionen['th3'] = 'Galerie beschr.'; $this->optionen['th4'] = 'Galerie Tags'; $this->optionen['th5'] = 'GPS Daten'; $this->optionen['th6'] = 'Exif Daten'; $this->optionen['th7'] = ''; $this->optionen['th8'] = 'Galerie freig.'; $this->optionen['th10'] = 'Galerie beschr.'; $this->optionen['th11'] = ''; $this->optionen['th12'] = 'löschen'; $this->optionen['td1'] = ''.$data1['data'][$i -1]->id.''; $this->optionen['td2'] = $data2['count']; $this->optionen['td3'] = $beschreibung; $this->optionen['td4'] = $tags; $this->optionen['td5'] = $gps_result; $this->optionen['td6'] = $exif_result; $this->optionen['td7'] = ''; $this->optionen['td8'] = $freigabe_count; $this->optionen['td10'] = $btn_bearbeiten; $this->optionen['td11'] = ''; $this->optionen['td12'] = $btn_new_delete; $template .= $this->get_template(); } break; case 'image_details': $this->optionen['icon'] = ''; $this->optionen['header'] = '

Image details

 schließen

'; $a1 = array("method" =>"read_wp_db", "table" =>"art_galerie", "select" =>"*"); $dat = new DbHandle($a1); $data1=$dat->return; for($i = 1; $i <= $data1['count']; $i++) { $a2 = array("method" =>"read_wp_db", "table" =>"art_images", "select" =>"*", "where" => " where galerie_name = %s", "search" => $data1['data'][$i -1]->galerie_name); $dat2 = new DbHandle($a2); $data2=$dat2->return; $a3 = array("method" =>"read_wp_db", "table" =>"art_freigaben", "select" =>"*", "where" => " where galerie_id = %s", "search" => $data1['data'][$i -1]->id); $dat3 = new DbHandle($a3); $data3=$dat3->return; $pid = unserialize($data3['data'][0]->select_image); $post_id = count($pid); $msg = unserialize($data3['data'][0]->message); $message = count($ms); $tags = 0; $beschreibung = 0; $exif = 0; $gps = 0; for ($x = 1; $x <= $data2['count']; $x++) { $exifData = unserialize($data2['data'][$x -1]->exif); if($exifData['count'] > 0){ $exif++; } if(!empty($exifData['GPSLatitudeRef'])){ $gps++; } if(!empty($data2['data'][$x -1]->tags)){ $tags++; } if(!empty($data2['data'][$x -1]->beschreibung)){ $beschreibung++; } } if(!empty($data3['count'])){ $color8 = 'green'; $txt = 'yes'; }else{ $color8 = '#c75e47'; $txt = 'no'; } if($post_id === 0){ $disabled1 = 'disabled="disabled"'; $color_badge1 = '#c75e47'; $color1 = 'danger'; $logo1 = ' fa-frown-o'; }else{ $disabled1 = ''; $color_badge1 = 'green'; $color1 = 'success'; $logo1 = ' fa-smile-o'; } if($message === 0){ $disabled2 = 'disabled="disabled"'; $color_badge2 = '#c75e47'; $color2 = 'danger'; $logo2 = ' fa-frown-o'; }else{ $disabled2 = ''; $color2 =' success'; $color_badge2 = 'green'; $logo2 = ' fa-envelope-o'; } $a3 = array("method" =>"read_wp_db", "table" =>"art_images", "select" =>"created_at,galerie_name", "where" => " where galerie_name = %s ORDER BY created_at ASC LIMIT 1", "search" => $data1['data'][$i -1]->galerie_name); $dat3 = new DbHandle($a3); $data3=$dat3->return; $date1 = new \DateTime($data3['data'][0]->created_at); $datum1 = $date1->format('d.m.Y'); $a4 = array("method" =>"read_wp_db", "table" =>"art_images", "select" =>"last_update", "where" => " where galerie_name = %s ORDER BY last_update DESC LIMIT 1", "search" => $data1['data'][$i -1]->galerie_name); $dat4 = new DbHandle($a4); $data4=$dat4->return; if(empty($data4['data'][0]->last_update)){ $datum2='unbekannt'; }else{ $date2 = new \DateTime($data4['data'][0]->last_update); $datum2 = $date2->format('d.m.Y'); } if(empty($data2['count']) ? $color3 = '#c75e47' : $color3='green'); if(empty($beschreibung) ? $color4 = '#c75e47' : $color4='green'); if(empty($tags) ? $color5 = '#c75e47' : $color5='green'); if(empty($gps) ? $color6 = '#c75e47' : $color6='green'); if(empty($exif) ? $color7 = '#c75e47' : $color7='green'); $btn1 = ''.$post_id.''; $btn2 = ''.$message.''; $this->optionen['name'] = $data1['data'][$i -1]->galerie_name; $this->optionen['datum1'] = $datum1; $this->optionen['datum2'] = $datum2; $this->optionen['th1'] = 'Galerie ID'; $this->optionen['th2'] = 'Galerie Name'; $this->optionen['th3'] = 'Bilder'; $this->optionen['th4'] = 'Bilder beschr.'; $this->optionen['th5'] = 'Bilder Tags'; $this->optionen['th6'] = 'GPS Daten'; $this->optionen['th7'] = 'Exif Daten'; $this->optionen['th8'] = 'freigaben'; $this->optionen['th9'] = 'Checked'; $this->optionen['th10'] = 'Message'; $this->optionen['td1'] = ''.$data1['data'][$i -1]->id.''; $this->optionen['td2'] = ''. $data1['data'][$i -1]->galerie_name.''; $this->optionen['td3'] = ''.$data2['count'].''; $this->optionen['td4'] = ''.$beschreibung.''; $this->optionen['td5'] = ''.$tags.''; $this->optionen['td6'] = ''.$gps.''; $this->optionen['td7'] = ''.$exif.''; $this->optionen['td8'] = ''.$txt.''; $this->optionen['td9'] = $btn1; $this->optionen['td10'] =$btn2; $template .= $this->get_template(); } break; case 'user_details': $a2 = array("method" =>"read_wp_db", "table" =>"art_user", "select" =>"*"); $dat2 = new DbHandle($a2); $data2=$dat2->return; if(empty($data2['count'])){ $err=parent::response('21'); return array("status"=>false,"message"=>$err['response_msg']); } $abfrage = array("method" =>"user_wp_freigabe_start"); $dat = new DbHandle($abfrage); $data=$dat->return; if(empty($data['count'])) { $err=parent::response('22'); return array("status"=>false,"message"=>$err['response_msg']); } foreach ($data['data'] as $tmp){ $return = $this->template_user_details($tmp); } break; case 'user_freigaben_start': $a2 = array("method" =>"read_wp_db", "table" =>"art_user", "select" =>"*"); $dat2 = new DbHandle($a2); $data2=$dat2->return; if(empty($data2['count'])){ $err=parent::response('22'); return array("status"=>false,"message"=>$err['response_msg']); } if(empty($this->optionen['data'])){ $abfrage = array("method" =>"user_wp_freigabe_start"); $dat = new DbHandle($abfrage); $data=$dat->return; }else{ $abfrage = array("method" =>"user_wp_freigabe_select", "data" =>array( "where" =>$this->optionen['data']['where'], "typ" =>$this->optionen['data']['typ'])); $dat = new DbHandle($abfrage); $data=$dat->return; } if(empty($data['count'])) { $err=parent::response('22'); return array("status"=>false,"message"=>$err['response_msg']); } foreach ($data['data'] as $tmp){ $date = new \DateTime($tmp->created_at); $this->created_at = $date->format('d.m.Y'); $date2 = new \DateTime($tmp->last_update); $this->last_update = $date2->format('d.m.Y'); $this->details = unserialize($tmp->settings); $this->htaccess_user = $tmp->htaccess_user ; if(!empty($tmp->message)){ $c = count(array_filter(unserialize($tmp->message))); $color1 = ' green'; $msgtxt1 = $c; }else{ $color1 ='#c75e47'; $msgtxt1 = '0'; } if(!empty($tmp->select_image)){ $d = count(array_filter(unserialize($tmp->select_image))); $color2 = ' green'; $msgtxt2 = $d; }else{ $color2 ='#c75e47'; $msgtxt2 = '0'; } if(strlen($tmp->galerie_name) > 10 ? $p = '...' : $p = '' ); $gN = substr($tmp->galerie_name,0,10); $galerieName = $gN.$p; if(!empty($this->details['beschreibung'])){ $this->checked_beschreibung = ' checked'; }else{ $this->checked_beschreibung =''; } if(!empty($this->details['gps'])){ $this->checked_gps = ' checked'; $this->valueGps=1; }else{ $this->checked_gps =''; $this->valueGps=0; } if(!empty($this->details['exif'])){ $this->checked_exif = ' checked'; $this->valueExif=1; }else{ $this->checked_exif =''; $this->valueExif=0; } if(!empty($this->details['auswahl'])){ $this->checked_auswahl = ' checked'; $this->valueAuswahl =1; }else{ $this->checked_auswahl =''; $this->valueAuswahl =0; } if(!empty($this->details['kommentar'])){ $this->checked_kommentar = ' checked'; $this->valueKommentar =1; }else{ $this->checked_kommentar =''; $this->valueKommentar =0; } if(!empty($this->details['log'])){ $this->checked_log = ' checked'; $this->valueLog =1; }else{ $this->checked_log =''; $this->valueLog =0; } if(!empty($this->details['nachricht'])){ $this->checked_nachricht = ' checked'; $this->valueNachricht =1; }else{ $this->checked_nachricht =''; $this->valueNachricht =0; } if(!empty($tmp->freigabe_aktiv)){ $checked = ' checked'; $this->value = 1; }else{ $this->value = 0; $checked =''; } $this->optionen['name'] = ''.$tmp->htaccess_vorname.' '.$tmp->htaccess_nachname.' | '.$tmp->galerie_name.' (erstellt am: '.$this->created_at.' | eMail: '.$tmp->htaccess_email.' | Login: '.$tmp->htaccess_user.' )'; $this->optionen['th1'] = 'ID'; $this->optionen['th2'] = ' freig. aktiv '; $this->optionen['th3'] = ' Galerie ID'; $this->optionen['th4'] = ' Benutzer'; $this->optionen['th6'] = ' Message '; $this->optionen['th7'] = ' check '; $this->optionen['th8'] = ' freigabe'; $this->optionen['th9'] = ' freig. löschen '; $this->optionen['td1'] = $tmp->freigabe_id; $this->optionen['td2'] = ''; $this->optionen['td3'] = ''.$tmp->galerie_id.''; $this->optionen['td4'] = ''.$tmp->htaccess_user.''; $this->optionen['td6'] = ''.$msgtxt1.''; $this->optionen['td7'] = ''.$msgtxt2.''; $this->optionen['td8'] = '

'. $galerieName.'

'; $this->optionen['td9'] = ' '; $this->optionen['freigabe-details'] = $this->template_freigabe_details($tmp); $template .= $this->get_template(); } break; case 'get_user_response': $template .= $this->get_template(); break; } $this->optionen['header'] = preg_replace(array('//Uis', "/[[:blank:]]+/"), array('', ' '), str_replace(array("\n","\r","\t"), '',$this->optionen['header'])); $template = preg_replace(array('//Uis', "/[[:blank:]]+/"), array('', ' '), str_replace(array("\n","\r","\t"), '', $template)); return $this->optionen['header'] . $template; } private function template_freigabe_details($daten="") { $select = ' selected="selected"'; if($daten->galerie_typ == 1 ? $select1 = $select : $select1 = ''); if($daten->galerie_typ == 2 ? $select2 = $select : $select2 = ''); if($daten->galerie_typ == 3 ? $select3 = $select : $select3 = ''); $gTyp = ''; if(empty($this->settings['license_aktiv'])){ $txt='


In der Standart Version sind GPS, EXIF und Galerie Typ-Auswahl deaktiviert.



In der Art-Picture Galerie Pro können Sie GPS und Exif Daten freigeben. Es stehen zuzätzlich 2 weitere Galerie-Layouts zur Verfügung.
'; $stern=''; } $template = '
'.$stern.' Gps '.$stern.' exif auswahl Kommentar user Log '.$stern.' galerie typ
'.$gTyp.'

last update ('.$this->last_update.')
'.$txt.'

Info: Um die GPS-Daten zu sehen, geben Sie bitte ihren Google-Maps Api-KEY ein. Die Eingabe finden Sie unter Settings GoogleMaps API-Key.
Hier finden Sie eine Anleitung wie Sie einen Standard GoogleMaps api-KEY anlegen.


'; return $template; } private function get_template() { $header = $this->optionen['header']; $template = '
'; if(!empty($this->optionen['datum1'])){ $datum1 ='erstellt am: '.$this->optionen['datum1'].''; } $template .='

'.$this->optionen['icon'].' '.$this->optionen['name'].' '.$datum1.'

'.$this->optionen['temp-head'].'
'.$this->optionen['th1'].' '.$this->optionen['th2'].' '.$this->optionen['th3'].' '.$this->optionen['th4'].' '.$this->optionen['th5'].' '.$this->optionen['th6'].' '.$this->optionen['th7'].' '.$this->optionen['th8'].' '.$this->optionen['th9'].' '.$this->optionen['th10'].' '.$this->optionen['th11'].' '.$this->optionen['th12'].'
'.$this->optionen['td1'].' '.$this->optionen['td2'].' '.$this->optionen['td3'].' '.$this->optionen['td4'].' '.$this->optionen['td5'].' '.$this->optionen['td6'].' '.$this->optionen['td7'].' '.$this->optionen['td8'].' '.$this->optionen['td9'].' '.$this->optionen['td10'].' '.$this->optionen['td11'].' '.$this->optionen['td12'].'
'.$this->optionen['freigabe-details'].'
'; //PRO-VERSON if(!empty($this->optionen['datum2'])){ $template .= ''; } $template .= '
'; return $template; } public function __destruct(){ $this->return; $this->settings; $this->optionen; } } ?>