Author Topic: 4images 1.7.8  (Read 95088 times)

0 Members and 1 Guest are viewing this topic.

Offline kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.418
    • View Profile
    • 4images - Image Gallery Management System
4images 1.7.8
« on: August 09, 2010, 05:29:52 PM »
: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.
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.418
    • View Profile
    • 4images - Image Gallery Management System
Re: 4images 1.7.8
« Reply #1 on: August 09, 2010, 05:35:26 PM »
=========================================================
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
« Last Edit: August 16, 2010, 03:44:52 PM by kai »
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.418
    • View Profile
    • 4images - Image Gallery Management System
Re: 4images 1.7.8
« Reply #2 on: August 10, 2010, 02:15:22 PM »
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: [Select]
$lang['send_postcard_success'] = "Viele Dank! Ihre eCard wurde erfolgreich versendet.";
replace with:
Code: [Select]
$lang['send_postcard_success'] = "Vielen Dank! Ihre eCard wurde erfolgreich versendet.";
find:
Code: [Select]
$lang['invalid_activationkey'] = "Diese Account ist nicht mehr aktiv. Bitte registrieren Sie sich erneut.</>";
replace with:
Code: [Select]
$lang['invalid_activationkey'] = "Dieser Account ist nicht mehr aktiv. Bitte registrieren Sie sich erneut.";
find:
Code: [Select]
$lang['edit_profile_msg'] = "Hier können Sie Ihr persönliches Profil und Ihre Passwort ändern.";
replace with:
Code: [Select]
$lang['edit_profile_msg'] = "Hier können Sie Ihr persönliches Profil und Ihr Passwort ändern.";
find:
Code: [Select]
$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.";

replace with:
Code: [Select]
$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.";

find:
Code: [Select]
$lang['comment_edit_error'] = "Fehler beim Bearbeiten der Kommentar";
replace with:
Code: [Select]
$lang['comment_edit_error'] = "Fehler beim Bearbeiten des Kommentars";
find:
Code: [Select]
$lang['comment_delete_error'] = "Fehler beim Löschen der Kommentar";
replace with:
Code: [Select]
$lang['comment_delete_error'] = "Fehler beim Löschen des Kommentars";
find:
Code: [Select]
$lang['keywords_ext'] = "Schlüsselw&ouml;rter:<br /><span class=\"smalltext\">Schlüsselw&ouml;rter durch Leerzeichen getrennt eingeben.</span>";
replace with:
Code: [Select]
$lang['keywords_ext'] = "Schlüsselw&ouml;rter:<br /><span class=\"smalltext\">Schlüsselw&ouml;rter durch Komma getrennt eingeben.</span>";
find:
Code: [Select]
$lang['lightbox_delete_success'] = "Leuchkasten erfolgreich gelöscht.";
replace with:
Code: [Select]
$lang['lightbox_delete_success'] = "Leuchtkasten erfolgreich gelöscht.";
find:
Code: [Select]
$lang['delete_lightbox_confirm'] = "Wollen Sie Ihren Leuchkasten wirklich loeschen?";
replace with:
Code: [Select]
$lang['delete_lightbox_confirm'] = "Wollen Sie Ihren Leuchtkasten wirklich loeschen?";

lang/deutsch/install.php

find:
Code: [Select]
?>
insert before:
Code: [Select]
$lang['timezone_select'] = "Bitte wählen Sie Ihre Zeitzone";


lang/deutsch/admin.php

find:
Code: [Select]
$lang['resizing_image_error'] = "Fehler beim Konvertieren der Bild-Datei!";
insert after:
Code: [Select]
//-----------------------------------------------------
//--- 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";


lang/spanish/main.php

find:
Code: [Select]
$lang['post_comment'] = "Agregar comentario";
insert after:
Code: [Select]
$lang['comment_success'] = "Tu comentario se ha guardado";

lang/spanish/install.php

find:
Code: [Select]
?>
insert before:
Code: [Select]
$lang['timezone_select'] = "Por favor seleccione su zona horaria";

lang/english/main.php

find:
Code: [Select]
$lang['keywords_ext'] = "Keywords:<br /><span class=\"smalltext\">Keywords must be seperated by spaces.</span>";
replace with:
Code: [Select]
$lang['keywords_ext'] = "Keywords:<br /><span class=\"smalltext\">Keywords must be separated by commas or newlines.</span>";

lang/english/install.php

find:
Code: [Select]
?>
insert before:
Code: [Select]
$lang['timezone_select'] = "Please select your timezone";


lang/english/admin.php

find:
Code: [Select]
$lang['field_keywords_ext'] = "Keywords<br /><span class=\"smalltext\">Keywords must be seperated by spaces.</span>";
replace with:
Code: [Select]
$lang['field_keywords_ext'] = "Keywords<br /><span class=\"smalltext\">Keywords must be separated by commas or newlines.</span>";
find:
Code: [Select]
$lang['resizing_image_error'] = "Error converting image file!";
insert after:
Code: [Select]
//-----------------------------------------------------
//--- 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";
« Last Edit: August 30, 2010, 04:23:40 PM by kai »
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.418
    • View Profile
    • 4images - Image Gallery Management System
