[Linpha-cvs] SF.net SVN: linpha: [4840] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <bz...@us...> - 2008-01-30 20:24:40
|
Revision: 4840 http://linpha.svn.sourceforge.net/linpha/?rev=4840&view=rev Author: bzrudi Date: 2008-01-30 12:24:33 -0800 (Wed, 30 Jan 2008) Log Message: ----------- "add support for other db than PG (hopefully)" Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/lib/classes/linpha.metadata.class.php trunk/linpha2/lib/classes/linpha.pjmt.class.php trunk/linpha2/lib/plugins/maps/module.maps.php trunk/linpha2/lib/plugins/maps/sql/sql.data.php trunk/linpha2/lib/plugins/maps/sql/sql.mysql.php trunk/linpha2/lib/plugins/maps/sql/sql.oci8po.php trunk/linpha2/lib/plugins/maps/sql/sql.postgres.php trunk/linpha2/lib/plugins/maps/sql/sql.sqlite.php trunk/linpha2/templates/default/maps.head.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2008-01-30 18:00:37 UTC (rev 4839) +++ trunk/linpha2/ChangeLog 2008-01-30 20:24:33 UTC (rev 4840) @@ -5,6 +5,9 @@ expected performance issues and the mysql "big table" problem. It should currently work partially with PostgresDB, other DB will follow later. Needs "reset_database.php" to work and sys_import_use_exiftool=1 + * add support for PJMT + * add support for other db than PG (hopefully) + * still a lot to fix, so expect errors 2008-01-29 flo * updated to latest protoype 1.6.0.2 and scriptaculous 1.8.1 Modified: trunk/linpha2/lib/classes/linpha.metadata.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.metadata.class.php 2008-01-30 18:00:37 UTC (rev 4839) +++ trunk/linpha2/lib/classes/linpha.metadata.class.php 2008-01-30 20:24:33 UTC (rev 4840) @@ -951,12 +951,20 @@ if(is_array($dataArray)) { + /** + * Lower array data to make it compareable to $metaTags + */ + $lowerDataArray = array_change_key_case($dataArray, 'LOWER_CASE'); + + //echo '<pre>', print_r($lowerDataArray), '</pre>'; + foreach($this->getDefaultMetaTags('gps') AS $key => $value) { - if(array_key_exists($value, $dataArray)) + if(array_key_exists($value, $lowerDataArray)) { + $str_columns .= str_replace("_", "-", $value) . ', '; - $str_values .= trim($dataArray[$value]).", "; + $str_values .= "'".trim($lowerDataArray[$value])."', "; } } /** Modified: trunk/linpha2/lib/classes/linpha.pjmt.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.pjmt.class.php 2008-01-30 18:00:37 UTC (rev 4839) +++ trunk/linpha2/lib/classes/linpha.pjmt.class.php 2008-01-30 20:24:33 UTC (rev 4840) @@ -74,24 +74,28 @@ case 2 : if(isset($exif_data[$ap[0]][$ap[1]]['Text Value'])) { - //echo "DATA:".$exif_data[$ap[0]][$ap[1]]['Text Value']."<br>"; + echo "DATA:".$exif_data[$ap[0]][$ap[1]]['Text Value']."<br>"; $dataArray[$value] = - "'" . LinSql :: linAddslashes(trim($exif_data[$ap[0]][$ap[1]]['Text Value'])) . "', "; + LinSql::linAddslashes(trim($exif_data[$ap[0]][$ap[1]]['Text Value'])); } break; case 5 : if(isset($exif_data[$ap[0]][$ap[1]][$ap[2]][$ap[3]][$ap[4]]['Text Value'])) { - //echo "DATA2".$exif_data[$ap[0]][$ap[1]][$ap[2]][$ap[3]][$ap[4]]['Text Value']; + echo "DATA2".$exif_data[$ap[0]][$ap[1]][$ap[2]][$ap[3]][$ap[4]]['Text Value']; $dataArray[$value] = - "'" . LinSql :: linAddslashes(trim($exif_data[$ap[0]][$ap[1]][$ap[2]][$ap[3]][$ap[4]]['Text Value'])) . "' "; + LinSql::linAddslashes(trim($exif_data[$ap[0]][$ap[1]][$ap[2]][$ap[3]][$ap[4]]['Text Value'])); } break; } } } - - return $dataArray; + if(is_array($dataArray)){ + return $dataArray; + }else { + return array(); + } + } } Modified: trunk/linpha2/lib/plugins/maps/module.maps.php =================================================================== --- trunk/linpha2/lib/plugins/maps/module.maps.php 2008-01-30 18:00:37 UTC (rev 4839) +++ trunk/linpha2/lib/plugins/maps/module.maps.php 2008-01-30 20:24:33 UTC (rev 4840) @@ -240,7 +240,8 @@ $query = $GLOBALS['linpha']->db->Execute("SELECT DISTINCT P.parent_id " . "FROM ".LIN_PREFIX."plugins_maps_image_geodata PM " . - "INNER JOIN ".LIN_PREFIX."photos P on PM.md5sum = P.md5sum " . + "INNER JOIN ".LIN_PREFIX."photos P ". + "ON PM.md5sum = P.md5sum " . "WHERE gpslatituderef IS NOT NULL " . "AND gpslatitude IS NOT NULL " . "AND gpslongituderef IS NOT NULL " . @@ -250,7 +251,8 @@ if( $query->EOF ) { - //echo "Error: Please enable EXIF GPS fields!"; + //echo "ERROR: Can't get data for albums"; + error_log("ERROR: Can't get data for albums",'',0); } else { @@ -291,7 +293,7 @@ $query = $GLOBALS['linpha']->db->Execute("SELECT P.id, P.parent_id, " . "P.name, gpslatituderef, gpslatitude, gpslongituderef, gpslongitude " . - "FROM ".LIN_PREFIX."plugins_maps_image_geodata AS PM " . + "FROM ".LIN_PREFIX."plugins_maps_image_geodata PM " . "INNER JOIN ".LIN_PREFIX."photos P on PM.md5sum = P.md5sum " . "WHERE gpslatituderef IS NOT NULL " . "AND gpslatitude IS NOT NULL " . @@ -385,7 +387,7 @@ { foreach(array('gpslatitude','gpslongitude') as $value) { - error_log("USING PJMT",'','0'); + error_log("USING PJMT",'','0'); $arrHits = array(); // use '?' to be �non-greedy� (http://de.wikipedia.org/wiki/Regul%C3%A4rer_Ausdruck#Gieriges_Verhalten) Modified: trunk/linpha2/lib/plugins/maps/sql/sql.data.php =================================================================== --- trunk/linpha2/lib/plugins/maps/sql/sql.data.php 2008-01-30 18:00:37 UTC (rev 4839) +++ trunk/linpha2/lib/plugins/maps/sql/sql.data.php 2008-01-30 20:24:33 UTC (rev 4840) @@ -9,7 +9,7 @@ "VALUES ('plugins_maps_defaultMarkerZoom', '10', '0', '0')"; $sql_queries[] = "INSERT INTO ".LIN_PREFIX."config (option_name, option_value, override, user_id) " . - "VALUES ('plugins_maps_mapType', 'google', '0', '0')"; + "VALUES ('plugins_maps_mapType', '0', '0', '0')"; // google maps key for http://localhost $sql_queries[] = "INSERT INTO ".LIN_PREFIX."config (option_name, option_value, override, user_id) " . @@ -22,6 +22,9 @@ "VALUES ('plugins_maps_setMarkers', '')"; $sql_queries[] = "INSERT INTO ".LIN_PREFIX."config (option_name, option_value, override, user_id) " . - "VALUES ('plugins_maps_enable_geotagged', '0', '0', '0')"; + "VALUES ('plugins_maps_enable_geotagged', '0', '0', '0')"; + +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."config (option_name, option_value, override, user_id) " . + "VALUES ('plugins_maps_geotagged_autoimport', '1', '0', '0')"; ?> Modified: trunk/linpha2/lib/plugins/maps/sql/sql.mysql.php =================================================================== --- trunk/linpha2/lib/plugins/maps/sql/sql.mysql.php 2008-01-30 18:00:37 UTC (rev 4839) +++ trunk/linpha2/lib/plugins/maps/sql/sql.mysql.php 2008-01-30 20:24:33 UTC (rev 4840) @@ -10,5 +10,42 @@ "markerlon VARCHAR(255) NOT NULL default '', " . "markerzoom INT NOT NULL default '0', " . "PRIMARY KEY (id) )"; + +$sql_tables[] = "CREATE TABLE ".LIN_PREFIX."plugins_maps_image_geodata ( ". + "md5sum CHAR(32) NOT NULL default '', " . + "gpsversionid VARCHAR(255) DEFAULT '', " . + "gpslatituderef VARCHAR(255) DEFAULT '', " . + "gpslatitude VARCHAR(255) DEFAULT '', " . + "gpslongituderef VARCHAR(255) DEFAULT '', " . + "gpslongitude VARCHAR(255) DEFAULT '', " . + "gpsaltituderef VARCHAR(255) DEFAULT '', " . + "gpsaltitude VARCHAR(255) DEFAULT '', " . + "gpstimestamp VARCHAR(255) DEFAULT '', " . + "gpssatellites VARCHAR(255) DEFAULT '', " . + "gpsstatus VARCHAR(255) DEFAULT '', " . + "gpsmeasuremode VARCHAR(255) DEFAULT '', " . + "gpsdop VARCHAR(255) DEFAULT '', " . + "gpsspeedref VARCHAR(255) DEFAULT '', " . + "gpsspeed VARCHAR(255) DEFAULT '', " . + "gpstrackref VARCHAR(255) DEFAULT '', " . + "gpstrack VARCHAR(255) DEFAULT '', " . + "gpsimgdirectionref VARCHAR(255) DEFAULT '', " . + "gpsimgdirection VARCHAR(255) DEFAULT '', " . + "gpsmapdatum VARCHAR(255) DEFAULT '', " . + "gpsdestlatituderef VARCHAR(255) DEFAULT '', " . + "gpsdestlatitude VARCHAR(255) DEFAULT '', " . + "gpsdestlongituderef VARCHAR(255) DEFAULT '', " . + "gpsdestlongitude VARCHAR(255) DEFAULT '', " . + "gpsdestbearingref VARCHAR(255) DEFAULT '', " . + "gpsdestbearing VARCHAR(255) DEFAULT '', " . + "gpsdestdistanceref VARCHAR(255) DEFAULT '', " . + "gpsdestdistance VARCHAR(255) DEFAULT '', " . + "gpsprocessingmethod VARCHAR(255) DEFAULT '', " . + "gpsareainformation VARCHAR(255) DEFAULT '', " . + "gpsdatestamp VARCHAR(255) DEFAULT '', " . + "gpsdatetime VARCHAR(255) DEFAULT '', " . + "gpsposition VARCHAR(255) DEFAULT '', " . + "PRIMARY KEY (md5sum) )"; -?> \ No newline at end of file +/* vi: set ts=4 sw=4 sts=4 */ +?> Modified: trunk/linpha2/lib/plugins/maps/sql/sql.oci8po.php =================================================================== --- trunk/linpha2/lib/plugins/maps/sql/sql.oci8po.php 2008-01-30 18:00:37 UTC (rev 4839) +++ trunk/linpha2/lib/plugins/maps/sql/sql.oci8po.php 2008-01-30 20:24:33 UTC (rev 4840) @@ -22,5 +22,44 @@ "BEGIN " . "SELECT ".LIN_PREFIX."plugins_maps_markers_seq.nextval INTO :new.id FROM DUAL; " . "END; "; - -?> \ No newline at end of file + + +$sql_tables[] = "CREATE TABLE ".LIN_PREFIX."plugins_maps_image_geodata ( ". + "md5sum CHAR(32) NOT NULL default '', " . + "gpsversionid VARCHAR(255) DEFAULT '', " . + "gpslatituderef VARCHAR(255) DEFAULT '', " . + "gpslatitude VARCHAR(255) DEFAULT '', " . + "gpslongituderef VARCHAR(255) DEFAULT '', " . + "gpslongitude VARCHAR(255) DEFAULT '', " . + "gpsaltituderef VARCHAR(255) DEFAULT '', " . + "gpsaltitude VARCHAR(255) DEFAULT '', " . + "gpstimestamp VARCHAR(255) DEFAULT '', " . + "gpssatellites VARCHAR(255) DEFAULT '', " . + "gpsstatus VARCHAR(255) DEFAULT '', " . + "gpsmeasuremode VARCHAR(255) DEFAULT '', " . + "gpsdop VARCHAR(255) DEFAULT '', " . + "gpsspeedref VARCHAR(255) DEFAULT '', " . + "gpsspeed VARCHAR(255) DEFAULT '', " . + "gpstrackref VARCHAR(255) DEFAULT '', " . + "gpstrack VARCHAR(255) DEFAULT '', " . + "gpsimgdirectionref VARCHAR(255) DEFAULT '', " . + "gpsimgdirection VARCHAR(255) DEFAULT '', " . + "gpsmapdatum VARCHAR(255) DEFAULT '', " . + "gpsdestlatituderef VARCHAR(255) DEFAULT '', " . + "gpsdestlatitude VARCHAR(255) DEFAULT '', " . + "gpsdestlongituderef VARCHAR(255) DEFAULT '', " . + "gpsdestlongitude VARCHAR(255) DEFAULT '', " . + "gpsdestbearingref VARCHAR(255) DEFAULT '', " . + "gpsdestbearing VARCHAR(255) DEFAULT '', " . + "gpsdestdistanceref VARCHAR(255) DEFAULT '', " . + "gpsdestdistance VARCHAR(255) DEFAULT '', " . + "gpsprocessingmethod VARCHAR(255) DEFAULT '', " . + "gpsareainformation VARCHAR(255) DEFAULT '', " . + "gpsdatestamp VARCHAR(255) DEFAULT '', " . + "gpsdatetime VARCHAR(255) DEFAULT '', " . + "gpsposition VARCHAR(255) DEFAULT '', " . + "PRIMARY KEY (md5sum) )"; + +/* vi: set ts=4 sw=4 sts=4 */ +?> + \ No newline at end of file Modified: trunk/linpha2/lib/plugins/maps/sql/sql.postgres.php =================================================================== --- trunk/linpha2/lib/plugins/maps/sql/sql.postgres.php 2008-01-30 18:00:37 UTC (rev 4839) +++ trunk/linpha2/lib/plugins/maps/sql/sql.postgres.php 2008-01-30 20:24:33 UTC (rev 4840) @@ -44,4 +44,8 @@ "gpsdatestamp VARCHAR(255) DEFAULT '', " . "gpsdatetime VARCHAR(255) DEFAULT '', " . "gpsposition VARCHAR(255) DEFAULT '' )"; + + +/* vi: set ts=4 sw=4 sts=4 */ ?> + Modified: trunk/linpha2/lib/plugins/maps/sql/sql.sqlite.php =================================================================== --- trunk/linpha2/lib/plugins/maps/sql/sql.sqlite.php 2008-01-30 18:00:37 UTC (rev 4839) +++ trunk/linpha2/lib/plugins/maps/sql/sql.sqlite.php 2008-01-30 20:24:33 UTC (rev 4840) @@ -10,4 +10,40 @@ "markerlon VARCHAR(255) NOT NULL default '', " . "markerzoom INTEGER NOT NULL default '0' )"; -?> \ No newline at end of file +$sql_tables[] = "CREATE TABLE ".LIN_PREFIX."plugins_maps_image_geodata ( ". + "md5sum CHAR(32) PRIMARY KEY, " . + "gpsversionid VARCHAR(255) DEFAULT '', " . + "gpslatituderef VARCHAR(255) DEFAULT '', " . + "gpslatitude VARCHAR(255) DEFAULT '', " . + "gpslongituderef VARCHAR(255) DEFAULT '', " . + "gpslongitude VARCHAR(255) DEFAULT '', " . + "gpsaltituderef VARCHAR(255) DEFAULT '', " . + "gpsaltitude VARCHAR(255) DEFAULT '', " . + "gpstimestamp VARCHAR(255) DEFAULT '', " . + "gpssatellites VARCHAR(255) DEFAULT '', " . + "gpsstatus VARCHAR(255) DEFAULT '', " . + "gpsmeasuremode VARCHAR(255) DEFAULT '', " . + "gpsdop VARCHAR(255) DEFAULT '', " . + "gpsspeedref VARCHAR(255) DEFAULT '', " . + "gpsspeed VARCHAR(255) DEFAULT '', " . + "gpstrackref VARCHAR(255) DEFAULT '', " . + "gpstrack VARCHAR(255) DEFAULT '', " . + "gpsimgdirectionref VARCHAR(255) DEFAULT '', " . + "gpsimgdirection VARCHAR(255) DEFAULT '', " . + "gpsmapdatum VARCHAR(255) DEFAULT '', " . + "gpsdestlatituderef VARCHAR(255) DEFAULT '', " . + "gpsdestlatitude VARCHAR(255) DEFAULT '', " . + "gpsdestlongituderef VARCHAR(255) DEFAULT '', " . + "gpsdestlongitude VARCHAR(255) DEFAULT '', " . + "gpsdestbearingref VARCHAR(255) DEFAULT '', " . + "gpsdestbearing VARCHAR(255) DEFAULT '', " . + "gpsdestdistanceref VARCHAR(255) DEFAULT '', " . + "gpsdestdistance VARCHAR(255) DEFAULT '', " . + "gpsprocessingmethod VARCHAR(255) DEFAULT '', " . + "gpsareainformation VARCHAR(255) DEFAULT '', " . + "gpsdatestamp VARCHAR(255) DEFAULT '', " . + "gpsdatetime VARCHAR(255) DEFAULT '', " . + "gpsposition VARCHAR(255) DEFAULT '' )"; + +/* vi: set ts=4 sw=4 sts=4 */ +?> Modified: trunk/linpha2/templates/default/maps.head.php =================================================================== --- trunk/linpha2/templates/default/maps.head.php 2008-01-30 18:00:37 UTC (rev 4839) +++ trunk/linpha2/templates/default/maps.head.php 2008-01-30 20:24:33 UTC (rev 4840) @@ -1,47 +1,47 @@ -<script type="text/javascript" language="javascript" src="<?php echo LINPHA_CLIENT; ?>/lib/js/scriptaculous.js?load=effects,builder,dragdrop"></script> -<script language="JavaScript" type="text/javascript"> -var xmlUrl = '<?php echo linConvertAmp($linTpl->URL_base); ?>'; -var imageSrc = '<?php echo LINPHA_CLIENT.'/get_image.php?linId='; ?>'; -var thumbSrc = '<?php echo LINPHA_CLIENT.'/get_thumb.php?linId='; ?>'; -var maxImageWidth = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_width']; ?>; -var maxImageHeight = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; ?>; -var maxThumbSize = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_max']; ?>; -var displayThumbSize = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>; - -var linMapsDefaultMarkerZoom = <?php echo $GLOBALS['linpha']->sql->config->value['plugins_maps_defaultMarkerZoom']; ?>; -var linMapsMarkerThumbSize = <?php echo $GLOBALS['linpha']->sql->config->value['plugins_maps_markerThumbSize']; ?>; -</script> - -<?php -if( $GLOBALS['linpha']->sql->config->value['plugins_maps_mapType'] == 'google' ) -{ - ?> - <script type="text/javascript" src="http://www.google.com/jsapi?key=<?php echo $GLOBALS['linpha']->sql->config->value['plugins_maps_google_key']; ?>"></script> - <script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/class.googlemaps.js"></script> - <?php - - /** - * @todo - * google recommends using this kind of html header: - * <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> - * but without strict mode we need this css stuff to get polylines also working - * http://www.google.com/apis/maps/documentation/#XHTML_and_VML - ?> - <style type="text/css"> - v\:* { - behavior:url(#default#VML); - } - </style> - <?php - */ -} -elseif( $linTpl->output['mapType'] == 'xyz' ) -{ - ?> - <script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/class.xyz.js"></script> - <?php -} -?> -<script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/LinMaps.js"></script> +<script type="text/javascript" language="javascript" src="<?php echo LINPHA_CLIENT; ?>/lib/js/scriptaculous.js?load=effects,builder,dragdrop"></script> +<script language="JavaScript" type="text/javascript"> +var xmlUrl = '<?php echo linConvertAmp($linTpl->URL_base); ?>'; +var imageSrc = '<?php echo LINPHA_CLIENT.'/get_image.php?linId='; ?>'; +var thumbSrc = '<?php echo LINPHA_CLIENT.'/get_thumb.php?linId='; ?>'; +var maxImageWidth = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_width']; ?>; +var maxImageHeight = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; ?>; +var maxThumbSize = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_max']; ?>; +var displayThumbSize = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>; + +var linMapsDefaultMarkerZoom = <?php echo $GLOBALS['linpha']->sql->config->value['plugins_maps_defaultMarkerZoom']; ?>; +var linMapsMarkerThumbSize = <?php echo $GLOBALS['linpha']->sql->config->value['plugins_maps_markerThumbSize']; ?>; +</script> + +<?php +if( $GLOBALS['linpha']->sql->config->value['plugins_maps_mapType'] == '0' ) //0=google +{ + ?> + <script type="text/javascript" src="http://www.google.com/jsapi?key=<?php echo $GLOBALS['linpha']->sql->config->value['plugins_maps_google_key']; ?>"></script> + <script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/class.googlemaps.js"></script> + <?php + + /** + * @todo + * google recommends using this kind of html header: + * <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> + * but without strict mode we need this css stuff to get polylines also working + * http://www.google.com/apis/maps/documentation/#XHTML_and_VML + ?> + <style type="text/css"> + v\:* { + behavior:url(#default#VML); + } + </style> + <?php + */ +} +elseif( $linTpl->output['mapType'] == 'xyz' ) +{ + ?> + <script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/class.xyz.js"></script> + <?php +} +?> +<script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/LinMaps.js"></script> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |