4images Help / Hilfe > News & Announcements
4images 1.7.8
kai:
Here is a detailed list of what has been changed in the php files from 4images 1.7.7 -> 1.7.8.
(The best way for yourself to compare the code of files is to use Winmerge.)
Root files
config.php
find:
--- Code: ---$db_servertype = "mysql";
--- End code ---
insert before:
--- Code: ---date_default_timezone_set('CET');
--- End code ---
global.php
find:
--- Code: ---error_reporting(E_ERROR | E_WARNING | E_PARSE);
set_magic_quotes_runtime(0);
$start_time = microtime();
--- End code ---
replace with:
--- Code: ---$start_time = microtime();
error_reporting(E_ERROR | E_WARNING | E_PARSE);
if (function_exists("set_magic_quotes_runtime"))
{
@set_magic_quotes_runtime(0);
}
--- End code ---
find:
--- Code: ---$captcha_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
--- End code ---
replace with:
--- Code: ---$captcha_chars = "abcdefghijklmnopqrstuvwxyz1234567890";
--- End code ---
find:
--- Code: ---if (eregi("gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"]) || eregi("x-gzip", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
--- End code ---
replace with:
--- Code: ---if (preg_match("/gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"]) || preg_match("/x-gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
--- End code ---
find:
--- Code: ---$config['cat_order'] = empty($config['cat_order']) ? 'cat_order, cat_name ASC' : $config['cat_order'];
--- End code ---
replace with:
--- Code: ---$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'];
--- End code ---
top.php
find:
--- Code: ---define('ROOT_PATH', './');
--- End code ---
insert after:
--- Code: ---define('MAIN_SCRIPT', __FILE__);
--- End code ---
postcards.php
find:
--- Code: ---define('ROOT_PATH', './');
--- End code ---
insert after:
--- Code: ---define('MAIN_SCRIPT', __FILE__);
--- End code ---
search.php
find:
--- Code: ---define('ROOT_PATH', './');
--- End code ---
insert after:
--- Code: ---define('MAIN_SCRIPT', __FILE__);
--- End code ---
find and delete:
--- Code: ---error_reporting(E_ALL);
--- End code ---
install.php
find:
--- Code: ---error_reporting(E_ERROR | E_WARNING | E_PARSE);
set_magic_quotes_runtime(0);
define('ROOT_PATH', './');
--- End code ---
replace with:
--- Code: ---error_reporting(E_ERROR | E_WARNING | E_PARSE);
if (function_exists("set_magic_quotes_runtime"))
{
@set_magic_quotes_runtime(0);
}
define('ROOT_PATH', './');
--- End code ---
find:
--- Code: ---if (!isset($HTTP_GET_VARS)) {
--- End code ---
insert before:
--- Code: ---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'];
}
--- End code ---
find:
--- Code: ---if (@file_exists(ROOT_PATH."config.php")) {
@include(ROOT_PATH.'config.php');
}
--- End code ---
replace with:
--- Code: ---if (@file_exists(ROOT_PATH."config.php")) {
@include(ROOT_PATH.'config.php');
} else {
date_default_timezone_set('CET');
}
--- End code ---
find:
--- Code: ---$admin_password2 = (isset($HTTP_POST_VARS['admin_password2'])) ? trim($HTTP_POST_VARS['admin_password2']) : "";
--- End code ---
insert after:
--- Code: ---$selected_timezone = (isset($HTTP_POST_VARS['timezone_select'])) ? trim($HTTP_POST_VARS['timezone_select']) : '1';
$selected_timezone = get_timezone_by_offset($selected_timezone);
--- End code ---
find:
--- Code: --- $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";
--- End code ---
replace with:
--- Code: --- $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";
--- End code ---
find:
--- Code: ---<p><b><?php echo $lang['admin_user'] ?></b></p>
--- End code ---
insert before:
--- Code: --- <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 & 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>
--- End code ---
member.php
find:
--- Code: ---define('ROOT_PATH', './');
--- End code ---
insert after:
--- Code: ---define('MAIN_SCRIPT', __FILE__);
--- End code ---
find:
--- Code: --- $image_keywords = preg_replace("/[\n\r]/is", " ", $image_keywords);
$image_keywords = str_replace(","," ",$image_keywords);
$image_keywords = ereg_replace("( ){2,}", " ", $image_keywords);
--- End code ---
replace with:
--- Code: --- $image_keywords = preg_replace("/[\n\r]/is", ",", $image_keywords);
$image_keywords_arr = explode(',', $image_keywords);
array_walk($image_keywords_arr, 'trim_value');
$image_keywords = implode(',', array_unique(array_filter($image_keywords_arr)));
--- End code ---
find:
--- Code: --- $image_keywords = preg_replace("/[\n\r]/is", " ", $image_keywords);
$image_keywords = str_replace(","," ",$image_keywords);
$image_keywords = ereg_replace("( ){2,}", " ", $image_keywords);
--- End code ---
replace with:
--- Code: --- $image_keywords = preg_replace("/[\n\r]/is", ",", $image_keywords);
$image_keywords_arr = explode(',', $image_keywords);
array_walk($image_keywords_arr, 'trim_value');
$image_keywords = implode(',', array_unique(array_filter($image_keywords_arr)));
--- End code ---
download.php
find:
--- Code: ---$disposition = (!eregi("\.zip$", $file_name)) ? 'attachment' : 'inline';
--- End code ---
replace with:
--- Code: ---$disposition = (!preg_match("/\.zip$/i", $file_name)) ? 'attachment' : 'inline';
--- End code ---
find:
--- Code: ---if (!is_remote_file($file_path) && ($filesize = filesize($file_path)) > 0) {
--- End code ---
replace with:
--- Code: ---if (!is_remote_file($file_path) && ($filesize = filesize($file_path)) > 0 && !@ini_get('zlib.output_compression') && !@ini_get('output_handler')) {
--- End code ---
find:
--- Code: ---ereg("(.+)\.(.+)", basename($image_row['image_download_url']), $regs);
--- End code ---
replace with:
--- Code: ---preg_match("/(.+)\.(.+)/", basename($image_row['image_download_url']), $regs);
--- End code ---
find:
--- Code: ---ereg("(.+)\.(.+)", get_basefile($image_row['image_media_file']), $regs);
--- End code ---
replace with:
--- Code: ---preg_match("/(.+)\.(.+)/", get_basefile($image_row['image_media_file']), $regs);
--- End code ---
find:
--- Code: ---ereg("(.+)\.(.+)", get_basefile($image_row['image_media_file']), $regs);
--- End code ---
replace with:
--- Code: ---preg_match("/(.+)\.(.+)/", get_basefile($image_row['image_media_file']), $regs);
--- End code ---
find:
--- Code: ---if ($action == "zip" && !eregi("\.zip$", $file['file_name']) && function_exists("gzcompress") && function_exists("crc32")) {
--- End code ---
replace with:
--- Code: ---if ($action == "zip" && !preg_match("/\.zip$/i", $file['file_name']) && function_exists("gzcompress") && function_exists("crc32")) {
--- End code ---
index.php
find:
--- Code: ---define('ROOT_PATH', './');
--- End code ---
insert after:
--- Code: ---define('MAIN_SCRIPT', __FILE__);
--- End code ---
rss.php
find:
--- Code: ---ORDER BY i.image_date DESC
--- End code ---
replace with:
--- Code: ---ORDER BY i.image_date DESC, i.image_id DESC
--- End code ---
login.php
find:
--- Code: ---if (!ereg("index.php", $url) && !ereg("login.php", $url) && !ereg("register.php", $url) && !ereg("member.php", $url)) {
--- End code ---
replace with:
--- Code: ---if (!preg_match("/index\.php/", $url) && !preg_match("/login\.php/", $url) && !preg_match("/register\.php/", $url) && !preg_match("/member\.php/", $url)) {
--- End code ---
find:
--- Code: ---if (!ereg("index.php", $url) && !ereg("login.php", $url) && !ereg("register.php", $url) && !ereg("member.php", $url)) {
--- End code ---
replace with:
--- Code: ---if (!preg_match("/index\.php/", $url) && !preg_match("/login\.php/", $url) && !preg_match("/register\.php/", $url) && !preg_match("/member\.php/", $url)) {
--- End code ---
logout.php
find:
--- Code: ---if (!ereg("index.php", $url) && !ereg("lightbox.php", $url) && !ereg("login.php", $url) && !ereg("register.php", $url) && !ereg("member.php", $url)) {
--- End code ---
replace with:
--- Code: ---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)) {
--- End code ---
register.php
find:
--- Code: ---define('ROOT_PATH', './');
--- End code ---
insert after:
--- Code: --- define('MAIN_SCRIPT', __FILE__);
--- End code ---
find:
--- Code: ---$user_name = ereg_replace("( ){2,}", " ", $user_name);
--- End code ---
replace with:
--- Code: ---$user_name = preg_replace("/( ){2,}/", " ", $user_name);
--- End code ---
details.php
find:
--- Code: ---define('ROOT_PATH', './');
--- End code ---
insert after:
--- Code: --- define('MAIN_SCRIPT', __FILE__);
--- End code ---
find:
--- Code: ---$meta_keywords = !empty($image_row['image_keywords']) ? implode(", ", explode(" ", $image_row['image_keywords'])) : "";
--- End code ---
replace with:
--- Code: ---$meta_keywords = !empty($image_row['image_keywords']) ? implode(", ", explode(",", $image_row['image_keywords'])) : "";
--- End code ---
find:
--- Code: --- update_comment_count($id, $user_info['user_id']);
$msg = $lang['comment_success'];
--- End code ---
insert after:
--- Code: --- $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 : ""));
--- End code ---
find:
--- Code: ---//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------
--- End code ---
insert after:
--- Code: ---if ($msgdetails = $site_sess->get_session_var("msgdetails"))
{
$msg .= ($msg !== "" ? "<br />" : "").$msgdetails;
unset($msgdetails);
$site_sess->drop_session_var("msgdetails");
}
--- End code ---
categories.php
find:
--- Code: ---define('ROOT_PATH', './');
--- End code ---
insert after:
--- Code: --- define('MAIN_SCRIPT', __FILE__);
--- End code ---
Navigation
[0] Message Index
[*] Previous page
Go to full version