Hi!
Diese Modifikation erweitert die Suchfelder der 4Images Galerie um die Exif einträge.
Diese Modifikation funktioniert nur wenn die Exifdaten in der Datenbank auch vorhanden sind,
wie das funktioniert wird in diesem Mod beschrieben:
http://www.4homepages.de/forum/index.php?topic=21017.0Suchfeld erweiterung um folgende werte: Hersteller;
Modell;
Aufnahme,Datum und Zeit;
ISO Wert;
Belichtungszeit;
Blende;
Brennweite (Objektiv);
Belichtungsabweichung;
Blendenöffnungswert;
Maximaler Blendenöffnungswert;
Belichtungsmessung;
Blitz;
Belichtungsprogramm;
Belichtungsmodus;
Weißabgleich;
GPS Breitengrad Referenz;
GPS Breitengrad;
GPS Längengrad Referenz";
GPS Längengrad;
GPS Höhe;
GPS Blickrichtung;
Zu Modifizierenden Dateien: 1.)SQL Table Word_Match;
2.)includes/constants.php
3.)includes/search_utils.php
4.)lang/main.php
5.)templates/dein_templates/search_form.html
1.)Erweitert die Felder SQL Datenbank Word_match,
Aternativ könnt ihr die Datei SQL_Exif_Word_match.php aus dem Anhang herrunterladen (THX an Nicky !),
und ins Hauptverzeichnis eurer Galerie kopieren und aufrufen,
vorher die Datenbank sichern!!! (Diese Datei wurde nicht von mir getestet)
ALTER TABLE 4images_wordmatch
ADD `Make_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `Model_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `DateTimeOriginal_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `ISOSpeedRatings_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `ExposureTime_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `FNumber_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `FocalLength_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `ExposureBiasValue_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `ApertureValue_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `MaxApertureValue_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `MeteringMode_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `Flash_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `ExposureProgram_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `ExposureMode_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `WhiteBalance_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `GPSLatitude_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `GPSLatitudeRef_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `GPSLongitude_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `GPSLongitudeRef_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `GPSAltitude_match` TINYINT(1) DEFAULT '0' NOT NULL,
ADD `GPSTrack_match` TINYINT(1) DEFAULT '0' NOT NULL;
2.)sucht in includes/constants.php:
define('MIN_SEARCH_KEYWORD_LENGTH', 3);
define('MAX_SEARCH_KEYWORD_LENGTH', 25);
und ersetzt es mit:
define('MIN_SEARCH_KEYWORD_LENGTH', 1);
define('MAX_SEARCH_KEYWORD_LENGTH', 100);
3.)sucht in der includes/search_utils.php
$search_match_fields = array(
"image_name" => "name_match",
"image_description" => "desc_match",
"image_keywords" => "keys_match"
und ersetzt es mit:
$search_match_fields = array(
"image_name" => "name_match",
"image_description" => "desc_match",
"image_keywords" => "keys_match",
"image_Make" => "Make_match",
"image_Model" => "Model_match",
"image_DateTimeOriginal" => "DateTimeOriginal_match",
"image_ISOSpeedRatings" => "ISOSpeedRatings_match",
"image_ExposureTime" => "ExposureTime_match",
"image_FNumber" => "FNumber_match",
"image_FocalLength" => "FocalLength_match",
"image_ExposureBiasValue" => "ExposureBiasValue_match",
"image_ApertureValue" => "ApertureValue_match",
"image_MaxApertureValue" => "MaxApertureValue_match",
"image_MeteringMode" => "MeteringMode_match",
"image_Flash" => "Flash_match",
"image_ExposureProgram" => "ExposureProgram_match",
"image_ExposureMode" => "ExposureMode_match",
"image_WhiteBalance" => "WhiteBalance_match",
"image_GPSLatitude" => "GPSLatitude_match",
"image_GPSLatitudeRef" => "GPSLatitudeRef_match",
"image_GPSLongitude" => "GPSLongitude_match",
"image_GPSLongitudeRef" => "GPSLongitudeRef_match",
"image_GPSAltitude" => "GPSAltitude_match",
"image_GPSTrack" => "GPSTrack_match"
4.)sucht in der lang/main.php:
$lang['or'] = "ODER";
und fügt danach ein:
$lang['image_Make_only'] = "Hersteller";
$lang['image_Model_only'] = "Modell";
$lang['image_DateTimeOriginal_only'] = "Aufnahme,Datum und Zeit";
$lang['image_ISOSpeedRatings_only'] = "ISO Wert";
$lang['image_ExposureTime_only'] = "Belichtungszeit";
$lang['image_FNumber_only'] = "Blende";
$lang['image_FocalLength_only'] = "Brennweite (Objektiv)";
$lang['image_ExposureBiasValue_only'] = "Belichtungsabweichung";
$lang['image_ApertureValue_only'] = "Blendenöffnungswert";
$lang['image_MaxApertureValue_only'] = "Max. Blendenöffnungswert";
$lang['image_MeteringMode_only'] = "Belichtungsmessung";
$lang['image_Flash_only'] = "Blitz";
$lang['image_ExposureProgram_only'] = "Belichtungsprogramm";
$lang['image_ExposureMode_only'] = "Belichtungsmodus";
$lang['image_WhiteBalance_only'] = "Weißabgleich";
$lang['image_GPSLatitudeRef_only'] = "GPS Breitengrad Referenz";
$lang['image_GPSLatitude_only'] = "GPS Breitengrad";
$lang['image_GPSLongitudeRef_only'] = "GPS Längengrad Referenz";
$lang['image_GPSLongitude_only'] = "GPS Längengrad";
$lang['image_GPSAltitude_only'] = "GPS Höhe";
$lang['image_GPSTrack_only'] = "GPS Blickrichtung";
5.)sucht in templates/dein_templates/search_form.html
<td nowrap="nowrap"><input type="radio" name="search_fields" value="all" checked="checked" /> {lang_all_fields}</td>
<td nowrap="nowrap"> </td>
<td nowrap="nowrap"><input type="radio" name="search_fields" value="image_name" /> {lang_name_only}</td>
</tr>
<tr>
<td nowrap="nowrap"><input type="radio" name="search_fields" value="image_description" /> {lang_description_only}</td>
<td nowrap="nowrap"> </td>
<td nowrap="nowrap"><input type="radio" name="search_fields" value="image_keywords" /> {lang_keywords_only}</td>
und ersetzt es mit:
(Ihr könnt den Code natürlich auch an jeder anderen Stelle in eurer Datei hinein kopieren.
Als Beispiel habe ich die default templates/ search_form.html genommen)
<select name="search_fields" size="1">
<optgroup label="Allgemein">
<option value="all">{lang_all_fields}</option>
<option value="image_name">{lang_name_only}</option>
<option value="image_description">{lang_description_only}</option>
<option value="image_keywords">{lang_keywords_only}</option>
</optgroup>
<optgroup label="Exif">
<option value="image_Make">{lang_image_Make_only}</option>
<option value="image_Model">{lang_image_Model_only}</option>
<option value="image_DateTimeOriginal">{lang_image_DateTimeOriginal_only}</option>
<option value="image_ISOSpeedRatings">{lang_image_ISOSpeedRatings_only}</option>
<option value="image_ExposureTime">{lang_image_ExposureTime_only}</option>
<option value="image_FNumber">{lang_image_FNumber_only}</option>
<option value="image_FocalLength">{lang_image_FocalLength_only}</option>
<option value="image_ExposureBiasValue">{lang_image_ExposureBiasValue_only}</option>
<option value="image_ApertureValue">{lang_image_ApertureValue_only}</option>
<option value="image_MaxApertureValue">{lang_image_MaxApertureValue_only}</option>
<option value="image_MeteringMode">{lang_image_MeteringMode_only}</option>
<option value="image_Flash">{lang_image_Flash_only}</option>
<option value="image_ExposureProgram">{lang_image_ExposureProgram_only}</option>
<option value="image_ExposureMode">{lang_image_ExposureMode_only}</option>
<option value="image_WhiteBalance">{lang_image_WhiteBalance_only}</option>
<option value="image_GPSLatitude">{lang_image_GPSLatitude_only}</option>
<option value="image_GPSLatitudeRef">{lang_image_GPSLatitudeRef_only}</option>
<option value="image_GPSLongitude">{lang_image_GPSLongitude_only}</option>
<option value="image_GPSLongitudeRef">{lang_image_GPSLongitudeRef_only}</option>
<option value="image_GPSAltitude">{lang_image_GPSAltitude_only}</option>
<option value="image_GPSTrack">{lang_image_GPSTrack_only}</option>
</optgroup>
</select>
6.)Zuletzt kopiert die im Anhang rebuild_search.php in euer admin/plugins verzeichnis und führt sie im ACP aus.
Danach könnt ihr in eurer templates Suche die Bilder nach den einzelnen Exifdaten durchsuchen.
mfg Andi