• [MOD] Google-Maps / GPS Integration V1.2 5 0 5 1
Currently:  

Author Topic: [MOD] Google-Maps / GPS Integration V1.2  (Read 144923 times)

0 Members and 1 Guest are viewing this topic.

Offline bma2004

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: [MOD] Google-Maps / GPS Integration V1.2
« Reply #135 on: September 08, 2010, 10:43:11 PM »
I have a problem.

1) When you edit an existing photo - everything works fine. map is displayed, the data are transferred from the window.

But. When adding a new photo via the administrative console, when you call map window ... It opens blank. If you manually specify the code zoom, pointx, pointy - map appears, but the OK button does not work.
The problem persists even if you set the archive  MOD to a clean 4images.
what could be wrong? :(

2) Are there any installation where the implementation of marker bindings by adding not through the administrative console? And on the page when you add to the site.

Sorry for my english. Google Translator :)
« Last Edit: September 08, 2010, 10:54:23 PM by bma2004 »

Offline kubiczek

  • Full Member
  • ***
  • Posts: 212
    • View Profile
    • Gross Peterwitz
Re: [MOD] Google-Maps / GPS Integration V1.2
« Reply #136 on: November 25, 2010, 10:46:45 PM »
Hallo,

sobald ich die upload.php bearbeite im DREAMWAVER tritt als hinweiss "Syntax fehler " auf.

hier meine upload.php

ich nutze zwar 1.7.4 Galerie,   das selbe problem habe ich auch mit 1.7.6

weiss jemand ein rat?

<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: upload.php                                           *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.4                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
if (!defined('ROOT_PATH')) {
  die(
"Security violation");
}

if (!
function_exists("is_uploaded_file")) {
  function 
is_uploaded_file($file_name) {
    if (!
$tmp_file = @get_cfg_var('upload_tmp_dir')) {
      
$tmp_file tempnam('','');
      
$deleted = @unlink($tmp_file);
      
$tmp_file dirname($tmp_file);
    }
    
$tmp_file .= '/'.get_basefile($file_name);
    return (
ereg_replace('/+''/'$tmp_file) == $file_name) ? 0;
  }

  function 
move_uploaded_file($file_name$destination) {
    return (
is_uploaded_file($file_name)) ? ((copy($file_name$destination)) ? 0) : 0;
  }
}

