4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 26, 2014, 05:22:15 AM

Login with username, password and session length
Search:     Advanced search
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Help / Hilfe
| |-+  News & Announcements
| | |-+  4images 1.7.8
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: 4images 1.7.8  (Read 64570 times)
kai
Administrator
Addicted member
*****
Offline Offline

Posts: 1385

Thank You
-Given: 64
-Receive: 175


View Profile WWW
« on: August 09, 2010, 05:29:52 PM »

Deutsch 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.

English 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.
Logged


Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search
kai
Administrator
Addicted member
*****
Offline Offline

Posts: 1385

Thank You
-Given: 64
-Receive: 175


View Profile WWW
« 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 » Logged


Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search
kai
Administrator
Addicted member
*****
Offline Offline

Posts: 1385

Thank You
-Given: 64
-Receive: 175


View Profile WWW
« 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:
1
$lang['send_postcard_success'] = "Viele Dank! Ihre eCard wurde erfolgreich versendet.";

replace with:
1
$lang['send_postcard_success'] = "Vielen Dank! Ihre eCard wurde erfolgreich versendet.";

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

replace with:
1
$lang['invalid_activationkey'] = "Dieser Account ist nicht mehr aktiv. Bitte registrieren Sie sich erneut.";

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

replace with:
1
$lang['edit_profile_msg'] = "Hier können Sie Ihr persönliches Profil und Ihr Passwort ändern.";

find:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$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:
1
$lang['comment_edit_error'] = "Fehler beim Bearbeiten der Kommentar";

replace with:
1
$lang['comment_edit_error'] = "Fehler beim Bearbeiten des Kommentars";

find:
1
$lang['comment_delete_error'] = "Fehler beim Löschen der Kommentar";

replace with:
1
$lang['comment_delete_error'] = "Fehler beim Löschen des Kommentars";

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

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

find:
1
$lang['lightbox_delete_success'] = "Leuchkasten erfolgreich gelöscht.";

replace with:
1
$lang['lightbox_delete_success'] = "Leuchtkasten erfolgreich gelöscht.";

find:
1
$lang['delete_lightbox_confirm'] = "Wollen Sie Ihren Leuchkasten wirklich loeschen?";

replace with:
1
$lang['delete_lightbox_confirm'] = "Wollen Sie Ihren Leuchtkasten wirklich loeschen?";


lang/deutsch/install.php

find:

insert before:
1
$lang['timezone_select'] = "Bitte wählen Sie Ihre Zeitzone";


lang/deutsch/admin.php

find:
1
$lang['resizing_image_error'] = "Fehler beim Konvertieren der Bild-Datei!";

insert after:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//-----------------------------------------------------
//--- 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:
1
$lang['post_comment'] = "Agregar comentario";

insert after:
1
$lang['comment_success'] = "Tu comentario se ha guardado";


lang/spanish/install.php

find:

insert before:
1
$lang['timezone_select'] = "Por favor seleccione su zona horaria";


lang/english/main.php

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

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


lang/english/install.php

find:

insert before:
1
$lang['timezone_select'] = "Please select your timezone";


lang/english/admin.php

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

replace with:
1
$lang['field_keywords_ext'] = "Keywords<br /><span class=\"smalltext\">Keywords must be separated by commas or newlines.</span>";

find:
1
$lang['resizing_image_error'] = "Error converting image file!";

insert after:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//-----------------------------------------------------
//--- 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 » Logged


Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search
kai
Administrator
Addicted member
*****
Offline Offline

Posts: 1385

Thank You
-Given: 64
-Receive: 175


View Profile WWW
« 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:
1
$root_path = (!eregi("\/plugins\/", $_SERVER['PHP_SELF'])) ? "./../" : "./../../";

replace with:
1
$root_path = (false === stristr($_SERVER['PHP_SELF'], "/plugins/")) ? "./../" : "./../../";


admin/templates.php

find:
1
$template_file_name = basename($template_file_name);

