Plugin Directory

Changeset 425813


Ignore:
Timestamp:
08/19/2011 12:12:43 PM (15 years ago)
Author:
dschuesae
Message:
  • Unterstützung NGG Funktionen statt Direktzugriff auf Datenbank
  • Multiuser Zugriff noch verbessert!
Location:
xml-google-maps/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • xml-google-maps/trunk/xmlgooglemaps_nggFunctions.php

    r425780 r425813  
    66
    77    function isNggInstalled() {
     8        if (!function_exists('is_plugin_active')) {
     9            require_once(ABSPATH . '/wp-admin/includes/plugin.php');
     10        }       
    811        return is_plugin_active("nextgen-gallery/nggallery.php");
    912    }
     
    1720        $ret = array();
    1821        $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));
    2227        }
    2328
    2429        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));
    2735        }
    2836       
    2937        foreach ($pictures as $picrow) {
    3038            $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);           
    4151            if ($exif->isValid) {               
    4252                $item["gpslat"] = $exif->getGPSLatitude();
    4353                $item["gpslon"] = $exif->getGPSLongitude();
    44                 $item["creation"] = $exif->getCreationDateTime();
    4554                if (($item["gpslat"] != 0) || ($item["gpslon"] != 0)) {
    4655                    $ret[] = $item;
  • xml-google-maps/trunk/xmlgooglemaps_show.php

    r370347 r425813  
    8686                $rows = $ngg->getNggPics($params->nggalGalleries,$params->nggalPics);
    8787                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 ));
    8991                    $lat = xmlgooglemaps_helper::latitude2Text($row["gpslat"]);
    9092                    $lon = xmlgooglemaps_helper::longitude2Text($row["gpslon"]);
    9193                    $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);
    96103                    $html = str_replace("%CREATIONDATE%", $creationdate, $html);
    97104                    $html = str_replace("%LATITUDE%", $lat, $html);
    98105                    $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);
    100109                }
    101110            } else {
Note: See TracChangeset for help on using the changeset viewer.