class 
Upload {

  var 
$upload_errors = array();
  var 
$accepted_mime_types = array();
  var 
$accepted_extensions = array();
  var 
$upload_mode 3;

  var 
$image_type "";
  var 
$max_width = array();
  var 
$max_height = array();
  var 
$max_size = array();
  var 
$upload_path = array();

  var 
$field_name;
  var 
$file_name;
  var 
$extension;

  var 
$image_size 0;
  var 
$image_size_ok 0;
  var 
$lang = array();

  function 
Upload() {
    global 
$config$lang;

    
$this->max_width['thumb'] = $config['max_thumb_width'];
    
$this->max_width['media'] = $config['max_image_width'];
    
$this->max_height['thumb'] = $config['max_thumb_height'];
    
$this->max_height['media'] = $config['max_image_height'];

    
$this->max_size['thumb'] = $config['max_thumb_size'] * 1024;
    
$this->max_size['media'] = $config['max_media_size'] * 1024;

    
$this->upload_mode $config['upload_mode'];
    
$this->lang $lang;

    
$this->set_allowed_filetypes();
  }

  function 
check_image_size() {
    
$this->image_size = @getimagesize($this->upload_file);
    
$ok 1;
    if (
$this->image_size[0] > $this->max_width[$this->image_type]) {
      
$ok 0;
      
$this->set_error($this->lang['invalid_image_width']);
    }

    if (
$this->image_size[1] > $this->max_height[$this->image_type]) {
      
$ok 0;
      
$this->set_error($this->lang['invalid_image_height']);
    }
    return 
$ok;
  }

  function 
copy_file() {
    switch (
$this->upload_mode) {
    case 
1// overwrite mode
      
if (file_exists($this->upload_path[$this->image_type]."/".$this->file_name)) {
        @
unlink($this->upload_path[$this->image_type]."/".$this->file_name);
      }
      
$ok move_uploaded_file($this->upload_file$this->upload_path[$this->image_type]."/".$this->file_name);
      break;
    case 
2// create new with incremental extention
      
$n 2;
      
$copy "";
      while (
file_exists($this->upload_path[$this->image_type]."/".$this->name.$copy.".".$this->extension)) {
        
$copy "_".$n;
        
$n++;
      }
      
$this->file_name $this->name.$copy.".".$this->extension;
      
$ok move_uploaded_file($this->upload_file$this->upload_path[$this->image_type]."/".$this->file_name);
      break;
    case 
3// do nothing if exists, highest protection
    
default:
      if (
file_exists($this->upload_path[$this->image_type]."/".$this->file_name)) {
       
$this->set_error($this->lang['file_already_exists']);
       
$ok 0;
      }
      else {
        
$ok move_uploaded_file($this->upload_file$this->upload_path[$this->image_type]."/".$this->file_name);
      }
      break;
    }
    @
chmod($this->upload_path[$this->image_type]."/".$this->file_nameCHMOD_FILES);
    return 
$ok;
  }

  function 
check_max_filesize() {
    if (
$this->HTTP_POST_FILES[$this->field_name]['size'] > $this->max_size[$this->image_type]) {
      return 
false;
    }
    else {
      return 
true;
    }
  }

  function 
save_file() {
    global 
$user_info;

    
$this->upload_file $this->HTTP_POST_FILES[$this->field_name]['tmp_name'];
    
$ok 1;
    if (empty(
$this->upload_file) || $this->upload_file == "none") {
      
$this->set_error($this->lang['no_image_file']);
      
$ok 0;
    }

    if (
$user_info['user_level'] != ADMIN) {
      if (!
$this->check_max_filesize()) {
        
$this->set_error($this->lang['invalid_file_size']);
        
$ok 0;
      }
      if (
eregi("image"$this->HTTP_POST_FILES[$this->field_name]['type'])) {
        if (!
$this->check_image_size()) {
          
$ok 0;
        }
      }
    }

    if (!
$this->check_file_extension() || !$this->check_mime_type()) {
      
$this->set_error($this->lang['invalid_file_type']. " (".$this->extension.", ".$this->mime_type.")");
      
$ok 0;
    }
    if (
$ok) {
      if (!
$this->copy_file()) {
        if (isset(
$this->lang['file_copy_error'])) {
          
$this->set_error($this->lang['file_copy_error']);
        }
        
$ok 0;
      }
    }
    return 
$ok;
  }

  function 
upload_file($field_name$image_type$cat_id 0$file_name "") {
    global 
$HTTP_COOKIE_VARS$HTTP_POST_VARS$HTTP_GET_VARS$HTTP_POST_FILES;

    
// Bugfix for: http://www.securityfocus.com/archive/1/80106
    
if (isset($HTTP_COOKIE_VARS[$field_name]) || isset($HTTP_POST_VARS  [$field_name]) || isset($HTTP_GET_VARS   [$field_name])) {
      die(
"Security violation");
    }

    
$this->HTTP_POST_FILES $HTTP_POST_FILES;
    
$this->image_type $image_type;
    
$this->field_name $field_name;

    if (
$cat_id) {
      
$this->upload_path['thumb'] = THUMB_PATH."/".$cat_id;
      
$this->upload_path['media'] = MEDIA_PATH."/".$cat_id;
    }
    else {
      
$this->upload_path['thumb'] = THUMB_TEMP_PATH;
      
$this->upload_path['media'] = MEDIA_TEMP_PATH;
    }

    if (
$file_name != "") {
      
ereg("(.+)\.(.+)"$file_name$regs);
      
$this->name $regs[1];
      
ereg("(.+)\.(.+)"$this->HTTP_POST_FILES[$this->field_name]['name'], $regs);
      
$this->extension $regs[2];
      
$this->file_name $this->name.".".$this->extension ;
    }
    else {
      
$this->file_name $this->HTTP_POST_FILES[$this->field_name]['name'];
      
$this->file_name ereg_replace(" ""_"$this->file_name);
      
$this->file_name ereg_replace("%20""_"$this->file_name);
      
$this->file_name preg_replace("/[^-\._a-zA-Z0-9]/"""$this->file_name);

      
ereg("(.+)\.(.+)"$this->file_name$regs);
      
$this->name $regs[1];
      
$this->extension $regs[2];
    }

    
$this->mime_type $this->HTTP_POST_FILES[$this->field_name]['type'];
    
preg_match("/([a-z]+\/[a-z\-]+)/"$this->mime_type$this->mime_type);
    
$this->mime_type $this->mime_type[1];

    if (
$this->save_file()) {
      return 
$this->file_name;
    }
    else {
      return 
false;
    }
  }

  function 
check_file_extension($extension "") {
    if (
$extension == "") {
      
$extension $this->extension;
    }
    if (!
in_array(strtolower($extension), $this->accepted_extensions[$this->image_type])) {
      return 
false;
    }
    else {
      return 
true;
    }
  }

  function 
check_mime_type() {
    if (!isset(
$this->accepted_mime_types[$this->image_type])) {
      return 
true;
    }
    if (!
in_array($this->mime_type$this->accepted_mime_types[$this->image_type])) {
      return 
false;
    }
    else {
      return 
true;
    }
  }

  function 
set_allowed_filetypes() {
    global 
$config;
    
//Thumbnails
    
$this->accepted_mime_types['thumb'] = array(
      
"image/jpg",
      
"image/jpeg",
      
"image/pjpeg",
      
"image/gif",
      
"image/x-png"
    
);
    
$this->accepted_extensions['thumb'] = array(
      
"jpg",
      
"jpeg",
      
"gif",
      
"png"
    
);

    
//Media
    
$this->accepted_extensions['media'] = $config['allowed_mediatypes_array'];

    
$mime_type_match = array();
    include(
ROOT_PATH.'includes/upload_definitions.php');

    foreach (
$mime_type_match as $key => $val) {
      if (
in_array($key$this->accepted_extensions['media'])) {
        if (
is_array($val)) {
          foreach (
$val as $key2 => $val2) {
            
$this->accepted_mime_types['media'][] = $val2;
          }
        }
        else {
          
$this->accepted_mime_types['media'][] = $val;
        }
      }
    }
  }

  function 
get_upload_errors() {
    if (empty(
$this->upload_errors[$this->file_name])) {
      return 
"";
    }
    
$error_msg "";
    foreach (
$this->upload_errors[$this->file_name] as $msg) {
      
$error_msg .= "<b>".$this->file_name.":</b> ".$msg."<br />";
    }
    return 
$error_msg;
  }

  function 
set_error($error_msg) {
    
$this->upload_errors[$this->file_name][] = $error_msg;
  } 
 
// EXIF Funktionen für das automatische einfügen der GPS Daten beim Upload - Groesstenteils aus der Functions.php übernommen.
  
function get_exif_info($exif) {
  
$exif_match = array();
  
$exif_match['Make'] = "make";
  
$exif_match['Model'] = "model";
  
$exif_match['DateTimeOriginal'] = "datetime";
  
$exif_match['ISOSpeedRatings'] = "isospeed";
  
$exif_match['ExposureTime'] = "exposure";
  
$exif_match['FNumber'] = "aperture";
  
$exif_match['FocalLength'] = "focallen";
// GPS EXIF Variablen Start  - Changes by Erik Groennerud - www.koelschwasser.de 8.2007
  
$exif_match['GPSLatitude'] = "GPSLatitude";
  
$exif_match['GPSLatitudeRef'] = "GPSLatitudeRef";
  
$exif_match['GPSLongitude'] = "GPSLongitude";
  
$exif_match['GPSLongitudeRef'] = "GPSLongitudeRef";
  
$exif_match['GPSAltitude'] = "GPSAltitude";
// GPS EXIF Variablen Ende

  
$exif_array = array();
  if (
is_array($exif)) {
    foreach (
$exif as $key => $val) {
      if (isset(
$exif_match[$key])) {
        
$exif_info $val;
        if (
$key == "DateTimeOriginal") {
          
$exif_array[$exif_match[$key]] = preg_replace("/([0-9]{4}):([0-9]{2}):([0-9]{2})/""\\3.\\2.\\1"$exif_info);
        }
        elseif (
$key == "ExposureTime") {
	
	
  
$exposure explode("/"$exif_info);
          
$exif_array[$exif_match[$key]] = "1/" . ($exposure[1] / $exposure[0]);
        }
        elseif (
$key == "FNumber") {
	
	
  
$aperture explode("/"$exif_info);
          
$exif_array[$exif_match[$key]] = "F/" . ($aperture[0] / $aperture[1]);
        }
        elseif (
$key == "FocalLength") {
	
	
  
$focalLen explode("/"$exif_info);
          
$exif_array[$exif_match[$key]] = ($focalLen[0] / $focalLen[1]) . "mm";
        }

// GPS EXIF START - Changes by Erik Groennerud - www.koelschwasser.de 8.2007
        
elseif ($key == "GPSLatitudeRef") {
	
	
  
	
	
if (
$exif_info == "N") {
	
	
  
	
	
	
$GPSLatitudeRef "Nord";
	
	
  
	
	
	
$GPSLatfaktor 1;
	
	
  
	
	
	
} else {
	
	
  
	
	
	
	
$GPSLatitudeRef "Süd";
	
	
  
	
	
	
	
$GPSLatfaktor = -1;
	
	
  
	
	
	
}
	
	
  
	
	
	

        }
        elseif (
$key == "GPSLongitudeRef") {
	
	
  
	
	
if (
$exif_info == "E") {
	
	
  
	
	
	
$GPSLongitudeRef "Ost";
	
	
  
	
	
	
$GPSLongfaktor 1;
	
	
  
	
	
	
} else { 
	
	
  
	
	
	
$GPSLongitudeRef "West";
	
	
  
	
	
	
$GPSLongfaktor = -1;
	
	
  
	
	
	
}
	
	
	
	
}
        elseif (
$key == "GPSLatitude") {
        
	
$GPSLatitude_h explode("/"$exif_info[0]);
        
	
$GPSLatitude_m explode("/"$exif_info[1]);
        
	
$GPSLatitude_s explode("/"$exif_info[2]);
        
	

        
	
$GPSLat_h $GPSLatitude_h[0] / $GPSLatitude_h[1];
        
	
$GPSLat_m $GPSLatitude_m[0] / $GPSLatitude_m[1];
        
	
$GPSLat_s $GPSLatitude_s[0] / $GPSLatitude_s[1];
        
	

        
	
$GPSLatGrad $GPSLatfaktor * ($GPSLat_h + ($GPSLat_m + ($GPSLat_s 60))/60);
        
	

        
	
$exif_array[$exif_match[$key]] =  $GPSLatitudeRef " " .$GPSLat_h "° "$GPSLat_m "' " $GPSLat_s "'' ($GPSLatGrad)";
        }
        elseif (
$key == "GPSLongitude") {
        
	
$GPSLongitude_h explode("/"$exif_info[0]);
        
	
$GPSLongitude_m explode("/"$exif_info[1]);
        
	
$GPSLongitude_s explode("/"$exif_info[2]);
        
	

        
	
$GPSLong_h $GPSLongitude_h[0] / $GPSLongitude_h[1];
        
	
$GPSLong_m $GPSLongitude_m[0] / $GPSLongitude_m[1];
        
	
$GPSLong_s $GPSLongitude_s[0] / $GPSLongitude_s[1];
        
	

        
	
$GPSLongGrad $GPSLatfaktor * ($GPSLong_h + ($GPSLong_m + ($GPSLong_s 60))/60);
        
	

        
	
$exif_array[$exif_match[$key]] =  $GPSLongitudeRef " " $GPSLong_h "° "$GPSLong_m "' " $GPSLong_s "'' ($GPSLongGrad)";
        }
        elseif (
$key == "GPSAltitude") {
   
	
	
	
  
$GPSAltitude explode("/"$exif_info);
          
$exif_array[$exif_match[$key]] = ($GPSAltitude[0] / $GPSAltitude[1]) . " Meter über NN";
        }  
// GPS EXIF ENDE

//end of class
?>

Rembrandt

  • Guest
Re: [MOD] Google-Maps / GPS Integration V1.2
« Reply #137 on: November 26, 2010, 04:51:21 AM »
@ kubiczek, ersetze in deinen code:

         
}  
// GPS EXIF ENDE

//end of class
?>

durch:

        
}  
      }
    }
  }
}
// GPS EXIF ENDE
}//end of class
?>