replace with:
1
$template_file_name = (strpos($template_file_name, 'media/') !== false ? 'media/' : '') . basename($template_file_name);


admin/users.php

find:
1
for ($i = 1; $i <= $num_newusers; $i++) {

insert after:
1
$log = array();


admin/checkimages.php

Completely rewritten, better replace whole file.


admin/backup.php

find:
1
if (eregi("\.gz", $file)) {

replace with:
1
if (preg_match("/\.gz$/i", $file)) {

find:
1
if (eregi("\.gz", $file)) {

replace with:
1
if (preg_match("/\.gz$/i", $file)) {

find:
1
if (is_file(ROOT_PATH.DATABASE_DIR."/".$file) && $file != "." && $file != ".." && eregi("\.sql",$file)) {

replace with:
1
if (is_file(ROOT_PATH.DATABASE_DIR."/".$file) && $file != "." && $file != ".." && preg_match("/\.sql$/i",$file)) {


admin/images.php

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

replace with:
1
2
3
4
$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:
1
2
3
$image_keywords = preg_replace("/[\n\r]/is", " ", $image_keywords);
$image_keywords = str_replace(","," ",$image_keywords);
$image_keywords = ereg_replace("( ){2,}", " ", $image_keywords);

replace with:
1
2
3
4
$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:
1
if (eregi("^\.{1,2}$", $file) || !eregi("\.php$", $file)) {

replace with:
1
if (get_file_extension($file) != "php") {

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

replace with:
1
if (preg_match("/PLUGIN_TITLE:(.+)/", $plugin_file[0], $regs)) {


admin/admin_global.php

find:
1
if (isset($PHP_SELF) && eregi("\/plugins\/", $PHP_SELF)) {

replace with:
1
if (isset($PHP_SELF) && preg_match("/\/plugins\//i", $PHP_SELF)) {


admin/thumbnailer.php

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

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

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

replace with:
1
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:
1
2
3
 $image_keywords = preg_replace("/[\n\r]/is", " ", $image_keywords);
  $image_keywords = str_replace(","," ",$image_keywords);
  $image_keywords = ereg_replace("( ){2,}", " ", $image_keywords);

replace with:
1
2
3
4
 $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:
1
if (is_array($iptc)) {

insert after:
1
$separator = "";

find:
1
$value = $iptc['2#120'][0];

replace with:
1
$value = trim($iptc['2#120'][0]);

find:
1
$value .= (($value != "" ) ? " " : "").$val;

replace with:
1
$value .= (($value != "" ) ? "," : "").trim($val);

find:
1
2
3
         break;

        case "object_name":

insert before:
1
$separator = ",";

find:
1
$value = $iptc['2#005'][0];

replace with:
1
$value = trim($iptc['2#005'][0]);

find:
1
$html = "\n<input type=\"hidden\" name=\"hidden_".$input."\" value=\"".trim($value)." \">\n";

replace with:
1
$html = "\n<input type=\"hidden\" name=\"hidden_".$input."\" value=\"".$value." \">\n";

find:
1
$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:
1
$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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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:
1
if ($newlangfile && !ereg("settings.php", $self_url)) {

replace with:
1
if ($newlangfile && strstr($self_url, "settings.php") === false) {

find:
1
if (ereg("de", $browser_language)) {

replace with:
1
if (strstr($browser_language, "de") !== false) {

find:
1
elseif (ereg("sb", $browser_language) || ereg("sr", $browser_language)) {

replace with:
1
elseif (preg_match("/s(b|r)/", $browser_language)) {

find:
1
if (eregi("gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {

replace with:
1
if (preg_match("/gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {

find:
1
elseif (eregi("x-gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {

replace with:
1
elseif (preg_match("/x-gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {

find:
1
$dir = (!eregi("/$", $dir)) ? $dir."/" : $dir;

replace with:
1
$dir = (!preg_match("#/$#", $dir)) ? $dir."/" : $dir;

find:
1
if (eregi("^\.{1,2}$",$file)) {

replace with:
1
if (preg_match("/^\.{1,2}$/",$file)) {


admin/resizer.php

find:
1
$nozip = 1;

insert before:
1
ini_set('memory_limit', '1024M');

find:
1
2
 $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:
1
2
3
 $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:
1
2
 $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:
1
2
3
 $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:
1
show_input_row($lang['resize_dimension_desc'], "dimension", $dimension);

replace with:
1
2
 show_input_row($lang['max_imagewidth'], "dimension", $dimension);
  show_input_row($lang['max_imageheight'], "height", $height);

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

replace with:
1
2
 $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:
1
if ($resize_type == 1 && ($image_info[0] > $dimension || $image_info[1] > $dimension)) {

replace with:
1
if ($resize_type == 1 && ($image_info[0] > $dimension || $image_info[1] > $height)) {

find:
1
elseif ($resize_type == 3 && $image_info[1] > $dimension) {

replace with:
1
elseif ($resize_type == 3 && $image_info[1] > $height) {

find:
1
$width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type);

replace with:
1
$width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type, $height);

find:
1
show_hidden_input("image_type", $image_type);

insert after:
1
show_hidden_input("height", $height);


admin/home.php

find:
1
if (eregi("Control Panel", $row[$user_table_fields['user_location']])) {

replace with:
1
if (preg_match("/Control Panel/i", $row[$user_table_fields['user_location']])) {

find:
1
if (eregi("Control Panel", $row['session_location'])) {

replace with:
1
if (preg_match("/Control Panel/i", $row['session_location'])) {
Logged


Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search
kai
Administrator
Addicted member
*****
Offline Offline

Posts: 1385

Thank You
-Given: 64
-Receive: 175


View Profile WWW
« 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:
1
if (eregi("gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {

replace with:
1
if (preg_match("/gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {

find:
1
elseif (eregi("x-gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {

replace with:
1
elseif (preg_match("/x-gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {


includes/image_utils.php

find:
1
"convert_path" => ereg_replace("\/$", "", $config['convert_tool_path'])

replace with:
1
"convert_path" => preg_replace("/\/$/", "", $config['convert_tool_path'])

find:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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:
1
function resize_image($file, $quality, $dimension, $resize_type = 1) {

replace with:
1
function resize_image($file, $quality, $dimension, $resize_type = 1, $height = false) {

find:
1
$width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type);

replace width:
1
$width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type, $height);


includes/db_utils.php

find:
1
$queries[$i] = preg_replace("/;$/i", "", $line);

replace with:
1
$queries[$i] = preg_replace("/;$/", "", $line);

find:
1
$queries[$i] .= preg_replace("/;$/i", "", $line);

replace with:
1
$queries[$i] .= preg_replace("/;$/", "", $line);

find:
1
if (eregi('^(MyISAM|ISAM|HEAP|InnoDB)$', ((isset($row['Type'])) ? $row['Type'] : $row['Engine']))) {

replace with:
1
if (preg_match('/^(MyISAM|ISAM|HEAP|InnoDB)$/i', ((isset($row['Type'])) ? $row['Type'] : $row['Engine']))) {


includes/paging.php

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

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


includes/sessions.php

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

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


includes/functions.php

find:
1
ereg("(.+)\?(.+)", $basename, $regs);

replace with:
1
preg_match("#(.+)\?(.+)#", $basename, $regs);

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

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

find:
1
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:
1
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:
1
2
3
4
function get_file_name($file_name) {
  ereg("(.+)\.(.+)", get_basefile($file_name), $regs);
  return $regs[1];
}

replace with:
1
2
3
4
5
6
function get_file_name($file_name) {
  if (preg_match("#(.+)\.(.+)#", get_basefile($file_name), $regs)) {
    return $regs[1];
  }
  return false;
}

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

replace with:
1
return (preg_match("#\.(gif|jpg|jpeg|png)$#is", $file_name)) ? 1 : 0;

find:
1
if (substr(PHP_OS, 0, 3) == "WIN" && !eregi("\.exe$", $file_name)) {

replace with:
1
if (substr(PHP_OS, 0, 3) == "WIN" && !preg_match("#\.exe$#i", $file_name)) {

find:
1
$file_name = eregi_replace("\.exe$", "", $file_name);

replace with:
1
$file_name = preg_replace("#\.exe$#i", "", $file_name);

find:
1
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:
1
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:
1
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:
1
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:
1
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:
1
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:
1
2
3
       elseif ($key == "ExposureTime") {
          $exposure = explode("/", $exif_info);
          $exif_array[$exif_match[$key]] = "1/" . ($exposure[1] / $exposure[0]);

replace with:
1
2
3
4
5
6
7
8
9
10
11
       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:
1
$split_keywords = explode(" ", $image_row['image_keywords']);

replace with:
1
$split_keywords = explode(",", $image_row['image_keywords']);

find and delete:
1
"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:
1
$site_template->register_vars("rate_form", $rate_form);

insert after:
1
2
3
 $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:
1
$thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".format_text($image_name, 2)."\" />";

replace with:
1
$thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".format_text($image_name, 2)."\" title=\"".format_text($image_name, 2)."\" />";

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

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

find:
1
if (eregi("Win", $HTTP_USER_AGENT)) {

replace with:
1
if (preg_match("#Win#i", $HTTP_USER_AGENT)) {

find:
1
elseif (eregi("Mac", $HTTP_USER_AGENT)) {

replace with:
1
elseif (preg_match("#Mac#i", $HTTP_USER_AGENT)) {

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

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

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

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

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

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

find:
1
if (!eregi("http", $url['scheme'])) {

replace with:
1
if (!preg_match("#http#i", $url['scheme'])) {

find:
1
2
   return 'application/octet-stream';
}

insert after:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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:
1
if (isset($user_info['user_level']) && $user_info['user_level'] == ADMIN){

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


includes/constants.php

find:
1
define('SCRIPT_VERSION', '1.7.7');

replace with
1
define('SCRIPT_VERSION', '1.7.8');


includes/captcha_utils.php

find:
1
$valid = $sess_code != '' && strtolower($sess_code) == strtolower($code);

replace with:
1
$valid = $sess_code != '' && $sess_code == $code;


includes/page_header.php

find:
1
2
3
4
5
6
7
8
$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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$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:
1
return (ereg_replace('/+', '/', $tmp_file) == $file_name) ? 1 : 0;

replace with:
1
return (preg_replace('#/+#', '/', $tmp_file) == $file_name) ? 1 : 0;

find:
1
if (eregi("image", $this->HTTP_POST_FILES[$this->field_name]['type'])) {

replace with:
1
if (preg_match("/image/i", $this->HTTP_POST_FILES[$this->field_name]['type'])) {

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

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

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

replace with:
1
2
     $this->file_name = str_replace(" ", "_", $this->file_name);
      $this->file_name = str_replace("%20", "_", $this->file_name);

find:
1
ereg("(.+)\.(.+)", $this->file_name, $regs);

replace with:
1
preg_match("/(.+)\.(.+)/", $this->file_name, $regs);

find:
1
2
3
4
5
6
7
8
9
10
11
 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:
1
2
3
4
5
6
7
8
9
10
 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:
1
2
3
4
5
6
7
   $this->accepted_mime_types['thumb'] = array(
      "image/jpg",
      "image/jpeg",
      "image/pjpeg",
      "image/gif",
      "image/x-png"
    );

find:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
   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:
1
2
   include_once(ROOT_PATH.'includes/upload_definitions.php');
    $this->accepted_mime_types = $mime_type_match;

includes/search_utils.php

find:
1
if ($for_search) {

insert before:
1
$val = preg_replace('/[\n\r]+/', ',', $val);

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

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

find:
1
$split_words = preg_split("/\s+/", $val);

replace with:
1
$split_words = preg_split("/,+/", $val);

find:
1
foreach ($split_words as $word) {

insert after:
1
$word = trim($word);


includes/email.php

find:
1
$to_header = ereg_replace(", $", "", $to_header);

replace with:
1
$to_header = preg_replace("/, $/", "", $to_header);
« Last Edit: August 30, 2010, 04:44:46 PM by kai » Logged


Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search
kai
Administrator
Addicted member
*****
Offline Offline

Posts: 1385

Thank You
-Given: 64
-Receive: 175


View Profile WWW
« 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:
1
$db_servertype = "mysql";

insert before:
1
date_default_timezone_set('CET');


global.php

find:
1
2
3
error_reporting(E_ERROR | E_WARNING | E_PARSE);
set_magic_quotes_runtime(0);
$start_time = microtime();

replace with:
1
2
3
4
5
6
$start_time = microtime();
error_reporting(E_ERROR | E_WARNING | E_PARSE);
if (function_exists("set_magic_quotes_runtime"))
{
  @set_magic_quotes_runtime(0);
}

find:
1
$captcha_chars               = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

replace with:
1
$captcha_chars               = "abcdefghijklmnopqrstuvwxyz1234567890";

find:
1
if (eregi("gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"]) || eregi("x-gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {

replace with:
1
if (preg_match("/gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"]) || preg_match("/x-gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {

find:
1
$config['cat_order'] = empty($config['cat_order']) ? 'cat_order, cat_name ASC' : $config['cat_order'];

replace with:
1
2
$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:
1
define('ROOT_PATH', './');

insert after:
1
define('MAIN_SCRIPT', __FILE__);

postcards.php

find:
1
define('ROOT_PATH', './');

insert after:
1
define('MAIN_SCRIPT', __FILE__);


search.php

find:
1
define('ROOT_PATH', './');

insert after:
1
define('MAIN_SCRIPT', __FILE__);

find and delete:
1
error_reporting(E_ALL);


install.php

find:
1
2
3
error_reporting(E_ERROR | E_WARNING | E_PARSE);
set_magic_quotes_runtime(0);
define('ROOT_PATH', './');

replace with:
1
2
3
4
5
6
error_reporting(E_ERROR | E_WARNING | E_PARSE);
if (function_exists("set_magic_quotes_runtime"))
{
  @set_magic_quotes_runtime(0);
}
define('ROOT_PATH', './');

find:
1
if (!isset($HTTP_GET_VARS)) {

insert before:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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:
1
2
3
if (@file_exists(ROOT_PATH."config.php")) {
  @include(ROOT_PATH.'config.php');
}

replace with:
1
2
3
4
5
if (@file_exists(ROOT_PATH."config.php")) {
  @include(ROOT_PATH.'config.php');
} else {
    date_default_timezone_set('CET');
}

find:
1
$admin_password2 = (isset($HTTP_POST_VARS['admin_password2'])) ? trim($HTTP_POST_VARS['admin_password2']) : "";

insert after:
1
2
$selected_timezone = (isset($HTTP_POST_VARS['timezone_select'])) ? trim($HTTP_POST_VARS['timezone_select']) : '1';
$selected_timezone = get_timezone_by_offset($selected_timezone);

find:
1
2
3
4
5
6
      $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:
1
2
3
4
5
6
7
      $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:
1
<p><b><?php echo $lang['admin_user'?></b></p>

insert before:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
              <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:
1
define('ROOT_PATH', './');

insert after:
1
define('MAIN_SCRIPT', __FILE__);

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

replace with:
1
2
3
4
  $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:
1
2
3
  $image_keywords = preg_replace("/[\n\r]/is", " ", $image_keywords);
  $image_keywords = str_replace(","," ",$image_keywords);
  $image_keywords = ereg_replace("( ){2,}", " ", $image_keywords);

replace with:
1
2
3
4
  $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:
1
$disposition = (!eregi("\.zip$", $file_name)) ? 'attachment' : 'inline';

replace with:
1
$disposition = (!preg_match("/\.zip$/i", $file_name)) ? 'attachment' : 'inline';

find:
1
if (!is_remote_file($file_path) && ($filesize = filesize($file_path)) > 0) {

replace with:
1
if (!is_remote_file($file_path) && ($filesize = filesize($file_path)) > 0 && !@ini_get('zlib.output_compression') && !@ini_get('output_handler')) {

find:
1
ereg("(.+)\.(.+)", basename($image_row['image_download_url']), $regs);

replace with:
1
preg_match("/(.+)\.(.+)/", basename($image_row['image_download_url']), $regs);

find:
1
ereg("(.+)\.(.+)", get_basefile($image_row['image_media_file']), $regs);

replace with:
1
preg_match("/(.+)\.(.+)/", get_basefile($image_row['image_media_file']), $regs);

find:
1
ereg("(.+)\.(.+)", get_basefile($image_row['image_media_file']), $regs);

replace with:
1
preg_match("/(.+)\.(.+)/", get_basefile($image_row['image_media_file']), $regs);

find:
1
if ($action == "zip" && !eregi("\.zip$", $file['file_name']) && function_exists("gzcompress") && function_exists("crc32")) {

replace with:
1
if ($action == "zip" && !preg_match("/\.zip$/i", $file['file_name']) && function_exists("gzcompress") && function_exists("crc32")) {


index.php

find:
1
define('ROOT_PATH', './');

insert after:
1
define('MAIN_SCRIPT', __FILE__);

rss.php

find:
1
ORDER BY i.image_date DESC

replace with:
1
ORDER BY i.image_date DESC, i.image_id DESC


login.php

find:
1
if (!ereg("index.php", $url) && !ereg("login.php", $url) && !ereg("register.php", $url) && !ereg("member.php", $url)) {

replace with:
1
if (!preg_match("/index\.php/", $url) && !preg_match("/login\.php/", $url) && !preg_match("/register\.php/", $url) && !preg_match("/member\.php/", $url)) {

find:
1
if (!ereg("index.php", $url) && !ereg("login.php", $url) && !ereg("register.php", $url) && !ereg("member.php", $url)) {

replace with:
1
if (!preg_match("/index\.php/", $url) && !preg_match("/login\.php/", $url) && !preg_match("/register\.php/", $url) && !preg_match("/member\.php/", $url)) {


logout.php

find:
1
if (!ereg("index.php", $url) && !ereg("lightbox.php", $url) && !ereg("login.php", $url) && !ereg("register.php", $url) && !ereg("member.php", $url)) {

replace with:
1
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:
1
define('ROOT_PATH', './');

insert after:
1
define('MAIN_SCRIPT', __FILE__);

find:
1
$user_name = ereg_replace("( ){2,}", " ", $user_name);

replace with:
1
$user_name = preg_replace("/( ){2,}/", " ", $user_name);


details.php

find:
1
define('ROOT_PATH', './');

insert after:
1
define('MAIN_SCRIPT', __FILE__);

find:
1
$meta_keywords  = !empty($image_row['image_keywords']) ? implode(", ", explode(" ", $image_row['image_keywords'])) : "";

replace with:
1
$meta_keywords  = !empty($image_row['image_keywords']) ? implode(", ", explode(",", $image_row['image_keywords'])) : "";

find:
1
2
      update_comment_count($id, $user_info['user_id']);
      $msg = $lang['comment_success'];

insert after:
1
2
      $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:
1
2
3
//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------

insert after:
1
2
3
4
5
6
if ($msgdetails = $site_sess->get_session_var("msgdetails"))
{
  $msg .= ($msg !== "" ? "<br />" : "").$msgdetails;
  unset($msgdetails);
  $site_sess->drop_session_var("msgdetails");
}


categories.php

find:
1
define('ROOT_PATH', './');

insert after:
1
define('MAIN_SCRIPT', __FILE__);
Logged


Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.402 seconds with 20 queries.