Author Topic: Changelog von 1.7.3 auf 1.7.4  (Read 6349 times)

0 Members and 1 Guest are viewing this topic.

Offline tansamalaja

  • Full Member
  • ***
  • Posts: 185
    • View Profile
Changelog von 1.7.3 auf 1.7.4
« on: October 28, 2006, 09:34:46 PM »
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.php

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

Search 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.php

Search 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.php

Search for
[qcode]'type' => mime_content_type($file),[/qcode]

Replace with
[qcode]'type' => get_mime_content_type($file)[/qcode]



search.php


Search 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.php

Search for
[qcode]define('SCRIPT_VERSION', '1.7.3');[/qcode]

Replace with
[qcode]define('SCRIPT_VERSION', '1.7.4');[/qcode]



includes/functions.php

Search 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.php

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]


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

Search 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.php

Search 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.php

Search 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.php

Search 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
Quote
<input type="radio" name="search_terms" value="all" checked="checked" />
{lang_and}&nbsp;&nbsp;
<input type="radio" name="search_terms" value="any" />
{lang_or}

Replace with
Quote
<input type="radio" name="search_terms" value="any" checked="checked" />
{lang_or}&nbsp;&nbsp;
<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.
« Last Edit: October 29, 2006, 09:17:19 AM by tansamalaja »

Offline valbuz

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: Changelog von 1.7.3 auf 1.7.4
« Reply #1 on: October 28, 2006, 10:06:05 PM »
Hallo tansamalaja

Danke Dir für die Info's.
Ich habe mein Update nun bereits mittels WinMerge vollbracht.
Jedoch habe ich noch eine Frage/Problem.
Im Changelog steht:

- Changed "Control Panel" to "Admin Control Panel" to avoid confusions with user control panel

Bei mir steht leider immer noch "Control Panel".

Weisst Du wo dies gespeichert ist?

Danke
Pat

Offline tansamalaja

  • Full Member
  • ***
  • Posts: 185
    • View Profile
Re: Changelog von 1.7.3 auf 1.7.4
« Reply #2 on: October 28, 2006, 10:48:53 PM »
Guter Hinweis, wurde in der Auflistung vergessen.

Befindet sich in der
includes/page_header.php

Search for
[qcode]"cp_link" => ($user_info['user_level'] != ADMIN) ? "" : "\n<p align=\"center\">[<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php")."\">Control Panel</a>]</p>\n",[/qcode]

Replace with
[qcode]"cp_link" => ($user_info['user_level'] != ADMIN) ? "" : "\n<p align=\"center\">[<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php")."\">Admin Control Panel</a>]</p>\n",[/qcode]

Offline diablowolf

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Changelog von 1.7.3 auf 1.7.4
« Reply #3 on: October 29, 2006, 03:42:59 AM »
includes/page_footer.php

search for:
$site_sess->freeze();

Delete:
if (isset($HTTP_GET_VARS['phpinfo']) && md5($HTTP_GET_VARS['phpinfo']) == "6111426fcb0b0a76558f9058c331a3a6") {
  phpinfo();
}

Offline tansamalaja

  • Full Member
  • ***
  • Posts: 185
    • View Profile
Re: Changelog von 1.7.3 auf 1.7.4
« Reply #4 on: October 29, 2006, 09:17:47 AM »
Thx, ist geändert