Offline Ninimaus

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Website unserer Tochter
Re: [MOD] Google-Maps / GPS Integration V1.2
« Reply #138 on: December 17, 2010, 10:48:04 PM »
Hallo Erik,

ich bin gerade dabei den Server zu wechseln.

Habe nun auch endlich die Möglichkeit die EXIF Info´s auszulesen

Nun fehlen mir noch die Änderungen zur

/includes/functions.php


Da ich nun auf die 1.7.9 geupdated habe, macht es wenig Sinn deine 1.7.7 Datei zu übernehmen, da sich bestimmt etwas geändert hat.

Sollte ich unrecht haben dann bitte kurz Bescheid geben, dann kann ich die Datei ja ohne Bedenken ersetzen.


Habe jetzt die Angeben laut Changelog 1.7.8 in der functions.php ersetzt.

In der 1.7.9 soll nichts an der functions.php geändert worden sein

Hier also die functions.php für die Version 1.7.9 (Habe sie bisher noch nicht getestet, falls es nicht klappt, bitte kurze Info)


----EDIT----

HM Also die Exif Daten werden nun angezeigt, darunter auch die GPS Daten, leider trägt es sich nicht selbst als Kooardinaten ein. Das Problem mit meiner koordinatencheck.html besteht noch immer. Wenn ich direkt beim Hochladen die Koordinaten von Hand eingeben will, zeigt er keine Karte an. Dabei habe ich den ganzen MOD nun von Hand neu "installiert" Mit Ausnahme der template Files, aber die sind doch nicht grundlegend für den upload ? Wenn ich hinterher über bearbeiten gehe, dann funktioniert es komischerweise.

