4images Help / Hilfe > News & Announcements

4images 1.7.8

(1/2) > >>

kai:
:flag-de: Die neue Version 4images 1.7.8 wurde veröffentlicht. Das Release bringt neue Funktionen sowie Detailverbesserungen, behebt einge Fehler und bietet weiter verbesserte PHP 5.3 Kompatibilität.
Wir empfehlen allen Nutzern ein Update auf die aktuelle Version. Alle Änderungen und Features sind in der Datei "docs/Changelog.txt" aufgelistet.

:flag-en: The new version 4images 1.7.8 has been released. This release comes with lots of improvements and new features, bugfixes and minor changes.
We recommend all users to update to the current version. All changes and features are listed in "docs/Changelog.txt".

Download:
http://www.4homepages.de/4images/download.php

Demo:
http://www.4homepages.de/4images/demo.php

Für Feedback zur 4images 1.7.8 Version bitte diesen Thread nutzen.

Please use this thread for feedback about the 4images 1.7.8 version.

kai:
=========================================================
ChangeLog Version 1.7.8
=========================================================
- PHP 5.3 compatibility fixes
- Improved security level of captcha handling
- Removed error reporting overriding in search.php
- Fixed typo in example of DB fields definitions
- Fixed German translation typos and misspellings across language files
- Fixed EXIF exposure time issue
- Fixed use of double quoted string in configuration file (http://www.4homepages.de/forum/index.php?topic=25792.0)
- Fixed an issue when max height has no affect on image resize (http://www.4homepages.de/forum/index.php?topic=7058.0)
- Fixed showing username containing curly braces in who is online box
- Fixed editing of templates into subdirectories from ACP (http://www.4homepages.de/forum/index.php?topic=25403.0)
- Fixed an issue when .zip files can be corrupt on download (http://www.4homepages.de/forum/index.php?topic=25893.0)
- Fixed an issue when some templating feature can not work properly if server auto prepends content prior output
- Fixed an issue when due missing MIME type thumbnail upload may fail (http://www.4homepages.de/forum/index.php?topic=27012.0)
- Fixed an issue when trying to edit media/* templates (http://www.4homepages.de/forum/index.php?topic=27669.0)
- Implemented population of alt and title attributes for thumbnail images with image name
- Extended number of possible template variables for media/* templates (http://www.4homepages.de/forum/index.php?topic=26279.0)
- Implemented comma separated keywords and plugin for migration from white-space separated keywords
- Enhanced "Check new images" feature in ACP with V@no's mod (http://www.4homepages.de/forum/index.php?topic=4754.0)
- Added plugin "Check files" (http://www.4homepages.de/forum/index.php?topic=6760.0)
- Fixed a visual glitch when adding multiple users from ACP
- Enhanced posting comments. After a comment posted page refresh will not attempt re-post that comment again.

Neue Dateien / New Files:
---------------------------------------
- admin/plugins/files_check.php
- admin/plugins/migrate_keywords.php


Geänderte Dateien / Changed Files:
---------------------------------------
config.new.php
categories.php
details.php
download.php
global.php
index.php
install.php
member.php
login.php
logout.php
postcards.php
register.php
rss.php
search.php
top.php
admin/admin_functions.php
admin/admin_global.php
admin/backup.php
admin/checkimages.php
admin/home.php
admin/images.php
admin/index.php
admin/resizer.php
admin/templates.php
admin/thumbnailer.php
admin/users.php
admin/validateimages.php
admin/plugins/clear_cache.php
includes/captcha_utils.php
includes/db_field_definitions.php
includes/db_utils.php
includes/email.php
includes/functions.php
includes/image_utils.php
includes/page_footer.php
includes/page_header.php
includes/paging.php
includes/upload.php
includes/search_utils.php
includes/sessions.php
lang/deutsch/admin.php
lang/deutsch/install.php
lang/deutsch/main.php
lang/english/admin.php
lang/english/install.php
lang/english/main.php
lang/spanish/install.php
lang/spanish/main.php


Sprache / Language:
---------------------------------------
- admin.php
    - added new section for "check new images"

- install.php
    - added new variable for timezone selector $lang['timezone_select']

=========================================================

The changelog for all versions can be found here:
http://www.4homepages.de/forum/index.php?topic=15186.0

kai:
Here is a detailed list of what has been changed in the php files from 4images 1.7.7 -> 1.7.8.
(The best way for yourself to compare the code of files is to use Winmerge.)


Language files:


lang/deutsch/main.php

find:

--- Code: ---$lang['send_postcard_success'] = "Viele Dank! Ihre eCard wurde erfolgreich versendet.";
--- End code ---

replace with:

--- Code: ---$lang['send_postcard_success'] = "Vielen Dank! Ihre eCard wurde erfolgreich versendet.";
--- End code ---

find:

--- Code: ---$lang['invalid_activationkey'] = "Diese Account ist nicht mehr aktiv. Bitte registrieren Sie sich erneut.</>";
--- End code ---

replace with:

--- Code: ---$lang['invalid_activationkey'] = "Dieser Account ist nicht mehr aktiv. Bitte registrieren Sie sich erneut.";
--- End code ---

find:

--- Code: ---$lang['edit_profile_msg'] = "Hier können Sie Ihr persönliches Profil und Ihre Passwort ändern.";
--- End code ---

replace with:

--- Code: ---$lang['edit_profile_msg'] = "Hier können Sie Ihr persönliches Profil und Ihr Passwort ändern.";
--- End code ---

find:

--- Code: ---$lang['agreement_terms'] = "
            Dieses Archiv nutzt ein Kommentarsystem mit dem die Besucher Kommentare
            zu den Eintr&auml;gen abgeben k&ouml;nnen. Obwohl die Administratoren
            dieser Seite versuchen, alle unerw&uuml;nschten Beitr&auml;ge von
            diesem System fernzuhalten, ist es f&uuml;r uns unm&ouml;glich, alle
            Beitr&auml;ge zu &uuml;berpr&uuml;fen. Alle Beitr&auml;ge dr&uuml;cken
            die Ansichten des Autors aus und die Eigent&uuml;mer dieser Website
            k&ouml;nnen nicht f&uuml;r den Inhalt jedes Beitrags verantwortlich
            gemacht werden.
            <br /><br />
            Sie verpflichten Sich, keine beleidigenden, obsz&ouml;nen, vulg&auml;ren,
            verleumdenden, gewaltverherrlichenden oder aus anderen Gr&uuml;nden
            strafbaren Inhalte zu ver&ouml;ffentlichen. Sie r&auml;umen den Betreibern
            und Administratoren dieser Website das Recht ein, Beitr&auml;ge nach
            eigenem Ermessen zu entfernen oder zu bearbeiten. Sie stimmen ausserdem
            zu, dass die im Rahmen der Registrierung erhobenen Daten in einer
            Datenbank gespeichert werden.
            <br /><br />
            Dieses System verwendet Cookies, um Informationen auf Ihrem Computer
            zu speichern. Diese Cookies enthalten keine persönlichen Informationen,
            sondern dienen ausschlie&szlig;lich Ihrem Komfort.
            <br /><br />
            Durch das Abschlie&szlig;en der Registrierung stimmen Sie diesen Nutzungsbedingungen zu.";

--- End code ---

replace with:

--- Code: ---$lang['agreement_terms'] = "
            Dieses Archiv nutzt ein Kommentarsystem mit dem die Besucher Kommentare
            zu den Eintr&auml;gen abgeben k&ouml;nnen. Obwohl die Administratoren
            dieser Seite versuchen, alle unerw&uuml;nschten Beitr&auml;ge von
            diesem System fernzuhalten, ist es f&uuml;r uns unm&ouml;glich, alle
            Beitr&auml;ge zu &uuml;berpr&uuml;fen. Alle Beitr&auml;ge dr&uuml;cken
            die Ansichten des Autors aus und die Eigent&uuml;mer dieser Website
            k&ouml;nnen nicht f&uuml;r den Inhalt jedes Beitrags verantwortlich
            gemacht werden.
            <br /><br />
            Sie verpflichten sich, keine beleidigenden, obsz&ouml;nen, vulg&auml;ren,
            verleumdenden, gewaltverherrlichenden oder aus anderen Gr&uuml;nden
            strafbaren Inhalte zu ver&ouml;ffentlichen. Sie r&auml;umen den Betreibern
            und Administratoren dieser Website das Recht ein, Beitr&auml;ge nach
            eigenem Ermessen zu entfernen oder zu bearbeiten. Sie stimmen ausserdem
            zu, dass die im Rahmen der Registrierung erhobenen Daten in einer
            Datenbank gespeichert werden.
            <br /><br />
            Dieses System verwendet Cookies, um Informationen auf Ihrem Computer
            zu speichern. Diese Cookies enthalten keine persönlichen Informationen,
            sondern dienen ausschlie&szlig;lich Ihrem Komfort.
            <br /><br />
            Durch das Abschlie&szlig;en der Registrierung stimmen Sie diesen Nutzungsbedingungen zu.";

--- End code ---

find:

--- Code: ---$lang['comment_edit_error'] = "Fehler beim Bearbeiten der Kommentar";
--- End code ---

replace with:

--- Code: ---$lang['comment_edit_error'] = "Fehler beim Bearbeiten des Kommentars";
--- End code ---

find:

--- Code: ---$lang['comment_delete_error'] = "Fehler beim Löschen der Kommentar";
--- End code ---

replace with:

--- Code: ---$lang['comment_delete_error'] = "Fehler beim Löschen des Kommentars";
--- End code ---

find:

--- Code: ---$lang['keywords_ext'] = "Schlüsselw&ouml;rter:<br /><span class=\"smalltext\">Schlüsselw&ouml;rter durch Leerzeichen getrennt eingeben.</span>";
--- End code ---

replace with:

--- Code: ---$lang['keywords_ext'] = "Schlüsselw&ouml;rter:<br /><span class=\"smalltext\">Schlüsselw&ouml;rter durch Komma getrennt eingeben.</span>";
--- End code ---

find:

--- Code: ---$lang['lightbox_delete_success'] = "Leuchkasten erfolgreich gelöscht.";
--- End code ---

replace with:

--- Code: ---$lang['lightbox_delete_success'] = "Leuchtkasten erfolgreich gelöscht.";
--- End code ---

find:

--- Code: ---$lang['delete_lightbox_confirm'] = "Wollen Sie Ihren Leuchkasten wirklich loeschen?";
--- End code ---

replace with:

--- Code: ---$lang['delete_lightbox_confirm'] = "Wollen Sie Ihren Leuchtkasten wirklich loeschen?";
--- End code ---


lang/deutsch/install.php

find:

--- Code: ---?>
--- End code ---

insert before:

--- Code: ---$lang['timezone_select'] = "Bitte wählen Sie Ihre Zeitzone";

--- End code ---


lang/deutsch/admin.php

find:

--- Code: ---$lang['resizing_image_error'] = "Fehler beim Konvertieren der Bild-Datei!";
--- End code ---

insert after:

--- Code: ---//-----------------------------------------------------
//--- Check New Images --------------------------------
//-----------------------------------------------------
$lang['add_as_user'] = "Hinzufügen als Benutzer:";
$lang['cni_max_dim'] = "Maximale Größe der Vorschaubilder:<br /><span class=\"smalltext\">Bei \"Ausführlicher Anzeige\", wird das Bild auf Ihrem Bildschirm auf diesen Wert verkleinert.</span>";
$lang['cni_iptc_name'] = "Verwende Dateiname aus IPTC Daten:";
$lang['cni_iptc_description'] = "Verwenden Beschreibung aus IPTC Daten:";
$lang['cni_iptc_keywords'] = "Verwenden Schlüsselwörter aus IPTC Daten:";
$lang['cni_iptc_date'] = "Verwende Datum aus IPTC Daten:";
$lang['cni_check_subcat'] = "Unterkategorien durchsuchen:";
$lang['cni_auto_resizer'] = "Automatisch verkleinern:";
$lang['cni_save_orig'] = "Originalbild speichern:";
$lang['cni_big_folder'] = "Ordnername in welchen das Originalbild gespeicher werden soll:";
$lang['cni_add_ann'] = "Wasserzeichen hinzufügen:";
$lang['cni_auto_thumbnailer'] = "Thumbnails automatisch erstellen:";
$lang['cni_foundin'] = "Gefunden in";
$lang['cni_root_folder'] = "Stammverzeichniss";
$lang['on'] = "Ein";
$lang['off'] = "Aus";
$lang['cni_file_rename_success'] = "Datei wurde umbenannt von <b>{from}</b> zu <b>{to}</b>";
$lang['cni_file_rename_error'] = "<u>Fehler</u> bei Umbenennen der Datei von <b>{from}</b> zu <b>{to}</b>";
$lang['cni_media_file_rename'] = "Media Dateiname wurde umbenannt von <b>{from}</b> zu <b>{to}</b>";
$lang['cni_media_file_rename_error'] = "<u>Fehler</u> bei Umbenennen der Media Datei von <b>{from}</b> zu <b>{to}</b>";
$lang['cni_thumb_file_rename'] = "Thumbnail Dateiname wurde umbenannt von <b>{from}</b> zu <b>{to}</b>";
$lang['cni_thumb_file_rename_error'] = "<u>Fehler</u> bei Umbenennen der Thumbnail Datei von <b>{from}</b> zu <b>{to}</b>";
$lang['cni_copy_success'] = "Kopiere Original Datei in <b>{name}</b> Ordner.";
$lang['cni_copy_thumb_success'] = "Kopiere Thumbnail in <b>{name}</b> Ordner.";
$lang['cni_backup_success'] = "Kopiere Original Datei in <b>{name}</b> Ordner.";
$lang['cni_backup_error'] = "<u>Fehler</u> bei kopieren der Original Datei in <b>{name}</b> Ordner.";
$lang['cni_annotation_success'] = "Wasserzeichen hinzufügen in <b>{name}</b> Datei.";
$lang['cni_annotation_error'] = "<u>Fehler</u> bei hinzufügen des Wasserzeichens in <b>{name}</b> Datei.";
$lang['cni_create_folder_success'] = "Erstelle <b>{name}/</b> Ordner.";
$lang['cni_create_folder_error'] = "<u>Fehler</u> bei erstellen des <b>{name}/</b> Ordner.";
$lang['cni_resized_success'] = "Bildgröße erfolgreich geändert.";
$lang['cni_resized_error'] = "<u>Fehler</u> bei Änderung der Bildgröße";
$lang['cni_thumbnail_success'] = "Thumbnail erfolgreich erstellt.";
$lang['cni_thumbnail_error'] = "<u>Fehler</u> Thumbnail konnten nicht erstellt werden!";
$lang['cni_error'] = "<u>Fehler</u>";
$lang['cni_working'] = "Datei <b>{file}</b> wurde Bearbeitet";

--- End code ---


lang/spanish/main.php

find:

--- Code: ---$lang['post_comment'] = "Agregar comentario";
--- End code ---

insert after:

--- Code: ---$lang['comment_success'] = "Tu comentario se ha guardado";
--- End code ---


lang/spanish/install.php

find:

--- Code: ---?>
--- End code ---

insert before:

--- Code: ---$lang['timezone_select'] = "Por favor seleccione su zona horaria";
--- End code ---


lang/english/main.php

find:

--- Code: ---$lang['keywords_ext'] = "Keywords:<br /><span class=\"smalltext\">Keywords must be seperated by spaces.</span>";
--- End code ---

replace with:

--- Code: ---$lang['keywords_ext'] = "Keywords:<br /><span class=\"smalltext\">Keywords must be separated by commas or newlines.</span>";
--- End code ---


lang/english/install.php

find:

--- Code: ---?>
--- End code ---

insert before:

--- Code: ---$lang['timezone_select'] = "Please select your timezone";

--- End code ---


lang/english/admin.php

find:

--- Code: ---$lang['field_keywords_ext'] = "Keywords<br /><span class=\"smalltext\">Keywords must be seperated by spaces.</span>";
--- End code ---

replace with:

--- Code: ---$lang['field_keywords_ext'] = "Keywords<br /><span class=\"smalltext\">Keywords must be separated by commas or newlines.</span>";
--- End code ---

find:

--- Code: ---$lang['resizing_image_error'] = "Error converting image file!";
--- End code ---

insert after:

--- Code: ---//-----------------------------------------------------
//--- Check New Images --------------------------------
//-----------------------------------------------------

$lang['add_as_user'] = 'Add as user';
$lang['cni_max_dim'] = "Max dimensions for images preview<br /><span class=\"smalltext\">When checked \"Detailed\", image will be resized on your screen acording this value.</span>";
$lang['cni_iptc_name'] = "Use name from IPTC value";
$lang['cni_iptc_description'] = "Use description from IPTC value";
$lang['cni_iptc_keywords'] = "Use keywords from IPTC value";
$lang['cni_iptc_date'] = "Use date from IPTC value";
$lang['cni_check_subcat'] = "Check subcategories";

$lang['cni_auto_resizer'] = "Auto resizer";
$lang['cni_save_orig'] = "Save original size images";
$lang['cni_big_folder'] = "Folder name where to save original size images (big)";
$lang['cni_add_ann'] = "Add annotation (watermark)";
$lang['cni_auto_thumbnailer'] = "Auto thumbnailer";
$lang['cni_foundin'] = "Found in";
$lang['cni_root_folder'] = "root folder";
$lang['on'] = "On";
$lang['off'] = "Off";

$lang['cni_file_rename_success'] = "File renamed from <b>{from}</b> to <b>{to}</b>";
$lang['cni_file_rename_error'] = "<u>Error</u> renaming media file from <b>{from}</b> to <b>{to}</b>";
$lang['cni_thumbnail_rename_success'] = "Thumbnail file renamed from <b>{from}</b> to <b>{to}</b>";
$lang['cni_thumbnail_rename_error'] = "<u>Error</u> renaming thumbnail file from <b>{from}</b> to <b>{to}</b>";
$lang['cni_copy_success'] = "Copied file into <b>{name}</b> folder.";
$lang['cni_copy_error'] = "<u>Error</u> copying file into <b>{name}</b> folder.";
$lang['cni_copy_thumb_success'] = "Copied thumbnail into <b>{name}</b> folder.";
$lang['cni_copy_thumb_error'] = "<u>Error</u> copying thumbnail into <b>{name}</b> folder.";
$lang['cni_backup_success'] = "Backup original file into <b>{name}</b> folder.";
$lang['cni_backup_error'] = "<u>Error</u> copying original file into <b>{name}</b> folder.";
$lang['cni_annotation_success'] = "Added annotation in <b>{name}</b> file.";
$lang['cni_annotation_error'] = "<u>Error</u> adding annotation in <b>{name}</b> file.";
$lang['cni_create_folder_success'] = "Created <b>{name}/</b> folder.";
$lang['cni_create_folder_error'] = "<u>Error</u> creating <b>{name}/</b> folder.";
$lang['cni_resized_success'] = "Image resized.";
$lang['cni_resized_error'] = "<u>Error</u> resizing image.";
$lang['cni_thumbnail_success'] = "Thumbnail created.";
$lang['cni_thumbnail_error'] = "<u>Error</u> creating thumbnail.";
$lang['cni_error'] = "<u>Error</u> adding image.";
$lang['cni_working'] = "Working on <b>{file}</b> file";

$lang['file_not_found'] = "File not found";

--- End code ---

kai:
Here is a detailed list of what has been changed in the php files from 4images 1.7.7 -> 1.7.8.
(The best way for yourself to compare the code of files is to use Winmerge.)


Admin files

admin/plugins/clear_cache.php

find:

--- Code: ---$root_path = (!eregi("\/plugins\/", $_SERVER['PHP_SELF'])) ? "./../" : "./../../";
--- End code ---

replace with:

--- Code: ---$root_path = (false === stristr($_SERVER['PHP_SELF'], "/plugins/")) ? "./../" : "./../../";
--- End code ---


admin/templates.php

find:

--- Code: ---$template_file_name = basename($template_file_name);
--- End code ---

replace with:

--- Code: ---$template_file_name = (strpos($template_file_name, 'media/') !== false ? 'media/' : '') . basename($template_file_name);
--- End code ---


admin/users.php

find:

--- Code: ---for ($i = 1; $i <= $num_newusers; $i++) {
--- End code ---

insert after:

--- Code: ---$log = array();
--- End code ---


admin/checkimages.php

Completely rewritten, better replace whole file.


admin/backup.php

find:

--- Code: ---if (eregi("\.gz", $file)) {
--- End code ---

replace with:

--- Code: ---if (preg_match("/\.gz$/i", $file)) {
--- End code ---

find:

--- Code: ---if (eregi("\.gz", $file)) {
--- End code ---

replace with:

--- Code: ---if (preg_match("/\.gz$/i", $file)) {
--- End code ---

find:

--- Code: ---if (is_file(ROOT_PATH.DATABASE_DIR."/".$file) && $file != "." && $file != ".." && eregi("\.sql",$file)) {
--- End code ---

replace with:

--- Code: ---if (is_file(ROOT_PATH.DATABASE_DIR."/".$file) && $file != "." && $file != ".." && preg_match("/\.sql$/i",$file)) {
--- End code ---


admin/images.php

find:

--- Code: ---$image_keywords = preg_replace("/[\n\r]/is", " ", $image_keywords);
$image_keywords = str_replace(","," ",$image_keywords);
$image_keywords = ereg_replace("( ){2,}", " ", $image_keywords);

--- End code ---

replace with:

--- Code: ---$image_keywords = preg_replace("/[\n\r]/is", ",", $image_keywords);
$image_keywords_arr = explode(',', $image_keywords);
array_walk($image_keywords_arr, 'trim_value');
$image_keywords = implode(',', array_unique(array_filter($image_keywords_arr)));

--- End code ---

find:

--- Code: ---$image_keywords = preg_replace("/[\n\r]/is", " ", $image_keywords);
$image_keywords = str_replace(","," ",$image_keywords);
$image_keywords = ereg_replace("( ){2,}", " ", $image_keywords);

--- End code ---

replace with:

--- Code: ---$image_keywords = preg_replace("/[\n\r]/is", ",", $image_keywords);
$image_keywords_arr = explode(',', $image_keywords);
array_walk($image_keywords_arr, 'trim_value');
$image_keywords = implode(',', array_unique(array_filter($image_keywords_arr)));

--- End code ---


admin/index.php

find:

--- Code: ---if (eregi("^\.{1,2}$", $file) || !eregi("\.php$", $file)) {
--- End code ---

replace with:

--- Code: ---if (get_file_extension($file) != "php") {
--- End code ---

find:

--- Code: ---if (preg_match("/PLUGIN_TITLE:([a-zäöüß0-9\-_ ]+)/i", $plugin_file[0], $regs)) {
--- End code ---

replace with:

--- Code: ---if (preg_match("/PLUGIN_TITLE:(.+)/", $plugin_file[0], $regs)) {
--- End code ---


admin/admin_global.php

find:

--- Code: ---if (isset($PHP_SELF) && eregi("\/plugins\/", $PHP_SELF)) {
--- End code ---

replace with:

--- Code: ---if (isset($PHP_SELF) && preg_match("/\/plugins\//i", $PHP_SELF)) {
--- End code ---


admin/thumbnailer.php

find:

--- Code: ---echo "<td colspan=\"2\"><p><input type=\"text\" size=\"$textinput_size\" name=\"dimension\" value=\"100\"></p></td>\n</tr>\n";
--- End code ---

replace with:

--- Code: ---echo "<td colspan=\"2\"><p><input type=\"text\" size=\"" . $textinput_size . "\" name=\"dimension\" value=\"" . $config['auto_thumbnail_dimension'] . "\"></p></td>\n</tr>\n";
--- End code ---

find:

--- Code: ---echo "<td colspan=\"2\"><p><input type=\"text\" size=\"$textinput_size\" name=\"quality\" value=\"75\"></p></td>\n</tr>\n";
--- End code ---

replace with:

--- Code: ---echo "<td colspan=\"2\"><p><input type=\"text\" size=\"" . $textinput_size . "\" name=\"quality\" value=\"" . $config['auto_thumbnail_quality'] . "\"></p></td>\n</tr>\n";
--- End code ---


admin/validateimages.php

find:

--- Code: ---  $image_keywords = preg_replace("/[\n\r]/is", " ", $image_keywords);
  $image_keywords = str_replace(","," ",$image_keywords);
  $image_keywords = ereg_replace("( ){2,}", " ", $image_keywords);

--- End code ---

replace with:

--- Code: ---  $image_keywords = preg_replace("/[\n\r]/is", ",", $image_keywords);
  $image_keywords_arr = explode(',', $image_keywords);
  array_walk($image_keywords_arr, 'trim_value');
  $image_keywords = implode(',', array_unique(array_filter($image_keywords_arr)));

--- End code ---


admin/admin_functions.php

find:

--- Code: ---if (is_array($iptc)) {
--- End code ---

insert after:

--- Code: ---$separator = "";
--- End code ---

find:

--- Code: ---$value = $iptc['2#120'][0];
--- End code ---

replace with:

--- Code: ---$value = trim($iptc['2#120'][0]);
--- End code ---

find:

--- Code: ---$value .= (($value != "" ) ? " " : "").$val;
--- End code ---

replace with:

--- Code: ---$value .= (($value != "" ) ? "," : "").trim($val);
--- End code ---

find:

--- Code: ---          break;

        case "object_name":

--- End code ---

insert before:

--- Code: ---$separator = ",";
--- End code ---

find:

--- Code: ---$value = $iptc['2#005'][0];
--- End code ---

replace with:

--- Code: ---$value = trim($iptc['2#005'][0]);
--- End code ---

find:

--- Code: ---$html = "\n<input type=\"hidden\" name=\"hidden_".$input."\" value=\"".trim($value)." \">\n";
--- End code ---

replace with:

--- Code: ---$html = "\n<input type=\"hidden\" name=\"hidden_".$input."\" value=\"".$value." \">\n";
--- End code ---

find:

--- Code: ---$html .= "this.document.writeln('<br /><br /><input type=\"button\" value=\"IPTC ".str_replace(":", "", $lang['iptc_'.$iptc_tag])." &raquo;\" onClick=\"this.form.".$input.".value=".(($add_text) ? "this.form.".$input.".value + " : "")."this.form.hidden_".$input.".value\">');";
--- End code ---

replace with:

--- Code: ---$html .= "this.document.writeln('<br /><br /><input type=\"button\" value=\"IPTC ".str_replace(":", "", $lang['iptc_'.$iptc_tag])." &raquo;\" onClick=\"this.form.".$input.".value=".(($add_text) ? "this.form.".$input.".value + ".($separator ? "(this.form.".$input.".value.replace(/^\s+/, \'\').replace(/\s+$/, \'\') == \'\' ? \'\' : \'".$separator."\')+" : "") : "")."this.form.hidden_".$input.".value\">');";
--- End code ---

find:

--- Code: ---function copy_media($image_media_file, $from_cat = 0, $to_cat = 0) {
  global $config;

  if (is_remote($image_media_file)) {
    return $image_media_file;
  }
  $ok = 0;

  $image_src = ($from_cat != -1) ? MEDIA_PATH.(($from_cat != 0) ? "/".$from_cat : "") : MEDIA_TEMP_PATH;
  $image_dest = ($to_cat != -1) ? MEDIA_PATH.(($to_cat != 0) ? "/".$to_cat : "") : MEDIA_TEMP_PATH;
  $image_src_file = $image_src."/".$image_media_file;

  switch ($config['upload_mode']) {
  case 1: // overwrite mode
    if (file_exists($image_src."/".$image_media_file)) {
      if (file_exists($image_dest."/".$image_media_file)) {
        unlink($image_dest."/".$image_media_file);
      }
      $ok = copy($image_src."/".$image_media_file, $image_dest."/".$image_media_file);
    }
    break;

  case 2: // create new with incremental extention
     if (file_exists($image_src."/".$image_media_file)) {
       $file_extension = get_file_extension($image_media_file);
       $file_name = get_file_name($image_media_file);

       $n = 2;
       $copy = "";
       while (file_exists($image_dest."/".$file_name.$copy.".".$file_extension)) {
         $copy = "_".$n;
         $n++;
       }
       $new_file = $file_name.$copy.".".$file_extension;
       $ok = copy($image_src."/".$image_media_file, $image_dest."/".$new_file);
       $image_media_file = $new_file;
     }
     break;

   case 3: // do nothing if exists, highest protection
   default:
     if (file_exists($image_src."/".$image_media_file)) {
       if (file_exists($image_dest."/".$image_media_file)) {
         $ok = 0;
       }
       else {
         $ok = copy($image_src."/".$image_media_file, $image_dest."/".$image_media_file);
       }
     }
     break;
   }

   if ($ok) {
     @unlink($image_src_file);
     @chmod($image_dest."/".$image_media_file, CHMOD_FILES);
     return $image_media_file;
   }
   else {
     return false;
   }
}

function copy_thumbnail($image_media_file, $image_thumb_file, $from_cat = 0, $to_cat = 0) {
  if (is_remote($image_thumb_file)) {
    return $image_thumb_file;
  }

  $thumb_src = ($from_cat != -1) ? THUMB_PATH.(($from_cat != 0) ? "/".$from_cat : "") : THUMB_TEMP_PATH;
  $thumb_dest = ($to_cat != -1) ? THUMB_PATH.(($to_cat != 0) ? "/".$to_cat : "") : THUMB_TEMP_PATH;
  $thumb_src_file = $thumb_src."/".$image_thumb_file;

  if ($image_thumb_file != "" && file_exists($thumb_src."/".$image_thumb_file)) {
    $thumb_extension = get_file_extension($image_thumb_file);
    $new_thumb = get_file_name($image_media_file).".".$thumb_extension;

    if (file_exists($thumb_dest."/".$new_thumb)) {
      unlink($thumb_dest."/".$new_thumb);
    }
    $ok = copy($thumb_src."/".$image_thumb_file, $thumb_dest."/".$new_thumb);
    if ($ok) {
      @unlink($thumb_src_file);
      @chmod($thumb_dest."/".$new_thumb, CHMOD_FILES);
      $image_thumb_file = $new_thumb;
    }
  }
  return $image_thumb_file;
}

--- End code ---

replace with:

--- Code: ---function copy_media($image_media_file, $from_cat = 0, $to_cat = 0) {
  global $config;

  if (is_remote($image_media_file)) {
    return $image_media_file;
  }

  $image_src = ($from_cat != -1) ? MEDIA_PATH.(($from_cat != 0) ? "/".$from_cat : "") : MEDIA_TEMP_PATH;
  $image_dest = ($to_cat != -1) ? MEDIA_PATH.(($to_cat != 0) ? "/".$to_cat : "") : MEDIA_TEMP_PATH;
  return copy_file($image_src, $image_dest, $image_media_file, $image_media_file, $config['upload_mode']);
}


function copy_thumbnail($image_media_file, $image_thumb_file, $from_cat = 0, $to_cat = 0) {
  if (is_remote($image_thumb_file)) {
    return $image_thumb_file;
  }

  $thumb_src = ($from_cat != -1) ? THUMB_PATH.(($from_cat != 0) ? "/".$from_cat : "") : THUMB_TEMP_PATH;
  $thumb_dest = ($to_cat != -1) ? THUMB_PATH.(($to_cat != 0) ? "/".$to_cat : "") : THUMB_TEMP_PATH;

  if ($image_thumb_file != "" && file_exists($thumb_src."/".$image_thumb_file)) {
    $thumb_extension = get_file_extension($image_thumb_file);
    $new_thumb = get_file_name($image_media_file).".".$thumb_extension;
    if ($new_thumb = copy_file($thumb_src, $thumb_dest, $image_thumb_file, $new_thumb, 1))
    {
      $image_thumb_file = $new_thumb;
    }
  }
  return $image_thumb_file;
}

function copy_file($image_src, $image_dest, $image_media_file, $dest_file_name, $type, $filter = 1, $move = 1)
{
  $image_src_file = $image_src."/".$image_media_file;
  $dest_file_name = ($filter) ? filterFileName($dest_file_name) : $dest_file_name;
  $ok = 0;
  if (!file_exists($image_dest) || !is_dir($image_dest))
  {
$oldumask = umask(0);
$result = _mkdir($image_dest);
        @chmod($image_dest, CHMOD_DIRS);
umask($oldumask);
  }
  switch ($type) {
  case 1: // overwrite mode
    if (file_exists($image_src."/".$image_media_file)) {
      if (file_exists($image_dest."/".$dest_file_name)) {
        unlink($image_dest."/".$dest_file_name);
      }
      $ok = copy($image_src."/".$image_media_file, $image_dest."/".$dest_file_name);
    }
    break;

  case 2: // create new with incremental extention
     if (file_exists($image_src."/".$image_media_file)) {
       $file_extension = get_file_extension($dest_file_name);
       $file_name = get_file_name($dest_file_name);

       $n = 2;
       $copy = "";
       while (file_exists($image_dest."/".$file_name.$copy.".".$file_extension)) {
         $copy = "_".$n;
         $n++;
       }
       $new_file = $file_name.$copy.".".$file_extension;
       $ok = copy($image_src."/".$image_media_file, $image_dest."/".$new_file);
       $dest_file_name = $new_file;
     }
     break;

   case 3: // do nothing if exists, highest protection
   default:
     if (file_exists($image_src."/".$image_media_file)) {
       if (file_exists($image_dest."/".$dest_file_name)) {
         $ok = 0;
       }
       else {
         $ok = copy($image_src."/".$image_media_file, $image_dest."/".$dest_file_name);
       }
     }
     break;
  }

  if ($ok) {
    if ($move)
    {
      @unlink($image_src_file);
    }
    @chmod($image_dest."/".$dest_file_name, CHMOD_FILES);
    return $dest_file_name;
  }
  else {
    return false;
  }
}

--- End code ---

find:

--- Code: ---if ($newlangfile && !ereg("settings.php", $self_url)) {
--- End code ---

replace with:

--- Code: ---if ($newlangfile && strstr($self_url, "settings.php") === false) {
--- End code ---

find:

--- Code: ---if (ereg("de", $browser_language)) {
--- End code ---

replace with:

--- Code: ---if (strstr($browser_language, "de") !== false) {
--- End code ---

find:

--- Code: ---elseif (ereg("sb", $browser_language) || ereg("sr", $browser_language)) {
--- End code ---

replace with:

--- Code: ---elseif (preg_match("/s(b|r)/", $browser_language)) {
--- End code ---

find:

--- Code: ---if (eregi("gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
--- End code ---

replace with:

--- Code: ---if (preg_match("/gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
--- End code ---

find:

--- Code: ---elseif (eregi("x-gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
--- End code ---

replace with:

--- Code: ---elseif (preg_match("/x-gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
--- End code ---

find:

--- Code: ---$dir = (!eregi("/$", $dir)) ? $dir."/" : $dir;
--- End code ---

replace with:

--- Code: ---$dir = (!preg_match("#/$#", $dir)) ? $dir."/" : $dir;
--- End code ---

find:

--- Code: ---if (eregi("^\.{1,2}$",$file)) {
--- End code ---

replace with:

--- Code: ---if (preg_match("/^\.{1,2}$/",$file)) {
--- End code ---


admin/resizer.php

find:

--- Code: ---$nozip = 1;
--- End code ---

insert before:

--- Code: ---ini_set('memory_limit', '1024M');
--- End code ---

find:

--- Code: ---  $dimension = (isset($HTTP_POST_VARS['dimension'])) ? intval($HTTP_POST_VARS['dimension']) : 200;
  $resize_type = (isset($HTTP_POST_VARS['resize_type'])) ? intval($HTTP_POST_VARS['resize_type']) : 1;

--- End code ---

replace with:

--- Code: ---  $dimension = (isset($HTTP_POST_VARS['dimension'])) ? intval($HTTP_POST_VARS['dimension']) : $config['max_image_width'];
  $height = (isset($HTTP_POST_VARS['height'])) ? intval($HTTP_POST_VARS['height']) : $config['max_image_height'];
  $resize_type = (isset($HTTP_POST_VARS['resize_type'])) ? intval($HTTP_POST_VARS['resize_type']) : $config['auto_thumbnail_resize_type'];

--- End code ---

find:

--- Code: ---  $dimension = (isset($HTTP_POST_VARS['dimension'])) ? intval($HTTP_POST_VARS['dimension']) : 200;
  $resize_type = (isset($HTTP_POST_VARS['resize_type'])) ? intval($HTTP_POST_VARS['resize_type']) : 1;

--- End code ---

replace with:

--- Code: ---  $dimension = (isset($HTTP_POST_VARS['dimension'])) ? intval($HTTP_POST_VARS['dimension']) : $config['max_image_width'];
  $height = (isset($HTTP_POST_VARS['height'])) ? intval($HTTP_POST_VARS['height']) : $config['max_image_height'];
  $resize_type = (isset($HTTP_POST_VARS['resize_type'])) ? intval($HTTP_POST_VARS['resize_type']) : $config['auto_thumbnail_resize_type'];

--- End code ---

find:

--- Code: ---show_input_row($lang['resize_dimension_desc'], "dimension", $dimension);
--- End code ---

replace with:

--- Code: ---  show_input_row($lang['max_imagewidth'], "dimension", $dimension);
  show_input_row($lang['max_imageheight'], "height", $height);

--- End code ---

find:

--- Code: ---$dimension = (isset($HTTP_POST_VARS['dimension'])) ? intval($HTTP_POST_VARS['dimension']) : 200;
--- End code ---

replace with:

--- Code: ---  $dimension = (isset($HTTP_POST_VARS['dimension'])) ? intval($HTTP_POST_VARS['dimension']) : $config['max_image_height'];
  $height = (isset($HTTP_POST_VARS['height'])) ? intval($HTTP_POST_VARS['height']) : $config['max_image_height'];

--- End code ---

find:

--- Code: ---if ($resize_type == 1 && ($image_info[0] > $dimension || $image_info[1] > $dimension)) {
--- End code ---

replace with:

--- Code: ---if ($resize_type == 1 && ($image_info[0] > $dimension || $image_info[1] > $height)) {
--- End code ---

find:

--- Code: ---elseif ($resize_type == 3 && $image_info[1] > $dimension) {
--- End code ---

replace with:

--- Code: ---elseif ($resize_type == 3 && $image_info[1] > $height) {
--- End code ---

find:

--- Code: ---$width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type);
--- End code ---

replace with:

--- Code: ---$width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type, $height);
--- End code ---

find:

--- Code: ---show_hidden_input("image_type", $image_type);
--- End code ---

insert after:

--- Code: --- show_hidden_input("height", $height);
--- End code ---


admin/home.php

find:

--- Code: ---if (eregi("Control Panel", $row[$user_table_fields['user_location']])) {
--- End code ---

replace with:

--- Code: ---if (preg_match("/Control Panel/i", $row[$user_table_fields['user_location']])) {
--- End code ---

find:

--- Code: ---if (eregi("Control Panel", $row['session_location'])) {
--- End code ---

replace with:

--- Code: ---if (preg_match("/Control Panel/i", $row['session_location'])) {
--- End code ---

kai:
Here is a detailed list of what has been changed in the php files from 4images 1.7.7 -> 1.7.8.
(The best way for yourself to compare the code of files is to use Winmerge.)


Includes


includes/page_footer.php

find:

--- Code: ---if (eregi("gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
--- End code ---

replace with:

--- Code: ---if (preg_match("/gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
--- End code ---

find:

--- Code: ---elseif (eregi("x-gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
--- End code ---

replace with:

--- Code: ---elseif (preg_match("/x-gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
--- End code ---


includes/image_utils.php

find:

--- Code: ---"convert_path" => ereg_replace("\/$", "", $config['convert_tool_path'])
--- End code ---

replace with:

--- Code: ---"convert_path" => preg_replace("/\/$/", "", $config['convert_tool_path'])
--- End code ---

find:

--- Code: ---function get_width_height($dimension, $width, $height, $resize_type = 1) {
  if ($resize_type == 2) {
    $new_width = $dimension;
    $new_height = floor(($dimension/$width) * $height);
  }
  elseif ($resize_type == 3) {
    $new_width = floor(($dimension/$height) * $width);
    $new_height = $dimension;
  }
  else {
    $ratio = $width / $height;
    if ($ratio > 1) {
      $new_width = $dimension;
      $new_height = floor(($dimension/$width) * $height);
    }
    else {
      $new_width = floor(($dimension/$height) * $width);
      $new_height = $dimension;
    }
  }
  return array("width" => $new_width, "height" => $new_height);
}

--- End code ---

replace with:

--- Code: ---function get_width_height($dimension, $width, $height, $resize_type = 1, $max_height = false) {
  $max_width = $dimension;
  $max_height = ($max_height === false) ? $max_width : $max_height;
  if ($resize_type == 2)
  {
    $new_width = $max_width;
    $new_height = floor(($max_width/$width) * $height);
  }
  elseif ($resize_type == 3)
  {
    $new_width = floor(($max_height/$height) * $width);
    $new_height = $max_height;
  }
  else
  {
    $new_width = $width;
    $new_height = $height;
    if ($width > $max_width || $height > $max_height)
    {
      $scale = min($max_width/$width, $max_height/$height);
      $new_width = floor($scale*$width);
      $new_height = floor($scale*$height);
    }
  }
  return array("width" => $new_width, "height" => $new_height);
}

--- End code ---

find:

--- Code: ---function resize_image($file, $quality, $dimension, $resize_type = 1) {
--- End code ---

replace with:

--- Code: ---function resize_image($file, $quality, $dimension, $resize_type = 1, $height = false) {
--- End code ---

find:

--- Code: ---$width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type);
--- End code ---

replace width:

--- Code: ---$width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type, $height);
--- End code ---


includes/db_utils.php

find:

--- Code: ---$queries[$i] = preg_replace("/;$/i", "", $line);
--- End code ---

replace with:

--- Code: ---$queries[$i] = preg_replace("/;$/", "", $line);
--- End code ---

find:

--- Code: ---$queries[$i] .= preg_replace("/;$/i", "", $line);
--- End code ---

replace with:

--- Code: ---$queries[$i] .= preg_replace("/;$/", "", $line);
--- End code ---

find:

--- Code: ---if (eregi('^(MyISAM|ISAM|HEAP|InnoDB)$', ((isset($row['Type'])) ? $row['Type'] : $row['Engine']))) {
--- End code ---

replace with:

--- Code: ---if (preg_match('/^(MyISAM|ISAM|HEAP|InnoDB)$/i', ((isset($row['Type'])) ? $row['Type'] : $row['Engine']))) {
--- End code ---


includes/paging.php

find:

--- Code: ---    $link_args = ereg_replace("&page=[0-9]*", "", $link_args);
    $link_args = ereg_replace("page=[0-9]*&", "", $link_args);

--- End code ---

replace with:

--- Code: ---    $link_args = preg_replace("/&page=[0-9]*/", "", $link_args);
    $link_args = preg_replace("/page=[0-9]*&/", "", $link_args);

--- End code ---


includes/sessions.php

find:

--- Code: ---$user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$username."</a>".$invisibleuser;
--- End code ---

replace with:

--- Code: ---$user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".str_replace(array("{", "}"), array("&#123;", "&#125;"), $username)."</a>".$invisibleuser;
--- End code ---


includes/functions.php

find:

--- Code: ---ereg("(.+)\?(.+)", $basename, $regs);
--- End code ---

replace with:

--- Code: ---preg_match("#(.+)\?(.+)#", $basename, $regs);
--- End code ---

find:

--- Code: ---return is_remote($remote_thumb_file) && preg_match("#\.[gif|jpg|jpeg|png]+$#is", $remote_thumb_file) ? 1 : 0;
--- End code ---

replace with:

--- Code: ---return is_remote($remote_thumb_file) && preg_match("#\.(gif|jpg|jpeg|png)$#is", $remote_thumb_file) ? 1 : 0;
--- End code ---

find:

--- Code: ---return !is_remote($local_thumb_file) && get_basefile($local_thumb_file) != $local_thumb_file && preg_match("#\.[gif|jpg|jpeg|png]+$#i", $local_thumb_file) ? 1 : 0;
--- End code ---

replace with:

--- Code: ---return !is_remote($local_thumb_file) && get_basefile($local_thumb_file) != $local_thumb_file && preg_match("#\.(gif|jpg|jpeg|png)$#i", $local_thumb_file) ? 1 : 0;
--- End code ---

find:

--- Code: ---function get_file_name($file_name) {
  ereg("(.+)\.(.+)", get_basefile($file_name), $regs);
  return $regs[1];
}

--- End code ---

replace with:

--- Code: ---function get_file_name($file_name) {
  if (preg_match("#(.+)\.(.+)#", get_basefile($file_name), $regs)) {
    return $regs[1];
  }
  return false;
}

--- End code ---

find:

--- Code: ---return (preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? 1 : 0;
--- End code ---

replace with:

--- Code: ---return (preg_match("#\.(gif|jpg|jpeg|png)$#is", $file_name)) ? 1 : 0;
--- End code ---

find:

--- Code: ---if (substr(PHP_OS, 0, 3) == "WIN" && !eregi("\.exe$", $file_name)) {
--- End code ---

replace with:

--- Code: ---if (substr(PHP_OS, 0, 3) == "WIN" && !preg_match("#\.exe$#i", $file_name)) {
--- End code ---

find:

--- Code: ---$file_name = eregi_replace("\.exe$", "", $file_name);
--- End code ---

replace with:

--- Code: ---$file_name = preg_replace("#\.exe$#i", "", $file_name);
--- End code ---

find:

--- Code: ---return ($check_handle($file_name) && remote_file_exists($file_name, $check_remote)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $file_name) : $return_code;
--- End code ---

replace with:

--- Code: ---return ($check_handle($file_name) && remote_file_exists($file_name, $check_remote)) ? (($in_admin && !preg_match("#\.(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $file_name) : $return_code;
--- End code ---

find:

--- Code: ---return ($check_handle($file_name) && file_exists($file_path)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $file_name) : $return_code;
--- End code ---

replace with:

--- Code: ---return ($check_handle($file_name) && file_exists($file_path)) ? (($in_admin && !preg_match("#\.(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $file_name) : $return_code;
--- End code ---

find:

--- Code: ---return ($check_handle($file_name) && file_exists($path)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $path) : $return_code;
--- End code ---

replace with:

--- Code: ---return ($check_handle($file_name) && file_exists($path)) ? (($in_admin && !preg_match("#\.(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $path) : $return_code;
--- End code ---

find:

--- Code: ---        elseif ($key == "ExposureTime") {
          $exposure = explode("/", $exif_info);
          $exif_array[$exif_match[$key]] = "1/" . ($exposure[1] / $exposure[0]);

--- End code ---

replace with:

--- Code: ---        elseif ( $key == "ExposureTime" ) {
            $ExposureTime = explode("/", $exif_info);
            if ( $ExposureTime[0] == 1 && $ExposureTime[1] == 1 ){
                $exif_array[$exif_match[$key]] = $ExposureTime[1]." sec(s)";
            } elseif ( $ExposureTime[0] == 1 ) {
                $exif_array[$exif_match[$key]] = "1/".($ExposureTime[1] * $ExposureTime[0])." sec(s)";
            } elseif ( $ExposureTime[1] > 1 ) {
                $exif_array[$exif_match[$key]] = ($ExposureTime[0]/$ExposureTime[1])." sec(s)";
            } elseif( $ExposureTime[1] == 1 ) {
                $exif_array[$exif_match[$key]] = ($ExposureTime[0] * $ExposureTime[1])." sec(s)";
            }

--- End code ---

find:

--- Code: ---$split_keywords = explode(" ", $image_row['image_keywords']);
--- End code ---

replace with:

--- Code: ---$split_keywords = explode(",", $image_row['image_keywords']);
--- End code ---

find and delete:

--- Code: ---"image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, $detailed_view),
--- End code ---

find:

--- Code: ---$site_template->register_vars("rate_form", $rate_form);
--- End code ---

insert after:

--- Code: ---  $site_template->register_vars(array(
    "image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, $detailed_view),
  ));

--- End code ---

find:

--- Code: ---$thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".format_text($image_name, 2)."\" />";
--- End code ---

replace with:

--- Code: ---$thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".format_text($image_name, 2)."\" title=\"".format_text($image_name, 2)."\" />";
--- End code ---

find:

--- Code: ---$thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".format_text($image_name, 2)."\" />";
--- End code ---

replace with:

--- Code: ---$thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".format_text($image_name, 2)."\" title=\"".format_text($image_name, 2)."\" />";
--- End code ---

find:

--- Code: ---if (eregi("Win", $HTTP_USER_AGENT)) {
--- End code ---

replace with:

--- Code: ---if (preg_match("#Win#i", $HTTP_USER_AGENT)) {
--- End code ---

find:

--- Code: ---elseif (eregi("Mac", $HTTP_USER_AGENT)) {
--- End code ---

replace with:

--- Code: ---elseif (preg_match("#Mac#i", $HTTP_USER_AGENT)) {
--- End code ---

find:

--- Code: ---if (eregi("MSIE ([0-9].[0-9]{1,2})", $HTTP_USER_AGENT, $regs)) {
--- End code ---

replace with:

--- Code: ---if (preg_match("#MSIE ([0-9].[0-9]{1,2})#i", $HTTP_USER_AGENT, $regs)) {
--- End code ---

find:

--- Code: ---elseif (eregi("Mozilla/([0-9].[0-9]{1,2})", $HTTP_USER_AGENT, $regs)) {
--- End code ---

replace with:

--- Code: ---elseif (preg_match("#Mozilla/([0-9].[0-9]{1,2})#i", $HTTP_USER_AGENT, $regs)) {
--- End code ---

find:

--- Code: ---elseif (eregi("Opera(/| )([0-9].[0-9]{1,2})", $HTTP_USER_AGENT, $regs)) {
--- End code ---

replace with:

--- Code: ---elseif (preg_match("#Opera(/| )([0-9].[0-9]{1,2})#i", $HTTP_USER_AGENT, $regs)) {
--- End code ---

find:

--- Code: ---if (!eregi("http", $url['scheme'])) {
--- End code ---

replace with:

--- Code: ---if (!preg_match("#http#i", $url['scheme'])) {
--- End code ---

find:

--- Code: ---    return 'application/octet-stream';
}

--- End code ---

insert after:

--- Code: ---function trim_value(&$value)
{
    $value = trim($value);
}

/*
    create directory tree recursively
    backward compatibility for php4
*/
function _mkdir($dir, $chmod = CHMOD_DIRS)
{
if (is_dir($dir) || @mkdir($dir, $chmod)) return true;
if (!_mkdir(dirname($dir), $chmod)) return false;
return @mkdir($dir, $chmod);
}

function filterFileName($text, $tolower = 1, $transl = null)
{
global $translit;
$transl = ($transl !== null) ? $transl : @$translit;
if ($transl)
$text = strtr(
$text,
array(
// russian Windows-1251
"\xc0" => "a",
"\xc1" => "b",
"\xc2" => "v",
"\xc3" => "g",
"\xc4" => "d",
"\xc5" => "e",
"\xa8" => "e",
"\xc6" => "zh",
"\xc7" => "z",
"\xc8" => "i",
"\xc9" => "j",
"\xca" => "k",
"\xcb" => "l",
"\xcc" => "m",
"\xcd" => "n",
"\xce" => "o",
"\xcf" => "p",
"\xd0" => "r",
"\xd1" => "s",
"\xd2" => "t",
"\xd3" => "u",
"\xd4" => "f",
"\xd5" => "h",
"\xd6" => "c",
"\xd7" => "ch",
"\xd8" => "sh",
"\xd9" => "sch",
"\xda" => "",
"\xdb" => "i",
"\xdc" => "",
"\xdd" => "e",
"\xde" => "yu",
"\xdf" => "ya",
"\xe0" => "a",
"\xe1" => "b",
"\xe2" => "v",
"\xe3" => "g",
"\xe4" => "d",
"\xe5" => "e",
"\xb8" => "e",
"\xe6" => "zh",
"\xe7" => "z",
"\xe8" => "i",
"\xe9" => "j",
"\xea" => "k",
"\xeb" => "l",
"\xec" => "m",
"\xed" => "n",
"\xee" => "o",
"\xef" => "p",
"\xf0" => "r",
"\xf1" => "s",
"\xf2" => "t",
"\xf3" => "u",
"\xf4" => "f",
"\xf5" => "h",
"\xf6" => "c",
"\xf7" => "ch",
"\xf8" => "sh",
"\xf9" => "sch",
"\xfa" => "",
"\xfb" => "i",
"\xfc" => "",
"\xfd" => "e",
"\xfe" => "yu",
"\xff" => "ya",
));

if ($tolower)
 $text = strtolower($text);

$text = str_replace(" ", "_", $text);
$text = str_replace("%20", "_", $text);
$text = preg_replace("/[^\-\._a-z0-9]/i", "_", $text);
return $text;
}

--- End code ---

includes/db_mysql.php

find:

--- Code: ---if (isset($user_info['user_level']) && $user_info['user_level'] == ADMIN){
--- End code ---

replace with:

--- Code: ---if (!defined("4IMAGES_ACTIVE") || (isset($user_info['user_level']) && $user_info['user_level'] == ADMIN)){
--- End code ---


includes/constants.php

find:

--- Code: ---define('SCRIPT_VERSION', '1.7.7');
--- End code ---

replace with

--- Code: ---define('SCRIPT_VERSION', '1.7.8');
--- End code ---


includes/captcha_utils.php

find:

--- Code: ---$valid = $sess_code != '' && strtolower($sess_code) == strtolower($code);
--- End code ---

replace with:

--- Code: ---$valid = $sess_code != '' && $sess_code == $code;
--- End code ---


includes/page_header.php

find:

--- Code: ---$file = get_included_files();
$file = get_file_name(basename($file[0]));
$list = array("categories", "details", "index", "member", "postcards", "register", "search", "top");
$array = array();
foreach ($list as $name)
{
  $array[$name] = ($name == $file);
}

--- End code ---

replace with:

--- Code: ---$file = get_file_name(basename(MAIN_SCRIPT));
$array = array(
    "categories" => false,
    "details"    => false,
    "index"      => false,
    "member"     => false,
    "postcards"  => false,
    "register"   => false,
    "search"     => false,
    "top"        => false
);
if ( isset($array[$file]) ) {
  $array[$file] = true;
}

--- End code ---


includes/upload.php

find:

--- Code: ---return (ereg_replace('/+', '/', $tmp_file) == $file_name) ? 1 : 0;
--- End code ---

replace with:

--- Code: ---return (preg_replace('#/+#', '/', $tmp_file) == $file_name) ? 1 : 0;
--- End code ---

find:

--- Code: ---if (eregi("image", $this->HTTP_POST_FILES[$this->field_name]['type'])) {
--- End code ---

replace with:

--- Code: ---if (preg_match("/image/i", $this->HTTP_POST_FILES[$this->field_name]['type'])) {
--- End code ---

find:

--- Code: ---      ereg("(.+)\.(.+)", $file_name, $regs);
      $this->name = $regs[1];
      ereg("(.+)\.(.+)", $this->HTTP_POST_FILES[$this->field_name]['name'], $regs);

--- End code ---

replace with:

--- Code: ---      preg_match("/(.+)\.(.+)/", $file_name, $regs);
      $this->name = $regs[1];
      preg_match("/(.+)\.(.+)/", $this->HTTP_POST_FILES[$this->field_name]['name'], $regs);

--- End code ---

find:

--- Code: ---      $this->file_name = ereg_replace(" ", "_", $this->file_name);
      $this->file_name = ereg_replace("%20", "_", $this->file_name);

--- End code ---

replace with:

--- Code: ---      $this->file_name = str_replace(" ", "_", $this->file_name);
      $this->file_name = str_replace("%20", "_", $this->file_name);

--- End code ---

find:

--- Code: ---ereg("(.+)\.(.+)", $this->file_name, $regs);
--- End code ---

replace with:

--- Code: ---preg_match("/(.+)\.(.+)/", $this->file_name, $regs);
--- End code ---

find:

--- Code: ---  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;
    }
  }

--- End code ---

replace with:

--- Code: ---  function check_mime_type()
  {
    if (!isset($this->accepted_mime_types[$this->extension]))
      return false;

    if (!is_array($this->accepted_mime_types[$this->extension]))
      return ($this->accepted_mime_types[$this->extension] == $this->mime_type);

    return (in_array($this->mime_type, $this->accepted_mime_types[$this->extension]));
  }

--- End code ---

find and delete:

--- Code: ---    $this->accepted_mime_types['thumb'] = array(
      "image/jpg",
      "image/jpeg",
      "image/pjpeg",
      "image/gif",
      "image/x-png"
    );

--- End code ---

find:

--- Code: ---    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;
        }
      }
    }

--- End code ---

replace with:

--- Code: ---    include_once(ROOT_PATH.'includes/upload_definitions.php');
    $this->accepted_mime_types = $mime_type_match;

--- End code ---

includes/search_utils.php

find:

--- Code: ---if ($for_search) {
--- End code ---

insert before:

--- Code: ---$val = preg_replace('/[\n\r]+/', ',', $val);
--- End code ---

find:

--- Code: ---"#[\n\t\r^\$\(\)<>\"\|,@\?%~\+\.\[\]{}:\/=!§\\\\]+#s"
--- End code ---

replace with:

--- Code: ---"#[\n\t\r^\$\(\)<>\"\|@\?%~\+\.\[\]{}:\/=!§\\\\]+#s"
--- End code ---

find:

--- Code: ---$split_words = preg_split("/\s+/", $val);
--- End code ---

replace with:

--- Code: ---$split_words = preg_split("/,+/", $val);
--- End code ---

find:

--- Code: ---foreach ($split_words as $word) {
--- End code ---

insert after:

--- Code: ---$word = trim($word);
--- End code ---


includes/email.php

find:

--- Code: ---$to_header = ereg_replace(", $", "", $to_header);
--- End code ---

replace with:

--- Code: ---$to_header = preg_replace("/, $/", "", $to_header);
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version