4images Forum & Community

4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: Przemek on November 14, 2010, 03:00:13 PM

Title: [1.7.8, 1.7.9] Probleme mit Stichworte
Post by: Przemek on November 14, 2010, 03:00:13 PM
In versions 1.7.8, and 1.7.9 I have a problem with the correct display of links to subpages detail.php keywords.
All the keywords are combined into one, and the newly added photos do not appear in the search tags along with the added earlier. In version 1.7.7 everything worked correctly.

Here's a link to the page: http://transportnews.22web.net/galeria/details.php?image_id=1034 (http://transportnews.22web.net/galeria/details.php?image_id=1034)


PS. Sorry for the post in the wrong topic, this is my first post here :)



--------EDIT @ 2010-11-14 21:43: -----

I found a solution to this problem:

Open functions.php file
Go to linie 309. There is:

function show_image($image_row, $mode = "", $show_link = 1, $detailed_view = 0) {
  global $self_url, $site_template, $site_sess, $user_info, $config, $cat_cache, $lang, $additional_image_fields, $user_table_fields, $url_show_profile;

  $is_new = ($image_row['image_date'] >= (time() - 60 * 60 * 24 * $config['new_cutoff'])) ? 1 : 0;
  $description = (!empty($image_row['image_description'])) ? format_text($image_row['image_description'], 1, 0, 1) : REPLACE_EMPTY;

  if (!empty($image_row['image_keywords'])) {
    $split_keywords = explode(",", $image_row['image_keywords']);
    $keywords = "";
    foreach ($split_keywords as $key => $val) {
      $keywords .= (($keywords != "" ) ? ", " : "")."<a href=\"".$site_sess->url(ROOT_PATH."search.php?search_keywords=".urlencode($val))."\">".format_text($val, 2)."</a>";
    }
  }
  else {
    $keywords = REPLACE_EMPTY;
  }

Replace it to:

function show_image($image_row, $mode = "", $show_link = 1, $detailed_view = 0) {
  global $self_url, $site_template, $site_sess, $user_info, $config, $cat_cache, $lang, $additional_image_fields, $user_table_fields, $url_show_profile;

  $is_new = ($image_row['image_date'] >= (time() - 60 * 60 * 24 * $config['new_cutoff'])) ? 1 : 0;
  $description = (!empty($image_row['image_description'])) ? format_text($image_row['image_description'], 1, 0, 1) : REPLACE_EMPTY;

  if (!empty($image_row['image_keywords'])) {
    $split_keywords = explode(" ", $image_row['image_keywords']);
    $keywords = "";
    foreach ($split_keywords as $key => $val) {
      $keywords .= (($keywords != "" ) ? ", " : "")."<a href=\"".$site_sess->url(ROOT_PATH."search.php?search_keywords=".urlencode($val))."\">".format_text($val, 2)."</a>";
    }
  }
  else {
    $keywords = REPLACE_EMPTY;
  }