Changeset 425813
- Timestamp:
- 08/19/2011 12:12:43 PM (15 years ago)
- Location:
- xml-google-maps/trunk
- Files:
-
- 2 edited
-
xmlgooglemaps_nggFunctions.php (modified) (2 diffs)
-
xmlgooglemaps_show.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
xml-google-maps/trunk/xmlgooglemaps_nggFunctions.php
r425780 r425813 6 6 7 7 function isNggInstalled() { 8 if (!function_exists('is_plugin_active')) { 9 require_once(ABSPATH . '/wp-admin/includes/plugin.php'); 10 } 8 11 return is_plugin_active("nextgen-gallery/nggallery.php"); 9 12 } … … 17 20 $ret = array(); 18 21 $pictures = array(); 19 foreach ($galleries as $gallery) { 20 $gallery = $wpdb->escape($gallery); 21 $pictures = array_merge($pictures, $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid=tt.galleryid WHERE t.gid = '$gallery' AND tt.exclude != 1")); 22 foreach ($galleries as $gallery) { 23 // Direct access to database by Patrick Matusz 24 // $gallery = $wpdb->escape($gallery); 25 // $pictures = array_merge($pictures, $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid=tt.galleryid WHERE t.gid = '$gallery' AND tt.exclude != 1")); 26 $pictures = array_merge($pictures, nggdb::get_gallery($gallery, false, false, true, $capture_date)); 22 27 } 23 28 24 29 foreach ($pics as $pic) { 25 $pic = $wpdb->escape($pic); 26 $pictures = array_merge($pictures , $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid=tt.galleryid WHERE tt.pid = '$pic' AND tt.exclude != 1")); 30 // Direct access to database by Patrick Matusz 31 // $pic = $wpdb->escape($pic); 32 // $pictures = array_merge($pictures , $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid=tt.galleryid WHERE tt.pid = '$pic' AND tt.exclude != 1")); 33 34 array_push($pictures, nggdb::find_image($pic)); 27 35 } 28 36 29 37 foreach ($pictures as $picrow) { 30 38 $item = array(); 31 $thumb = $this->get_thumbnail_addition($picrow->path); 32 $item["path"] = get_option('siteurl')."/".$picrow->path."/".$picrow->filename; 33 $item["abspath"] = WINABSPATH."/".$picrow->path."/".$picrow->filename; 34 $item["thumbpath"] = get_option('siteurl')."/".$picrow->path.$thumb.$picrow->filename; 35 $item["description"] = html_entity_decode(stripslashes($picrow->description)); 36 $item["title"] = html_entity_decode(stripslashes($picrow->alttext)); 37 $item["galtitle"] = $picrow->title; 38 $item["galdescription"] = html_entity_decode(stripslashes($picrow->galdesc)); 39 $exif = new xmlgooglemaps_exif($item["abspath"]); 40 39 // Direct access to database by Patrick Matusz 40 // $thumb = $this->get_thumbnail_addition($picrow->path); 41 // $item["path"] = get_option('siteurl')."/".$picrow->path."/".$picrow->filename; 42 // $item["abspath"] = WINABSPATH."/".$picrow->path."/".$picrow->filename; 43 // $item["thumbpath"] = get_option('siteurl')."/".$picrow->path.$thumb.$picrow->filename; 44 // $item["description"] = html_entity_decode(stripslashes($picrow->description)); 45 // $item["title"] = html_entity_decode(stripslashes($picrow->alttext)); 46 // $item["galtitle"] = $picrow->title; 47 // $item["galdescription"] = html_entity_decode(stripslashes($picrow->galdesc)); 48 // $exif = new xmlgooglemaps_exif($item["abspath"]); 49 $item["nggimage"] = $picrow; 50 $exif = new xmlgooglemaps_exif($item["nggimage"]->imagePath); 41 51 if ($exif->isValid) { 42 52 $item["gpslat"] = $exif->getGPSLatitude(); 43 53 $item["gpslon"] = $exif->getGPSLongitude(); 44 $item["creation"] = $exif->getCreationDateTime();45 54 if (($item["gpslat"] != 0) || ($item["gpslon"] != 0)) { 46 55 $ret[] = $item; -
xml-google-maps/trunk/xmlgooglemaps_show.php
r370347 r425813 86 86 $rows = $ngg->getNggPics($params->nggalGalleries,$params->nggalPics); 87 87 foreach ($rows as $row) { 88 $creationdate = date_i18n(get_option('date_format').' '.get_option('time_format'), $row["creation"]); 88 // Direct access to database by Patrick Matusz 89 // $creationdate = date_i18n(get_option('date_format').' '.get_option('time_format'), $row["creation"]); 90 $creationdate = date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime( $row["nggimage"]->imagedate )); 89 91 $lat = xmlgooglemaps_helper::latitude2Text($row["gpslat"]); 90 92 $lon = xmlgooglemaps_helper::longitude2Text($row["gpslon"]); 91 93 $html = $params->nggalMarkerTemplate; 92 $html = str_replace("%FULLPATH%",$row["path"],$html); 93 $html = str_replace("%THUMBPATH%",$row["thumbpath"], $html); 94 $html = str_replace("%TITLE%",$row["title"],$html); 95 $html = str_replace("%DESCRIPTION%", $row["description"], $html); 94 // Direct access to database by Patrick Matusz 95 // $html = str_replace("%FULLPATH%",$row["path"],$html); 96 // $html = str_replace("%THUMBPATH%",$row["thumbpath"], $html); 97 // $html = str_replace("%TITLE%",$row["title"],$html); 98 // $html = str_replace("%DESCRIPTION%", $row["description"], $html); 99 $html = str_replace("%FULLPATH%",$row["nggimage"]->imageURL,$html); 100 $html = str_replace("%THUMBPATH%",$row["nggimage"]->thumbURL, $html); 101 $html = str_replace("%TITLE%",$row["nggimage"]->altext,$html); 102 $html = str_replace("%DESCRIPTION%", $row["nggimage"]->description, $html); 96 103 $html = str_replace("%CREATIONDATE%", $creationdate, $html); 97 104 $html = str_replace("%LATITUDE%", $lat, $html); 98 105 $html = str_replace("%LONGITUDE%", $lon, $html); 99 $googlemaps->addMarker($row["gpslat"],$row["gpslon"],$html,"","",$row["thumbpath"],$row["thumbpath"],32,32,32,32,16,16); 106 // Direct access to database by Patrick Matusz 107 // $googlemaps->addMarker($row["gpslat"],$row["gpslon"],$html,"","",$row["thumbpath"],$row["thumbpath"],32,32,32,32,16,16); 108 $googlemaps->addMarker($row["gpslat"],$row["gpslon"],$html,"","",$row["nggimage"]->thumbURL,$row["nggimage"]->thumbURL,32,32,32,32,16,16); 100 109 } 101 110 } else {
Note: See TracChangeset
for help on using the changeset viewer.