Woran kann das liegen ?

« Last Edit: December 18, 2010, 12:44:16 AM by Ninimaus »


Offline Elsterkicker

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • leipzig-am-wasser.de
Re: [MOD] Google-Maps / GPS Integration V1.2
« Reply #139 on: May 19, 2011, 11:32:01 PM »
SOS, die Google Maps werden auf der Detailseite nicht mehr angezeigt  :twisted:

Hat Google etwas geändert?

Rembrandt

  • Guest
Re: [MOD] Google-Maps / GPS Integration V1.2
« Reply #140 on: May 20, 2011, 05:15:55 AM »
..Hat Google etwas geändert?
bei mir funktioniert alles, hast vielleicht eine neue domain?

Offline Elsterkicker

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • leipzig-am-wasser.de
Re: [MOD] Google-Maps / GPS Integration V1.2
« Reply #141 on: May 20, 2011, 05:36:32 AM »
Hallo, nein, habe jetzt mal diesbezüglich den Key von Google durch wirres Zeugs ersetzt, da reagiert nix.
Naja, werd mal an einem regnerischen Tag die neueste Version von 4images installieren und alles neu machen (müssen)  :cry:

Oder eine regnerische Woche, es sind jetzt 2865 Bilder auf http://www.leipzig-am-wasser.de