Da mir hier ja auch schon viel geholfen wurde, revanchiere ich mich mal mit einem kleinen Fleißkärtchen.
Folgende Dateien muss man für das Versionsupdate von 1.7.3 auf 1.7.4 ändern:
- details.php
- global.php
- postcards.php
- rss.php
- search.php
- includes/constants.php
- includes/functions.php
- includes/page_footer.php
- includes/search_utils.php
- admin/settings.php
- admin/thumbnailer.php
- admin/usergroups.php
- search_form.html
details.phpSearch for
[qcode]$cat_id_sql = 0;
$sub_cat_ids = get_subcat_ids($search_id['search_cat'], $search_id['search_cat'], $cat_parent_cache);
if (check_permission("auth_viewcat", $search_id['search_cat'])) {[/qcode]
Replace with
[qcode]$cat_id_sql = 0;
if (check_permission("auth_viewcat", $search_id['search_cat'])) {
$sub_cat_ids = get_subcat_ids($search_id['search_cat'], $search_id['search_cat'], $cat_parent_cache);[/qcode]
Search for [qcode]
}
else {
$cat_id_sql = get_auth_cat_sql("auth_viewcat");[/qcode]
Insert
above[qcode]$cat_id_sql = $cat_id_sql !== 0 ? "AND cat_id IN ($cat_id_sql)" : "";[/qcode]
Search for
[qcode]else {
$cat_id_sql = get_auth_cat_sql("auth_viewcat");[/qcode]
Replace with
[qcode]else {
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
$cat_id_sql = $cat_id_sql !== 0 ? "AND cat_id NOT IN (".$cat_id_sql.")" : "";
[/qcode]
Search for
[qcode]AND cat_id IN ($cat_id_sql)
[/qcode]
Replace with
[qcode]$cat_id_sql[/qcode]
global.phpSearch for
[qcode]$action = (isset($HTTP_POST_VARS['action'])) ? stripslashes(trim($HTTP_POST_VARS['action'])) : stripslashes(trim($HTTP_GET_VARS['action']));[/qcode]
insert
below[qcode]$action = preg_replace("/[^a-z0-9]+/i", "", $action);[/qcode]
Search for
[qcode]$mode = (isset($HTTP_POST_VARS['mode'])) ? stripslashes(trim($HTTP_POST_VARS['mode'])) : stripslashes(trim($HTTP_GET_VARS['mode']));[/qcode]
Insert
below[qcode]$mode = preg_replace("/[^a-z0-9]+/i", "", $mode);[/qcode]
postcards.phpSearch for
[qcode]$msg = $lang['invalid_postcard_id'];[/qcode]
Replace with
[qcode]show_error_page($lang['invalid_postcard_id']);[/qcode]
Search for
[qcode]"headline" => format_text(stripslashes($headline)),
[/qcode]
Replace with
[qcode]"headline" => format_text(stripslashes($headline), 2),[/qcode]
rss.phpSearch for
[qcode]'type' => mime_content_type($file),[/qcode]
Replace with
[qcode]'type' => get_mime_content_type($file)[/qcode]
search.phpSearch for
[qcode]include(ROOT_PATH.'includes/search_utils.php');[/qcode]
Insert
below[qcode]error_reporting(E_ALL);[/qcode]
Search for
[qcode]$split_words = prepare_searchwords($search_keywords);[/qcode]
Replace with
[qcode]$split_words = prepare_searchwords($search_keywords, true);[/qcode]
Search for
[qcode]$cat_id_sql = 0;
$sub_cat_ids = get_subcat_ids($search_id['search_cat'], $search_id['search_cat'], $cat_parent_cache);
if (check_permission("auth_viewcat", $search_id['search_cat'])) {[/qcode]
Replace with
[qcode]$cat_id_sql = 0;
if (check_permission("auth_viewcat", $search_id['search_cat'])) {
$sub_cat_ids = get_subcat_ids($search_id['search_cat'], $search_id['search_cat'], $cat_parent_cache);[/qcode]
Search for
[qcode]}
else {
$cat_id_sql = get_auth_cat_sql("auth_viewcat");[/qcode]
Insert
above[qcode]$cat_id_sql = $cat_id_sql !== 0 ? "AND i.cat_id IN ($cat_id_sql)" : "";[/qcode]
Search for
[qcode]else {
$cat_id_sql = get_auth_cat_sql("auth_viewcat");[/qcode]
Replace with
[qcode]else {
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
$cat_id_sql = $cat_id_sql !== 0 ? "AND i.cat_id NOT IN (".$cat_id_sql.")" : "";
[/qcode]
Search for
[qcode]AND i.cat_id IN ($cat_id_sql)";[/qcode]
Replace with
[qcode]$cat_id_sql";[/qcode]
Search for
[qcode]AND c.cat_id = i.cat_id AND i.cat_id IN ($cat_id_sql)[/qcode]
Replace with
[qcode]AND c.cat_id = i.cat_id $cat_id_sql[/qcode]
includes/constants.phpSearch for
[qcode]define('SCRIPT_VERSION', '1.7.3');[/qcode]
Replace with
[qcode]define('SCRIPT_VERSION', '1.7.4');[/qcode]
includes/functions.phpSearch for
[qcode]if (!function_exists('mime_content_type')) {
function mime_content_type($file) {[/qcode]
Replace with
[qcode]function get_mime_content_type($file) {
if (function_exists('mime_content_type')) {
$type = mime_content_type($file);
if ($type) {
return $type;
}
}[/qcode]
Search for
[qcode]$type = @exec(trim('file -bi '.escapeshellarg($file)));[/qcode]
Insert
below[qcode]if (strpos($type, ';') !== false) {
list($type) = explode(';', $type);
}[/qcode]
Search for
[qcode]return 'application/octet-stream';[/qcode]
Delete after
[qcode]} //(
only one!)[/qcode]
includes/page_footer.phpSearch for
[qcode]if ((defined("PRINT_STATS") && PRINT_STATS == 1) || (isset($HTTP_GET_VARS['printstats']) && md5($HTTP_GET_VARS['printstats']) == "6111426fcb0b0a76558f9058c331a3a6")) {[/qcode]
Replace with
[qcode]if (defined("PRINT_STATS") && PRINT_STATS == 1) {[/qcode]
Search for
[qcode]$site_sess->freeze();[/qcode]
Delete
below[qcode]if (isset($HTTP_GET_VARS['phpinfo']) && md5($HTTP_GET_VARS['phpinfo']) == "6111426fcb0b0a76558f9058c331a3a6") {
phpinfo();
}[/qcode]
Search for
[qcode]if ((defined("PRINT_STATS") && PRINT_STATS == 1) || (isset($HTTP_GET_VARS['printstats']) && md5($HTTP_GET_VARS['printstats']) == "6111426fcb0b0a76558f9058c331a3a6")) {[/qcode]
Replace with
[qcode]if (defined("PRINT_STATS") && PRINT_STATS == 1) {[/qcode]
includes/search_utils.phpSearch for
[qcode]function prepare_searchwords($val)[/qcode]
Replace with
[qcode]function prepare_searchwords($val, $for_search = false)[/qcode]
Search for
[qcode]$val = strtolower($val);[/qcode]
Insert
below [qcode]if ($for_search) {
$search_array = array(
"/\s+\+/",
"/\s+\-/"
);
$replace_array = array(
" and ",
" not "
);
$val = preg_replace($search_array, $replace_array, $val);
} else {
$val = str_replace("*", "", $val);
}
[/qcode]
Search for
[qcode]"#[\*\n\t\r^\$\(\)<>\"\|,@\?%~\+\.\[\]{}:\/=!§\\\\]+#s"[/qcode]
Replace with
[qcode]"#[\n\t\r^\$\(\)<>\"\|,@\?%~\+\.\[\]{}:\/=!§\\\\]+#s"[/qcode]
Search for
[qcode]foreach ($split_words as $word) {[/qcode]
Insert
below [qcode]if ($word == "") {
continue;
}
if ($for_search && ($word == "and" || $word == "und" || $word == "or" || $word == "oder" || $word == "not")) {
$clean_words[] = $word;
continue;
}[/qcode]
Search for
[qcode]if ($word != "" && $len >= MIN_SEARCH_KEYWORD_LENGTH && $len <= MAX_SEARCH_KEYWORD_LENGTH && !in_array($word, $stopword_list)) {[/qcode]
Replace with
[qcode]if ($len >= MIN_SEARCH_KEYWORD_LENGTH && $len <= MAX_SEARCH_KEYWORD_LENGTH && !in_array($word, $stopword_list)) {[/qcode]
admin/settings.phpSearch for
[qcode]//$config_value = ($htmlspecialchars) ? htmlspecialchars($config[$setting_name]) : $config[$setting_name];[/qcode]
Replace with
[qcode]$config_value = ($htmlspecialchars) ? htmlspecialchars($config[$setting_name]) : $config[$setting_name];[/qcode]
Search for
[qcode]$val = un_htmlspecialchars(trim($val));[/qcode]
Replace with
[qcode]$val = trim($val);[/qcode]
Search for
[qcode]printf("<b>%s</b><p>", urldecode($HTTP_GET_VARS['settings_msg']));[/qcode]
Replace with
[qcode]printf("<b>%s</b><p>", trim($HTTP_GET_VARS['settings_msg']));[/qcode]
admin/thumbnailer.phpSearch for
[qcode]SET image_thumb_file = '".$image_cache[$key]['image_media_file']."'[/qcode]
Replace with
[qcode]SET image_thumb_file = '".addslashes($image_cache[$key]['image_media_file'])."'[/qcode]
admin/usergroups.phpSearch for
[qcode]$permission_select_type = "select"; // choose "select" or "radio"[/qcode]
Replace with
[qcode]$permission_select_type = "checkbox"; // choose "checkbox", "select" or "radio"[/qcode]
Search for
[qcode]else {
echo "<select name=\"auth[".$category_id."][".$val."]\">\n";[/qcode]
Insert
above[qcode]elseif ($permission_select_type == "checkbox") {
$checked = "";
if (isset($cat_access_array[$category_id]) && $cat_access_array[$category_id][$val] == 1) {
$checked = " checked=\"checked\"\n";
}
echo "<input type=\"checkbox\" name=\"auth[".$category_id."][".$val."]\" value=\"1\"$checked>\n";
}
[/qcode]
Search for
[qcode]show_admin_header();[/qcode]
Replace with
[qcode]show_admin_header('
<script language="JavaScript">
<!--
function CheckAllCats(el, type) {
for (var i=0;i<document.form.elements.length;i++) {
var e = document.form.elements
;
if (e.name != el && e.name.indexOf("["+type+"]") > 0) {
e.checked = el.checked;
}
}
}
// -->
</script>
');[/qcode]
Search for
[qcode]show_form_header("usergroups.php", "updatepermissions");[/qcode]
Replace with
[qcode]show_form_header("usergroups.php", "updatepermissions", "form");[/qcode]
Search for
[qcode]echo "<td class=\"tableseparator\" width=\"".$col_width."%\" align=\"center\">".$lang[$val]."</td>\n";[/qcode]
Replace with
[qcode]echo "<td class=\"tableseparator\" width=\"".$col_width."%\" align=\"center\"><input name=\"allbox[".$val."]\" type=\"checkbox\" onClick=\"CheckAllCats(this, '".$val."');\" />".$lang[$val]."</td>\n";[/qcode]
search_form.html
Search for
<input type="radio" name="search_terms" value="all" checked="checked" />
{lang_and}
<input type="radio" name="search_terms" value="any" />
{lang_or}
Replace with
<input type="radio" name="search_terms" value="any" checked="checked" />
{lang_or}
<input type="radio" name="search_terms" value="all" />
{lang_and}
Ich hoffe, dass ich nichts übersehen habe und sich kein Flüchtigkeitsfehler eingeschlichen hat.
Sonst kann das ja hier gepostet werden.