Re: 4images 1.7.8
« Reply #3 on: August 30, 2010, 04:25:23 PM »
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: [Select]
$root_path = (!eregi("\/plugins\/", $_SERVER['PHP_SELF'])) ? "./../" : "./../../";
replace with:
Code: [Select]
$root_path = (false === stristr($_SERVER['PHP_SELF'], "/plugins/")) ? "./../" : "./../../";

admin/templates.php

find:
Code: [Select]
$template_file_name = basename($template_file_name);
replace with:
Code: [Select]
$template_file_name = (strpos($template_file_name, 'media/') !== false ? 'media/' : '') . basename($template_file_name);

admin/users.php

find:
Code: [Select]
for ($i = 1; $i <= $num_newusers; $i++) {
insert after:
Code: [Select]
$log = array();

admin/checkimages.php

Completely rewritten, better replace whole file.


admin/backup.php

find:
Code: [Select]
if (eregi("\.gz", $file)) {
replace with:
Code: [Select]
if (preg_match("/\.gz$/i", $file)) {
find:
Code: [Select]
if (eregi("\.gz", $file)) {
replace with:
Code: [Select]
if (preg_match("/\.gz$/i", $file)) {
find:
Code: [Select]
if (is_file(ROOT_PATH.DATABASE_DIR."/".$file) && $file != "." && $file != ".." && eregi("\.sql",$file)) {
replace with:
Code: [Select]
if (is_file(ROOT_PATH.DATABASE_DIR."/".$file) && $file != "." && $file != ".." && preg_match("/\.sql$/i",$file)) {

admin/images.php

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

replace with:
Code: [Select]
$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)));

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

replace with:
Code: [Select]
$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)));


admin/index.php

find:
Code: [Select]
if (eregi("^\.{1,2}$", $file) || !eregi("\.php$", $file)) {
replace with:
Code: [Select]
if (get_file_extension($file) != "php") {
find:
Code: [Select]
if (preg_match("/PLUGIN_TITLE:([a-zäöüß0-9\-_ ]+)/i", $plugin_file[0], $regs)) {
replace with:
Code: [Select]
if (preg_match("/PLUGIN_TITLE:(.+)/", $plugin_file[0], $regs)) {

admin/admin_global.php

find:
Code: [Select]
if (isset($PHP_SELF) && eregi("\/plugins\/", $PHP_SELF)) {
replace with:
Code: [Select]
if (isset($PHP_SELF) && preg_match("/\/plugins\//i", $PHP_SELF)) {

admin/thumbnailer.php

find:
Code: [Select]
echo "<td colspan=\"2\"><p><input type=\"text\" size=\"$textinput_size\" name=\"dimension\" value=\"100\"></p></td>\n</tr>\n";
replace with:
Code: [Select]
echo "<td colspan=\"2\"><p><input type=\"text\" size=\"" . $textinput_size . "\" name=\"dimension\" value=\"" . $config['auto_thumbnail_dimension'] . "\"></p></td>\n</tr>\n";
find:
Code: [Select]
echo "<td colspan=\"2\"><p><input type=\"text\" size=\"$textinput_size\" name=\"quality\" value=\"75\"></p></td>\n</tr>\n";
replace with:
Code: [Select]
echo "<td colspan=\"2\"><p><input type=\"text\" size=\"" . $textinput_size . "\" name=\"quality\" value=\"" . $config['auto_thumbnail_quality'] . "\"></p></td>\n</tr>\n";

admin/validateimages.php

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

replace with:
Code: [Select]
 $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)));


admin/admin_functions.php

find:
Code: [Select]
if (is_array($iptc)) {
insert after:
Code: [Select]
$separator = "";
find:
Code: [Select]
$value = $iptc['2#120'][0];
replace with:
Code: [Select]
$value = trim($iptc['2#120'][0]);
find:
Code: [Select]
$value .= (($value != "" ) ? " " : "").$val;
replace with:
Code: [Select]
$value .= (($value != "" ) ? "," : "").trim($val);
find:
Code: [Select]
         break;

        case "object_name":

insert before:
Code: [Select]
$separator = ",";
find:
Code: [Select]
$value = $iptc['2#005'][0];
replace with:
Code: [Select]
$value = trim($iptc['2#005'][0]);
find:
Code: [Select]
$html = "\n<input type=\"hidden\" name=\"hidden_".$input."\" value=\"".trim($value)." \">\n";
replace with:
Code: [Select]
$html = "\n<input type=\"hidden\" name=\"hidden_".$input."\" value=\"".$value." \">\n";
find:
Code: [Select]
$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\">');";
replace with:
Code: [Select]
$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\">');";
find:
Code: [Select]
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;
}

replace with:
Code: [Select]
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;
  }
}

find:
Code: [Select]
if ($newlangfile && !ereg("settings.php", $self_url)) {
replace with:
Code: [Select]
if ($newlangfile && strstr($self_url, "settings.php") === false) {
find:
Code: [Select]
if (ereg("de", $browser_language)) {
replace with:
Code: [Select]
if (strstr($browser_language, "de") !== false) {
find:
Code: [Select]
elseif (ereg("sb", $browser_language) || ereg("sr", $browser_language)) {
replace with:
Code: [Select]
elseif (preg_match("/s(b|r)/", $browser_language)) {
find:
Code: [Select]
if (eregi("gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
replace with:
Code: [Select]
if (preg_match("/gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
find:
Code: [Select]
elseif (eregi("x-gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
replace with:
Code: [Select]
elseif (preg_match("/x-gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
find:
Code: [Select]
$dir = (!eregi("/$", $dir)) ? $dir."/" : $dir;
replace with:
Code: [Select]
$dir = (!preg_match("#/$#", $dir)) ? $dir."/" : $dir;
find:
Code: [Select]
if (eregi("^\.{1,2}$",$file)) {
replace with:
Code: [Select]
if (preg_match("/^\.{1,2}$/",$file)) {

admin/resizer.php

find:
Code: [Select]
$nozip = 1;
insert before:
Code: [Select]
ini_set('memory_limit', '1024M');
find:
Code: [Select]
 $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;

replace with:
Code: [Select]
 $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'];

find:
Code: [Select]
 $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;

replace with:
Code: [Select]
 $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'];

find:
Code: [Select]
show_input_row($lang['resize_dimension_desc'], "dimension", $dimension);
replace with:
Code: [Select]
 show_input_row($lang['max_imagewidth'], "dimension", $dimension);
  show_input_row($lang['max_imageheight'], "height", $height);

find:
Code: [Select]
$dimension = (isset($HTTP_POST_VARS['dimension'])) ? intval($HTTP_POST_VARS['dimension']) : 200;
replace with:
Code: [Select]
 $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'];

find:
Code: [Select]
if ($resize_type == 1 && ($image_info[0] > $dimension || $image_info[1] > $dimension)) {
replace with:
Code: [Select]
if ($resize_type == 1 && ($image_info[0] > $dimension || $image_info[1] > $height)) {
find:
Code: [Select]
elseif ($resize_type == 3 && $image_info[1] > $dimension) {
replace with:
Code: [Select]
elseif ($resize_type == 3 && $image_info[1] > $height) {
find:
Code: [Select]
$width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type);
replace with:
Code: [Select]
$width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type, $height);
find:
Code: [Select]
show_hidden_input("image_type", $image_type);
insert after:
Code: [Select]
show_hidden_input("height", $height);

admin/home.php

find:
Code: [Select]
if (eregi("Control Panel", $row[$user_table_fields['user_location']])) {
replace with:
Code: [Select]
if (preg_match("/Control Panel/i", $row[$user_table_fields['user_location']])) {
find:
Code: [Select]
if (eregi("Control Panel", $row['session_location'])) {
replace with:
Code: [Select]
if (preg_match("/Control Panel/i", $row['session_location'])) {
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.418
    • View Profile
    • 4images - Image Gallery Management System
Re: 4images 1.7.8
« Reply #4 on: August 30, 2010, 04:27:28 PM »
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: [Select]
if (eregi("gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
replace with:
Code: [Select]
if (preg_match("/gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
find:
Code: [Select]
elseif (eregi("x-gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
replace with:
Code: [Select]
elseif (preg_match("/x-gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {

includes/image_utils.php

find:
Code: [Select]
"convert_path" => ereg_replace("\/$", "", $config['convert_tool_path'])
replace with:
Code: [Select]
"convert_path" => preg_replace("/\/$/", "", $config['convert_tool_path'])
find:
Code: [Select]
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);
}

replace with:
Code: [Select]
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);
}

find:
Code: [Select]
function resize_image($file, $quality, $dimension, $resize_type = 1) {
replace with:
Code: [Select]
function resize_image($file, $quality, $dimension, $resize_type = 1, $height = false) {
find:
Code: [Select]
$width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type);
replace width:
Code: [Select]
$width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type, $height);

includes/db_utils.php

find:
Code: [Select]
$queries[$i] = preg_replace("/;$/i", "", $line);
replace with:
Code: [Select]
$queries[$i] = preg_replace("/;$/", "", $line);
find:
Code: [Select]
$queries[$i] .= preg_replace("/;$/i", "", $line);
replace with:
Code: [Select]
$queries[$i] .= preg_replace("/;$/", "", $line);
find:
Code: [Select]
if (eregi('^(MyISAM|ISAM|HEAP|InnoDB)$', ((isset($row['Type'])) ? $row['Type'] : $row['Engine']))) {
replace with:
Code: [Select]
if (preg_match('/^(MyISAM|ISAM|HEAP|InnoDB)$/i', ((isset($row['Type'])) ? $row['Type'] : $row['Engine']))) {

includes/paging.php

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

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


includes/sessions.php

find:
Code: [Select]
$user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$username."</a>".$invisibleuser;
replace with:
Code: [Select]
$user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".str_replace(array("{", "}"), array("&#123;", "&#125;"), $username)."</a>".$invisibleuser;

includes/functions.php

find:
Code: [Select]
ereg("(.+)\?(.+)", $basename, $regs);
replace with:
Code: [Select]
preg_match("#(.+)\?(.+)#", $basename, $regs);
find:
Code: [Select]
return is_remote($remote_thumb_file) && preg_match("#\.[gif|jpg|jpeg|png]+$#is", $remote_thumb_file) ? 1 : 0;
replace with:
Code: [Select]
return is_remote($remote_thumb_file) && preg_match("#\.(gif|jpg|jpeg|png)$#is", $remote_thumb_file) ? 1 : 0;
find:
Code: [Select]
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;
replace with:
Code: [Select]
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;
find:
Code: [Select]
function get_file_name($file_name) {
  ereg("(.+)\.(.+)", get_basefile($file_name), $regs);
  return $regs[1];
}

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

find:
Code: [Select]
return (preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? 1 : 0;
replace with:
Code: [Select]
return (preg_match("#\.(gif|jpg|jpeg|png)$#is", $file_name)) ? 1 : 0;
find:
Code: [Select]
if (substr(PHP_OS, 0, 3) == "WIN" && !eregi("\.exe$", $file_name)) {
replace with:
Code: [Select]
if (substr(PHP_OS, 0, 3) == "WIN" && !preg_match("#\.exe$#i", $file_name)) {
find:
Code: [Select]
$file_name = eregi_replace("\.exe$", "", $file_name);
replace with:
Code: [Select]
$file_name = preg_replace("#\.exe$#i", "", $file_name);
find:
Code: [Select]
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;
replace with:
Code: [Select]
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;
find:
Code: [Select]
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;
replace with:
Code: [Select]
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;
find:
Code: [Select]
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;
replace with:
Code: [Select]
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;
find:
Code: [Select]
       elseif ($key == "ExposureTime") {
          $exposure = explode("/", $exif_info);
          $exif_array[$exif_match[$key]] = "1/" . ($exposure[1] / $exposure[0]);

replace with:
Code: [Select]
       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)";
            }

find:
Code: [Select]
$split_keywords = explode(" ", $image_row['image_keywords']);
replace with:
Code: [Select]
$split_keywords = explode(",", $image_row['image_keywords']);
find and delete:
Code: [Select]
"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),
find:
Code: [Select]
$site_template->register_vars("rate_form", $rate_form);
insert after:
Code: [Select]
 $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),
  ));

find:
Code: [Select]
$thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".format_text($image_name, 2)."\" />";
replace with:
Code: [Select]
$thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".format_text($image_name, 2)."\" title=\"".format_text($image_name, 2)."\" />";
find:
Code: [Select]
$thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".format_text($image_name, 2)."\" />";
replace with:
Code: [Select]
$thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".format_text($image_name, 2)."\" title=\"".format_text($image_name, 2)."\" />";
find:
Code: [Select]
if (eregi("Win", $HTTP_USER_AGENT)) {
replace with:
Code: [Select]
if (preg_match("#Win#i", $HTTP_USER_AGENT)) {
find:
Code: [Select]
elseif (eregi("Mac", $HTTP_USER_AGENT)) {
replace with:
Code: [Select]
elseif (preg_match("#Mac#i", $HTTP_USER_AGENT)) {
find:
Code: [Select]
if (eregi("MSIE ([0-9].[0-9]{1,2})", $HTTP_USER_AGENT, $regs)) {
replace with:
Code: [Select]
if (preg_match("#MSIE ([0-9].[0-9]{1,2})#i", $HTTP_USER_AGENT, $regs)) {
find:
Code: [Select]
elseif (eregi("Mozilla/([0-9].[0-9]{1,2})", $HTTP_USER_AGENT, $regs)) {
replace with:
Code: [Select]
elseif (preg_match("#Mozilla/([0-9].[0-9]{1,2})#i", $HTTP_USER_AGENT, $regs)) {
find:
Code: [Select]
elseif (eregi("Opera(/| )([0-9].[0-9]{1,2})", $HTTP_USER_AGENT, $regs)) {
replace with:
Code: [Select]
elseif (preg_match("#Opera(/| )([0-9].[0-9]{1,2})#i", $HTTP_USER_AGENT, $regs)) {
find:
Code: [Select]
if (!eregi("http", $url['scheme'])) {
replace with:
Code: [Select]
if (!preg_match("#http#i", $url['scheme'])) {
find:
Code: [Select]
   return 'application/octet-stream';
}

insert after:
Code: [Select]
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;
}

includes/db_mysql.php

find:
Code: [Select]
if (isset($user_info['user_level']) && $user_info['user_level'] == ADMIN){
replace with:
Code: [Select]
if (!defined("4IMAGES_ACTIVE") || (isset($user_info['user_level']) && $user_info['user_level'] == ADMIN)){

includes/constants.php

find:
Code: [Select]
define('SCRIPT_VERSION', '1.7.7');
replace with
Code: [Select]
define('SCRIPT_VERSION', '1.7.8');

includes/captcha_utils.php

find:
Code: [Select]
$valid = $sess_code != '' && strtolower($sess_code) == strtolower($code);
replace with:
Code: [Select]
$valid = $sess_code != '' && $sess_code == $code;

includes/page_header.php

find:
Code: [Select]
$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);
}

replace with:
Code: [Select]
$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;
}


includes/upload.php

find:
Code: [Select]
return (ereg_replace('/+', '/', $tmp_file) == $file_name) ? 1 : 0;
replace with:
Code: [Select]
return (preg_replace('#/+#', '/', $tmp_file) == $file_name) ? 1 : 0;
find:
Code: [Select]
if (eregi("image", $this->HTTP_POST_FILES[$this->field_name]['type'])) {
replace with:
Code: [Select]
if (preg_match("/image/i", $this->HTTP_POST_FILES[$this->field_name]['type'])) {
find:
Code: [Select]
     ereg("(.+)\.(.+)", $file_name, $regs);
      $this->name = $regs[1];
      ereg("(.+)\.(.+)", $this->HTTP_POST_FILES[$this->field_name]['name'], $regs);

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

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

replace with:
Code: [Select]
     $this->file_name = str_replace(" ", "_", $this->file_name);
      $this->file_name = str_replace("%20", "_", $this->file_name);

find:
Code: [Select]
ereg("(.+)\.(.+)", $this->file_name, $regs);
replace with:
Code: [Select]
preg_match("/(.+)\.(.+)/", $this->file_name, $regs);
find:
Code: [Select]
 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;
    }
  }

replace with:
Code: [Select]
 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]));
  }

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

find:
Code: [Select]
   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;
        }
      }
    }

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

includes/search_utils.php

find:
Code: [Select]
if ($for_search) {
insert before:
Code: [Select]
$val = preg_replace('/[\n\r]+/', ',', $val);
find:
Code: [Select]
"#[\n\t\r^\$\(\)<>\"\|,@\?%~\+\.\[\]{}:\/=!§\\\\]+#s"
replace with:
Code: [Select]
"#[\n\t\r^\$\(\)<>\"\|@\?%~\+\.\[\]{}:\/=!§\\\\]+#s"
find:
Code: [Select]
$split_words = preg_split("/\s+/", $val);
replace with:
Code: [Select]
$split_words = preg_split("/,+/", $val);
find:
Code: [Select]
foreach ($split_words as $word) {
insert after:
Code: [Select]
$word = trim($word);

includes/email.php

find:
Code: [Select]
$to_header = ereg_replace(", $", "", $to_header);
replace with:
Code: [Select]
$to_header = preg_replace("/, $/", "", $to_header);
« Last Edit: August 30, 2010, 04:44:46 PM by kai »
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.418
    • View Profile
    • 4images - Image Gallery Management System
Re: 4images 1.7.8
« Reply #5 on: August 30, 2010, 04:45:48 PM »
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.)



Root files


config.php

find:
Code: [Select]
$db_servertype = "mysql";
insert before:
Code: [Select]
date_default_timezone_set('CET');

global.php

find:
Code: [Select]
error_reporting(E_ERROR | E_WARNING | E_PARSE);
set_magic_quotes_runtime(0);
$start_time = microtime();

replace with:
Code: [Select]
$start_time = microtime();
error_reporting(E_ERROR | E_WARNING | E_PARSE);
if (function_exists("set_magic_quotes_runtime"))
{
  @set_magic_quotes_runtime(0);
}

find:
Code: [Select]
$captcha_chars               = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
replace with:
Code: [Select]
$captcha_chars               = "abcdefghijklmnopqrstuvwxyz1234567890";
find:
Code: [Select]
if (eregi("gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"]) || eregi("x-gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
replace with:
Code: [Select]
if (preg_match("/gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"]) || preg_match("/x-gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
find:
Code: [Select]
$config['cat_order'] = empty($config['cat_order']) ? 'cat_order, cat_name ASC' : $config['cat_order'];
replace with:
Code: [Select]
$config['cat_order'] = empty($config['cat_order']) ? 'cat_order, cat_name' : $config['cat_order'];
$config['cat_sort']  = empty($config['cat_sort']) ? 'ASC' : $config['cat_sort'];


top.php

find:
Code: [Select]
define('ROOT_PATH', './');
insert after:
Code: [Select]
define('MAIN_SCRIPT', __FILE__);
postcards.php

find:
Code: [Select]
define('ROOT_PATH', './');
insert after:
Code: [Select]
define('MAIN_SCRIPT', __FILE__);

search.php

find:
Code: [Select]
define('ROOT_PATH', './');
insert after:
Code: [Select]
define('MAIN_SCRIPT', __FILE__);
find and delete:
Code: [Select]
error_reporting(E_ALL);

install.php

find:
Code: [Select]
error_reporting(E_ERROR | E_WARNING | E_PARSE);
set_magic_quotes_runtime(0);
define('ROOT_PATH', './');

replace with:
Code: [Select]
error_reporting(E_ERROR | E_WARNING | E_PARSE);
if (function_exists("set_magic_quotes_runtime"))
{
  @set_magic_quotes_runtime(0);
}
define('ROOT_PATH', './');

find:
Code: [Select]
if (!isset($HTTP_GET_VARS)) {
insert before:
Code: [Select]
function get_timezone_by_offset($offset) {
    $timezones = array(
        '-12'   => 'Pacific/Kwajalein',
        '-11'   => 'Pacific/Samoa',
        '-10'   => 'Pacific/Honolulu',
        '-9.5'  => 'Pacific/Marquesas',
        '-9'    => 'America/Juneau',
        '-8'    => 'America/Los_Angeles',
        '-7'    => 'America/Denver',
        '-6'    => 'America/Mexico_City',
        '-5'    => 'America/New_York',
        '-4.5'  => 'America/Caracas',
        '-4'    => 'America/Caracas',
        '-3.5'  => 'America/St_Johns',
        '-3'    => 'America/Argentina/Buenos_Aires',
        '-2'    => 'Atlantic/South_Georgia',
        '-1'    => 'Atlantic/Azores',
        '0'     => 'Europe/London',
        '1'     => 'Europe/Berlin',
        '2'     => 'Europe/Helsinki',
        '3'     => 'Europe/Moscow',
        '3.5'   => 'Asia/Tehran',
        '4'     => 'Asia/Baku',
        '4.5'   => 'Asia/Kabul',
        '5'     => 'Asia/Karachi',
        '5.5'   => 'Asia/Calcutta',
        '5.75'  => 'Asia/Kathmandu',
        '6'     => 'Asia/Colombo',
        '6.5'   => 'Indian/Cocos',
        '7'     => 'Asia/Bangkok',
        '8'     => 'Asia/Singapore',
        '8.75'  => 'Australia/Eucla',
        '9'     => 'Asia/Tokyo',
        '9.5'   => 'Australia/Darwin',
        '10'    => 'Pacific/Guam',
        '10.5'  => 'Australia/Lord_Howe',
        '11'    => 'Asia/Magadan',
        '11.5'  => 'Pacific/Norfolk',
        '12'    => 'Asia/Kamchatka',
        '12.75' => 'Pacific/Chatham',
        '13'    => 'Pacific/Enderbury',
        '14'    => 'Pacific/Kiritimati',
    );

    if ( isset($timezones[$offset]) ) {
        return $timezones[$offset];
    }
    return $timezones['1'];
}

find:
Code: [Select]
if (@file_exists(ROOT_PATH."config.php")) {
  @include(ROOT_PATH.'config.php');
}

replace with:
Code: [Select]
if (@file_exists(ROOT_PATH."config.php")) {
  @include(ROOT_PATH.'config.php');
} else {
    date_default_timezone_set('CET');
}

find:
Code: [Select]
$admin_password2 = (isset($HTTP_POST_VARS['admin_password2'])) ? trim($HTTP_POST_VARS['admin_password2']) : "";
insert after:
Code: [Select]
$selected_timezone = (isset($HTTP_POST_VARS['timezone_select'])) ? trim($HTTP_POST_VARS['timezone_select']) : '1';
$selected_timezone = get_timezone_by_offset($selected_timezone);

find:
Code: [Select]
      $config_file .= '$db_servertype = "'.$db_servertype.'";'."\n";
      $config_file .= '$db_host = "'.$db_host.'";'."\n";
      $config_file .= '$db_name = "'.$db_name.'";'."\n";
      $config_file .= '$db_user = "'.$db_user.'";'."\n";
      $config_file .= '$db_password = "'.$db_password.'";'."\n\n";
      $config_file .= '$table_prefix = "'.$table_prefix . '";'."\n\n";

replace with:
Code: [Select]
      $config_file .= 'date_default_timezone_set("' . $selected_timezone . '");'."\n\n";
      $config_file .= '$db_servertype = \''.$db_servertype.'\';'."\n";
      $config_file .= '$db_host = \''.$db_host.'\';'."\n";
      $config_file .= '$db_name = \''.$db_name.'\';'."\n";
      $config_file .= '$db_user = \''.$db_user.'\';'."\n";
      $config_file .= '$db_password = \''.$db_password.'\';'."\n\n";
      $config_file .= '$table_prefix = \''.$table_prefix . '\';'."\n\n";

find:
Code: [Select]
<p><b><?php echo $lang['admin_user'?></b></p>
insert before:
Code: [Select]
              <p><b><?php echo $lang['timezone_select'?></b></p>
            </td>
            <td>
              <p>
                <select name="timezone_select" style="width: 188px;">
                    <option value="-12">Baker Island Time (UTC-12)</option>
                    <option value="-11">Niue Time, Samoa Standard Time (UTC-11)</option>
                    <option value="-10">Hawaii-Aleutian Standard Time, Cook Island Time (UTC-10)</option>
                    <option value="-9.5">Marquesas Islands Time (UTC-9:30)</option>
                    <option value="-9">Alaska Standard Time, Gambier Island Time (UTC-9)</option>
                    <option value="-8">Pacific Standard Time (UTC-8)</option>
                    <option value="-7">Mountain Standard Time (UTC-7)</option>
                    <option value="-6">Central Standard Time (UTC-6)</option>
                    <option value="-5">Eastern Standard Time (UTC-5)</option>
                    <option value="-4.5">Venezuelan Standard Time (UTC-4:30)</option>
                    <option value="-4">Atlantic Standard Time (UTC-4)</option>
                    <option value="-3.5">Newfoundland Standard Time (UTC-3:30)</option>
                    <option value="-3">Amazon Standard Time, Central Greenland Time (UTC-3)</option>
                    <option value="-2">Fernando de Noronha Time, South Georgia &amp; the South Sandwich Islands Time (UTC-2)</option>
                    <option value="-1">Azores Standard Time, Cape Verde Time, Eastern Greenland Time (UTC-1)</option>
                    <option value="0">Western European Time, Greenwich Mean Time (UTC)</option>
                    <option value="1" selected="selected">Central European Time, West African Time (UTC+1)</option>
                    <option value="2">Eastern European Time, Central African Time (UTC+2)</option>
                    <option value="3">Moscow Standard Time, Eastern African Time (UTC+3)</option>
                    <option value="3.5">Iran Standard Time (UTC+3:30)</option>
                    <option value="4">Gulf Standard Time, Samara Standard Time (UTC+4)</option>
                    <option value="4.5">Afghanistan Time (UTC+4:30)</option>
                    <option value="5">Pakistan Standard Time, Yekaterinburg Standard Time (UTC+5)</option>
                    <option value="5.5">Indian Standard Time, Sri Lanka Time (UTC+5:30)</option>
                    <option value="5.75">Nepal Time (UTC+5:45)</option>
                    <option value="6">Bangladesh Time, Bhutan Time, Novosibirsk Standard Time (UTC+6)</option>
                    <option value="6.5">Cocos Islands Time, Myanmar Time (UTC+6:30)</option>
                    <option value="7">Indochina Time, Krasnoyarsk Standard Time (UTC+7)</option>
                    <option value="8">Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time (UTC+8)</option>
                    <option value="8.75">Southeastern Western Australia Standard Time (UTC+8:45)</option>
                    <option value="9">Japan Standard Time, Korea Standard Time, Chita Standard Time (UTC+9)</option>
                    <option value="9.5"> Australian Central Standard Time (UTC+9:30)</option>
                    <option value="10">Australian Eastern Standard Time, Vladivostok Standard Time (UTC+10)</option>
                    <option value="10.5">Lord Howe Standard Time (UTC+10:30)</option>
                    <option value="11">Solomon Island Time, Magadan Standard Time (UTC+11)</option>
                    <option value="11.5">Norfolk Island Time (UTC+11:30)</option>
                    <option value="12">New Zealand Time, Fiji Time, Kamchatka Standard Time (UTC+12)</option>
                    <option value="12.75">Chatham Islands Time (UTC+12:45)</option>
                    <option value="13">Tonga Time, Phoenix Islands Time (UTC+13)</option>
                    <option value="14">Line Island Time (UTC+14)</option>
                </select>
              </p>
            </td>
          </tr>
          <tr class="tablerow2">
            <td>


member.php

find:
Code: [Select]
define('ROOT_PATH', './');
insert after:
Code: [Select]
define('MAIN_SCRIPT', __FILE__);
find:
Code: [Select]
  $image_keywords = preg_replace("/[\n\r]/is", " ", $image_keywords);
  $image_keywords = str_replace(","," ",$image_keywords);
  $image_keywords = ereg_replace("( ){2,}", " ", $image_keywords);

replace with:
Code: [Select]
  $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)));

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

replace with:
Code: [Select]
  $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)));


download.php

find:
Code: [Select]
$disposition = (!eregi("\.zip$", $file_name)) ? 'attachment' : 'inline';
replace with:
Code: [Select]
$disposition = (!preg_match("/\.zip$/i", $file_name)) ? 'attachment' : 'inline';
find:
Code: [Select]
if (!is_remote_file($file_path) && ($filesize = filesize($file_path)) > 0) {
replace with:
Code: [Select]
if (!is_remote_file($file_path) && ($filesize = filesize($file_path)) > 0 && !@ini_get('zlib.output_compression') && !@ini_get('output_handler')) {
find:
Code: [Select]
ereg("(.+)\.(.+)", basename($image_row['image_download_url']), $regs);
replace with:
Code: [Select]
preg_match("/(.+)\.(.+)/", basename($image_row['image_download_url']), $regs);
find:
Code: [Select]
ereg("(.+)\.(.+)", get_basefile($image_row['image_media_file']), $regs);
replace with:
Code: [Select]
preg_match("/(.+)\.(.+)/", get_basefile($image_row['image_media_file']), $regs);
find:
Code: [Select]
ereg("(.+)\.(.+)", get_basefile($image_row['image_media_file']), $regs);
replace with:
Code: [Select]
preg_match("/(.+)\.(.+)/", get_basefile($image_row['image_media_file']), $regs);
find:
Code: [Select]
if ($action == "zip" && !eregi("\.zip$", $file['file_name']) && function_exists("gzcompress") && function_exists("crc32")) {
replace with:
Code: [Select]
if ($action == "zip" && !preg_match("/\.zip$/i", $file['file_name']) && function_exists("gzcompress") && function_exists("crc32")) {

index.php

find:
Code: [Select]
define('ROOT_PATH', './');
insert after:
Code: [Select]
define('MAIN_SCRIPT', __FILE__);
rss.php

find:
Code: [Select]
ORDER BY i.image_date DESC
replace with:
Code: [Select]
ORDER BY i.image_date DESC, i.image_id DESC

login.php

find:
Code: [Select]
if (!ereg("index.php", $url) && !ereg("login.php", $url) && !ereg("register.php", $url) && !ereg("member.php", $url)) {
replace with:
Code: [Select]
if (!preg_match("/index\.php/", $url) && !preg_match("/login\.php/", $url) && !preg_match("/register\.php/", $url) && !preg_match("/member\.php/", $url)) {
find:
Code: [Select]
if (!ereg("index.php", $url) && !ereg("login.php", $url) && !ereg("register.php", $url) && !ereg("member.php", $url)) {
replace with:
Code: [Select]
if (!preg_match("/index\.php/", $url) && !preg_match("/login\.php/", $url) && !preg_match("/register\.php/", $url) && !preg_match("/member\.php/", $url)) {

logout.php

find:
Code: [Select]
if (!ereg("index.php", $url) && !ereg("lightbox.php", $url) && !ereg("login.php", $url) && !ereg("register.php", $url) && !ereg("member.php", $url)) {
replace with:
Code: [Select]
if (!preg_match("/index\.php/", $url) && !preg_match("/lightbox\.php/", $url) && !preg_match("/login\.php/", $url) && !preg_match("/register\.php/", $url) && !preg_match("/member\.php/", $url)) {

register.php

find:
Code: [Select]
define('ROOT_PATH', './');
insert after:
Code: [Select]
define('MAIN_SCRIPT', __FILE__);
find:
Code: [Select]
$user_name = ereg_replace("( ){2,}", " ", $user_name);
replace with:
Code: [Select]
$user_name = preg_replace("/( ){2,}/", " ", $user_name);

details.php

find:
Code: [Select]
define('ROOT_PATH', './');
insert after:
Code: [Select]
define('MAIN_SCRIPT', __FILE__);
find:
Code: [Select]
$meta_keywords  = !empty($image_row['image_keywords']) ? implode(", ", explode(" ", $image_row['image_keywords'])) : "";
replace with:
Code: [Select]
$meta_keywords  = !empty($image_row['image_keywords']) ? implode(", ", explode(",", $image_row['image_keywords'])) : "";
find:
Code: [Select]
      update_comment_count($id, $user_info['user_id']);
      $msg = $lang['comment_success'];

insert after:
Code: [Select]
      $site_sess->set_session_var("msgdetails", $msg);
      redirect(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : "").(($page > 1) ? "&page=".$page : ""));

find:
Code: [Select]
//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------

insert after:
Code: [Select]
if ($msgdetails = $site_sess->get_session_var("msgdetails"))
{
  $msg .= ($msg !== "" ? "<br />" : "").$msgdetails;
  unset($msgdetails);
  $site_sess->drop_session_var("msgdetails");
}


categories.php

find:
Code: [Select]
define('ROOT_PATH', './');
insert after:
Code: [Select]
define('MAIN_SCRIPT', __FILE__);
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search