4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: xox on May 23, 2007, 04:34:24 PM

Title: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: xox on May 23, 2007, 04:34:24 PM
1)open the .htaccess file and add the lines to the .htaccess
Code: [Select]
RewriteEngine On

#RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+)\.htm$ categories.php?cat_id=$2&%{QUERY_STRING}
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}

2.) open /include/sessions.php before the last line ?> add the following code
The following code in this step is not optimized. You should use an optimized code from this (http://www.4homepages.de/forum/index.php?topic=17598.msg126772#msg126772) reply on page 11
Code: [Select]
//Mod_bmollet
/**
 * Get the category url
 * @param int $cat_id The id of the category
 * @param string $cat_url The current status of the URL
 */
function get_category_url($cat_id,$cat_url = '')
{
global $site_db;
$sql = "SELECT cat_name,cat_parent_id FROM ".CATEGORIES_TABLE." WHERE cat_id = '".$cat_id."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
$cat_url  = '-'.str_replace('+','-',urlencode($row['cat_name'])).'-'.$cat_id.$cat_url;
// if you want full path of category in url, put next line in comment
return $cat_url;
if( $row['cat_parent_id'] != 0)
{
return get_category_url($row['cat_parent_id'],$cat_url);
}
else
{
return $cat_url;
}
}
//Mod_bmollet
/**
 * Get the image url
 * @param int $image_id The id of the image
 */
function get_image_url($image_id)
{
global $site_db;
$sql = "SELECT cat_id,image_name FROM ".IMAGES_TABLE." WHERE image_id = '".$image_id."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
// if you want comlpete path to image in url, remove comment from following line
//return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
return '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
}

3.)open /include/sessions.php find this code

Code: [Select]
function url($url, $amp = "&") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && !preg_match("/".SESSION_NAME."=/i", $url)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }

4.)Replace with this one

Code: [Select]
/* ORIGINAL CODE
  function url($url, $amp = "&") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && !preg_match("/".SESSION_NAME."=/i", $url)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }
*/
  function url($url, $amp = "&") {
    global $l, $user_info;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];
    $url = str_replace('&', '&', $url);
    if (!defined('IN_CP')) {
      if (strstr($url, 'index.php')) {
        $url = str_replace('index.php', '', $url);
      }
      elseif (strstr($url, 'search.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('search.php', 'search.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('search.php', 'search.htm', $url);
        }
      }
      elseif (strstr($url, 'lightbox.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('lightbox.php', 'lightbox.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
                $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('lightbox.php', 'lightbox.htm', $url);
        }
      }
      elseif (strstr($url, 'categories.php')) {
        if (strstr($url, 'cat_id=') && strstr($url, 'page=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#page=([0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('categories.php', 'cat'.$matches1[1].'.'.$matches2[1].'.htm', $url);
            $query = str_replace('cat_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches1[1], '', $query);
            $query = str_replace('cat_id='.$matches1[1], '', $query);
            $query = str_replace('page='.$matches2[1].'&', '', $query);
            $query = str_replace('&page='.$matches2[1], '', $query);
            $query = str_replace('page='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        elseif (strstr($url, 'cat_id=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $cat_url = get_category_url($matches[1]);
            $url   = str_replace('categories.php', 'cat'.$cat_url.'.htm', $url);
            $query = str_replace('cat_id='.$matches[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches[1], '', $query);
            $query = str_replace('cat_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('categories.php', 'cat.htm', $url);
        }
      }
      elseif (strstr($url, 'details.php?image_id=')) {
        if (strstr($url, 'image_id=') && strstr($url, 'mode=')) {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#mode=([a-zA-Z0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'img'.$matches1[1].'.'.$matches2[1].'.htm', $url);
            $query = str_replace('image_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches1[1], '', $query);
            $query = str_replace('image_id='.$matches1[1], '', $query);
            $query = str_replace('mode='.$matches2[1].'&', '', $query);
            $query = str_replace('&mode='.$matches2[1], '', $query);
            $query = str_replace('mode='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'img'.get_image_url($matches[1]).'.htm', $url);
            $query = str_replace('image_id='.$matches[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches[1], '', $query);
            $query = str_replace('image_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
      }
      elseif (strstr($url, 'postcards.php?image_id=')) {
        preg_match('#image_id=([0-9]+)&?#', $url, $matches);
        if (isset($matches[1])) {
          $split = explode('?', $url);
          $url = $split[0];
          $query = @$split[1];
          $url   = str_replace('postcards.php', 'postcard.img'.$matches[1].'.htm', $url);
          $query = str_replace('image_id='.$matches[1].'&', '', $query);
          $query = str_replace('&image_id='.$matches[1], '', $query);
          $query = str_replace('image_id='.$matches[1], '', $query);
          if (!empty($query)) {
            $url .= '?' . $query;
          }
        }
      }
    }
    if ($this->mode == "get" && strstr($url, $this->session_id)) {
      $url .= strpos($url, '?') !== false ? '&' : '?';
      $url .= SESSION_NAME."=".$this->session_id;
    }
    if (!empty($l)) {
      $url .= strpos($url, '?') ? '&' : '?';
      $url .= "l=".$l;
    }
    $url = str_replace('&', $amp, $url);
    $url .= isset($dummy_array[1]) ? "#".$dummy_array[1] : "";
    return $url;
  }

then it would like this
http://www.turkiye-resimleri.com/


also i have upload the pre-edited files for 1.7.4 http://rapidshare.com/files/33076491/seo.rar.html
this seo.rar file contains .htaccess file and /include/sessions.php file you can use it withour modifying
The files provided in the package are out of date, do not use them, install mod manually instead.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: al3aqeed on May 24, 2007, 09:44:56 AM
i start whith you step to step but i have now big problem
can you help me
this my problem

DB Error: Bad SQL Query: DELETE FROM 4images_sessions WHERE session_lastaction < 1179992031
Incorrect key file for table '4images_sessions'; try to repair it

DB Error: Bad SQL Query: INSERT INTO 4images_sessions (session_id, session_user_id, session_lastaction, session_location, session_ip) VALUES ('9a70711b04e42b85bd059891e5e2a76c', -1, 1179992631, 'index.php', '62.150.109.129')
Duplicate entry '-1' for key 2

Warning: Cannot modify header information - headers already sent by (output started at /home/XXXXXX/public_html/gallery/includes/db_mysql.php:188) in /home/XXXXXX/public_html/gallery/includes/sessions.php on line 85

Warning: Cannot modify header information - headers already sent by (output started at /home/XXXXXX/public_html/gallery/includes/db_mysql.php:188) in /home/XXXXXX/public_html/gallery/includes/sessions.php on line 85

Warning: Cannot modify header information - headers already sent by (output started at /home/XXXXXX/public_html/gallery/includes/db_mysql.php:188) in /home/XXXXXX/public_html/gallery/includes/sessions.php on line 85

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: xox on May 24, 2007, 10:13:22 AM
try to repair the 4images_sessions table in phpmyadmin i dont think it is not related with this mod
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: al3aqeed on May 24, 2007, 10:21:58 AM
can you Explain whin i join phpmyadmin ?

Because these big problem and i can`t join cpanel admin my gallery :(



Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: xox on May 24, 2007, 10:24:38 AM
login to cpanel go to mysql database under the menu and select repair near database name
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: al3aqeed on May 24, 2007, 10:35:50 AM
these is true ?

(http://www.7lm.com/up/uploads/3ea7b09700.jpg)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: xox on May 24, 2007, 10:40:56 AM
yes
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: al3aqeed on May 24, 2007, 10:44:20 AM
it not have any Change  :(
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: xox on May 24, 2007, 10:59:35 AM
revert the changes you made by modifying code and try again
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: al3aqeed on May 24, 2007, 11:47:12 AM
i have buck-up to sessions.php and uploud now and not have any chang
why ? :(
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: xox on May 24, 2007, 11:48:06 AM
try to repair all tables using phpmyadmin
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: al3aqeed on May 24, 2007, 11:51:01 AM
you have msn
add al_3aqeed@hotmail.com
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: al3aqeed on May 24, 2007, 12:24:48 PM
not have any change  :(
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: yas3min on May 25, 2007, 11:58:28 AM
Teşekkürler emeğine sağlık

Thank you very much ;)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Vincent on May 30, 2007, 05:12:52 PM
how to use it if you have no .htaccess file because of using a MS Server?

sincerly
vincent
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: xox on May 30, 2007, 05:16:51 PM
if it is apache working on windows it will work
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: theolbap on May 31, 2007, 11:58:46 PM
Please Help!

Not work in my search:

Notice: Undefined offset: 0 in /www/docs/ahmira.com.ar/public_html/includes/page_header.php on line 438

Notice: Undefined offset: 0 in /www/docs/ahmira.com.ar/public_html/includes/page_header.php on line 439

Notice: Undefined offset: 0 in /www/docs/ahmira.com.ar/public_html/includes/page_header.php on line 440


this:
line438   "cat_name" => htmlspecialchars($cat_cache[$cat_id]['cat_name']),
line439   "cat_description" => $cat_cache[$cat_id]['cat_description'],
line440   "cat_hits" => $cat_cache[$cat_id]['cat_hits'],


and my search.php

Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: search.php                                           *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.4                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$main_template 'search';

define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/search_utils.php');
error_reporting(E_ALL);
$org_search_keywords $search_keywords;
$org_search_user $search_user;

if (isset(
$HTTP_GET_VARS['search_terms']) || isset($HTTP_POST_VARS['search_terms'])) {
  
$search_terms = isset($HTTP_POST_VARS['search_terms']) ? $HTTP_POST_VARS['search_terms'] : $HTTP_GET_VARS['search_terms'];
  
$search_terms $search_terms == "all" 0;
}
else {
  
$search_terms 0;
}

if (isset(
$HTTP_GET_VARS['search_fields']) || isset($HTTP_POST_VARS['search_fields'])) {
  
$search_fields = isset($HTTP_POST_VARS['search_fields']) ? trim($HTTP_POST_VARS['search_fields']) : trim($HTTP_GET_VARS['search_fields']);
}
else {
  
$search_fields "all";
}

$search_cat $cat_id;

$search_id = array();

if (
$search_user != "" && $show_result == 1) {
  
$search_user str_replace('*''%'trim($search_user));
  
$sql "SELECT ".get_user_table_field("""user_id")."
          FROM "
.USERS_TABLE."
          WHERE "
.get_user_table_field("""user_name")." LIKE '$search_user'";
  
$result $site_db->query($sql);
  
$search_id['user_ids'] = "";
  if (
$result) {
    while (
$row $site_db->fetch_array($result)) {
      
$search_id['user_ids'] .= (($search_id['user_ids'] != "") ? ", " "").$row[$user_table_fields['user_id']];
    }
    
$site_db->free_result($result);
  }
}

if (
$search_keywords != "" && $show_result == 1) {
  
$split_words prepare_searchwords($search_keywordstrue);

  
$match_field_sql = ($search_fields != "all" && isset($search_match_fields[$search_fields])) ? "AND m.".$search_match_fields[$search_fields]." = 1" "";
  
$search_word_cache = array();
  for (
$i 0$i sizeof($split_words); $i++) {
    if (
$split_words[$i] == "and" || $split_words[$i] == "und" || $split_words[$i] == "or" || $split_words[$i] == "oder" || $split_words[$i] == "not") {
      
$search_word_cache[$i] = ($search_terms) ? "and" $split_words[$i];
    }
    else {
      
$sql "SELECT m.image_id
              FROM ("
.WORDLIST_TABLE." w, ".WORDMATCH_TABLE." m)
              WHERE w.word_text LIKE '"
.addslashes(str_replace("*""%"$split_words[$i]))."'
              AND m.word_id = w.word_id
              
$match_field_sql";
      
$result $site_db->query($sql);
      
$search_word_cache[$i] = array();
      while (
$row $site_db->fetch_array($result)) {
        
$search_word_cache[$i][$row['image_id']] = 1;
      }
      
$site_db->free_result();
    }
  }

  
$is_first_word 1;
  
$operator "or";
  
$image_id_list = array();
  for (
$i 0$i sizeof($search_word_cache); $i++) {
    if (
$search_word_cache[$i] == "and" || $search_word_cache[$i] == "und" || $search_word_cache[$i] == "or" || $search_word_cache[$i] == "oder" || $search_word_cache[$i] == "not") {
      if (!
$is_first_word) {
        
$operator $search_word_cache[$i];
      }
    }
    elseif (
is_array($search_word_cache[$i])) {
      if (
$search_terms) {
        
$operator "and";
      }
      foreach (
$search_word_cache[$i] as $key => $val) {
        if (
$is_first_word || $operator == "or" || $operator == "oder") {
          
$image_id_list[$key] = 1;
        }
        elseif (
$operator == "not") {
          unset(
$image_id_list[$key]);
        }
      }
      if ((
$operator == "and" || $operator == "und") && !$is_first_word) {
        foreach (
$image_id_list as $key => $val) {
          if (!isset(
$search_word_cache[$i][$key])) {
            unset(
$image_id_list[$key]);
          }
        }
      }
    }
    
$is_first_word 0;
  }

  
$search_id['image_ids'] = "";
  foreach (
$image_id_list as $key => $val) {
    
$search_id['image_ids'] .= (($search_id['image_ids'] != "") ? ", " "").$key;
  }
  unset(
$image_id_list);
}

if (
$search_new_images && $show_result == 1) {
  
$search_id['search_new_images'] = 1;
}

if (
$search_cat && $show_result == 1) {
  
$search_id['search_cat'] = $search_cat;
}

if (!empty(
$search_id)) {
  
$site_sess->set_session_var("search_id"serialize($search_id));
}

include(
ROOT_PATH.'includes/page_header.php');

$num_rows_all 0;
if (
$show_result == 1) {
  if (empty(
$search_id)) {
    if (!empty(
$session_info['search_id'])) {
      
$search_id unserialize($session_info['search_id']);
    } else {
      
$search_id unserialize($site_sess->get_session_var("search_id"));
    }
  }

  
$sql_where_query "";

  if (!empty(
$search_id['image_ids'])) {
    
$sql_where_query .= "AND i.image_id IN (".$search_id['image_ids'].") ";
  }

  if (!empty(
$search_id['user_ids'])) {
    
$sql_where_query .= "AND i.user_id IN (".$search_id['user_ids'].") ";
  }

  if (!empty(
$search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
    
$new_cutoff time() - 60 60 24 $config['new_cutoff'];
    
$sql_where_query .= "AND i.image_date >= $new_cutoff ";
  }

  if (!empty(
$search_id['search_cat']) && $search_id['search_cat'] != 0) {
    
$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);
      
$cat_id_sql .= ", ".$search_id['search_cat'];
      if (!empty(
$sub_cat_ids[$search_id['search_cat']])) {
        foreach (
$sub_cat_ids[$search_id['search_cat']] as $val) {
          if (
check_permission("auth_viewcat"$val)) {
            
$cat_id_sql .= ", ".$val;
          }
        }
      }
    }
    
$cat_id_sql $cat_id_sql !== "AND i.cat_id IN ($cat_id_sql)" "";
  }
  else {
    
$cat_id_sql get_auth_cat_sql("auth_viewcat""NOTIN");
    
$cat_id_sql $cat_id_sql !== "AND i.cat_id NOT IN (".$cat_id_sql.")" "";
  }

  if (!empty(
$sql_where_query)) {
    
$sql "SELECT COUNT(*) AS num_rows_all
            FROM "
.IMAGES_TABLE." i
            WHERE i.image_active = 1 
$sql_where_query
            
$cat_id_sql";
    
$row $site_db->query_firstrow($sql);
    
$num_rows_all $row['num_rows_all'];
  }
}

if (!
$num_rows_all && $show_result == 1)  {
  
$msg preg_replace("/".$site_template->start."search_keywords".$site_template->end."/"$search_keywords$lang['search_no_results']);
}

//-----------------------------------------------------
//--- Show Search Results -----------------------------
//-----------------------------------------------------
if ($num_rows_all && $show_result == 1)  {
  
$link_arg $site_sess->url(ROOT_PATH."search.php?show_result=1");

  include(
ROOT_PATH.'includes/paging.php');
  
$getpaging = new Paging($page$perpage$num_rows_all$link_arg);
  
$offset $getpaging->get_offset();
  
$site_template->register_vars(array(
    
"paging" => $getpaging->get_paging(),
    
"paging_stats" => $getpaging->get_paging_stats()
  ));

  
$imgtable_width ceil((intval($config['image_table_width'])) / $config['image_cells']);
  if ((
substr($config['image_table_width'], -1)) == "%") {
    
$imgtable_width .= "%";
  }

  
$additional_sql "";
  if (!empty(
$additional_image_fields)) {
    foreach (
$additional_image_fields as $key => $val) {
      
$additional_sql .= ", i.".$key;
    }
  }

  
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name")."
          FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
          WHERE i.image_active = 1
          
$sql_where_query
          AND c.cat_id = i.cat_id 
$cat_id_sql
          ORDER BY "
.$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort']."
          LIMIT 
$offset$perpage";
  
$result $site_db->query($sql);

  
$thumbnails "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";

  
$count 0;
  
$bgcounter 0;
  while (
$image_row $site_db->fetch_array($result)) {
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    
$thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
    
show_image($image_row"search");
    
$thumbnails .= $site_template->parse_template("thumbnail_bit");
    
$thumbnails .= "\n</td>\n";
    
$count++;
    if (
$count == $config['image_cells']) {
      
$thumbnails .= "</tr>\n";
      
$count 0;
    }
  } 
// end while
  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover >= 1) {
      for (
$i 0$i $leftover$i++) {
        
$thumbnails .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      
$thumbnails .= "</tr>\n";
    }
  }
  
$thumbnails .= "</table>\n";
  
$content $thumbnails;
  unset(
$thumbnails);
// end if
else {
  
$site_template->register_vars(array(
    
"search_keywords" => format_text(stripslashes($org_search_keywords), 2),
    
"search_user" => format_text(stripslashes($org_search_user), 2),
    
"lang_search_by_keyword" => $lang['search_by_keyword'],
    
"lang_search_by_username" => $lang['search_by_username'],
    
"lang_new_images_only" => $lang['new_images_only'],
    
"lang_search_terms" => $lang['search_terms'],
    
"lang_or" => $lang['or'],
    
"lang_and" => $lang['and'],
    
"lang_category" => $lang['category'],
    
"lang_search_fields" => $lang['search_fields'],
    
"lang_all_fields" => $lang['all_fields'],
    
"lang_name_only" => $lang['name_only'],
    
"lang_description_only" => $lang['description_only'],
    
"lang_keywords_only" => $lang['keywords_only'],
    
"category_dropdown" => get_category_dropdown($cat_id)
  ));

  if (!empty(
$additional_image_fields)) {
    
$additional_field_array = array();
    foreach (
$additional_image_fields as $key => $val) {
      if (isset(
$lang[$key.'_only'])) {
        
$additional_field_array['lang_'.$key.'_only'] = $lang[$key.'_only'];
      }
    }
    if (!empty(
$additional_field_array)) {
      
$site_template->register_vars($additional_field_array);
    }
  }
  
$content $site_template->parse_template("search_form");
}

//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
// $clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$lang['search']."</span>"; // Original code
// MOD: Dynamic page title BLOCK BEGIN
if (!empty($search_id['search_new_images'])) {
  if( 
$search_id['search_new_images'] == )
    
$txt_clickstream $lang['new_images'];
  else
    
$txt_clickstream $lang['new_images_since'];
}
else {
  
$txt_clickstream $lang['search'];
}
$clickstream "<span class=\"clickstream\"><a title=\"".$lang['home']."\" href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].(($search_keywords) ? "<a href=\"".$site_sess->url(ROOT_PATH."search.php")."\" class=\"clickstream\">".$lang['search']."</a>".$config['category_separator'].$search_keywords $txt_clickstream)."</span>";  // Show search keywords
$page_title $config['category_separator'].$txt_clickstream;
// MOD: Dynamic page title BLOCK END

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  
"content" => $content,
  
"msg" => $msg,
  
"clickstream" => $clickstream,
  
"page_title" => $page_title// MOD: Dynamic page title
  
"lang_search" => $lang['search']
));
$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php');
?>


search but links wrong..

ty for help!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: xox on June 01, 2007, 05:07:51 AM
use the pre modified files for it first backup your files
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: zoomos on June 03, 2007, 03:10:50 AM
great mod.. works perfectly.

I did find a problem with the search results

The link in thumb images after search is img[image_number].search.htm  ex: img123.search.htm

Just add this to your .htaccess and it should work perfect
Code: [Select]
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Smoothice on June 04, 2007, 12:39:38 AM
Ok I thought this was working great except for a couple things.

Catagories


Images are being shown properly with the catagory name and the image name but when I am just in a catagory and not an image it isn't working.  It still shows the old format. Now I also came across that when I either login or logout when I am on a catagory page that I get a 404 error that it is trying to access /cat.html. This does not happen on the main page or the details page.  I have double checked everything even used your pre-modded files but it is still not working for me.

Aaron
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: xox on June 04, 2007, 09:06:29 AM
if you have cat.html you are using the other google friendly url make sure you remove the lines from .htaccess
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Smoothice on June 04, 2007, 02:29:16 PM
Sorry it is cat.htm

eg error message
The requested URL /cat.htm was not found on this server.

I am using the pre modded files

Aaron
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: theolbap on June 06, 2007, 11:34:23 PM
great mod.. works perfectly.

I did find a problem with the search results

The link in thumb images after search is img[image_number].search.htm  ex: img123.search.htm

Just add this to your .htaccess and it should work perfect
Code: [Select]
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}


yes!! works perfectly,

only lightbox not work, help to modify:

Quote
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}

 :D ty
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Smoothice on June 08, 2007, 06:11:38 AM
Upon further inspection my lightbox does not work either.  I did use your pre-modded files and they are still not working.  Both the logging in and out when in a catagory page as well as the catagory does not show correct in the url.  It has been almost a week and I have not really had any help with this just wondering if I am alone here with my problems.

Aaron

In case you wish to see the url is www.fukthedog.com (http://www.fukthedog.com)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: flash77 on June 08, 2007, 02:20:07 PM
Sorry it is cat.htm

eg error message
The requested URL /cat.htm was not found on this server.

I am using the pre modded files

Aaron

add this rule to .htaccess
Code: [Select]
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Smoothice on June 08, 2007, 02:51:19 PM
Perfect that worked but is there a way to get the lighbox working correct.  The link to the images is still not crrect.  I tried several things but to no avail yet.

Aaron
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: om6acw on June 09, 2007, 02:48:04 AM
Great, works on first time  :!: :!: :!:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Martin2006-B-2 on June 13, 2007, 03:25:30 PM
Don't work. Get "Internal Server Error 500"

what shall i do?

Greetz! Martin
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: xox on June 13, 2007, 03:27:15 PM
check htaccess check mod rewrite support on the host
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: impss on June 14, 2007, 02:51:57 PM

theolbap , for my lightbox i used this code in the htaccess file and it seems to work

Code: [Select]
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Martin2006-B-2 on June 21, 2007, 01:58:19 PM
Don't work. Get "Internal Server Error 500"

what shall i do?

Greetz! Martin

Sorry my mistake! mod_rewrite was not enabled  :roll:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: yellows on June 24, 2007, 06:07:58 PM
cheers ace mod, hopefully google will start to list my new pics now :)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: yellows on June 24, 2007, 06:20:56 PM
on search / new images - is there any way to display the actual url rather than the img15434.search.htm is display img-jamie-cook---9-15426.htm

any chance of this

James
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: knsin0 on July 06, 2007, 05:32:38 AM
and what abou the page titles and the keywords? i see that in your site are implemented www.turkiye-resimleri.com , that would do this mod the really best seo mod  :roll: :D
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: darvid on July 06, 2007, 04:37:29 PM
as i see my categories are renamed to cat-aus-der-luft-1.htm. when i click on the category, i get a 404 error.

any idea?


// EDIT //

If fixed it:

Code: [Select]
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteBase /4images/
RewriteRule ^cat-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}

#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
</IfModule>

What I did, was uncommenting the "RewriteBase" and adding the path to 4images.


Details on http://www.4homepages.de/forum/index.php?topic=6729.0 (http://www.4homepages.de/forum/index.php?topic=6729.0)

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: darvid on July 06, 2007, 05:49:50 PM
I have seen on http://www.turkiye-resimleri.com/k-aksaray-5.htm (http://www.turkiye-resimleri.com/k-aksaray-5.htm) that the thumbnail links to the detail page also are seo friendly. how would i do that?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: netlovers on July 14, 2007, 07:02:47 PM
I have installed SEO MOD and main page of gallery in opening OK and it is also generating .htm URLs for categories and images but when i click on any image or category it shows 404 error page(page not found) So do u know whats the reason behind this error.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: darvid on July 14, 2007, 07:30:58 PM
did u try my fix mentioned above?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: netlovers on July 16, 2007, 02:27:47 PM
Thanks c-bass
Everything is working OK now.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: darvid on July 16, 2007, 02:37:14 PM
good to know.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sami1255 on July 19, 2007, 12:53:13 AM
Well, is it possible to have categories link without the prefix of 'k' like k-category-name-5.htm becomes 'category-name-5.htm'.. i think iam asking for too much but you guys are pros..  :)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: netlovers on July 20, 2007, 10:25:29 PM
MOD is working OK
But when i m clicking on ecard it is showing 404 error and i can see that there is no rewriterule defind in .htaccess.
So can anybody tell me how to solve this problem
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: kuruz on July 24, 2007, 08:02:05 PM
Last two lines resolve problems with e-card and new images
Code: [Select]
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}

#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}

RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}

RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}

RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^postcard\.img([0-9]+)\.htm$ postcards.php?image_id=$1&%{QUERY_STRING}
</IfModule>
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: darvid on July 24, 2007, 08:40:09 PM
plz dont forget do edit the path for

Code: [Select]
RewriteBase
in the code above.[/b] how to do that, look at the posts before.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sami1255 on July 24, 2007, 09:04:03 PM
Quote
Well, is it possible to have categories link without the prefix of 'k' like k-category-name-5.htm becomes 'category-name-5.htm'.. i think iam asking for too much but you guys are pros..

please i need an answer for this !
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: darvid on July 24, 2007, 09:07:45 PM
yes it is.

look at this thread --> http://www.4homepages.de/forum/index.php?topic=6729.0

there is somewhere a post from somebody, who asks the same and solves it. i cant remember who it was, but it was somebody from the netherlands
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: FotoRalle on July 24, 2007, 09:08:49 PM
After i have checked all Problems with this, it works perfectly! The Code for htaccess musst be:
Code: [Select]
RewriteEngine On

#RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sami1255 on July 24, 2007, 10:36:17 PM
Quote
yes it is.

look at this thread --> http://www.4homepages.de/forum/index.php?topic=6729.0

there is somewhere a post from somebody, who asks the same and solves it. i cant remember who it was, but it was somebody from the netherlands

I suppose you are talking about the page 14 mod of the specified thread.. well, that problem still remains buddy..


has anybody completely optimized 4images urls to


www.mysite.com/categoryname/imagename.html



without any ks or keywords preceeding the name.. everybody want their 4image to look like /categoryname/imagename.html ONLY.. no k's or r's or keywords or numbers inbetween..


Thats extremely important question and everybody running 4images desperately wants to know.. who are the pros here?  :roll:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sami1255 on July 25, 2007, 02:32:13 PM
is there any or should i stop searching.. ?  :cry:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: darvid on July 25, 2007, 04:26:37 PM
http://www.4homepages.de/forum/index.php?topic=6729.msg57268#msg57268

but i dont believe that it was working with 4images 1.74
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Omsky on July 26, 2007, 08:11:56 AM
Quote
open /include/sessions.php before the last line ?> add the following code
Code: [Select]
//Mod_bmollet
/**
"éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");


"éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");


what this symbols "éèêàëâúóíá" and "eeeaeauoia"? this it is correct?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: xox on July 29, 2007, 03:02:40 PM
it is for the urls you wount want these symbols in those urls
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: lolak on August 03, 2007, 06:57:11 AM
Thank you very much for this clean url plugin, i like it - very cool 8)
see it action http://www.asianphoto.org (http://www.asianphoto.org)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Shabu on August 08, 2007, 03:21:23 PM
It will great if anybody make one condition for pagination :)

for example:
...cat-people-1-page-2.htm
instead of
...cat-people-1.htm?page=2

Thanks
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: tepetakla on August 09, 2007, 02:37:39 PM
Turkish  Character Problem   ( Türkçe Karakterde Sorun var )  ( es hat türkische karekter fehle  )

It is becoming such ( böyle oluyor) ( so geht das )
http://www.xxx.com/cat-%FEiirler-31.htm

but i such becom, want ( ben böyle olmasını istiyorum) ( ich wil das so ist )

http://www.xxx.com/cat-şiirler-31.htm
or ( veya böyle) ( oder )
http://www.xxx/cat-siirler-31.htm


anlamayan kimse kalmaz sanırım  :mrgreen:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: nfprehn on August 11, 2007, 01:01:22 PM
This is a great MOD, but it is not compatible with "show user images in profile"-MOD  http://www.4homepages.de/forum/index.php?topic=15390.msg82566#msg82566 (http://www.4homepages.de/forum/index.php?topic=15390.msg82566#msg82566)

Do you know how to fix this?  Basically, the {url_show_user_images} in details.html stop working!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: skidpics on August 13, 2007, 06:44:24 PM
Can this be done without the .htaccess modification?  I do not use that on my server - Not allowed.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: ntr on August 16, 2007, 07:37:16 PM
Well, I have 1.7.4 and tried everything, but it won't work.  :( I get HTTP 404 problem - the webpage cannot be found.

Anyone else who got the same problem?  :roll:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: tepetakla on August 17, 2007, 08:00:31 PM
Turkish  Character Problem   ( Türkçe Karakterde Sorun var )  ( es hat türkische karekter fehle  )

It is becoming such ( böyle oluyor) ( so geht das )
http://www.xxx.com/cat-%FEiirler-31.htm

but i such becom, want ( ben böyle olmasını istiyorum) ( ich wil das so ist )

http://www.xxx.com/cat-şiirler-31.htm
or ( veya böyle) ( oder )
http://www.xxx/cat-siirler-31.htm


anlamayan kimse kalmaz sanırım  :mrgreen:


can not ben found my problem :(
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: batu544 on August 17, 2007, 11:19:49 PM


then it would like this
http://www.turkiye-resimleri.com/

also i have upload the pre-edited files for 1.7.4 http://rapidshare.com/files/33076491/seo.rar.html
this seo.rar file contains .htaccess file and /include/sessions.php file you can use it withour modifying

Hi,
      I have used the provided MOd. .But only in detail page the title is coming same as the URL.. It really looks odd :(

Can anyone tell me how to get the title of all the like this web site http://www.turkiye-resimleri.com/ ?

thanks

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: kowalski on September 01, 2007, 08:05:17 AM
The one thing stopping me from using 4images on my live site is the problem with the URL


After spending several weeks fine tuning and adding lots of great mods to my site on a localhost WAMP test area I just can't get the URLs the way I want them


I've been thru the 27 pages of this MOD:

[Mod] Search Engine Friendly URLs aka Short URLs
http://www.4homepages.de/forum/index.php?topic=6729.0

and whilst I quite like the effect
eg.
www.mysite.com/cat-12 
www.mysite.com/images-321

I can't get my dropdown menu to function with that particular mod
(and also it's not great for Google SEO as it has no category or image name in the URL)




I've also tried the mod on this current thread - [MOD] Google Friendly Urls For 4images Best Seo Mod - but can't manipulate the URL the way I want because I am struggling with REGEX and the .htaccess, and my own understanding of php coding

I appreciate that you have to have the cat ID and image ID in every URL using this mod but can I split up the long URL with a forward slash? (And remove the .htm extension)

eg. I want:
www.mysite.com/categoryname-12/imagename-43

I've also managed to remove the .htm / .html / .php ending successfully but would like to split up the category and the image with a forward slash (/)

because I have sub-categories, the URL currently looks ridiculous and would help if I could have forward slashes like this - category / subcat / image


any suggestions/advice?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: cpuswe on September 12, 2007, 11:32:34 PM
Hi!

Is there a way to replace certain characters in the image name or cat? I have / (slash) in my image names (and some cats) and that does not work. Image name is "AMD AMD-K6 3D/250 ES" url becomes http://www.site.org/img-amd-amd-k6-3d%2F250-es-323.htm and the webserver interpret it "The requested URL /img-amd-amd-k6-3d/250-es-323.htm was not found on this server." Remove %2F it all works fine.

If i could replace / with _ that would solve the problem. Doable?

Edit: As always... Give it some time. Solved!

Found and changed:
$row['image_name'] = strtr($row['image_name'], "/éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","_eeeaeauoiaabcdefghijklmnopqrstuvwxyz");



Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: aminhd on September 18, 2007, 02:15:31 AM
I got loads of errors when I used the premodified files. But it worked when I edit everything manually!!!  :D Thanks a lot bro!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: thunderstrike on September 18, 2007, 03:19:36 AM
Change:

Quote
$row['image_name'] = strtr($row['image_name']

for:

Code: [Select]
$row['image_name'] = strtr(format_text(trim($row['image_name']), 2)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: joxxxe on September 19, 2007, 08:34:49 AM
it could have the name of the section, file at my title like this page

http://www.enchulatupagina.com/comentarios-en-espanol/saludos/q-hubo-40688.html

thanx
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: cpuswe on September 19, 2007, 08:47:24 PM
on search / new images - is there any way to display the actual url rather than the img15434.search.htm is display img-jamie-cook---9-15426.htm

any chance of this

James

+1, would this be possible to solve?

/Thomas
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: thunderstrike on September 19, 2007, 08:51:29 PM
No. If .htaccess modify for all folder in 4images ... this is no possible. Is what .htaccess do ... is re-write ...
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: cpuswe on September 19, 2007, 08:58:04 PM
But has this to do with .htaccess? Is´nt this "problem" in the code that generates the search result?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: thunderstrike on September 19, 2007, 09:09:59 PM
Is what change .php to .html ... is .htaccess file (parse for server). ;)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: saud on October 12, 2007, 01:38:43 PM
i'm using an old version of seo mod , my urls are shows like http://pakistani.pk/wallpapers/img109.htm and http://pakistani.pk/wallpapers/cat1.htm

and i want them like http://pakistani.pk/wallpapers/image-name.htm and http://pakistani.pk/wallpapers/cat-name.htm

regards =)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: egyptsons on October 12, 2007, 10:37:25 PM
worked good with me  :wink:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: darvid on October 19, 2007, 05:17:19 PM
when i installed the code, everything seems to be right. all links look good. but when i click on it, the url switches again to the old. where is the problem? i doubt, i could let it be like that, because of producing double content, right?

my htaccess:

Code: [Select]
<IfModule mod_rewrite.c>
RewriteEngine On


RewriteBase /4images/


#Mod_bmollet : Cat name in URL
RewriteRule ^cat-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}

#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}

RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}

RewriteRule ^postcard([a-zA-Z0-9]+)\.htm$ postcards.php?postcard_id=$1&%{QUERY_STRING}
RewriteRule ^postcard\.img([0-9]+)\.htm$ postcards.php?image_id=$1&%{QUERY_STRING}


</IfModule>

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sharangan on October 22, 2007, 05:00:28 PM
hey the link to post card is not working
how will i be able to fix that?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: prive on October 22, 2007, 06:56:57 PM
Let me add the letter ñ and Ñ
ñ &#241;
Ñ &#209;

I have done this but does not work:

Quote
//Mod_bmollet bitissss
/**
 * Get the category url
 * @param int $cat_id The id of the category
 * @param string $cat_url The current status of the URL
 */
function get_category_url($cat_id,$cat_url = '')
{
   global $site_db;
   $sql = "SELECT cat_name,cat_parent_id FROM ".CATEGORIES_TABLE." WHERE cat_id = '".$cat_id."'";
   $result = $site_db->query($sql);
   $row = $site_db->fetch_array($result);

   $trans = array(","=>"","\\"=>"",";"=>"",":"=>"","/"=>"","&#304;"=>"i","&#305;"=>"i","&#241;"=>"ñ","&#209;"=>"Ñ","&#351;"=>"s","&#287;"=>"g","&#246;"=>"ö","Ö"=>"O","&#252;"=>"u","&#220;"=>"U","&#231;"=>"c","&#199;"=>"C","?"=>"");
   $row['cat_name']=strtr($row['cat_name'],$trans);

   $row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNÑOPQRSTUVWXYZsSiIÝIÇçöÖGgüÜýþÞðÐ","eeeaeauoiaabcdefghijklmnñopqrstuvwxyzssiiiiccoogguuissgg");
   $cat_url  = '-'.str_replace('+','-',urlencode($row['cat_name'])).'-'.$cat_id.$cat_url;
   // if you want full path of category in url, put next line in comment
   //return $cat_url;
   if( $row['cat_parent_id'] != 0)
   {
      return get_category_url($row['cat_parent_id'],$cat_url);
   }
   else
   {
      return $cat_url;
   }
}
//Mod_bmollet
/**
 * Get the image url
 * @param int $image_id The id of the image
 */
function get_image_url($image_id)
{
   global $site_db;
   $sql = "SELECT cat_id,image_name FROM ".IMAGES_TABLE." WHERE image_id = '".$image_id."'";
   $result = $site_db->query($sql);
   $row = $site_db->fetch_array($result);

   $trans = array(","=>"","\\"=>"",";"=>"",":"=>"","/"=>"","&#304;"=>"i","&#305;"=>"i","&#241;"=>"ñ","&#209;"=>"Ñ","&#351;"=>"s","&#287;"=>"g","&#246;"=>"ö","Ö"=>"O","&#252;"=>"u","&#220;"=>"U","&#231;"=>"c","&#199;"=>"C","?"=>"");

   $row['image_name']=strtr($row['image_name'],$trans);


      $row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNÑOPQRSTUVWXYZsSiIÝIÇçöÖGgüÜýþÞðÐ","eeeaeauoiaabcdefghijklmnñopqrstuvwxyzssiiiiccoogguuissgg");
   // if you want comlpete path to image in url, remove comment from following line
   return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
   return '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
}

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: KPeBiz on October 22, 2007, 09:24:35 PM

Thank you for this mod. This works real well!

Thank you.

1)open the .htaccess file and add the lines to the .htaccess
Code: [Select]
RewriteEngine On

#RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}

2.) open /include/sessions.php before the last line ?> add the following code
Code: [Select]
//Mod_bmollet
/**
 * Get the category url
 * @param int $cat_id The id of the category
 * @param string $cat_url The current status of the URL
 */
function get_category_url($cat_id,$cat_url = '')
{
global $site_db;
$sql = "SELECT cat_name,cat_parent_id FROM ".CATEGORIES_TABLE." WHERE cat_id = '".$cat_id."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
$cat_url  = '-'.str_replace('+','-',urlencode($row['cat_name'])).'-'.$cat_id.$cat_url;
// if you want full path of category in url, put next line in comment
return $cat_url;
if( $row['cat_parent_id'] != 0)
{
return get_category_url($row['cat_parent_id'],$cat_url);
}
else
{
return $cat_url;
}
}
//Mod_bmollet
/**
 * Get the image url
 * @param int $image_id The id of the image
 */
function get_image_url($image_id)
{
global $site_db;
$sql = "SELECT cat_id,image_name FROM ".IMAGES_TABLE." WHERE image_id = '".$image_id."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
// if you want comlpete path to image in url, remove comment from following line
//return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
return '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
}

3.)open /include/sessions.php find this code

Code: [Select]
function url($url, $amp = "&amp;") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && !preg_match("/".SESSION_NAME."=/i", $url)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }

4.)Replace with this one

Code: [Select]
/* ORIGINAL CODE
  function url($url, $amp = "&amp;") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && !preg_match("/".SESSION_NAME."=/i", $url)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }
*/
  function url($url, $amp = "&amp;") {
    global $l, $user_info;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];
    $url = str_replace('&amp;', '&', $url);
    if (!defined('IN_CP')) {
      if (strstr($url, 'index.php')) {
        $url = str_replace('index.php', '', $url);
      }
      elseif (strstr($url, 'search.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('search.php', 'search.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('search.php', 'search.htm', $url);
        }
      }
      elseif (strstr($url, 'lightbox.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('lightbox.php', 'lightbox.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
                $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('lightbox.php', 'lightbox.htm', $url);
        }
      }
      elseif (strstr($url, 'categories.php')) {
        if (strstr($url, 'cat_id=') && strstr($url, 'page=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#page=([0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('categories.php', 'cat'.$matches1[1].'.'.$matches2[1].'.htm', $url);
            $query = str_replace('cat_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches1[1], '', $query);
            $query = str_replace('cat_id='.$matches1[1], '', $query);
            $query = str_replace('page='.$matches2[1].'&', '', $query);
            $query = str_replace('&page='.$matches2[1], '', $query);
            $query = str_replace('page='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        elseif (strstr($url, 'cat_id=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $cat_url = get_category_url($matches[1]);
            $url   = str_replace('categories.php', 'cat'.$cat_url.'.htm', $url);
            $query = str_replace('cat_id='.$matches[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches[1], '', $query);
            $query = str_replace('cat_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('categories.php', 'cat.htm', $url);
        }
      }
      elseif (strstr($url, 'details.php?image_id=')) {
        if (strstr($url, 'image_id=') && strstr($url, 'mode=')) {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#mode=([a-zA-Z0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'img'.$matches1[1].'.'.$matches2[1].'.htm', $url);
            $query = str_replace('image_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches1[1], '', $query);
            $query = str_replace('image_id='.$matches1[1], '', $query);
            $query = str_replace('mode='.$matches2[1].'&', '', $query);
            $query = str_replace('&mode='.$matches2[1], '', $query);
            $query = str_replace('mode='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'img'.get_image_url($matches[1]).'.htm', $url);
            $query = str_replace('image_id='.$matches[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches[1], '', $query);
            $query = str_replace('image_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
      }
      elseif (strstr($url, 'postcards.php?image_id=')) {
        preg_match('#image_id=([0-9]+)&?#', $url, $matches);
        if (isset($matches[1])) {
          $split = explode('?', $url);
          $url = $split[0];
          $query = @$split[1];
          $url   = str_replace('postcards.php', 'postcard.img'.$matches[1].'.htm', $url);
          $query = str_replace('image_id='.$matches[1].'&', '', $query);
          $query = str_replace('&image_id='.$matches[1], '', $query);
          $query = str_replace('image_id='.$matches[1], '', $query);
          if (!empty($query)) {
            $url .= '?' . $query;
          }
        }
      }
    }
    if ($this->mode == "get" && strstr($url, $this->session_id)) {
      $url .= strpos($url, '?') !== false ? '&' : '?';
      $url .= SESSION_NAME."=".$this->session_id;
    }
    if (!empty($l)) {
      $url .= strpos($url, '?') ? '&' : '?';
      $url .= "l=".$l;
    }
    $url = str_replace('&', $amp, $url);
    $url .= isset($dummy_array[1]) ? "#".$dummy_array[1] : "";
    return $url;
  }

then it would like this
http://www.turkiye-resimleri.com/

also i have upload the pre-edited files for 1.7.4 http://rapidshare.com/files/33076491/seo.rar.html
this seo.rar file contains .htaccess file and /include/sessions.php file you can use it withour modifying
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: KPeBiz on October 24, 2007, 08:15:23 AM
Hi,

I have managed to get this SEF URL to work well following this thread.

I would like to set up an auto sitemap generator script as well, I followed the thread:
http://www.4homepages.de/forum/index.php?topic=15687.0

But the URL format are different and the sitemap script is not working well. Have anyone created a sitemap for the SEF MOD of this thread? Can someone share about that?

Thank you.

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: tepetakla on October 24, 2007, 03:27:33 PM
Turkish  Character Problem   ( Türkçe Karakterde Sorun var )  ( es hat türkische karekter fehle  )

It is becoming such ( böyle oluyor) ( so geht das )
http://www.xxx.com/cat-%FEiirler-31.htm

but i such becom, want ( ben böyle olmasını istiyorum) ( ich wil das so ist )

http://www.xxx.com/cat-şiirler-31.htm
or ( veya böyle) ( oder )
http://www.xxx/cat-siirler-31.htm
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: MaveriC on November 18, 2007, 10:01:21 PM
thanks for the great mod! excellent one.. somethng 4images needed for a long time :)

I got one suggest though.. can we do away with the "cat" and "img" thing in the category and image URLs? Something clean like wordpress? Am gonna try this anyways coz i have a feeling it's easy..  :p
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: yousaf on November 25, 2007, 12:38:27 PM
i dont want Cat n img keywords with links but will still use it as i think it is a nice SEO mod for 4images.
but the problem is that it completely change category name like

category path is  Bahram Jan this Seo mod changes it to cat-lahram-tan-20.htm

any solution for this. ? to get it as cat-bahram-jan-20.htm
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: yousaf on November 26, 2007, 07:55:58 PM
no reply from any one :(

xox, where are you man. i need help
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: macintosh on November 28, 2007, 07:13:14 PM
it is very useful,thanks for you from my first post ;)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sammas on November 30, 2007, 05:10:15 AM
Hello
I know the next

How to convert to and from the links

member.php?action=showprofile&user_id=1 convert mamber-1.html

search.html?search_keywords=kids convert search-kids.html

search.html?search_new_images=1 convert new-images.html

cat4.html?page=2 convert cat4-2.html

search.html?show_result=1&page=2 convert search-2.html

and And

add title keyword to searching Add title keyword to searching Taitl title with the addition of each search and keywords

Note I can work foodstuffs Reiter, but I do not know how to work the file
sessions.php
And how addendum inside.

Therefore I need explanation Thank
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on November 30, 2007, 08:24:38 AM
hi sammas,

is this not the seo mod?
if yes, please ask in this thread..
thx
nicky
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sammas on November 30, 2007, 09:00:00 AM
hi to you dear Nicky

yes this seo

edit files
sessions.php and .htaccess
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sammas on November 30, 2007, 10:26:05 AM
ammMMMMmmmMm Nicky ok no problem to move to in
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: darvid on November 30, 2007, 06:01:15 PM
I can't get my dropdown menu to function with that particular mod
(and also it's not great for Google SEO as it has no category or image name in the URL)

hi,

i just discovered the same at my galery: http://www.pilotenbilder.de/photos/.

does this only happen at me, or is it a general problem with this mod?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sammas on December 01, 2007, 05:45:21 PM
please help me

Supervisors Can I write a new topic for the problem that confronted?

Here I do not think I will get a solution to the problem, I am also the currency is the subject
http://www.4homepages.de/forum/index.php?topic=6729.0

waiting
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: drastx on December 02, 2007, 10:33:19 AM
Hello all,

I have a irritating problem with this mod.
I use http://www.4homepages.de/forum/index.php?topic=16812.0 (http://www.4homepages.de/forum/index.php?topic=16812.0) <- a tag cloud mod in my gallery, and it
shows on the homepage... a tag cloud ;)

For example i'll show you this image:
http://www.ojejku.net/img-tapety-na-pulpit-30-merry-christmas-2007-2154.htm
A "Merry Christmas 2007" wallpaper
It's tagged by "merry", "christmas" and "2007"
And that makes it for tag clouds this:
http://www.ojejku.net/search.htm?search_keywords=Merry
http://www.ojejku.net/search.htm?search_keywords=Christmas
http://www.ojejku.net/search.htm?search_keywords=2007
^^^^^^^^^ those pages links to http://www.ojejku.net/img-tapety-na-pulpit-30-merry-christmas-2007-2154.htm <- this details page
BUT!
It show not
http://www.ojejku.net/img-tapety-na-pulpit-30-merry-christmas-2007-2154.htm <- a proper, seo friendly link,
but somthing like that:
http://www.ojejku.net/img2154.search.htm ...

And now google gave (3x 1 tag) 3 links to http://www.ojejku.net/img2154.search.htm <- that crappy link and 1
to this: http://www.ojejku.net/img-tapety-na-pulpit-30-merry-christmas-2007-2154.htm ...

So my question is: Is it possible to change search results too ?;)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sammas on December 03, 2007, 08:49:37 AM
؟?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: darvid on December 04, 2007, 06:05:07 PM
hi,

i would like to fix the category dropdown bug, but i have a few questions:

in sessions.php the url for the category is prozessed, right?
and in page_header.php the url is put into a category dropdown form, right?


so in :

Code: [Select]
//-----------------------------------------------------
//--- Category Dropdown -------------------------------
//-----------------------------------------------------

if (!$cache_enable) {
    $category_dropdown_selfjump = get_category_dropdown($cat_id, 1);
} else {
  $cache_id = create_cache_id(
    'data.dropdown_selfjump',
    array(
      $user_info[$user_table_fields['user_id']],
      $config['template_dir'],
      $config['language_dir']
    )
  );

i would have to change the category url?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: jojomart on December 09, 2007, 04:05:01 AM
Well, I have 1.7.4 and tried everything, but it won't work.  :( I get HTTP 404 problem - the webpage cannot be found.

Anyone else who got the same problem?  :roll:


Yes!  I am having the same problem - I have other scripts running on my server that use modrewrite and they work perfectly, but I just can't get this one to work.

Joanne

woohoo got it working!  I'm not even sure of what I did, but who cares LOL
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: nemonic-berg on December 25, 2007, 01:58:20 AM
hello all
i have used the mod that xoox give...
FYI my web image is on folder sub domain

for exaample :    http://subdomain.mydomain.com/4images

and i got error page like this

Not Found
The requested URL /4images/k-wallpaper-1.htm was not found on this server.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.39 Server at demo3.indodisain.net Port 80


please can you show me the right path on my htaccess ?

this is my htaccess :

Code: [Select]
RewriteEngine On

RewriteBase /demo3/
RewriteRule ^cat-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}

thanks for your help
regards
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: FotoRalle on January 10, 2008, 09:16:07 AM
This is now my full htaccess code. It works perfect. Including the problem with the postcards...

Code: [Select]
RewriteEngine On

#RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}

RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^postcard\.img([0-9]+)\.htm$ postcards.php?image_id=$1&%{QUERY_STRING}
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sea on January 19, 2008, 08:43:27 AM
How can I get this to work on a subdomain IE images.domain.com
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: tirakle on January 19, 2008, 07:36:58 PM
i use this mod and it works very well so far.

new i checked my links with an online link checker. the links are OK too exept one path

http://www.xxxxx.com/data/media/3/Baseball   Not Found

the word "Baseball" ist wrong. does any body know why this path is shown ?

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: satine88 on January 27, 2008, 02:54:48 PM
Hello,
I place a "/" in a category, and he no  find page !


This mod :
[MOD] Google Friendly Urls For 4images Best Seo Mod
http://www.4homepages.de/forum/index.php?topic=17598.0

Page :
http://www.wallpaper-gratuit.net/cat-film-%2F-series-tv-6.htm

Thanks   :D
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: satine88 on January 28, 2008, 10:37:36 PM
Hello,
I place a "/" in a category, and he no  find page !


This mod :
[MOD] Google Friendly Urls For 4images Best Seo Mod
http://www.4homepages.de/forum/index.php?topic=17598.0

Page :
http://www.wallpaper-gratuit.net/cat-film-%2F-series-tv-6.htm

Thanks   :D

No one?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: nemonic-berg on January 30, 2008, 09:07:16 PM
hello friend...
i just install this mod a few week ago..and i have trouble when i go to quick jump  sub categories..(bottom left template)
when click on it, it not linked at the correct url (sef url) but only go to http://namesite.com/categories.php

so ...my page could not be found...can anyone solve my problem...
and this is my site  : http://www.idwallpaper.com

for a while, that quick menu drop down i was disable for avoid visitor to click on it, but if you want to see or check, i will  active that quick menu

thanks

regards
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: nemonic-berg on February 25, 2008, 08:56:22 PM
hi,

i would like to fix the category dropdown bug, but i have a few questions:

in sessions.php the url for the category is prozessed, right?
and in page_header.php the url is put into a category dropdown form, right?


so in :

Code: [Select]
//-----------------------------------------------------
//--- Category Dropdown -------------------------------
//-----------------------------------------------------

if (!$cache_enable) {
    $category_dropdown_selfjump = get_category_dropdown($cat_id, 1);
} else {
  $cache_id = create_cache_id(
    'data.dropdown_selfjump',
    array(
      $user_info[$user_table_fields['user_id']],
      $config['template_dir'],
      $config['language_dir']
    )
  );

i would have to change the category url?

hello darvid

i still got problem with category drop down bug when im using ser url mod...

as that you mention above my page_header.php is same excactly as you say above...

so what should i do to fix it ?

thanks
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: tzepf on February 27, 2008, 09:48:32 AM
hi,

i´ve changed my files and the url´s in the links are correct, but i still get a 404 error allthough i changed the base path in htaccess

here is my htaccess:

Code: [Select]
RewriteEngine On

RewriteBase /php/bilder/4images/
RewriteRule ^cat-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /error404.php

ErrorDocument 404 /error404.php
ErrorDocument 403 /error403.php
ErrorDocument 500 /error500.php
ErrorDocument 400 /error400.php
ErrorDocument 401 /error401.php



so what´s wrong?

thanks for help
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Perry on March 01, 2008, 11:20:11 PM
Hallo,

ich habe das Seo Mod nach der Anleitung installiert und dabei tritt folgendes Problem auf:
Gebe ich einen Suchbegriff ein, wird das Bild auch angezeigt, klicke ich auf das gefundene Bild wird es auch geladen. Dabei verändert sich der Clickstream von Suche/ Bild auf Homepage/Bild. Ich kann also nicht mehr auf die anderen Suchergebnisse zurückkehren. Ich hoffe mir kann jemand helfen.

Perry
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: maineyak on March 03, 2008, 04:47:24 AM
I have found one problem with this, I'm hoping someone can help. When I go to lightbox and click an image, the image url is now http://www.domain.com/image222.lightbox.htm.

How can I get it to show correctly like the rest of my site?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: tzepf on March 11, 2008, 01:23:39 PM
wooohooo i just get it to work :-)

my site is hosted on 1und1, and i´ve made the following changes to the htaccess. note that i din´t changed rewritebase. you have too change the path in the rewrite rules like this:

Code: [Select]
RewriteBase /
RewriteEngine on
RewriteRule ^php/bilder/4images/lightbox\.htm$ lphp/bilder/4images/ightbox.php?%{QUERY_STRING}

RewriteRule ^php/bilder/4images/lightbox\.([0-9]+)\.htm$ php/bilder/4images/lightbox.php?page=$1&%{QUERY_STRING}

RewriteRule ^php/bilder/4images/search\.htm$ php/bilder/4images/search.php?%{QUERY_STRING}

RewriteRule ^php/bilder/4images/search\.([0-9]+)\.htm$ php/bilder/4images/search.php?page=$1&%{QUERY_STRING}

RewriteRule ^php/bilder/4images/postcard([a-zA-Z0-9]+)\.htm$ php/bilder/4images/postcards.php?postcard_id=$1&%{QUERY_STRING}

RewriteRule ^php/bilder/4images/postcard\.img([0-9]+)\.htm$ php/bilder/4images/postcards.php?image_id=$1&%{QUERY_STRING}

RewriteRule ^php/bilder/4images/k-(.*)-([0-9]+).htm php/bilder/4images/categories.php?cat_id=$2&%{QUERY_STRING}

RewriteRule ^php/bilder/4images/r-(.*)-([0-9]+).htm php/bilder/4images/details.php?image_id=$2&%{QUERY_STRING}

RewriteRule ^php/bilder/4images/r([0-9]+).search.htm php/bilder/4images/details.php?image_id=$1&%{QUERY_STRING}

another problem with the mod is that i cannot handel german ä,ö and ü. for this i added two lines in sessions.php (think that the developer could change this in his download versions, too)

replace
Code: [Select]
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZsSiIÝIÇçöÖGgüÜýþÞðÐ","eeeaeauoiaabcdefghijklmnopqrstuvwxyzssiiiiccoogguuissgg");
with
Code: [Select]
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZsSiIÝIÇçGgýþÞðÐ","eeeaeauoiaabcdefghijklmnopqrstuvwxyzssiiiiccggissgg");
$row['cat_name'] = strtr($row['cat_name'],Array("ä"=>"ae","ö"=>"oe","ü"=>"ue", "Ä"=>"Ae","Ö"=>"Oe","Ü"=>"Ue"));


and replace
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZsSiIÝIÇçöÖGgüÜýþÞðÐ","eeeaeauoiaabcdefghijklmnopqrstuvwxyzssiiiiccoogguuissgg");
with
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZsSiIÝIÇçGgýþÞðÐ","eeeaeauoiaabcdefghijklmnopqrstuvwxyzssiiiiccggissgg");
$row['image_name'] = strtr($row['image_name'],Array("ä"=>"ae","ö"=>"oe","ü"=>"ue", "Ä"=>"Ae","Ö"=>"Oe","Ü"=>"Ue"));

i hope i could help somebody!!!

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: alegre on March 13, 2008, 09:20:24 AM
hi,

in my file sessions.php (ver. 1.76) not exist this code.
Is there a solution?


Quote
function url($url, $amp = "&amp;") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && !preg_match("/".SESSION_NAME."=/i", $url)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: jany.yar on March 31, 2008, 02:39:39 PM
Does this MOD work with version 1.7.6? If NO.. Then Is there any SEO mod out there for 1.7.6 version?

I'm very confused because even for 1.7.4 version nobody has replied with positive result, everyone was having a problem when they install this mod.. Can someone please give me link to a working SEO mod without any problems? or can someone please create one.. It will be very convenient for the users and I will really appreciate it. Thanks :)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: om6acw on March 31, 2008, 03:54:33 PM
Does this MOD work with version 1.7.6? If NO.. Then Is there any SEO mod out there for 1.7.6 version?

I'm very confused because even for 1.7.4 version nobody has replied with positive result, everyone was having a problem when they install this mod.. Can someone please give me link to a working SEO mod without any problems? or can someone please create one.. It will be very convenient for the users and I will really appreciate it. Thanks :)

works great with 1.7.4, 1.7.5 and 1.7.6 too, look here http://www.myanimalsworld.com
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: jany.yar on March 31, 2008, 04:34:06 PM
Does this MOD work with version 1.7.6? If NO.. Then Is there any SEO mod out there for 1.7.6 version?

I'm very confused because even for 1.7.4 version nobody has replied with positive result, everyone was having a problem when they install this mod.. Can someone please give me link to a working SEO mod without any problems? or can someone please create one.. It will be very convenient for the users and I will really appreciate it. Thanks :)

works great with 1.7.4, 1.7.5 and 1.7.6 too, look here http://www.myanimalsworld.com

Did you face any problems installing the mod?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: jany.yar on March 31, 2008, 11:06:23 PM
Ok I installed this mod without facing any problem. However I would really appreciate if anyone could find a way to change it into this format:

http://www.site.com/category-name-123/image-name-123.htm

I'm 100% sure it's possible if a pro take a look at it., alot of people have asked for this.. please someone find the solution.


or atleast without the k-category-name or cat-category, img-imagename etc..

thank you in advance
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: varvez on April 04, 2008, 12:10:45 PM
Hy everybody,

sorry for my poor English....


I have one question about 4images MOD Seo, i have make the changes that are indicated in this post but the url now appears like this:

www.namesite.com/k-namecategory-14.htm

with a progressive numbers after categories names.

If i want an url like this:

www.namesite.com/namecategory.htm

or

www.namesite.com/namecategory/namesubcategory/namefile.htm


what i have to do?

Thank you everybody
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: fernanzip on April 05, 2008, 06:07:18 AM
@om6acw

i checked your site and the search results working great. how did you do that? i followed the instruction in the mod but mine just got error but the main page and details page works fine, only the search result links messed up?

any help and sugestions

im using 1.7.6.


thank you..
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: om6acw on April 05, 2008, 06:59:40 AM
@om6acw

i checked your site and the search results working great. how did you do that? i followed the instruction in the mod but mine just got error but the main page and details page works fine, only the search result links messed up?

any help and sugestions

im using 1.7.6.


thank you..

Just put those two lines

Code: [Select]
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}

into your .htaccess file
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: fernanzip on April 05, 2008, 07:52:12 AM
i already did that, but not working how about the sessions.php? care to share your file?

like below and try to search link form search results are not working
http://filipinooverseas.org/search.htm


thanks
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: om6acw on April 06, 2008, 01:41:29 AM
i already did that, but not working how about the sessions.php? care to share your file?
like below and try to search link form search results are not working
http://filipinooverseas.org/search.htm
thanks

What I did was everything just in this thread, so just carefully read every post and if is not working just do it again.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: rbfabbri on April 06, 2008, 05:40:55 AM
As i see my categories are renamed to name.htm but when i click on the category, i get a 404 error.

I read all the posts here and nothing... :roll:

My site is http://www.estampafotos.com/galeria/

I used the sessions.php that i downloaded in the first post and my htaccess is:

Code: [Select]
RewriteEngine On

RewriteBase /galeria/
RewriteRule ^cat-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: om6acw on April 06, 2008, 06:09:20 AM
As i see my categories are renamed to name.htm but when i click on the category, i get a 404 error.

I read all the posts here and nothing... :roll:

My site is http://www.estampafotos.com/galeria/

I used the sessions.php that i downloaded in the first post and my htaccess is:

Are you shure your host is supporting .htaccess file? are you hosting on winserver or apache??? because this mod is working just on apache server host's
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: rbfabbri on April 06, 2008, 07:23:21 AM
Thanks, i found the error!!!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: fernanzip on April 06, 2008, 01:13:06 PM
its working now, transfered to linux host thanks
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: rbfabbri on April 07, 2008, 03:50:15 PM
And the category dropdown bug, any solution?

Thanks!!!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Safariguy on April 09, 2008, 10:43:56 PM
As i see my categories are renamed to name.htm but when i click on the category, i get a 404 error.

I read all the posts here and nothing... :roll:

My site is http://www.estampafotos.com/galeria/

I used the sessions.php that i downloaded in the first post and my htaccess is:

Code: [Select]
RewriteEngine On

RewriteBase /galeria/
RewriteRule ^cat-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}


I am using the same .htaccess with the exception of changing galeria to 4images. 4images is the directory location of my install. I have tried all of the permutations in these 8 pages and have even done an un-install re-install of 4images.

Perhaps you could tell me what your fix was?

I am sure this is something simple, it nearly always is. By the way the only .htaccess file I found is in the cache folder. Some other topics have it elsewhere. Could this be my problem?

Cheers and thanks in advance...!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: hamaset on April 22, 2008, 09:56:18 PM
İn this mod dropdownlist doesn't work. How can I solve this problem ?

And how can I edit the google.php in this topic to create my sitemap.xml

http://www.4homepages.de/forum/index.php?topic=15687.0
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: rodier on April 23, 2008, 03:28:55 AM
really cool 100% working :-)
thanks

Please xox can you look on sitemap for google  generator? its mod here on page .. but its working only with another short url mod ..   I look inside and it seems pretty simply it took names from sql and generate url..  but my knowledge is not enough good to change the generator to work with your seo mod .. can you try it please? :)

will be cool if yes.. thanks :)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: titika on May 24, 2008, 08:59:36 PM
Code: [Select]
/* ORIGINAL CODE
  function url($url, $amp = "&amp;") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && !preg_match("/".SESSION_NAME."=/i", $url)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }
*/
  function url($url, $amp = "&amp;") {
    global $l, $user_info;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];
    $url = str_replace('&amp;', '&', $url);
    if (!defined('IN_CP')) {
      if (strstr($url, 'index.php')) {
        $url = str_replace('index.php', '', $url);
      }
      elseif (strstr($url, 'search.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('search.php', 'search.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('search.php', 'search.htm', $url);
        }
      }
      elseif (strstr($url, 'lightbox.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('lightbox.php', 'lightbox.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
                $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('lightbox.php', 'lightbox.htm', $url);
        }
      }
      elseif (strstr($url, 'categories.php')) {
        if (strstr($url, 'cat_id=') && strstr($url, 'page=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#page=([0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('categories.php', 'cat'.$matches1[1].'.'.$matches2[1].'.htm', $url);
            $query = str_replace('cat_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches1[1], '', $query);
            $query = str_replace('cat_id='.$matches1[1], '', $query);
            $query = str_replace('page='.$matches2[1].'&', '', $query);
            $query = str_replace('&page='.$matches2[1], '', $query);
            $query = str_replace('page='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        elseif (strstr($url, 'cat_id=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $cat_url = get_category_url($matches[1]);
            $url   = str_replace('categories.php', 'http://'.$cat_url.'.tepkigosterelim.com', $url);
            $query = str_replace('cat_id='.$matches[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches[1], '', $query);
            $query = str_replace('cat_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('categories.php', 'cat.htm', $url);
        }
      }
      elseif (strstr($url, 'details.php?image_id=')) {
        if (strstr($url, 'image_id=') && strstr($url, 'mode=')) {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#mode=([a-zA-Z0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'img'.$matches1[1].'.'.$matches2[1].'.htm', $url);
            $query = str_replace('image_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches1[1], '', $query);
            $query = str_replace('image_id='.$matches1[1], '', $query);
            $query = str_replace('mode='.$matches2[1].'&', '', $query);
            $query = str_replace('&mode='.$matches2[1], '', $query);
            $query = str_replace('mode='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'img'.get_image_url($matches[1]).'.htm', $url);
            $query = str_replace('image_id='.$matches[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches[1], '', $query);
            $query = str_replace('image_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
      }
      elseif (strstr($url, 'postcards.php?image_id=')) {
        preg_match('#image_id=([0-9]+)&?#', $url, $matches);
        if (isset($matches[1])) {
          $split = explode('?', $url);
          $url = $split[0];
          $query = @$split[1];
          $url   = str_replace('postcards.php', 'postcard.img'.$matches[1].'.htm', $url);
          $query = str_replace('image_id='.$matches[1].'&', '', $query);
          $query = str_replace('&image_id='.$matches[1], '', $query);
          $query = str_replace('image_id='.$matches[1], '', $query);
          if (!empty($query)) {
            $url .= '?' . $query;
          }
        }
      }
    }
    if ($this->mode == "get" && strstr($url, $this->session_id)) {
      $url .= strpos($url, '?') !== false ? '&' : '?';
      $url .= SESSION_NAME."=".$this->session_id;
    }
    if (!empty($l)) {
      $url .= strpos($url, '?') ? '&' : '?';
      $url .= "l=".$l;
    }
    $url = str_replace('&', $amp, $url);
    $url .= isset($dummy_array[1]) ? "#".$dummy_array[1] : "";
    return $url;
  }
} //end of class


Koddaki şu kısmı değiştirdim...



Code: [Select]
$url   = str_replace('categories.php', 'http://'.$cat_url.'.tepkigosterelim.com', $url);

(http://img208.imageshack.us/img208/1600/urlas6.jpg)

Benim istediğim

http://www.tepkigosterelim.com/http://deneme1.tepkigosterelim.com 
değil de, linklerin;

"http://deneme1.tepkigosterelim.com" şeklinde gözükmesi. bunu nasıl yapabilirim...
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: titika on May 25, 2008, 01:34:42 PM
tamamdır, okey okey..

Links --> http://cat-name.tepkigosterelim.com  (okey )
but
.htaccess code =) ?..
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: silentg on June 05, 2008, 02:17:42 AM
Any solution to fixing the problems with dropdown menu?

thanks
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: 12noon on June 08, 2008, 01:45:17 PM
Same problem here. The drop down menu takes me to a none existent web page. I need help fixing it or removing the drop down all together.

EDIT

Found that i needed to add these last few lines to the .htaccess

Code: [Select]
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}

RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^postcard\.img([0-9]+)\.htm$ postcards.php?image_id=$1&%{QUERY_STRING}

 8)
That worked. Thanks.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: silentg on June 21, 2008, 01:52:12 AM
Still having problems with the seo mod drop down selection.
When a user is in a category with 100 pages. And on 2nd page. If the user wishes to change the image displayed per page setting from 20 - 40 then the mod redirects the user to a page that doesn't exist.

Example: Try changing the number of images displayed on this page:
http://www.wallpaperjoint.com/cat-vehicles-30.htm?page=2 (http://www.wallpaperjoint.com/cat-vehicles-30.htm?page=2)

help would be appreciated.


thanks,
SilentG
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: birdost on July 08, 2008, 11:09:02 PM
ellerinden öptüm... thanks you're crazy , i think (banlamasınlar diye iki ingilizce kelime  :wink:)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sunny C. on July 16, 2008, 12:23:11 PM
Bei mir klappt das in der 1.7.6 nicht!
Egal welches Bild ich anklicke er findet es nicht!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: raaja4u on July 17, 2008, 09:10:11 AM
1)open the .htaccess file and add the lines to the .htaccess
Code: [Select]
RewriteEngine On

#RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}


Do u mean.. .htaccess in      public_html/.htacess ?

i juz need to paste this code below the file right? bit im getting 404 error
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sunny C. on August 02, 2008, 12:19:52 PM
Soll ich eine htaccess erstellen?
Welche ist gemeint?
Im root gibt es keine!

Und läuft das Teil denn mit 1.7.6?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Jan-Lukas on August 02, 2008, 09:03:34 PM
Die Antwort war nicht für Dich  :wink:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sunny C. on August 02, 2008, 11:06:18 PM
Nene, das war meine Frage :D

Ich check das wirklich nicht!
Wo ist denn in 4images eine htacces vorhanden bzw. welche wird gebraucht für diesen Mod oder muss im Root eine erstellt werden?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Jan-Lukas on August 02, 2008, 11:19:02 PM
Ich frage mich täglich was Du da machst  :wink:
Du installierst dir alles was es hier gibt, aber infomationen in den Mods übergehst Du einfach.

Quote
Ich check das wirklich nicht!
Wo ist denn in 4images eine htacces vorhanden bzw. welche wird gebraucht für diesen Mod oder muss im Root eine erstellt werden?

Hast Du überhaubt das erste Posting gelesen, und Dir die seo.rar runter geladen ??
da ist eine session.php und auch deine .htaccess enthalten.

Also was soll die Frage  :?:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sunny C. on August 02, 2008, 11:33:12 PM
Ich frage mich täglich was Du da machst  :wink:
Du installierst dir alles was es hier gibt, aber infomationen in den Mods übergehst Du einfach.

Quote
Ich check das wirklich nicht!
Wo ist denn in 4images eine htacces vorhanden bzw. welche wird gebraucht für diesen Mod oder muss im Root eine erstellt werden?

Hast Du überhaubt das erste Posting gelesen, und Dir die seo.rar runter geladen ??
da ist eine session.php und auch deine .htaccess enthalten.

Also was soll die Frage  :?:


So kann man das nicht sagen! Ich installiere nicht wahllos die Mods. Viele Teste ich einfach nur ob die klappen und erweitere somit meine Liste die ich hier führe. Aber ab und an verstehe ich einiges nicht, es ist mir meist zu viel Text, soviel kann ich manchmal auch nicht behalten und dann komme ich durch einander. Ich habe nunmal eine Aufnahmeschwäche mein Hauptproblem liegt darin "Zu lesen und gleichzeitig zu behalten und zu verstehen" im nachhinein verstehe ich es dann....

B²t:
Aber ich weis auch durch die seo.rar nicht wohin mit der htaccess dann!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Jan-Lukas on August 02, 2008, 11:52:34 PM
wenn nichts dabei steht, gehört diese Datei eigentlich ins Root

und wenn man direkt unter einem Posting antwortet, braucht man nicht aufs zitat klicken :wink:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Omsky on August 15, 2008, 07:26:37 AM
problem install on 1.7.6

worked, but there is double thumbnails :)

http://sexy-girls-photo.com/k-a-1-anastacia-2.htm or other categories

and in new images, on first page - this bug.

instruction in FAQ, differs from both attached files

look plz
my files session.php & .htaccess http://sexy-girls-photo.com/bug.zip

help plz, where error?

on 1.7.4 works without errors
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on August 15, 2008, 08:00:01 AM
The problems you have has nothing to do with this mod, you have HTML comment in template that being premature terminated by <img> tag.

Quote
<!-- you wish detail page in a small javascript open window, use .... -->
Remove it and you'll be alright.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Omsky on August 15, 2008, 08:13:39 AM
V@no
thnk - worked :)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: unite on August 21, 2008, 10:53:16 PM
Dose this work with version 1.7.4? I don't have a .htaccess file. Do I need to create one?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on August 22, 2008, 01:08:36 AM
I don't have a .htaccess file. Do I need to create one?
Yes
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: unite on August 25, 2008, 04:40:22 AM
Ok the install went well and I think it's working. Only one problem... When I select to open the image in a new window on my details page, it opens at the bottom of the page. It use to open right over the top of the old one. I will pay to have someone help me fix this.

http://www.wallewallpaper.com/img-fast-rope-training-492.htm
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on August 25, 2008, 05:21:40 AM
Ok the install went well and I think it's working. Only one problem... When I select to open the image in a new window on my details page, it opens at the bottom of the page. It use to open right over the top of the old one. I will pay to have someone help me fix this.

http://www.wallewallpaper.com/img-fast-rope-training-492.htm
I highly doubt that has anything to do with this mod...
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: unite on August 25, 2008, 03:30:32 PM
Ok the install went well and I think it's working. Only one problem... When I select to open the image in a new window on my details page, it opens at the bottom of the page. It use to open right over the top of the old one. I will pay to have someone help me fix this.

http://www.wallewallpaper.com/img-fast-rope-training-492.htm
I highly doubt that has anything to do with this mod...

I can remove the mod and it works just fine.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on August 26, 2008, 02:55:09 AM
I can remove the mod and it works just fine.
Your problem is somewhere in javascript and/or html templates, this mod has nothing to do with either...
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Delirium on September 10, 2008, 02:08:16 PM

Wenn ich auf der Detailseite bin (als Admin eingeloggt) und die Links Bearbeiten und Löschen benützen will funktioniert das ganze nicht.
Was muss ich in der httaccess eintragen damit dies wieder funktioniert?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Omsky on September 26, 2008, 08:29:25 AM
problem
http://www.4homepages.de/forum/index.php?topic=17912.msg124550#msg124550

help :)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: coolspic on October 16, 2008, 10:19:47 AM
The problems you have has nothing to do with this mod, you have HTML comment in template that being premature terminated by <img> tag.

Quote
<!-- you wish detail page in a small javascript open window, use .... -->
Remove it and you'll be alright.

where i find it to remove it... please help
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: batu544 on October 16, 2008, 02:32:27 PM
You can find it in thumbnail_bit.html  file.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: metal_brain on October 26, 2008, 10:23:45 PM
Thanks xox
it's a very nice mod
but my question is how can i make it compatible with V@no's [MOD] Multi-Language support for any text (updated 05-11-2005) ] (http://www.4homepages.de/forum/index.php?topic=6749.msg29540#msg29540)

I wanted only to take the english name! 
i have used this line
Code: [Select]
$cat_url  = '-'.str_replace('+','-',urlencode(multilang($row['cat_name']))).'-'.$cat_id.$cat_url;\
but when i change the lang it changes everything
thanks in advance!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on October 26, 2008, 11:07:50 PM
global $config;
$lang_backup = $config['language_dir'];
$config['language_dir'] = "english";
$cat_url  = '-'.str_replace('+','-',urlencode(multilang($row['cat_name']))).'-'.$cat_id.$cat_url;
$config['language_dir'] = $lang_backup;
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: metal_brain on October 27, 2008, 06:45:39 AM
Thanks V@no  :D
as usual u r very helpful
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sunny C. on October 27, 2008, 07:49:48 AM
What makes this mod here differently than like this?
http://www.4homepages.de/forum/index.php?topic=6729.0
Here is this better or is that whatever you take?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on October 27, 2008, 08:27:56 AM
The author of this mod went an "easy" way by adding additional database query requests for each link to an image or category. It made the mod more universal with less changes in the code, but which creates more server load.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sunny C. on October 27, 2008, 08:46:01 AM
ok, thank you!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: nic_bck on November 01, 2008, 02:44:31 AM
Hello guys!  Sorry for my English :P

Please, I need your help!

I want to use this mod, but I want to have the URLs like this:

Code: [Select]
http://www.misite.com/4images/cat-[CATEGORY_NAME]-[CATEGORY_ID].htm
http://www.misite.com/4images/img-[IMAGE_NAME]-[IMAGE_ID].htm

But this mod do this kind of URL:

Code: [Select]
http://www.misite.com/4images/cat[CATEGORY_ID]..htm
http://www.misite.com/4images/img[IMAGE_ID].htm

This other mod do the kind of URL what I want:
[MOD] Google Friendly Urls For 4images Best Seo Mod (http://www.4homepages.de/forum/index.php?topic=17598.0)

BUT, like V@no said:
Quote
The author of this mod went an "easy" way by adding additional database query requests for each link to an image or category. It made the mod more universal with less changes in the code, but which creates more server load.

That mod do a lot of querys, and do it more than one time  8O
Like this:

Code: [Select]
SELECT cat_id,image_name FROM 4images_images WHERE image_id = '5683'
Querytime: 0

SELECT cat_id,image_name FROM 4images_images WHERE image_id = '5683'
Querytime: 0

SELECT cat_id,image_name FROM 4images_images WHERE image_id = '5683'
Querytime: 0

SELECT cat_id,image_name FROM 4images_images WHERE image_id = '5683'
Querytime: 0

SELECT cat_id,image_name FROM 4images_images WHERE image_id = '5683'
Querytime: 0

SELECT sessionvars_value FROM 4images_sessionvars WHERE sessionvars_name = 'download_token' AND session_id = '0132b7f63b60ad312cd8afb82d69e221'
Querytime: 0.002

SELECT cat_id,image_name FROM 4images_images WHERE image_id = '6813'
Querytime: 0

SELECT cat_id,image_name FROM 4images_images WHERE image_id = '6813'
Querytime: 0

SELECT cat_name,cat_parent_id FROM 4images_categories WHERE cat_id = '148'
Querytime: 0

SELECT cat_id,image_name FROM 4images_images WHERE image_id = '6813'
Querytime: 0

SELECT cat_id,image_name FROM 4images_images WHERE image_id = '6813'
Querytime: 0

SELECT cat_id,image_name FROM 4images_images WHERE image_id = '6813'
Querytime: 0

SELECT cat_id,image_name FROM 4images_images WHERE image_id = '6813'
Querytime: 0

SELECT cat_id,image_name FROM 4images_images WHERE image_id = '6813'
Querytime: 0

SELECT cat_id,image_name FROM 4images_images WHERE image_id = '6813'

Examples:

With this mod, category page load:
Code: [Select]
Page generated in 0.739813 seconds with 23 queries, spending 0.427000 seconds doing MySQL queries and 0.312813 doing PHP things. GZIP compression disabled
With the other mod ([MOD] Google Friendly Urls For 4images Best Seo Mod), category page load::
Code: [Select]
Page generated in 1.061930 seconds with 134 queries, spending 0.715000 seconds doing MySQL queries and 0.346930 doing PHP things. GZIP compression disabled
With this mod, details page load:
Code: [Select]
Page generated in 0.665015 seconds with 15 queries, spending 0.368000 seconds doing MySQL queries and 0.297015 doing PHP things. GZIP compression disabled
With the other mod ([MOD] Google Friendly Urls For 4images Best Seo Mod), details page load::
Code: [Select]
Page generated in 0.713163 seconds with 39 queries, spending 0.393000 seconds doing MySQL queries and 0.320163 doing PHP things. GZIP compression disabled
Please I need help to do a "hybrid", I want to have this good mod but with the name of the category or the name of the image into the URL.

Please help me, I think that it would be very interesting for a lot of people.

I'm trying to do it :P

Thanks!

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on November 01, 2008, 11:52:40 AM
h nic_bck,

okay do it :)

just for your info:

i have this stats in another mod - [MOD] Google Friendly Urls For 4images Best Seo Mod

index site
Code: [Select]
Page generated in 0.392127 seconds with 120 queries, spending 0.228000 seconds doing MySQL queries and 0.164127 doing PHP things. GZIP compression enabled
category site (most subcategories)
Code: [Select]
Page generated in 0.690441 seconds with 1183 queries, spending 0.052000 seconds doing MySQL queries and 0.638441 doing PHP things. GZIP compression enabled
details site
Code: [Select]
Page generated in 0.152386 seconds with 21 queries, spending 0.054000 seconds doing MySQL queries and 0.098386 doing PHP things. GZIP compression enabled
hope you can make it better
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: nic_bck on November 01, 2008, 02:36:41 PM
Hi Nicky and friends!! First Sorry for my English :P

I have my first improve to the mod: [MOD] Google Friendly Urls For 4images Best Seo Mod, this modification avoid duplicate queries.

Examples:

With the mod ([MOD] Google Friendly Urls For 4images Best Seo Mod), category page load:
Code: [Select]
Page generated in 1.061930 seconds with 134 queries, spending 0.715000 seconds doing MySQL queries and 0.346930 doing PHP things. GZIP compression disabled
With the mod ([MOD] Google Friendly Urls For 4images Best Seo Mod) with my improve, category page load:
Code: [Select]
Page generated in 0.697700 seconds with 38 queries, spending 0.362000 seconds doing MySQL queries and 0.335700 doing PHP things. GZIP compression disabled
With the mod ([MOD] Google Friendly Urls For 4images Best Seo Mod), details page load:
Code: [Select]
Page generated in 0.713163 seconds with 39 queries, spending 0.393000 seconds doing MySQL queries and 0.320163 doing PHP things. GZIP compression disabled
With the mod ([MOD] Google Friendly Urls For 4images Best Seo Mod) with my improve, details page load:
Code: [Select]
Page generated in 0.654014 seconds with 22 queries, spending 0.349000 seconds doing MySQL queries and 0.305014 doing PHP things. GZIP compression disabled
The modification:
NOTE: This is a improve of  [MOD] Google Friendly Urls For 4images Best Seo Mod so you have to have it installed :P

Step 1
Open /includes/sessions.php
Find:
Code: [Select]
//Mod_bmollet
/**
 * Get the category url
 * @param int $cat_id The id of the category
 * @param string $cat_url The current status of the URL
 */
function get_category_url($cat_id,$cat_url = '')
{
global $site_db;
$sql = "SELECT cat_name,cat_parent_id FROM ".CATEGORIES_TABLE." WHERE cat_id = '".$cat_id."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
$cat_url  = '-'.str_replace('+','-',urlencode($row['cat_name'])).'-'.$cat_id.$cat_url;
// if you want full path of category in url, put next line in comment
return $cat_url;
if( $row['cat_parent_id'] != 0)
{
return get_category_url($row['cat_parent_id'],$cat_url);
}
else
{
return $cat_url;
}
}
//Mod_bmollet
/**
 * Get the image url
 * @param int $image_id The id of the image
 */
function get_image_url($image_id)
{
global $site_db;
$sql = "SELECT cat_id,image_name FROM ".IMAGES_TABLE." WHERE image_id = '".$image_id."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
// if you want comlpete path to image in url, remove comment from following line
//return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
return '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
}

Replace with:

Code: [Select]
//Mod_bmollet && improve by nic_bck v0.1
/**
 * Get the category url
 * @param int $cat_id The id of the category
 * @param string $cat_url The current status of the URL
 */
$categoria_anterior;
$url_categoria_anterior;
function get_category_url($cat_id,$cat_url = '')
{
global $site_db;
global $categoria_anterior;
global $url_categoria_anterior;
if ($categoria_anterior == $cat_id)
{
return $url_categoria_anterior;
}
$sql = "SELECT cat_name,cat_parent_id FROM ".CATEGORIES_TABLE." WHERE cat_id = '".$cat_id."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
$cat_url  = '-'.str_replace('+','-',urlencode($row['cat_name'])).'-'.$cat_id.$cat_url;
// if you want full path of category in url, put next line in comment
$categoria_anterior = $cat_id;
$url_categoria_anterior = $cat_url;
return $cat_url;
if( $row['cat_parent_id'] != 0)
{
return get_category_url($row['cat_parent_id'],$cat_url);
}
else
{
return $cat_url;
}
}
//Mod_bmollet && improve by nic_bck v0.1
/**
 * Get the image url
 * @param int $image_id The id of the image
 */
$imagen_anterior;
$url_imagen_anterior;
function get_image_url($image_id)
{
global $site_db;
global $imagen_anterior;
global $url_imagen_anterior;
//echo "imagen: " . $imagen_anterior;
if ($imagen_anterior == $image_id)
{
return $url_imagen_anterior;
}
$sql = "SELECT cat_id,image_name FROM ".IMAGES_TABLE." WHERE image_id = '".$image_id."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
// if you want comlpete path to image in url, remove comment from following line
//return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
       $imagen_anterior = $image_id;
$url_imagen_anterior = '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
return '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;

}

Please, Nicky test it!!! and put here your new stats.

I'm trying to improve it with a better version.

Thanks!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on November 01, 2008, 05:14:44 PM
hi nic,

okay, i added our post#s to the correct thread..
i will test it in few minutes.

btw. your english is okay ;)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on November 01, 2008, 05:39:54 PM
okay,

here we go

index site
Code: [Select]
Page generated in 0.395708 seconds with 76 queries, spending 0.232000 seconds doing MySQL queries and 0.163708 doing PHP things. GZIP compression enabled
category site (most subs)
Code: [Select]
Page generated in 0.680518 seconds with 596 queries, spending 0.055000 seconds doing MySQL queries and 0.625518 doing PHP things. GZIP compression enabled
details site
Code: [Select]
Page generated in 0.158879 seconds with 16 queries, spending 0.054000 seconds doing MySQL queries and 0.104879 doing PHP things. GZIP compression enabled
yep..
index and categories queries are down up to 50%

GREAT! Thank you 4 that!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: nic_bck on November 01, 2008, 08:10:00 PM
okay,

here we go

index site
Code: [Select]
Page generated in 0.395708 seconds with 76 queries, spending 0.232000 seconds doing MySQL queries and 0.163708 doing PHP things. GZIP compression enabled
category site (most subs)
Code: [Select]
Page generated in 0.680518 seconds with 596 queries, spending 0.055000 seconds doing MySQL queries and 0.625518 doing PHP things. GZIP compression enabled
details site
Code: [Select]
Page generated in 0.158879 seconds with 16 queries, spending 0.054000 seconds doing MySQL queries and 0.104879 doing PHP things. GZIP compression enabled
yep..
index and categories queries are down up to 50%

GREAT! Thank you 4 that!

Hi! Nicky. It works! I'm very happy :P

I'll try to make it better, but I don't have free time now. :(

Thanks for test it!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on November 01, 2008, 09:17:31 PM
Since we are on optimizing rage today, little more optimized nic_bck's version:

Code: [Select]
function fixname($text)
{
  return strtolower(strtr(
    $text,
     array(
      "é" => "e",
      "è" => "e",
      "ê" => "e",
      "à" => "a",
      "ë" => "e",
      "â" => "a",
      "ú" => "a",
      "ó" => "o",
      "í" => "i",
      "á" => "a",

      //russian UTF8 encoded alphabet (lower and upper cases)
      "&#1040;" => "a",
      "&#1072;" => "a",
      "&#1041;" => "b",
      "&#1073;" => "b",
      "&#1042;" => "v",
      "&#1074;" => "v",
      "&#1043;" => "g",
      "&#1075;" => "g",
      "&#1044;" => "d",
      "&#1076;" => "d",
      "&#1045;" => "e",
      "&#1077;" => "e",
      "&#1025;" => "yo",
      "&#1105;" => "yo",
      "&#1046;" => "zh",
      "&#1078;" => "zh",
      "&#1047;" => "z",
      "&#1079;" => "z",
      "&#1048;" => "i",
      "&#1080;" => "i",
      "&#1049;" => "j",
      "&#1081;" => "j",
      "&#1050;" => "k",
      "&#1082;" => "k",
      "&#1051;" => "l",
      "&#1083;" => "l",
      "&#1052;" => "m",
      "&#1084;" => "m",
      "&#1053;" => "n",
      "&#1085;" => "n",
      "&#1054;" => "o",
      "&#1086;" => "o",
      "&#1055;" => "p",
      "&#1087;" => "p",
      "&#1056;" => "r",
      "&#1088;" => "r",
      "&#1057;" => "s",
      "&#1089;" => "s",
      "&#1058;" => "t",
      "&#1090;" => "t",
      "&#1059;" => "u",
      "&#1091;" => "u",
      "&#1060;" => "f",
      "&#1092;" => "f",
      "&#1061;" => "h",
      "&#1093;" => "h",
      "&#1062;" => "c",
      "&#1094;" => "c",
      "&#1063;" => "ch",
      "&#1095;" => "ch",
      "&#1064;" => "sh",
      "&#1096;" => "sh",
      "&#1065;" => "sch",
      "&#1097;" => "sch",
      "&#1066;" => "",
      "&#1098;" => "",
      "&#1067;" => "i",
      "&#1099;" => "i",
      "&#1068;" => "'",
      "&#1100;" => "'",
      "&#1069;" => "e",
      "&#1101;" => "e",
      "&#1070;" => "yu",
      "&#1102;" => "yu",
      "&#1071;" => "ya",
      "&#1103;" => "ya",
  )));
}
function get_category_url($cat_id,$cat_url = '')
{
  global $site_db, $cat_cache;
  static $urlname = array(); //cache names in this array
  if (isset($urlname[$cat_id]))
    return $urlname[$cat_id];
  if (!empty($cat_cache))
  {
    $row['cat_name'] = @$cat_cache[$cat_id]['cat_name'];
    $row['cat_parent_id'] = @$cat_cache[$cat_id]['cat_parent_id'];
  }
  else
  {
    $sql = "SELECT cat_name,cat_parent_id FROM ".CATEGORIES_TABLE." WHERE cat_id = '".$cat_id."'";
    $row = $site_db->query_firstrow($sql);
  }
  $row['cat_name'] = fixname($row['cat_name']);
  $cat_url  = '-'.str_replace('+','-',urlencode($row['cat_name'])).'-'.$cat_id.$cat_url;
  // if you want full path of category in url, put next line in comment
  $row['cat_parent_id'] = 0;
  if($row['cat_parent_id'] != 0)
  {
    $urlname[$cat_id] = get_category_url($row['cat_parent_id'],$cat_url);
  }
  else
  {
    $urlname[$cat_id] = $cat_url;
  }
  return $urlname[$cat_id];
}
//Mod_bmollet
/**
 * Get the image url
 * @param int $image_id The id of the image
 */
function get_image_url($image_id)
{
  global $site_db;
  static $urlname = array(); //cache names in this array
  if (isset($urlname[$image_id]))
    return $urlname[$image_id];
 
  $sql = "SELECT cat_id,image_name FROM ".IMAGES_TABLE." WHERE image_id = '".$image_id."'";
  $row = $site_db->query_firstrow($sql);
  $row['image_name'] = fixname($row['image_name']);
  // if you want comlpete path to image in url, remove comment from following line
  //$urlname[$image_id] = get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id; 
  $urlname[$image_id] = '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
  return $urlname[$image_id];
}


Results:

index.php
Original
Code: [Select]
Page generated in 0.109686 seconds with 36 queries, spending 0.059000 seconds doing MySQL queries and 0.050686 doing PHP things. GZIP compression disabledOptimized
Code: [Select]
Page generated in 0.095068 seconds with 11 queries, spending 0.059000 seconds doing MySQL queries and 0.036068 doing PHP things. GZIP compression disabled
categories.php (30 images per page)
Original:
Code: [Select]
Page generated in 0.227558 seconds with 195 queries, spending 0.051000 seconds doing MySQL queries and 0.176558 doing PHP things. GZIP compression disabledOptimized:
Code: [Select]
Page generated in 0.179981 seconds with 37 queries, spending 0.050000 seconds doing MySQL queries and 0.129981 doing PHP things. GZIP compression disabled
details.php
Original
Code: [Select]
Page generated in 0.219341 seconds with 22 queries, spending 0.110000 seconds doing MySQL queries and 0.109341 doing PHP things. GZIP compression disabledOptimized
Code: [Select]
Page generated in 0.060998 seconds with 14 queries, spending 0.028000 seconds doing MySQL queries and 0.032998 doing PHP things. GZIP compression disabled
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on November 01, 2008, 09:33:55 PM
PERFECT!

index.php
Code: [Select]
Page generated in 0.194642 seconds with 27 queries, spending 0.044000 seconds doing MySQL queries and 0.150642 doing PHP things. GZIP compression enabled
categories.php with most subcategories
Code: [Select]
Page generated in 0.607308 seconds with 8 queries, spending 0.045000 seconds doing MySQL queries and 0.562308 doing PHP things. GZIP compression enabled
categories.php with 30 images per page
Code: [Select]
Page generated in 0.263828 seconds with 98 queries, spending 0.046000 seconds doing MySQL queries and 0.217828 doing PHP things. GZIP compression enabled
details.php
Code: [Select]
Page generated in 0.209541 seconds with 15 queries, spending 0.112000 seconds doing MySQL queries and 0.097541 doing PHP things. GZIP compression enabled
LOL.. i turned off GZIP compression................................................
2-4 seconds building...
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: nic_bck on November 02, 2008, 03:01:34 PM
Thanks V@no!!

Good work!

One question: what is better? GZIP enable or disable?

Thanks!

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: batu544 on November 05, 2008, 08:34:36 PM
V@no,
              Is your optimized code works for english  version. ?


FYI,
       I just tried the changed code on my local system.. here is the result..

For index page only ( before change)
Code: [Select]
Page generated in 0.466600 seconds with 67 queries, spending 0.215000 seconds doing MySQL queries and 0.251600 doing PHP things. GZIP compression disabled
Page generated in 0.409851 seconds with 67 queries, spending 0.222000 seconds doing MySQL queries and 0.187851 doing PHP things. GZIP compression disabled
Page generated in 0.459074 seconds with 67 queries, spending 0.215000 seconds doing MySQL queries and 0.244074 doing PHP things. GZIP compression disabled
Page generated in 0.468307 seconds with 70 queries, spending 0.225000 seconds doing MySQL queries and 0.243307 doing PHP things. GZIP compression disabled
Page generated in 0.462290 seconds with 67 queries, spending 0.215000 seconds doing MySQL queries and 0.247290 doing PHP things. GZIP compression disabled
Page generated in 0.481106 seconds with 67 queries, spending 0.223000 seconds doing MySQL queries and 0.258106 doing PHP things. GZIP compression disabled
Page generated in 0.450743 seconds with 67 queries, spending 0.212000 seconds doing MySQL queries and 0.238743 doing PHP things. GZIP compression disabled
Page generated in 0.461674 seconds with 67 queries, spending 0.220000 seconds doing MySQL queries and 0.241674 doing PHP things. GZIP compression disabled



After change

Code: [Select]
Page generated in 0.493634 seconds with 22 queries, spending 0.272000 seconds doing MySQL queries and 0.221634 doing PHP things. GZIP compression disabled
Page generated in 0.449397 seconds with 19 queries, spending 0.214000 seconds doing MySQL queries and 0.235397 doing PHP things. GZIP compression disabled
Page generated in 0.445229 seconds with 19 queries, spending 0.217000 seconds doing MySQL queries and 0.228229 doing PHP things. GZIP compression disabled
Page generated in 0.445182 seconds with 19 queries, spending 0.215000 seconds doing MySQL queries and 0.230182 doing PHP things. GZIP compression disabled
Page generated in 0.461345 seconds with 19 queries, spending 0.224000 seconds doing MySQL queries and 0.237345 doing PHP things. GZIP compression disabled
Page generated in 0.445921 seconds with 19 queries, spending 0.216000 seconds doing MySQL queries and 0.229921 doing PHP things. GZIP compression disabled
Page generated in 0.468698 seconds with 22 queries, spending 0.221000 seconds doing MySQL queries and 0.247698 doing PHP things. GZIP compression disabled



I can see only the number of queries has decreased .. not the total time of page generation..  :)


Thanks
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@nо on November 05, 2008, 09:03:41 PM
yes, english names don't need any conversion, they will be used as they are
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@nо on November 05, 2008, 09:11:39 PM
your results are not surprising. usually mysql become a bottleneck in gallery's performance  when it has lots of images
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: batu544 on November 05, 2008, 09:24:16 PM
yes, english names don't need any conversion, they will be used as they are

this means  can I remove fixname function from the code ?

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@nо on November 05, 2008, 10:33:50 PM
yes, you can. that function only makes non-latin letters look pretty in the address bar
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: xLaM on November 08, 2008, 04:01:34 PM
Wow...working great for me:)
But i have one trouble, in main website my image thumbnail is double showing. My website http://wallpapercantik.com (http://wallpapercantik.com), please help me....... before this my website is no problem.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on November 08, 2008, 04:22:18 PM
hi und welcome to the 4images forum,

template thumbnail_bit.html

delete this if you don't need it
Code: [Select]
<!-- you wish detail page in a small javascript open window, use {thumbnail_openwindow} -->
test it afterward
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: xLaM on November 08, 2008, 11:31:29 PM
Thanks Nicky, you are the best:D :wink:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on November 09, 2008, 12:12:04 AM
nope....

this is V@no  :lol:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: ashfaq on November 15, 2008, 02:32:52 AM
I am using seo and its nice but i need some modifications to make it more better.

Currently my site categoreis are like this:
http://www.deskbeauty.com/k-cars-bikes-wallpapers-7.htm
http://www.deskbeauty.com/k-sexy-girls-wallpaper-5.htm
http://www.deskbeauty.com/k-vista-wallpaper-21.htm        etc....
You have noticed that with every category start there is a (k), plz how can i remove it ?

Also when i open any wallpaper first it shows the category link and then wallpaper link: for example
http://www.deskbeauty.com/r-cars-bikes-wallpapers-7-cars-wallpaper-144-3756.htm
http://www.deskbeauty.com/r-sexy-girls-wallpaper-5-bikini-models-8-3811.htm
http://www.deskbeauty.com/r-vista-wallpaper-21-longhorn-m4-bliss-2514.htm
Now how to make it simple by removing category link and sow just wallpaper link ?

Hope you understand it and will help, my hataccess and sessions.php files are attached.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on November 15, 2008, 02:55:27 AM
in the original code it has this:
Code: [Select]
// if you want full path of category in url, put next line in comment
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: ashfaq on November 15, 2008, 03:31:48 AM
in the original code it has this:
Code: [Select]
// if you want full path of category in url, put next line in comment

Dear your reply always put me in trouble, plz explain it... Thanks
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: ashfaq on November 16, 2008, 12:30:08 PM
in the original code it has this:
Code: [Select]
// if you want full path of category in url, put next line in comment

Dear your reply always put me in trouble, plz explain it... Thanks

Big Brother where are you ?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on November 17, 2008, 06:14:53 AM
if you use unmodified code from the original tutorial on first page of this topic, you should not see all the parent categories in the links, only current category name.
as of links to image details, in includes/sessions.php find
Code: [Select]
//return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
replace it with
Code: [Select]
return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: ashfaq on November 17, 2008, 03:32:37 PM
if you use unmodified code from the original tutorial on first page of this topic, you should not see all the parent categories in the links, only current category name.
as of links to image details, in includes/sessions.php find
Code: [Select]
//return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
replace it with
Code: [Select]
return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;

I am using your given sessions.php file which didnt have the code which you tell to replace.
I have attached your given sessions.php file which i am currently using plz plz edit it for better seo and also tell can i use it with 4images 1.6.7  for better seo and user flags?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on November 17, 2008, 03:45:43 PM
No, you have modified my original code and enabled the category path.

So, read carefully the comments inside my code and comment out the line you uncommented.

P.S.
a hint:
Quote
   // if you want comlpete path to image in url, remove comment from following line


P.P.S.
Please next time state if you are not using original code, to avoid confusion
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: ashfaq on November 17, 2008, 04:18:39 PM
Thanks V@no Dear you are helping me much

I comment out this line
Quote
return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
but it only bypass the category link from image link but k and r like words are still there with start of category link and image link

For example currently category link is like this
http://www.deskbeauty.com/k-hollywood-girls-17.htm
How to make it like this
http://www.deskbeauty.com/hollywood-girls.htm

Also currently image link is like this
http://www.deskbeauty.com/r-girls-wallpaper-34-3867.htm
How to make it like this
http://www.deskbeauty.com/girls-wallpaper-34.htm

Also i am using 1.7.4 can i use this session file with 1.7.6 for seo and user flags ?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Jan-Lukas on November 17, 2008, 05:56:32 PM
habe mir das gerade mal Probeweise auf meiner Testseite gemacht, unter 1.7.6 keine Probleme mit der Original Install von Seite 1
werde ich wohl auch auf meiner Seite installieren

Edit:  musste die .htaccess noch anpassen, jetzt läuft auch die search und Lightbox mit dem Mod unter 1.7.6

Code: [Select]
RewriteEngine On

#RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@nо on November 17, 2008, 06:55:56 PM
@ashfaq:
at the moment I can't look at your site and  ot sure what is your "r" is, but I can tell you right now, you cannot remove the image/category id from url (the last number in url). The names in the url is absolutely irrelevant, it's only cosmetic feature.

[EDIT]
Your "k" and "r" are the "markers" to identify what kind of link this is: image details or categories. you cannot create links without such markers, however you can replace these markers with something else (a word or similar)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: ashfaq on November 18, 2008, 04:01:16 AM
@ashfaq:
at the moment I can't look at your site and  ot sure what is your "r" is, but I can tell you right now, you cannot remove the image/category id from url (the last number in url). The names in the url is absolutely irrelevant, it's only cosmetic feature.

[EDIT]
Your "k" and "r" are the "markers" to identify what kind of link this is: image details or categories. you cannot create links without such markers, however you can replace these markers with something else (a word or similar)

Ok Vano brother no problem, but plz just tell me how to change markers for category and image detail ?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on November 18, 2008, 04:08:00 AM
I'm sorry, I don't understand why you ask this question, somehow you've managed change the code, in the original code no "k" or "r" markers, so do the same again to meet your needs. Or reinstall the mod.

P.S.
by any chance is there a relationship between you and user *handsome*? Both of you asking questions without any willing to try understand or fix things yourself.
No offense, but your questions lately just got me thinking of this "coincidence".
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: ashfaq on November 18, 2008, 04:40:05 PM
I am sory if you think i am putting questions without knowing thing myself, but dear i try myself as i am not a php user but know html little bit so i try to change things at php,
plz dear just give some hints about changing markers or plz check sessions file which i attached in my last post.
I am sory again that bcoz of my poor php knowledge i am putting you in problem but i dont know how to change markers maybe by mistake i chagne markers in my sessions file but i realy dont know where are markers exist ?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: satine88 on November 20, 2008, 03:47:49 PM
Is there a mod to make sitemap with this mod?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on November 20, 2008, 04:57:07 PM
satine88,

this one works fine for me
http://www.4homepages.de/forum/index.php?topic=15687.0
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: ashfaq on November 21, 2008, 03:16:19 PM
Plz tell me how to change markers for categories and image details ?
I will be very very thankfull.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: ashfaq on November 24, 2008, 04:03:36 PM
Plz tell me how to change markers for categories and image details ?
I will be very very thankfull.

Help anyone plz.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on November 24, 2008, 04:17:54 PM
just reinstall the mod.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: ashfaq on November 24, 2008, 04:51:54 PM
just reinstall the mod.

V@no dear you always help me plz also help now, if i reinstall the mod then how i know where r the "k" and "r" markers, and which mod i have to install ? Should i have to install mode which is on first page of this topic ?
Bro just tell me where are these markers i will change them myself.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: rescue911 on December 06, 2008, 08:23:09 PM
any solution for the not-working drop down list?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on December 06, 2008, 08:48:48 PM
hmm, rescue911,

check my site.. is it working?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: mawenzi on December 06, 2008, 08:57:09 PM
@ Nicky and also rescue911

... is checked ... it works perfectly on your site ... and why not ...  :mrgreen:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: rescue911 on December 06, 2008, 09:16:23 PM
yes it's working on your site.
but i have 1.7.4 and SEO works well too except for that dropwdown...
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: rescue911 on December 07, 2008, 10:56:37 AM
ok problem found, just added

Code: [Select]
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
in htaccess
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on December 07, 2008, 11:43:36 AM
yeah.

correct! ;)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: rescue911 on December 07, 2008, 01:12:12 PM
i also have the language mod installed, so what i get now is :

http://www.domain.com/img-title-id.htm?l=language

how can i get that "?l=language" removed?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: fah on December 07, 2008, 01:26:15 PM
I use 4images 1.7.4. Will code for 1.7.1 (or 1.7) shown in the first post of this topic works with my version 1.7.4?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: alemam on December 30, 2008, 08:14:45 PM
Can I change the link from


http://www.xxx.com/cat-2alemam%20alemam.htm

to

http://www.xxx.com/cat-2alemam-alemam.htm
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@nо on December 30, 2008, 10:30:37 PM
%20 is a encoded  space. you cannot use non-latin laters and some special characters (including spaces) in the addresses, without encoding them first

[EDIT]
ops...my cellphone didn't show the correct text...didn't see the - in your request.

try replacing
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");

with:
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz-");
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: alemam on December 31, 2008, 05:39:00 AM
The same thing

this example

http://games.mofadlty.com/cat-2-العاب%20اطفال.html
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: zhono on December 31, 2008, 07:33:07 AM
I noticed that the instructions in the first post have different code than the pre-made files in the attachment. I'm using 4images 1.7.6  Which files/instructions should I use?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: mike30 on January 02, 2009, 12:21:53 AM
Thanks for this cool mod!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: ashfaq on January 04, 2009, 04:14:47 PM
Will anyone please please tell me how to change image markers ?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: alemam on January 07, 2009, 07:45:47 PM
this link

http://games.mofadlty.com/cat-2-العاب%20اطفال.html


how i chnge like this

http://games.mofadlty.com/cat-2-العاب-طفال.html
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Anarchology on January 09, 2009, 04:31:22 AM
Hey everyone!

I just installed the MOD from the link below...
http://www.4homepages.de/forum/index.php?topic=18304.0

I am thinking about putting this MOD on my site. Are these two mods compatible with each other?

Also, I have already had Google crawl my site, and created a sitemap.xml file. I figure I would have to update my sitemap file, but I'm wondering if the links already crawled and listed on Google will be now invalid or point to an error if I add this MOD?

Thanks,
A
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: ntws on January 13, 2009, 09:17:03 PM
Ok, I'm in trouble, first i managed to make working bot codes with cat-urlhere / img-urlhere and k-urlhere / r-urlhere. Also i figured how to changed cat-/img- or k-/r- with other generic words for better seo.

I'm in trouble because after installing the mod, neither cat-/imig- or k-/r- is going to work with the search function. I read 3 times alt he posts. i have in .htaccess the lines regarding the search rewriting rules, but i got:
[query] - seraching on the site => "An unexpected error occured. Please try again later.", and I'll have diplayed the extended search page.

If i search (extended page) [query] and chose a category where i know the image+query is i'll get results without error.

Any idea ? What I'm doing wrong ?

P.S. All isworking except search !
cat-/img- and k-/r- reffers to version of the script (mod)

Sorry for my english !

regards
NTWS
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Duca on January 20, 2009, 01:43:57 AM
Good mod! Thanks!

Is there a way to have url structure like this:

site.com/category-id/filename-id.htm

or
site.com/category-id/subcetogry-id/filename-id.htm

Duca
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Satya_love on January 23, 2009, 01:33:31 PM
Hello,

I used this MOD on my gallery V1.7.6

Everything is working fine except "lightbox" link which is placed in the sidebar.

Action to add images to lightbox works fine but only the link to lightbox is not working.

Actually when it transforms the link to "/lightbox.htm" and when i open , it says URL not found on server.So i think that "/lightbox.php" is not redirecting to "/lightbox.htm"

Please help me !!!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on January 23, 2009, 03:49:51 PM
try re-do step 1, I've fixed it in the original topic.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Satya_love on January 24, 2009, 07:53:04 AM
try re-do step 1, I've fixed it in the original topic.

Thanks V@no !!!  :D

Its working perfect now  :wink:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sleep9999 on January 28, 2009, 10:17:03 AM
I'm use 1.7.6. It's working, but why "object not found, 404 error message" when I click category or random images.

I'm working on localhost, with windows and apache.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on January 28, 2009, 02:04:41 PM
hi sleep9999 and welcome to the 4images forum

this is working fine when your invorement is setup correctly
eg mod rewrite in your apache is activated
Code: [Select]
LoadModule rewrite_module modules/mod_rewrite.soand .htaccess is allowed

and of course SEO Mod is correctly added into 4images files

or try this [PROGRAM] 4images Mobile Server (http://www.4homepages.de/forum/index.php?topic=18352.0)

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sleep9999 on January 28, 2009, 06:41:25 PM
Thanks Nicky !!! 

Its working perfect now

 :P
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: yellows on January 29, 2009, 12:35:41 PM
is there a way to make the links in search results show up as

http://www.sexymalecelebs.co.uk/Galeries/img-elliott-tittensor---154-18264.htm

instead of

http://www.sexymalecelebs.co.uk/Galeries/img18264.search.htm
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: vollcom on January 30, 2009, 02:44:06 PM
Hallo, ich möchte auch gerne den SEO Mod Installieren. Nur leider klappt es bei mir nicht! Es kommt immer
Code: [Select]
Error 404 - Not found
Die angegebene Seite konnte nicht gefunden werden.
Ich denke das liegt bei mir an der .htaccess. Meine hp habe ich bei 1und1 gehostet.
Wenn ich zu meinem Server connecte, bin ich im root Verzeichnis, dort liegt eine .htaccess und 4 Ordner mit den jeweiligen homepages (alles unterschiedliche) in einem Ordner ist 4image installiet.
Wenn ich im Browser meine URL eingebe, weiß der 1und1 Server, in welchen ordner er mich weiter leiten soll.
Nun meine frage: muss ich die .htaccess im rootordner modivizieren oder muss ich eine neue .htaccess anlegen welche dann im dem Ordner liegt ???

edit:// habe es hinbekommen!! 4Image Version 1.7.6

.htaccess in den root ordner von 4image legen
Code: [Select]
RewriteBase /
RewriteEngine on
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}

RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}

RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}

RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}

RewriteRule ^postcard([a-zA-Z0-9]+)\.htm$ postcards.php?postcard_id=$1&%{QUERY_STRING}

RewriteRule ^postcard\.img([0-9]+)\.htm$ postcards.php?image_id=$1&%{QUERY_STRING}

RewriteRule ^k-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}

RewriteRule ^r-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}

RewriteRule ^r([0-9]+).search.htm details.php?image_id=$1&%{QUERY_STRING}

und session.php (komplett)
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: sessions.php                                         *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.4                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
if (!defined('ROOT_PATH')) {
  die(
"Security violation");
}

//-----------------------------------------------------
//--- Start Configuration -----------------------------
//-----------------------------------------------------

define('SESSION_NAME''sessionid');

$user_table_fields = array(
  
"user_id" => "user_id",
  
"user_level" => "user_level",
  
"user_name" => "user_name",
  
"user_password" => "user_password",
  
"user_email" => "user_email",
  
"user_showemail" => "user_showemail",
  
"user_allowemails" => "user_allowemails",
  
"user_invisible" => "user_invisible",
  
"user_joindate" => "user_joindate",
  
"user_activationkey" => "user_activationkey",
  
"user_lastaction" => "user_lastaction",
  
"user_location" => "user_location",
  
"user_lastvisit" => "user_lastvisit",
  
"user_comments" => "user_comments",
  
"user_homepage" => "user_homepage",
  
"user_icq" => "user_icq"
);

//-----------------------------------------------------
//--- End Configuration -------------------------------
//-----------------------------------------------------
function get_category_id($path,$parent_id 0)
{
$cat_name array_shift($path);
global $site_db;
$sql "SELECT cat_id FROM ".CATEGORIES_TABLE." WHERE cat_parent_id = $parent_id AND cat_name = '".mysql_real_escape_string($cat_name)."'";
$result $site_db->query($sql);
$row $site_db->fetch_array($result);
if( count($path) != 0)
{
return get_category_id($path,$row['cat_id']);
}
else
{
return $row['cat_id'];
}
}
//Mod_bmollet
/**
 * Get the image id
 * @param array $path An array with the path of the image
 */
function get_image_id($path)
{
global $site_db;
$image_name array_pop($path);
$cat_id get_category_id($path);
$sql "SELECT image_id FROM ".IMAGES_TABLE." WHERE image_name = '".mysql_real_escape_string($image_name)."' AND cat_id = $cat_id";
$result $site_db->query($sql);
$row $site_db->fetch_array($result);
return $row['image_id'];
}


function 
get_user_table_field($add$user_field) {
  global 
$user_table_fields;
  return (!empty(
$user_table_fields[$user_field])) ? $add.$user_table_fields[$user_field] : "";
}

class 
Session {

  var 
$session_id;
  var 
$session_key;
  var 
$user_ip;
  var 
$user_location;
  var 
$current_time;
  var 
$session_timeout;
  var 
$mode "get";
  var 
$session_info = array();
  var 
$user_info = array();

  function 
Session() {
    global 
$config;
    
$this->session_timeout $config['session_timeout'] * 60;
    
$this->user_ip $this->get_user_ip();
    
$this->user_location $this->get_user_location();
    
$this->current_time time();

    if (
defined('SESSION_KEY') && SESSION_KEY != '') {
        
$this->session_key SESSION_KEY;
    } else {
        
$this->session_key md5('4images' realpath(ROOT_PATH));
    }

    
// Stop adding SID to URLs
    
@ini_set('session.use_trans_sid'0);

    
//@ini_set('session.cookie_lifetime', $this->session_timeout);

    
session_name(urlencode(SESSION_NAME));
    @
session_start();

    
$this->demand_session();
  }

  function 
set_cookie_data($name$value$permanent 1) {
    
$cookie_expire = ($permanent) ? $this->current_time 60 60 24 365 0;
    
$cookie_name COOKIE_NAME.$name;
    
setcookie($cookie_name$value$cookie_expireCOOKIE_PATHCOOKIE_DOMAINCOOKIE_SECURE);
    
$HTTP_COOKIE_VARS[$cookie_name] = $value;
  }

  function 
read_cookie_data($name) {
    global 
$HTTP_COOKIE_VARS;
    
$cookie_name COOKIE_NAME.$name;
    return (isset(
$HTTP_COOKIE_VARS[$cookie_name])) ? $HTTP_COOKIE_VARS[$cookie_name] : false;
  }

  function 
get_session_id() {
    if (
SID == '') {
      
$this->mode "cookie";
    }

    if (
preg_match('/[^a-z0-9]+/i'session_id())) {
      @
session_regenerate_id();
    }

    
$this->session_id session_id();
  }

  function 
demand_session() {
    
$this->get_session_id();
    if (!
$this->load_session_info()) {
      
$this->delete_old_sessions();
      
$user_id = ($this->read_cookie_data("userid")) ? intval($this->read_cookie_data("userid")) : GUEST;
      
$this->start_session($user_id);
    }
    else {
      
$this->user_info $this->load_user_info($this->session_info['session_user_id']);
      
$update_cutoff = ($this->user_info['user_id'] != GUEST) ? $this->current_time $this->user_info['user_lastaction'] : $this->current_time $this->session_info['session_lastaction'];
      if (
$update_cutoff 60) {
        
$this->update_session();
        
$this->delete_old_sessions();
      }
    }
  }

  function 
start_session($user_id GUEST$login_process 0) {
    global 
$site_db;

    
$this->user_info $this->load_user_info($user_id);
    if (
$this->user_info['user_id'] != GUEST && !$login_process) {
      if (
$this->read_cookie_data("userpass") == $this->user_info['user_password'] && $this->user_info['user_level'] > USER_AWAITING) {
        
$this->set_cookie_data("userpass"$this->user_info['user_password']);
      }
      else {
        
$this->set_cookie_data("userpass"""0);
        
$this->user_info $this->load_user_info(GUEST);
      }
    }

    
//if (!$login_process) {
      
$sql "REPLACE INTO ".SESSIONS_TABLE."
              (session_id, session_user_id, session_lastaction, session_location, session_ip)
              VALUES
              ('"
.addslashes($this->session_id)."', ".$this->user_info['user_id'].", $this->current_time, '$this->user_location', '$this->user_ip')";
      
$site_db->query($sql);
    
//}

    
$this->session_info['session_user_id'] = $this->user_info['user_id'];
    
$this->session_info['session_lastaction'] = $this->current_time;
    
$this->session_info['session_location'] = $this->user_location;
    
$this->session_info['session_ip'] = $this->user_ip;

    if (
$this->user_info['user_id'] != GUEST) {
      
$this->user_info['user_lastvisit'] = (!empty($this->user_info['user_lastaction'])) ? $this->user_info['user_lastaction'] : $this->current_time;
      
$sql "UPDATE ".USERS_TABLE."
              SET "
.get_user_table_field("""user_lastaction")." = $this->current_time, ".get_user_table_field("""user_location")." = '$this->user_location', ".get_user_table_field("""user_lastvisit")." = ".$this->user_info['user_lastvisit']."
              WHERE "
.get_user_table_field("""user_id")." = ".$this->user_info['user_id'];
      
$site_db->query($sql);
    }
    
$this->set_cookie_data("lastvisit"$this->user_info['user_lastvisit']);
    
$this->set_cookie_data("userid"$this->user_info['user_id']);
    return 
true;
  }

  function 
login($user_name ""$user_password ""$auto_login 0$set_auto_login 1) {
    global 
$site_db$user_table_fields;

    if (empty(
$user_name) || empty($user_password)) {
      return 
false;
    }
    
$sql "SELECT ".get_user_table_field("""user_id").get_user_table_field(", ""user_password")."
            FROM "
.USERS_TABLE."
            WHERE "
.get_user_table_field("""user_name")." = '$user_name' AND ".get_user_table_field("""user_level")." <> ".USER_AWAITING;
    
$row $site_db->query_firstrow($sql);

    
$user_id = (isset($row[$user_table_fields['user_id']])) ? $row[$user_table_fields['user_id']] : GUEST;
    
$user_password md5($user_password);
    if (
$user_id != GUEST) {
      if (
$row[$user_table_fields['user_password']] == $user_password) {
        
$sql "UPDATE ".SESSIONS_TABLE."
                SET session_user_id = 
$user_id
                WHERE session_id = '"
.addslashes($this->session_id)."'";
        
$site_db->query($sql);
        if (
$set_auto_login) {
          
$this->set_cookie_data("userpass", ($auto_login) ? $user_password "");
        }
        
$this->start_session($user_id1);
        return 
true;
      }
    }
    return 
false;
  }

  function 
logout($user_id) {
    global 
$site_db;
    
$sql "DELETE FROM ".SESSIONS_TABLE."
            WHERE session_id = '"
.addslashes($this->session_id)."' OR session_user_id = $user_id";
    
$site_db->query($sql);
    
$this->set_cookie_data("userpass"""0);
    
$this->set_cookie_data("userid"GUEST);

    
$this->session_info = array();

    return 
true;
  }

  function 
delete_old_sessions() {
    global 
$site_db;
    
$expiry_time $this->current_time $this->session_timeout;
    
$sql "DELETE FROM ".SESSIONS_TABLE."
            WHERE session_lastaction < 
$expiry_time";
    
$site_db->query($sql);

    return 
true;
  }

  function 
update_session() {
    global 
$site_db;

    
$sql "REPLACE INTO ".SESSIONS_TABLE."
           (session_id, session_user_id, session_lastaction, session_location, session_ip)
           VALUES
           ('"
.addslashes($this->session_id)."', ".$this->user_info['user_id'].", $this->current_time, '$this->user_location', '$this->user_ip')";
    
$site_db->query($sql);

    
$this->session_info['session_lastaction'] = $this->current_time;
    
$this->session_info['session_location'] = $this->user_location;
    
$this->session_info['session_ip'] = $this->user_ip;

    if (
$this->user_info['user_id'] != GUEST) {
      
$sql "UPDATE ".USERS_TABLE."
              SET "
.get_user_table_field("""user_lastaction")." = $this->current_time, ".get_user_table_field("""user_location")." = '$this->user_location'
              WHERE "
.get_user_table_field("""user_id")." = ".$this->user_info['user_id'];
      
$site_db->query($sql);
    }
    return;
  }

  function 
return_session_info() {
    return 
$this->session_info;
  }

  function 
return_user_info() {
    return 
$this->user_info;
  }

  function 
freeze() {
    return;
  }

  function 
load_session_info() {
    if (@
ini_get('register_globals')) {
      
session_register($this->session_key);

      if (!isset(
$GLOBALS[$this->session_key])) {
        
$GLOBALS[$this->session_key] = array();
      }

      
$this->session_info = &$GLOBALS[$this->session_key];

    } else {
      if (isset(
$_SESSION)) {
        if (!isset(
$_SESSION[$this->session_key])) {
          
$_SESSION[$this->session_key] = array();
        }

        
$this->session_info = &$_SESSION[$this->session_key];

      } else {
        if (!isset(
$GLOBALS['HTTP_SESSION_VARS'][$this->session_key])) {
          
$GLOBALS['HTTP_SESSION_VARS'][$this->session_key] = array();
        }

        
$this->session_info = &$GLOBALS['HTTP_SESSION_VARS'][$this->session_key];
      }
    }

    if (!isset(
$this->session_info['session_ip'])) {
      
$this->session_info = array();
      return 
false;
    }

    if (
$this->mode == "get" && $this->session_info['session_ip'] != $this->user_ip) {
      if (
function_exists('session_regenerate_id')) {
        @
session_regenerate_id();
      }
      
$this->get_session_id();
      
$this->session_info = array();
      return 
false;
    }

    return 
$this->session_info;
  }

  function 
load_user_info($user_id GUEST) {
    global 
$site_db$user_table_fields;

    if (
$user_id != GUEST) {
      
$sql "SELECT u.*, l.*
              FROM "
.USERS_TABLE." u, ".LIGHTBOXES_TABLE." l
              WHERE "
.get_user_table_field("u.""user_id")." = $user_id AND l.user_id = ".get_user_table_field("u.""user_id");
      
$user_info $site_db->query_firstrow($sql);
      if (!
$user_info) {
        
$sql "SELECT *
                FROM "
.USERS_TABLE."
                WHERE "
.get_user_table_field("""user_id")." = $user_id";
        
$user_info $site_db->query_firstrow($sql);
        if (
$user_info) {
          
$lightbox_id get_random_key(LIGHTBOXES_TABLE"lightbox_id");
          
$sql "INSERT INTO ".LIGHTBOXES_TABLE."
                  (lightbox_id, user_id, lightbox_lastaction, lightbox_image_ids)
                  VALUES
                  ('
$lightbox_id', ".$user_info[$user_table_fields['user_id']].", $this->current_time, '')";
          
$site_db->query($sql);
          
$user_info['lightbox_lastaction'] = $this->current_time;
          
$user_info['lightbox_image_ids'] = "";
        }
      }
    }
    if (empty(
$user_info[$user_table_fields['user_id']])) {
      
$user_info = array();
      
$user_info['user_id'] = GUEST;
      
$user_info['user_level'] = GUEST;
      
$user_info['user_lastaction'] = $this->current_time;
      
$user_info['user_lastvisit'] = ($this->read_cookie_data("lastvisit")) ? $this->read_cookie_data("lastvisit") : $this->current_time;
    }
    foreach (
$user_table_fields as $key => $val) {
      if (isset(
$user_info[$val])) {
        
$user_info[$key] = $user_info[$val];
      }
      elseif (!isset(
$user_info[$key])) {
        
$user_info[$key] = "";
      }
    }
    return 
$user_info;
  }

  function 
set_session_var($var_name$value) {
    
$this->session_info[$var_name] = $value;
    return 
true;
  }

  function 
get_session_var($var_name) {
    if (isset(
$this->session_info[$var_name])) {
      return 
$this->session_info[$var_name];
    }

    return 
'';
  }

  function 
drop_session_var($var_name) {
    unset(
$this->session_info[$var_name]);
  }

  function 
get_user_ip() {
    global 
$HTTP_SERVER_VARS$HTTP_ENV_VARS;
    
$ip = (!empty($HTTP_SERVER_VARS['REMOTE_ADDR'])) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ((!empty($HTTP_ENV_VARS['REMOTE_ADDR'])) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv("REMOTE_ADDR"));
    
$ip preg_replace("/[^\.0-9]+/"""$ip);
    return 
substr($ip050);
  }

  function 
get_user_location() {
    global 
$self_url;
    return (
defined("IN_CP")) ? "Control Panel" preg_replace(array("/([?|&])action=[^?|&]*/""/([?|&])mode=[^?|&]*/""/([?|&])phpinfo=[^?|&]*/""/([?|&])printstats=[^?|&]*/""/[?|&]".URL_ID."=[^?|&]*/""/[?|&]l=[^?|&]*/""/[&?]+$/"), array(""""""""""""""), addslashes($self_url));
  }
/* ORIGINAL CODE
  function url($url, $amp = "&amp;") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && !preg_match("/".SESSION_NAME."=/i", $url)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }
*/
  
function url($url$amp "&amp;") {
    global 
$l$user_info;
    
$dummy_array explode("#"$url);
    
$url $dummy_array[0];
    
$url str_replace('&amp;''&'$url);
    if (!
defined('IN_CP')) {
      if (
strstr($url'index.php')) {
        
$url str_replace('index.php'''$url);
      }
      elseif (
strstr($url'search.php')) {
        if (
strstr($url'page=')) {
          
preg_match('#page=([0-9]+)&?#'$url$matches);
          if (isset(
$matches[1])) {
            
$split explode('?'$url);
            
$url $split[0];
            
$query = @$split[1];
            
$url   str_replace('search.php''search.'.$matches[1].'.htm'$url);
            
$query str_replace('page='.$matches[1].'&'''$query);
            
$query str_replace('&page='.$matches[1], ''$query);
            
$query str_replace('page='.$matches[1], ''$query);
            if (!empty(
$query)) {
              
$url .= '?' $query;
            }
          }
        }
        else {
          
$url str_replace('search.php''search.htm'$url);
        }
      }
      elseif (
strstr($url'lightbox.php')) {
        if (
strstr($url'page=')) {
          
preg_match('#page=([0-9]+)&?#'$url$matches);
          if (isset(
$matches[1])) {
            
$split explode('?'$url);
            
$url $split[0];
            
$query = @$split[1];
            
$url   str_replace('lightbox.php''lightbox.'.$matches[1].'.htm'$url);
            
$query str_replace('page='.$matches[1].'&'''$query);
            
$query str_replace('&page='.$matches[1], ''$query);
            
$query str_replace('page='.$matches[1], ''$query);
            if (!empty(
$query)) {
                
$url .= '?' $query;
            }
          }
        }
        else {
          
$url str_replace('lightbox.php''lightbox.htm'$url);
        }
      }
      elseif (
strstr($url'categories.php')) {
        if (
strstr($url'cat_id=') && strstr($url'page=')) {
          
preg_match('#cat_id=([0-9]+)&?#'$url$matches1);
          
preg_match('#page=([0-9]+)&?#'$url$matches2);
          if (isset(
$matches1[1]) && isset($matches2[1])) {
            
$split explode('?'$url);
            
$url $split[0];
            
$query = @$split[1];
            
$url   str_replace('categories.php','k'.$matches1[1].'.'.$matches2[1].'.htm'$url);
            
$query str_replace('cat_id='.$matches1[1].'&'''$query);
            
$query str_replace('&cat_id='.$matches1[1], ''$query);
            
$query str_replace('cat_id='.$matches1[1], ''$query);
            
$query str_replace('page='.$matches2[1].'&'''$query);
            
$query str_replace('&page='.$matches2[1], ''$query);
            
$query str_replace('page='.$matches2[1], ''$query);
            if (!empty(
$query)) {
              
$url .= '?' $query;
            }
          }
        }
        elseif (
strstr($url'cat_id=')) {
          
preg_match('#cat_id=([0-9]+)&?#'$url$matches);
          if (isset(
$matches[1])) {
            
$split explode('?'$url);
            
$url $split[0];
            
$query = @$split[1];
            
$cat_url get_category_url($matches[1]);
            
$url   str_replace('categories.php','k'.$cat_url.'.htm'$url);
            
$query str_replace('cat_id='.$matches[1].'&'''$query);
            
$query str_replace('&cat_id='.$matches[1], ''$query);
            
$query str_replace('cat_id='.$matches[1], ''$query);
            if (!empty(
$query)) {
              
$url .= '?' $query;
            }
          }
        }
        else {
          
$url str_replace('categories.php''cat.htm'$url);
        }
      }
      elseif (
strstr($url'details.php?image_id=')) {
        if (
strstr($url'image_id=') && strstr($url'mode=')) {
          
preg_match('#image_id=([0-9]+)&?#'$url$matches1);
          
preg_match('#mode=([a-zA-Z0-9]+)&?#'$url$matches2);
          if (isset(
$matches1[1]) && isset($matches2[1])) {
            
$split explode('?'$url);
            
$url $split[0];
            
$query = @$split[1];
            
$url   str_replace('details.php','r'.$matches1[1].'.'.$matches2[1].'.htm'$url);
            
$query str_replace('image_id='.$matches1[1].'&'''$query);
            
$query str_replace('&image_id='.$matches1[1], ''$query);
            
$query str_replace('image_id='.$matches1[1], ''$query);
            
$query str_replace('mode='.$matches2[1].'&'''$query);
            
$query str_replace('&mode='.$matches2[1], ''$query);
            
$query str_replace('mode='.$matches2[1], ''$query);
            if (!empty(
$query)) {
              
$url .= '?' $query;
            }
          }
        }
        else {
          
preg_match('#image_id=([0-9]+)&?#'$url$matches);
          if (isset(
$matches[1])) {
            
$split explode('?'$url);
            
$url $split[0];
            
$query = @$split[1];
            
$url   str_replace('details.php','r'.get_image_url($matches[1]).'.htm'$url);
            
$query str_replace('image_id='.$matches[1].'&'''$query);
            
$query str_replace('&image_id='.$matches[1], ''$query);
            
$query str_replace('image_id='.$matches[1], ''$query);
            if (!empty(
$query)) {
              
$url .= '?' $query;
            }
          }
        }
      }
      elseif (
strstr($url'postcards.php?image_id=')) {
        
preg_match('#image_id=([0-9]+)&?#'$url$matches);
        if (isset(
$matches[1])) {
          
$split explode('?'$url);
          
$url $split[0];
          
$query = @$split[1];
          
$url   str_replace('postcards.php''postcard.img'.$matches[1].'.htm'$url);
          
$query str_replace('image_id='.$matches[1].'&'''$query);
          
$query str_replace('&image_id='.$matches[1], ''$query);
          
$query str_replace('image_id='.$matches[1], ''$query);
          if (!empty(
$query)) {
            
$url .= '?' $query;
          }
        }
      }
    }
    if (
$this->mode == "get" && strstr($url$this->session_id)) {
      
$url .= strpos($url'?') !== false '&' '?';
      
$url .= SESSION_NAME."=".$this->session_id;
    }
    if (!empty(
$l)) {
      
$url .= strpos($url'?') ? '&' '?';
      
$url .= "l=".$l;
    }
    
$url str_replace('&'$amp$url);
    
$url .= isset($dummy_array[1]) ? "#".$dummy_array[1] : "";
    return 
$url;
  }


//end of class  bassss

//Mod_bmollet bitissss
/**
 * Get the category url
 * @param int $cat_id The id of the category
 * @param string $cat_url The current status of the URL
 */
function get_category_url($cat_id,$cat_url '')
{
global $site_db;
$sql "SELECT cat_name,cat_parent_id FROM ".CATEGORIES_TABLE." WHERE cat_id = '".$cat_id."'";
$result $site_db->query($sql);
$row $site_db->fetch_array($result);

$trans = array(","=>"","\\"=>"",";"=>"",":"=>"","/"=>"","&#38;#304;"=>"i","&#38;#305;"=>"i","&#38;#351;"=>"s","&#38;#287;"=>"g","&#38;#246;"=>"ö","Ö"=>"O","&#38;#252;"=>"u","&#38;#220;"=>"U","&#38;#231;"=>"c","&#38;#199;"=>"C","?"=>"");
$row['cat_name']=strtr($row['cat_name'],$trans);

$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZsSiIÝIÇçGgýþÞðÐ","eeeaeauoiaabcdefghijklmnopqrstuvwxyzssiiiiccggissgg");
$row['cat_name'] = strtr($row['cat_name'],Array("ä"=>"ae","ö"=>"oe","ü"=>"ue""Ä"=>"Ae","Ö"=>"Oe","Ü"=>"Ue"));
$cat_url  '-'.str_replace('+','-',urlencode($row['cat_name'])).'-'.$cat_id.$cat_url;
// if you want full path of category in url, put next line in comment
//return $cat_url;
if( $row['cat_parent_id'] != 0)
{
return get_category_url($row['cat_parent_id'],$cat_url);
}
else
{
return $cat_url;
}
}
//Mod_bmollet
/**
 * Get the image url
 * @param int $image_id The id of the image
 */
function get_image_url($image_id)
{
global $site_db;
$sql "SELECT cat_id,image_name FROM ".IMAGES_TABLE." WHERE image_id = '".$image_id."'";
$result $site_db->query($sql);
$row $site_db->fetch_array($result);

$trans = array(","=>"","\\"=>"",";"=>"",":"=>"","/"=>"","&#38;#304;"=>"i","&#38;#305;"=>"i","&#38;#351;"=>"s","&#38;#287;"=>"g","&#38;#246;"=>"ö","Ö"=>"O","&#38;#252;"=>"u","&#38;#220;"=>"U","&#38;#231;"=>"c","&#38;#199;"=>"C","?"=>"");

$row['image_name']=strtr($row['image_name'],$trans);


$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZsSiIÝIÇçGgýþÞðÐ","eeeaeauoiaabcdefghijklmnopqrstuvwxyzssiiiiccggissgg");
$row['image_name'] = strtr($row['image_name'],Array("ä"=>"ae","ö"=>"oe","ü"=>"ue""Ä"=>"Ae","Ö"=>"Oe","Ü"=>"Ue"));
// if you want comlpete path to image in url, remove comment from following line
return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
return '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
}

//-----------------------------------------------------
//--- Start Session -----------------------------------
//-----------------------------------------------------
define('COOKIE_NAME''4images_');
define('COOKIE_PATH''');
define('COOKIE_DOMAIN''');
define('COOKIE_SECURE''0');

$site_sess = new Session();

// Get Userinfo
$session_info $site_sess->return_session_info();
$user_info $site_sess->return_user_info();

//-----------------------------------------------------
//--- Get User Caches ---------------------------------
//-----------------------------------------------------
$num_total_online 0;
$num_visible_online 0;
$num_invisible_online 0;
$num_registered_online 0;
$num_guests_online 0;
$user_online_list "";
$prev_user_ids = array();
$prev_session_ips = array();

if (
defined("GET_USER_ONLINE") && ($config['display_whosonline'] == || $user_info['user_level'] == ADMIN)) {
  
$time_out time() - 300;
  
$sql "SELECT s.session_user_id, s.session_lastaction, s.session_ip".get_user_table_field(", u.""user_id").get_user_table_field(", u.""user_level").get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_invisible")."
      FROM "
.SESSIONS_TABLE." s
      LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = s.session_user_id)
      WHERE s.session_lastaction >= 
$time_out
      ORDER BY "
.get_user_table_field("u.""user_id")." ASC, s.session_ip ASC";
  
$result $site_db->query($sql);
  while (
$row $site_db->fetch_array($result)) {
    if (
$row['session_user_id'] != GUEST && (isset($row[$user_table_fields['user_id']]) && $row[$user_table_fields['user_id']] != GUEST)) {
      if (!isset(
$prev_user_ids[$row['session_user_id']])) {
        
$is_invisible = (isset($row[$user_table_fields['user_invisible']]) && $row[$user_table_fields['user_invisible']] == 1) ? 0;
        
$invisibleuser = ($is_invisible) ? "*" "";
        
$username = (isset($row[$user_table_fields['user_level']]) && $row[$user_table_fields['user_level']] == ADMIN && $config['highlight_admin'] == 1) ? sprintf("<b>%s</b>"$row[$user_table_fields['user_name']]) : $row[$user_table_fields['user_name']];
        if (!
$is_invisible || $user_info['user_level'] == ADMIN) {
          
$user_online_list .= ($user_online_list != "") ? ", " "";
          
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];
          
$user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$username."</a>".$invisibleuser;
        }
        (!
$is_invisible) ? $num_visible_online++ : $num_invisible_online++;
        
$num_registered_online++;
      }
      
$prev_user_ids[$row['session_user_id']] = 1;
    }
    else {
      if (!isset(
$prev_session_ips[$row['session_ip']])) {
        
$num_guests_online++;
      }
    }
    
$prev_session_ips[$row['session_ip']] = 1;
  }
  
$num_total_online $num_registered_online $num_guests_online;
  
//$num_invisible_online = $num_registered_online - $num_visible_online;

  
$site_template->register_vars(array(
    
"num_total_online" => $num_total_online,
    
"num_invisible_online" => $num_invisible_online,
    
"num_registered_online" => $num_registered_online,
    
"num_guests_online" => $num_guests_online,
    
"user_online_list" => $user_online_list,
    
"lang_user_online" => str_replace('{num_total_online}'$num_total_online$lang['user_online']),
    
"lang_user_online_detail" => str_replace(array('{num_registered_online}','{num_invisible_online}','{num_guests_online}'), array($num_registered_online,$num_invisible_online,$num_guests_online), $lang['user_online_detail']),
  ));
  
$whos_online $site_template->parse_template("whos_online");
  
$site_template->register_vars("whos_online"$whos_online);
  unset(
$whos_online);
  unset(
$prev_user_ids);
  unset(
$prev_session_ips);
}
?>

its only 4 German Users and 1und1 Hoster!!!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: didoman on February 03, 2009, 01:45:14 PM
Hi,
Is it compatible with Ver.1.7.6, as the chunk of code in Step 3 you say to find does not exist in my sessions.php (ver 1.7.6)

Step 3 says to find this chunk of code

Code: [Select]
function url($url, $amp = "&amp;") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && !preg_match("/".SESSION_NAME."=/i", $url)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }


But Ver. 1.7.6 /includes/sessions.php is slightly different where the following code is not the same

    if ($this->mode == "get" && strpos($url, $this->session_id) === false) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= "l=".$l;
    }

So my question is should I just replace this whole chunk of code with what you say in Step 4 or is there different code for ver 1.7.6
Has it been tested and if I go ahead can I easily restore back and my database will be fine.

Also not trying to be funny but is this mod worth it. Has anybody seen improvements or should one just be smarter with what is in ones content.

Thanks for your help, this forum and the PHP Guru's here are Awesome.

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on February 04, 2009, 01:30:24 AM
hi,

indeed i replaced the whole thing and don't have any troubles.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Dblockn05 on February 06, 2009, 12:58:58 AM
Hi, I have an old 4images site which uses an OLD SEO MOD
The OLD SEO has urls like this: http://mysite.com/4images/cat87.htm

I want to use the NEW SEO MOD(the one on this thread) but I want to have my OLD SEO urls redirect to the new URLs so that I don't get penalized by google.

So basically, how would I be able to do this...

OLD URL: http://mysite.com/4images/cat87.htm ---AUTO REDIRECT TO NEW URL:--->http://mysite.com/4images/cat-yellow-cars-87.html

If you can help me out in anyway, even some hints of what I should do, thanks.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: om6acw on February 06, 2009, 01:14:54 AM
Hi, I have an old 4images site which uses an OLD SEO MOD
The OLD SEO has urls like this: http://mysite.com/4images/cat87.htm

I want to use the NEW SEO MOD(the one on this thread) but I want to have my OLD SEO urls redirect to the new URLs so that I don't get penalized by google.

So basically, how would I be able to do this...

OLD URL: http://mysite.com/4images/cat87.htm ---AUTO REDIRECT TO NEW URL:--->http://mysite.com/4images/cat-yellow-cars-87.html

If you can help me out in anyway, even some hints of what I should do, thanks.


just install this new mode and disallow your old addresses in robots.txt
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Dblockn05 on February 06, 2009, 02:16:53 AM
Hi, I have an old 4images site which uses an OLD SEO MOD
The OLD SEO has urls like this: http://mysite.com/4images/cat87.htm

I want to use the NEW SEO MOD(the one on this thread) but I want to have my OLD SEO urls redirect to the new URLs so that I don't get penalized by google.

So basically, how would I be able to do this...

OLD URL: http://mysite.com/4images/cat87.htm ---AUTO REDIRECT TO NEW URL:--->http://mysite.com/4images/cat-yellow-cars-87.html

If you can help me out in anyway, even some hints of what I should do, thanks.


just install this new mode and disallow your old addresses in robots.txt

Hi, if I install the NEW MOD, the old url's that people have linked to won't redirect to the new URLS.  I need to see if there is something I can do to auto-redirect old url to new url...php? .htacess?  something should be able to be done... =/
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on February 06, 2009, 02:55:29 AM
as long as you keep lines from old seo in .htaccess it should work just fine.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Dblockn05 on February 06, 2009, 04:58:59 PM
Thanks Vano, it worked as you said, I guess I have to read up more on how apache mod_rewrite works!

Thanks again as always.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: spookypld on February 10, 2009, 10:59:52 PM
Hi folks!

I have problem (nothing new).

Ekhm... I've installed SEO mod on my test gallery and it was ok! Now i moved to main site and wack. Something ugly started to show above Headed. Check it please: http://cssship.net/categories.php?cat_id=1 http://cssship.net/top.php I've found that this is not always. I have really no idea. I tried even to install new from .rar file the beginning of this topic.

sry if my english sucks!

please help.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on February 11, 2009, 06:16:48 AM
It has nothing to do with this mod.
you have in your header.html template
Code: [Select]
<meta name="description" content="{image_description}">
and {image_description} contains HTML.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: b-707 on February 15, 2009, 04:42:57 PM
Quote
then it would like this
http://www.turkiye-resimleri.com/

also i have upload the pre-edited files for 1.7.4 http://rapidshare.com/files/33076491/seo.rar.html
this seo.rar file contains .htaccess file and /include/sessions.php file you can use it withour modifying


Thank you very much, XOX.
Your hints are very good, and your gallery is very good, too.

But I had problems, and I solved these by putting this special  .htaccess  into my 4images-directory (it is a sub-sub-directory of the root).
This was my problem: I tried to control the 4images rewrite with the .htaccess in the root. Even the "rewrite base /my_path_to_sub_sub_directory" command in the root .htaccess was not successfull.
I write this for other people having rewrite problems.

Josef
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: yesme on February 15, 2009, 05:38:50 PM
Roughly the seo works well BUT when comes to search the keyword that clicked in the image details the searching found the correct result and after clicked the image result, an error 404 Not Found appeared. The url looks like this http://www.YOURNAME.com/img5.search.htm, http://www.YOURNAME.com/img6.search.htm

Do you know how and why this is happened? If you know how to fix this, please help me.

Thank you for the mod and the people who are generous. :)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on February 15, 2009, 08:31:02 PM
http://www.4homepages.de/forum/index.php?topic=17598.msg127889#msg127889

P.S.
I've corrected original post.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: yesme on February 16, 2009, 09:13:45 AM
Thanks V@no. The search results is working very well. But my Drop Down Category menu is not working very well because all categories will be directed to this url http://www.YOURNAME.com/cat.htm

Take a look the screenshot of my drop down category menu in my 4images.

Next, may I know how to remove http://www.yourname.com/img-wallpaper-city.htm and http://www.yourname.com/cat-city.htm ?

I saw it is possible to remove as this web http://www.wallpaperjoint.com/venturi_fetish_7284-wallpapers.html

Thank you.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: yesme on February 16, 2009, 04:50:50 PM
Does anyone know how to link back the correct path for my dropdown menu? I have installed this mod successfully but my category dropdown menu is not linking to right path.

Thank you.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on February 16, 2009, 05:12:46 PM
I've updated code for .htaccess in the original post.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: yesme on February 16, 2009, 06:37:52 PM
Owh, heaven...Thanks V@no, you have helped me a lot! Please, contact me if you need something or anything that you think I have it.  :mrgreen:

I have open my web to public just now. And, after this will advertise to all over my region/country.

Thanks again!

p.s Do you know how to remove the img and cat for the seo? I just need more simple and short url.  :wink:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on February 16, 2009, 06:42:37 PM
you can't remove them, because they are the key that detect what kind of URL this is.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: yesme on February 17, 2009, 08:29:17 AM
Okay, understood. Thanks. :D
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: darkcurves on March 19, 2009, 06:19:06 AM
I've got a stupid question. Where is teh .htaccess file located? I found a few, which one should i edit? Thanks!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on March 19, 2009, 06:56:47 AM
In the root of your 4images gallery.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: darkcurves on March 19, 2009, 09:36:24 AM
Ohhh, so i have to create a new .htaccess file in the root. Thanks!   :oops:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: darkcurves on March 22, 2009, 11:33:32 AM
Works great, thanks alot man!  :D
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: hotvips on March 26, 2009, 12:42:14 PM
THX, works ok but have a few questions

http://www.hotvips.net/img-aeyonce-cnowles-a035-443.htm
should be
http://www.hotvips.net/img-Beyonce-Knowles-a035-443.htm

How can I change that?

For categories it does the same - changes the first letter of the words...
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on March 26, 2009, 01:56:57 PM
Are you using original mod's code?

try replace
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");

with:
$row['image_name'] = strtr(strtolower($row['image_name']), "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");


and replace
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");

with:
$row['cat_name'] = strtr(strtolower($row['cat_name']), "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: hotvips on March 26, 2009, 02:30:57 PM
Thank you:)
it works now...
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Bogdan on April 11, 2009, 01:50:14 PM
Is there a way to redirect search result from this img78555.search.htm to the original link img-something-78555.htm ?
Because google is considering the search result as duplicate content ( in webmaster tools ).
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on April 11, 2009, 05:10:36 PM
Doing so you'll loose ability see next and previous images from the search result.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Bogdan on April 11, 2009, 05:38:43 PM
True... but look at almost any webpage ( this forum too ). Link to the search result is the same with the normal link.
The problem is that both pages use the same template. One option is to make img78555.search.htm to use different template, ( named detailsearch.htm) but i guess it's more difficult.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: om6acw on April 11, 2009, 06:28:37 PM
True... but look at almost any webpage ( this forum too ). Link to the search result is the same with the normal link.
The problem is that both pages use the same template. One option is to make img78555.search.htm to use different template, ( named detailsearch.htm) but i guess it's more difficult.

its easy to fix, just exclude your search results from google indexing in your robots.txt

like this:
Code: [Select]
Disallow: /search.php
Disallow: /search.htm
Disallow: /*.search.*
Disallow: /*?mode=search

no more double content ;)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Bogdan on April 11, 2009, 06:55:16 PM
First 2 lines are already in my htaccess and still google show search pages.. well, i will try the 3rd and 4th line.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: om6acw on April 11, 2009, 07:51:15 PM
First 2 lines are already in my htaccess and still google show search pages.. well, i will try the 3rd and 4th line.

this code is not for .htaccess, those lines should be in robots.txt in your root directory, if you dont have one just create it. Also dont expect google clean your indexed search pages right way, it take months to do it.....
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Bogdan on April 11, 2009, 07:55:08 PM
Sorry, i meant robots, which i have from a long time...
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: om6acw on April 11, 2009, 07:57:46 PM
Sorry, i meant robots, which i have from a long time...

thats ok but first two lines are not protecting you if you use this mode, put those two last ones there and you should see in couple next days-weeks search links moved from double content ones to robot restricted ones.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: jopainter on April 16, 2009, 05:51:08 PM
i have this proplem
how could i

make the url only with catgory number without the name of the cat and the litter k
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on April 17, 2009, 01:25:02 AM
example please.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: whosthis.ee on April 19, 2009, 07:47:10 PM
Hi

the keyword "cat" has to be removed from the url

for ex. if this is the url http://test.com/cat-hollywood-actress-1.htm

it should be http://test.com/hollywood-actress-1.htm

and on details page the keyword "img" has to be removed from the url

ex : http://test.com/img-vanessa-1-1.htm

instead it should be

http://test.com/vanessa-1-1.htm

and is there any way to display category path in the image url

for ex : if a site has hollywood-actress as a category it should say

http://test.com//hollywood-actress-1/vanessa-21.htm

kindly work on this

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on April 19, 2009, 10:23:03 PM
And how do you think 4images would know that http://example.com/some-name-1-1.htm is a category or an image?
that is the whole point of "cat" and "img" pointers in the address.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: whosthis.ee on April 20, 2009, 05:25:52 AM
tats ok

is there any way to display category path in the image url

for ex : if a site has hollywood-actress as a category it should say

http://test.com/cat-hollywood-actress-1/img-vanessa-21.htm
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: om6acw on April 20, 2009, 06:06:09 AM
tats ok

is there any way to display category path in the image url

for ex : if a site has hollywood-actress as a category it should say

http://test.com/cat-hollywood-actress-1/img-vanessa-21.htm


Take a time and read whole thread carefully, this was requested here dozen times with some result........
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: whosthis.ee on April 20, 2009, 06:15:38 PM
i searched whole topic but not able to locate

can u just send me the exact post

i'll be very thankful to you

 :)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: om6acw on April 20, 2009, 10:07:28 PM
i searched whole topic but not able to locate

can u just send me the exact post

i'll be very thankful to you

 :)

sorry I cant, we have search function on top of this page......
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: whosthis.ee on April 23, 2009, 06:58:21 AM
The one thing stopping me from using 4images on my live site is the problem with the URL


After spending several weeks fine tuning and adding lots of great mods to my site on a localhost WAMP test area I just can't get the URLs the way I want them


I've been thru the 27 pages of this MOD:

[Mod] Search Engine Friendly URLs aka Short URLs
http://www.4homepages.de/forum/index.php?topic=6729.0

and whilst I quite like the effect
eg.
www.mysite.com/cat-12 
www.mysite.com/images-321

I can't get my dropdown menu to function with that particular mod
(and also it's not great for Google SEO as it has no category or image name in the URL)




I've also tried the mod on this current thread - [MOD] Google Friendly Urls For 4images Best Seo Mod - but can't manipulate the URL the way I want because I am struggling with REGEX and the .htaccess, and my own understanding of php coding

I appreciate that you have to have the cat ID and image ID in every URL using this mod but can I split up the long URL with a forward slash? (And remove the .htm extension)

eg. I want:
www.mysite.com/categoryname-12/imagename-43

I've also managed to remove the .htm / .html / .php ending successfully but would like to split up the category and the image with a forward slash (/)

because I have sub-categories, the URL currently looks ridiculous and would help if I could have forward slashes like this - category / subcat / image


any suggestions/advice?

hey

didi you got the solution

even im trying for the same
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: whosthis.ee on April 23, 2009, 07:19:30 AM
if you use unmodified code from the original tutorial on first page of this topic, you should not see all the parent categories in the links, only current category name.
as of links to image details, in includes/sessions.php find
Code: [Select]
//return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
replace it with
Code: [Select]
return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;

I am using your given sessions.php file which didnt have the code which you tell to replace.
I have attached your given sessions.php file which i am currently using plz plz edit it for better seo and also tell can i use it with 4images 1.6.7  for better seo and user flags?

the same is not working
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: AntiNSA2 on May 03, 2009, 08:06:20 PM
Im replacing this in step 2.... I cant find the negative effects.... however
Code: [Select]
if ($this->mode == "get" && strpos($url, $this->session_id) === false) {
Why is my session.php different? I cant find the mod it is related to... using 1.7.6
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on May 03, 2009, 08:47:50 PM
@whosthis.ee:
@AntiNSA2:
Would you repeat what is the problem again?

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: whosthis.ee on May 03, 2009, 08:52:04 PM
The one thing stopping me from using 4images on my live site is the problem with the URL


After spending several weeks fine tuning and adding lots of great mods to my site on a localhost WAMP test area I just can't get the URLs the way I want them


I've been thru the 27 pages of this MOD:

[Mod] Search Engine Friendly URLs aka Short URLs
http://www.4homepages.de/forum/index.php?topic=6729.0

and whilst I quite like the effect
eg.
www.mysite.com/cat-12
www.mysite.com/images-321

I can't get my dropdown menu to function with that particular mod
(and also it's not great for Google SEO as it has no category or image name in the URL)




I've also tried the mod on this current thread - [MOD] Google Friendly Urls For 4images Best Seo Mod - but can't manipulate the URL the way I want because I am struggling with REGEX and the .htaccess, and my own understanding of php coding

I appreciate that you have to have the cat ID and image ID in every URL using this mod but can I split up the long URL with a forward slash? (And remove the .htm extension)

eg. I want:
www.mysite.com/categoryname-12/imagename-43

I've also managed to remove the .htm / .html / .php ending successfully but would like to split up the category and the image with a forward slash (/)

because I have sub-categories, the URL currently looks ridiculous and would help if I could have forward slashes like this - category / subcat / image


any suggestions/advice?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on May 03, 2009, 09:00:08 PM
I can't get my dropdown menu to function with that particular mod
(and also it's not great for Google SEO as it has no category or image name in the URL)
Exactly what is the problem? On my test site dropdown works fine. You can try replacing POST with GET in category_dropdown_form.html template.






I appreciate that you have to have the cat ID and image ID in every URL using this mod but can I split up the long URL with a forward slash? (And remove the .htm extension)

eg. I want:
www.mysite.com/categoryname-12/imagename-43

I've also managed to remove the .htm / .html / .php ending successfully but would like to split up the category and the image with a forward slash (/)

because I have sub-categories, the URL currently looks ridiculous and would help if I could have forward slashes like this - category / subcat / image


any suggestions/advice?

the splitting path with slashes is more complicated then it looks, due to 4images using relative paths ./ and ../

.htm you can remove in includes/sessions.php and in .htaccess
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: whosthis.ee on May 03, 2009, 09:10:31 PM
when i click on any item in my dropdown

its taking to this url : http://celebrityphotogallery.org/cat.htm?cat_id=31
instead of this url : http://celebrityphotogallery.org/cat-aishwarya-rai-31.htm
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on May 03, 2009, 09:56:31 PM
If you know a little how HTML works, then this would not surprise you at all. This is normal and you can't do anything about it without javascript or without removing dropdown.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: AntiNSA2 on May 04, 2009, 06:29:31 AM
Step three says to find this code
Code: [Select]
function url($url, $amp = "&amp;") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && !preg_match("/".SESSION_NAME."=/i", $url)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }



however

Mine is like this :
Code: [Select]
function url($url, $amp = "&amp;") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && strpos($url, $this->session_id) === false) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;


This line of code is different
Code: [Select]
  if ($this->mode == "get" && strpos($url, $this->session_id) === false) {
I dont know why it is didfferent... I cant find the mod if there is one that added the code to make it different... is it safe to take that out of there in order to do the last step of this mod without breaking anything?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on May 04, 2009, 08:27:41 AM
yes, replace that block of code and then in the new code replace
Code: [Select]
    if ($this->mode == "get" && strstr($url, $this->session_id)) {
      $url .= strpos($url, '?') !== false ? '&' : '?';
      $url .= SESSION_NAME."=".$this->session_id;
    }
    if (!empty($l)) {
      $url .= strpos($url, '?') ? '&' : '?';
      $url .= "l=".$l;
    }
    $url = str_replace('&', $amp, $url);
    $url .= isset($dummy_array[1]) ? "#".$dummy_array[1] : "";
    return $url;


with:
Code: [Select]
    if ($this->mode == "get" && strpos($url, $this->session_id) === false) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= "l=".$l;
    }

    $url = str_replace('&', $amp, $url);
    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: whosthis.ee on May 04, 2009, 08:18:32 PM
i done the same V@no

but my url is http://celebrityphotogallery.org/cat.htm

instead of : http://celebrityphotogallery.org/cat-aishwarya-rai-31.htm
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: AntiNSA2 on May 05, 2009, 04:47:41 AM

Thanks it works very well!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: AntiNSA2 on May 06, 2009, 09:05:23 PM
Can anyone tell me what the best sitemap mod to use with this is? I am going to try to read all 18 pages so forgive me if it is mentioned :)

Ok I saw the question asked in this thread... but not answered.... What are you guys using for the site map mod and this?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on May 07, 2009, 02:18:58 AM
This mod will work with any other mods as long the others mods follow 4images standard by using $session->url() function for their URLs
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: fixyou on May 12, 2009, 06:53:53 AM
please  :(


http://www.4homepages.de/forum/index.php?topic=24766.0
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on May 12, 2009, 09:47:47 AM
hi fixyou,

there is no such MOD like you wish.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: fixyou on May 12, 2009, 04:59:10 PM
hi fixyou,

there is no such MOD like you wish.

 :(    
then these websites as they did?

http://imagenesparatuhi5.net

http://www.imagenesparahi5.org/


any solution for this?

 :(

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: AntiNSA2 on May 17, 2009, 09:59:59 PM
True... but look at almost any webpage ( this forum too ). Link to the search result is the same with the normal link.
The problem is that both pages use the same template. One option is to make img78555.search.htm to use different template, ( named detailsearch.htm) but i guess it's more difficult.

its easy to fix, just exclude your search results from google indexing in your robots.txt

like this:
Code: [Select]
Disallow: /search.php
Disallow: /search.htm
Disallow: /*.search.*
Disallow: /*?mode=search

no more double content ;)


Is this the wise thing to do ? Is this what most people are doing?

What are the negative aspects of doing this?

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: michael1234 on May 18, 2009, 06:14:45 PM
Ich hab ebenfalls das Problem, dass wenn ich über die Suche gehe die Urls falsch gesetzt werden.

Wenn ich Bild über Kategorieauswahl aufrufe erhalte ich diese Url:
www.xxx.de/img-hola-australien-2.htm

Aber wenn ich über Suche auf ein Bild klicke, dann bekomme ich diese UIrl:
www.xxx.de/img2.search.htm

Wie bekomme ich dies so hin:
www.xxx.de/Kategorie/Bildname-xx.htm


Über einen kleine Tip würde ich mich freuen...

Thx alot!

LG micha
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: zorex on May 20, 2009, 02:26:15 AM
Hello,

Thanks for this great Mod!

I have made necessary modifications as you mentioned,my problem is, image page is displayed as a static .htm page but categories are always displayed as .php?cat_id=xx ,surprisingly category page is displayed as .htm only when a category is selected through 'clickstream'

please have a look at www.pixeeds.com

Any Help would be appreciated

Regards,
zorex
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on May 20, 2009, 04:20:17 AM
Hello and welcome to 4images forum.

Double check step 4
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: zorex on May 20, 2009, 01:26:31 PM
V@no,

thanks for your reply.

I just now discovered my home page customization (category section) is the source of the issue,i think it does entirely bypass your core functions ,whereas detail section hasn't been disturbed,that's why detail page is displayed as static .htm page,thanks for your one line instruction :idea:  in the previous post.


well, my request is how do i implement  SEO mod without disturbing home page customization,below given is customized code from index.php.
I dont want to disturb the home cusmization simply  put lot of time to achieve it.

Thanks a lot.

Code: [Select]
$result = $site_db->query('select cat_id,cat_name from 4images_categories where cat_id <> 60 and cat_id <> 61 order by cat_order');
$tab_head="<TABLE STYLE='width:auto;border:0px solid gray'>";
$tab_tail="</TABLE>";
$tab_body='';
$tdx=1;
$trs='<TR>';
$tre='</TR>';
$goo=0;
$cat_link='./categories.php?cat_id=';

//$row['cat_name']

$gscript='<script type="text/javascript"><!--
google_ad_client = "xxxx";
/* 336x280, created 5/13/09 */
google_ad_slot = "xxxx";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>';

$cat_thum_img_border_color='#F5F5DC';
while ($row = mysql_fetch_assoc($result))
{
if($tdx==1)
{
$rlt = $site_db->query('select count(*) from 4images_images where cat_id='.$row['cat_id']);
$rw=mysql_fetch_row($rlt);
$rfolder=$row['cat_id'].'/';
$rfile=RandomFile($folder='./data/thumbnails/'.$rfolder, $extensions='jpg');
$img="<img onmouseover='zload(this)' onmouseout='bye()' style='border:1px solid ".$cat_thum_img_border_color."' alt='".$row['cat_name']."' src='".$rfile."'>";

if($goo==0)
{
//$tab_body=$tab_body.$trs."<td class='catAds' rowspan='3'><img  style='border:1px dotted #CCCCCC' src='./data/farm_336x280.jpg'></td><td class='catthumb'><div class='cathead'><a href='".$cat_link.$row['cat_id']."' >".$row['cat_name'].' ['.$rw[0].']'."</a></div><a href='".$cat_link.$row['cat_id']."'>".$img."</a></td>";
$tab_body=$tab_body.$trs."<td class='catAds' rowspan='3'>".$gscript."<td class='catthumb'><div class='cathead'><a href='".$cat_link.$row['cat_id']."' >".$row['cat_name'].' ['.$rw[0].']'."</a></div><a href='".$cat_link.$row['cat_id']."'>".$img."</a></td>";
$goo=1;
}
else
{
$tab_body=$tab_body."<td class='catthumb'><div class='cathead'><a href='".$cat_link.$row['cat_id']."' >".$row['cat_name'].' ['.$rw[0].']'."</a></div><a href='".$cat_link.$row['cat_id']."'>".$img."</a></td>";
}
}
if($tdx<4 && $tdx>1)
{
$rfolder=$row['cat_id'].'/';
$rfile=RandomFile($folder='./data/thumbnails/'.$rfolder, $extensions='jpg');
$img="<img onmouseover='zload(this)' onmouseout='bye()' style='border:1px solid ".$cat_thum_img_border_color."' alt='".$row['cat_name']."' src='".$rfile."'>";

$tab_body=$tab_body."<td class='catthumb'><div class='cathead'><a href='".$cat_link.$row['cat_id']."' >".$row['cat_name'].' ['.$rw[0].']'."</a></div><a href='".$cat_link.$row['cat_id']."'>".$img."</a></td>";
}
if($tdx==4)
{
$rfolder=$row['cat_id'].'/';
$rfile=RandomFile($folder='./data/thumbnails/'.$rfolder, $extensions='jpg');
$img="<img onmouseover='zload(this)' onmouseout='bye()' style='border:1px solid ".$cat_thum_img_border_color."' alt='".$row['cat_name']."' src='".$rfile."'>";
/*
if($goo==0)
{
$tab_body=$tab_body."<td class='catthumb'><div class='cathead'><a href='".$cat_link.$row['cat_id']."' >".$row['cat_name'].' ['.$rw[0].']'."</a></div><a href='".$cat_link.$row['cat_id']."'>".$img."</a></td><td class='catthumb' rowspan='3'><img style='border:1px dotted #CCCCCC' src='./data/farm_336x280.jpg'></td>".$tre;
$goo=1;
}
else*/
{

$tab_body=$tab_body."<td class='catthumb'><div class='cathead'><a href='".$cat_link.$row['cat_id']."' >".$row['cat_name'].' ['.$rw[0].']'."</a></div><a href='".$cat_link.$row['cat_id']."'>".$img."</a></td>".$tre;
}
$tdx=0;
}
$tdx=$tdx+1;

}

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: zorex on May 20, 2009, 06:24:53 PM
At last i found the solution by changing this:

Code: [Select]
$cat_link='./categories.php?cat_id='.$row['cat_id'];

into this:
Code: [Select]
$cat_link=$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID.'='.$row['cat_id']);

Once again thanks for this great Mod !

Regards,
zorex
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: fixyou on May 21, 2009, 01:08:27 AM
I go crazy
   
How did it?

we step

The first category:

http://enchulatupagina.wamba.com/comentarios-en-espanol/index.html

later

http://enchulatupagina.wamba.com/comentarios-en-espanol/actitud/index.html

later

http://enchulatupagina.wamba.com/comentarios-en-espanol/actitud/chica-con-glamour-79536.html

can review this site, at this 4images. :(
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: tramfahrer on May 21, 2009, 06:42:28 PM
sobald ich die .htaccess da einfüge kommt dieser hässliche Fehler

Quote
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@tram-und-bahnbilder.de and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

habe auf 1.7.7 geupdatet
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sunny C. on May 27, 2009, 01:09:52 PM
Wie kann man denn den Profillink kürzen?

Das dieser in etwas so aussieht:

Code: [Select]
member.php?action=showprofile&user_id=1
to

Code: [Select]
nickname/profile/
Geht das?


add1

in sessions.php
before
Code: [Select]
elseif (strstr($url, 'postcards.php?image_id=')) {
add
Code: [Select]
      elseif (strstr($url, 'member.php?action=showprofile&user_id=')) {
                preg_match('#user_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $url   = str_replace('member.php', 'profile'.$matches[1].'.htm', $url);
          }

return $url;
}
Now short urls for profiles works and looks like
Code: [Select]
http://localhost/4images/profile49

And now I planing to make them like
Code: [Select]
http://localhost/4images/nick/profilelater planing
Code: [Select]
http://localhost/4images/search.htm?search_user=nickchange in to
Code: [Select]
http://localhost/4images/nick/gallery
If someone could help...
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Bogdan on June 07, 2009, 04:45:56 PM
Hi,

It's possible to change the cat and img ( /cat- and /img- ) word from the link with something else? Example: /new- or /picture .
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sunny C. on June 25, 2009, 02:31:16 PM
:flag-de: Deutsch


Ich habe den Code komplett zusammengetragen. Demnach ist hier eigentlich alles wichtige nun vorhanden, was in den Thread vorkam. Ich hoffe das ich damit etwas helfen konnte.
Getestet mit 4images 1.7.7


:flag-en: English


I have the code completely together. Accordingly, everything here is important now in place, what happens in the thread. I hope I could help somewhat.
Tested with 4images 1.7.7


:arrow: Installation


Step 1

Open / Öffne: include/sessions.php
Search / Suche
?>
Add before / Füge davor ein
function fixname($text)
{
  return strtolower(strtr(
    $text,
     array(
      "é" => "e",
      "è" => "e",
      "ê" => "e",
      "à" => "a",
      "ë" => "e",
      "â" => "a",
      "ú" => "a",
      "ó" => "o",
      "í" => "i",
      "á" => "a",

      //russian UTF8 encoded alphabet (lower and upper cases)
      "&#1040;" => "a",
      "&#1072;" => "a",
      "&#1041;" => "b",
      "&#1073;" => "b",
      "&#1042;" => "v",
      "&#1074;" => "v",
      "&#1043;" => "g",
      "&#1075;" => "g",
      "&#1044;" => "d",
      "&#1076;" => "d",
      "&#1045;" => "e",
      "&#1077;" => "e",
      "&#1025;" => "yo",
      "&#1105;" => "yo",
      "&#1046;" => "zh",
      "&#1078;" => "zh",
      "&#1047;" => "z",
      "&#1079;" => "z",
      "&#1048;" => "i",
      "&#1080;" => "i",
      "&#1049;" => "j",
      "&#1081;" => "j",
      "&#1050;" => "k",
      "&#1082;" => "k",
      "&#1051;" => "l",
      "&#1083;" => "l",
      "&#1052;" => "m",
      "&#1084;" => "m",
      "&#1053;" => "n",
      "&#1085;" => "n",
      "&#1054;" => "o",
      "&#1086;" => "o",
      "&#1055;" => "p",
      "&#1087;" => "p",
      "&#1056;" => "r",
      "&#1088;" => "r",
      "&#1057;" => "s",
      "&#1089;" => "s",
      "&#1058;" => "t",
      "&#1090;" => "t",
      "&#1059;" => "u",
      "&#1091;" => "u",
      "&#1060;" => "f",
      "&#1092;" => "f",
      "&#1061;" => "h",
      "&#1093;" => "h",
      "&#1062;" => "c",
      "&#1094;" => "c",
      "&#1063;" => "ch",
      "&#1095;" => "ch",
      "&#1064;" => "sh",
      "&#1096;" => "sh",
      "&#1065;" => "sch",
      "&#1097;" => "sch",
      "&#1066;" => "",
      "&#1098;" => "",
      "&#1067;" => "i",
      "&#1099;" => "i",
      "&#1068;" => "'",
      "&#1100;" => "'",
      "&#1069;" => "e",
      "&#1101;" => "e",
      "&#1070;" => "yu",
      "&#1102;" => "yu",
      "&#1071;" => "ya",
      "&#1103;" => "ya",
  )));
}
function get_category_url($cat_id,$cat_url = '')
{
  global $site_db, $cat_cache;
  static $urlname = array(); //cache names in this array
  if (isset($urlname[$cat_id]))
    return $urlname[$cat_id];
  if (!empty($cat_cache))
  {
    $row['cat_name'] = @$cat_cache[$cat_id]['cat_name'];
    $row['cat_parent_id'] = @$cat_cache[$cat_id]['cat_parent_id'];
  }
  else
  {
    $sql = "SELECT cat_name,cat_parent_id FROM ".CATEGORIES_TABLE." WHERE cat_id = '".$cat_id."'";
    $row = $site_db->query_firstrow($sql);
  }
  $row['cat_name'] = fixname($row['cat_name']);
  $cat_url  = '-'.str_replace('+','-',urlencode($row['cat_name'])).'-'.$cat_id.$cat_url;
  // if you want full path of category in url, put next line in comment
  $row['cat_parent_id'] = 0;
  if($row['cat_parent_id'] != 0)
  {
    $urlname[$cat_id] = get_category_url($row['cat_parent_id'],$cat_url);
  }
  else
  {
    $urlname[$cat_id] = $cat_url;
  }
  return $urlname[$cat_id];
}
function get_image_url($image_id)
{
  global $site_db;
  static $urlname = array(); //cache names in this array
  if (isset($urlname[$image_id]))
    return $urlname[$image_id];
  
  $sql = "SELECT cat_id,image_name FROM ".IMAGES_TABLE." WHERE image_id = '".$image_id."'";
  $row = $site_db->query_firstrow($sql);
  $row['image_name'] = fixname($row['image_name']);
  // if you want comlpete path to image in url, remove comment from following line
  //$urlname[$image_id] = get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;  
  $urlname[$image_id] = '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
  return $urlname[$image_id];
}

Find / Finde
  function url($url, $amp = "&amp;") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && strpos($url, $this->session_id) === false) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }

Replace with / ersetze mit
/* ORIGINAL CODE
  function url($url, $amp = "&amp;") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && strpos($url, $this->session_id) === false) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }
*/
  function url($url, $amp = "&amp;") {
    global $l, $user_info;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];
    $url = str_replace('&amp;', '&', $url);
    if (!defined('IN_CP')) {
      if (strstr($url, 'index.php')) {
        if (strstr($url, 'template=')) {
          preg_match('#template=([0-9a-zA-Z_-]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('index.php', 'page-'.$matches[1].'.htm', $url);
            $query = str_replace('template='.$matches[1].'&', '', $query);
            $query = str_replace('&template='.$matches[1], '', $query);
            $query = str_replace('template='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('index.php', './', $url);
        }
      }
      elseif (strstr($url, 'search.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('search.php', 'search.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('search.php', 'search.htm', $url);
        }
      }
      elseif (strstr($url, 'lightbox.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('lightbox.php', 'lightbox.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
                $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('lightbox.php', 'lightbox.htm', $url);
        }
      }
      elseif (strstr($url, 'categories.php')) {
        if (strstr($url, 'cat_id=') && strstr($url, 'page=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#page=([0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('categories.php', 'cat'.$matches1[1].'.'.$matches2[1].'.htm', $url);
            $query = str_replace('cat_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches1[1], '', $query);
            $query = str_replace('cat_id='.$matches1[1], '', $query);
            $query = str_replace('page='.$matches2[1].'&', '', $query);
            $query = str_replace('&page='.$matches2[1], '', $query);
            $query = str_replace('page='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        elseif (strstr($url, 'cat_id=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $cat_url = get_category_url($matches[1]);
            $url   = str_replace('categories.php', 'cat'.$cat_url.'.htm', $url);
            $query = str_replace('cat_id='.$matches[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches[1], '', $query);
            $query = str_replace('cat_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('categories.php', 'cat.htm', $url);
        }
      }
      elseif (strstr($url, 'details.php?image_id=')) {
        if (strstr($url, 'image_id=') && strstr($url, 'mode=')) {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#mode=([a-zA-Z0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'img'.$matches1[1].'.'.$matches2[1].'.htm', $url);
            $query = str_replace('image_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches1[1], '', $query);
            $query = str_replace('image_id='.$matches1[1], '', $query);
            $query = str_replace('mode='.$matches2[1].'&', '', $query);
            $query = str_replace('&mode='.$matches2[1], '', $query);
            $query = str_replace('mode='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'img'.get_image_url($matches[1]).'.htm', $url);
            $query = str_replace('image_id='.$matches[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches[1], '', $query);
            $query = str_replace('image_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
      }
      elseif (strstr($url, 'member.php?action=uploadform'))
      {
        preg_match('#cat_id=([0-9]+)&?#', $url, $matches);
        $url_cat_id = "";
        if (isset($matches[1]))
        {
          $url_cat_id = $matches[1];
        }
        $split = explode('?', $url);
        $url = $split[0];
        $query = @$split[1];
        $url   = str_replace('member.php', 'upload'.$url_cat_id, $url);
        $query = str_replace('cat_id='.$url_cat_id.'&', '', $query);
        $query = str_replace('&cat_id='.$url_cat_id, '', $query);
        $query = str_replace('cat_id='.$url_cat_id, '', $query);
        $query = str_replace('action=uploadform&', '', $query);
        $query = str_replace('&action=uploadform', '', $query);
        $query = str_replace('action=uploadform', '', $query);
        if (!empty($query)) {
            $url .= '?' . $query;
        }
      }
      elseif (strstr($url, 'postcards.php?image_id=')) {
        preg_match('#image_id=([0-9]+)&?#', $url, $matches);
        if (isset($matches[1])) {
          $split = explode('?', $url);
          $url = $split[0];
          $query = @$split[1];
          $url   = str_replace('postcards.php', 'postcard.img'.$matches[1].'.htm', $url);
          $query = str_replace('image_id='.$matches[1].'&', '', $query);
          $query = str_replace('&image_id='.$matches[1], '', $query);
          $query = str_replace('image_id='.$matches[1], '', $query);
          if (!empty($query)) {
            $url .= '?' . $query;
          }
        }
      }
    }
    if ($this->mode == "get" && strstr($url, $this->session_id)) {
      $url .= strpos($url, '?') !== false ? '&' : '?';
      $url .= SESSION_NAME."=".$this->session_id;
    }
    if (!empty($l)) {
      $url .= strpos($url, '?') ? '&' : '?';
      $url .= "l=".$l;
    }
    $url = str_replace('&', $amp, $url);
    $url .= isset($dummy_array[1]) ? "#".$dummy_array[1] : "";
    return $url;
  }

Find / Finde:
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];

Replace with / ersetze mit:
$user_profile_link = (!empty($url_show_profile)) ? str_replace("{user_id}", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];

Download the Attachment
Downloade im Anhang die Datei

Put the .*htaccess in your ROOT
Füge die .*htaccess in dein ROOT
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: tramfahrer on June 25, 2009, 02:56:54 PM
Hallo,

habe das jetz mal durchgeführt,  Die URL http://www.tram-und-bahnbilder.de/img-tw-8012-augsburg-m8c-1094.htm  allerdings kommt  "Die Webseite konnte nicht angezeigt werden!" 404

wer kann helfen ?? hab die Änderung erstmal rausgenommen wieder

grüße Tobias
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sunny C. on June 25, 2009, 03:13:06 PM
Hast du das aus meiner Anleitung genommen oder ist das noch das alte gewesen?
Hier läuft das aktuell: http://4images-videopaket.benny-boehnke.info/
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sebas Bonito on June 25, 2009, 03:29:44 PM
Hallo,

habe das jetz mal durchgeführt,  Die URL http://www.tram-und-bahnbilder.de/img-tw-8012-augsburg-m8c-1094.htm  allerdings kommt  "Die Webseite konnte nicht angezeigt werden!" 404

wer kann helfen ?? hab die Änderung erstmal rausgenommen wieder

grüße Tobias
Hatte dieses Problem beim Zusammenspiel mit der MOD TOP100. Hast Du die?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: bergblume on June 25, 2009, 03:30:38 PM
hi benny, ich habe auch mich genau nach deiner anleitung gehalten und bekomme beim aufruf meiner existierenden (test)gallerie und der bilder:
Diese Seite ist leider nicht verfügbar.
(startseite funktioniert - bloss in die kategoreien und detail-bilder komme ich nicht mehr, da dort die obige fehlermeldung kommt,.,.)
(Top100 ist nicht installiert)

[Edit: kann es evtl. daran liegen dass mein testserver unter funpic läuft und dort kein mod-rewrite [RewriteEngine On
] unterstützt wird??? ]
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sunny C. on June 25, 2009, 03:39:52 PM
Eventuell habe ich irgendwie doch ein Fehler in der Anleitung.
Aber ich bin mir 100% sicher, dass dies der Code ist den ich in dem Paket verwende!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: tramfahrer on June 25, 2009, 03:48:27 PM
Hallo

ichhabe die aktuelle Anleitung verwendet

als mod habe ich den
Kalender Mod
den Bewerten Mod
und den 3 Spalten template Mod
die  oben genannten Mods alle von KurtW (wo ist er eigentlich abgeblieben??? es existiert rein Garnichts mehr von ihm, schade er hatt immer so gute Sachen gemacht)

den Moderatormod (von dem Spanier oder wer auch immer das war)

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sebas Bonito on June 28, 2009, 03:36:27 PM
Bei mir läuft die MOD, bis auf einen winzigen Punkt:

Code: [Select]
elseif (strstr($url, 'postcards.php?image_id=')) {
        preg_match('#image_id=([0-9]+)&?#', $url, $matches);
        if (isset($matches[1])) {
          $split = explode('?', $url);
          $url = $split[0];
          $query = @$split[1];
          $url   = str_replace('postcards.php', 'postcard.img'.$matches[1].'.htm', $url);
          $query = str_replace('image_id='.$matches[1].'&', '', $query);
          $query = str_replace('&image_id='.$matches[1], '', $query);
          $query = str_replace('image_id='.$matches[1], '', $query);
          if (!empty($query)) {
            $url .= '?' . $query;
          }
        }
      }

Die Postkart-Short-URL haut nicht hin, es kommt ne 404-Fehlermeldung. Ich hab das jetzt erstmal entfernt, bzw. zu folgendem abgeändert:
Code: [Select]
      elseif (strstr($url, 'postcards.php?image_id=')) {
      }
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sebas Bonito on June 29, 2009, 11:02:52 PM
BUG REPORT: Another 404-error, when the title/name of an image has the slash "/".
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on June 30, 2009, 12:18:20 AM
Schnick und Schnack,

there is no bug..
you can control all extra chars within
Code: [Select]
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");and
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sebas Bonito on June 30, 2009, 12:28:40 AM
Schnick und Schnack,

there is no bug..
you can control all extra chars within
Code: [Select]
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");and
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");

Okay, no bug. Thx for this info... but I don't understand what do you mean bei "control". May I add the "/" in there?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on June 30, 2009, 12:55:19 AM
try this for image name
change
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");to
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "/éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","-eeeaeauoiaabcdefghijklmnopqrstuvwxyz");or
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "/éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","_eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sebas Bonito on June 30, 2009, 01:05:17 AM
try this for image name
change
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");to
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "/éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","-eeeaeauoiaabcdefghijklmnopqrstuvwxyz");or
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "/éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","_eeeaeauoiaabcdefghijklmnopqrstuvwxyz");

Thx a lot, mate! This works...  :)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: crimmer on July 01, 2009, 11:25:24 AM
Thanks @Benny
i added your seo mod codes
but turkish characters can not be seen in links?
 help me pls.

http://www.****.net/cat-%DDstanbul-1.htm
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: mayashu on July 03, 2009, 07:28:50 AM
I instaled step by stef for many times but I have this error:

Quote
Not Found

The requested URL /4i/img-bafta-2647.htm was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on July 03, 2009, 07:51:29 AM
Thanks @Benny
i added your seo mod codes
but turkish characters can not be seen in links?
My site: www.resimtr.net help me pls.
http://www.resimtr.net/cat-%DDstanbul-1.htm

morning crimmer and welcome to the 4images forum,

same here

change
Code: [Select]
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
to
Code: [Select]
$row['cat_name'] = strtr($row['cat_name'], "İéèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","ieeeaeauoiaabcdefghijklmnopqrstuvwxyz");and maybe to
Code: [Select]
$row['cat_name'] = strtr($row['cat_name'], "'İéèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","_ieeeaeauoiaabcdefghijklmnopqrstuvwxyz");and to
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "'İéèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","_ieeeaeauoiaabcdefghijklmnopqrstuvwxyz");
because your İstanbul'da will be procude an 404 error

add all special chars into this replacement..
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sunny C. on July 03, 2009, 09:16:11 AM
hi benny, ich habe auch mich genau nach deiner anleitung gehalten und bekomme beim aufruf meiner existierenden (test)gallerie und der bilder:
Diese Seite ist leider nicht verfügbar.
(startseite funktioniert - bloss in die kategoreien und detail-bilder komme ich nicht mehr, da dort die obige fehlermeldung kommt,.,.)
(Top100 ist nicht installiert)

[Edit: kann es evtl. daran liegen dass mein testserver unter funpic läuft und dort kein mod-rewrite [RewriteEngine On
] unterstützt wird??? ]


Natürlich kann das sein und wird es auch! Mod-Rewrite muss an sein!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: crimmer on July 04, 2009, 02:06:20 AM
thank you very much  :P

I added Turkish characters this file (sessions.php+.htaccess)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: varoon on July 15, 2009, 03:19:49 PM
can anyone help me...

using 1.7.7

after updating. in index page. i see all my link ****.htm seems perfect.

 but when i click on them it says Page does not exist.

what might be the problem ??
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: dicrox on July 20, 2009, 04:57:33 AM
I think we need a professional guy to make a good mod rewrite, since all the people here including me want a clear root like example.com/category/image.htm vano says he cant, there is a lot of CMS with a similar structure than 4images that can do it. i am not an expert in rewrite URL but am pretty sure it can be done we ll have to wait I supose.

I hope your understanding, my english in not too good
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: varoon on July 20, 2009, 02:44:57 PM
Hallo,

habe das jetz mal durchgeführt,  Die URL http://www.tram-und-bahnbilder.de/img-tw-8012-augsburg-m8c-1094.htm  allerdings kommt  "Die Webseite konnte nicht angezeigt werden!" 404

wer kann helfen ?? hab die Änderung erstmal rausgenommen wieder

grüße Tobias

Add this code to ur .htaccess file

the attachment is missing this code.

Code: [Select]
RewriteRule ^img-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Mimiru on July 20, 2009, 05:25:03 PM
Quote
I think we need a professional guy to make a good mod rewrite, since all the people here including me want a clear root like example.com/category/image.htm vano says he cant, there is a lot of CMS with a similar structure than 4images that can do it. i am not an expert in rewrite URL but am pretty sure it can be done we ll have to wait I supose.
Main problem is not make "good mod rewrite", because mod rewrite only few rules. Most difficult is - make engine understand and generate FURLs and save ability to use old-style urls for compatibility. Of course, we may done this with a lots of if(...), but it is a indian-style and will slow down not fast 4img.
I'm thinking about FURL for my gallery, and maybe share some ideas here.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: fitterashes on July 24, 2009, 11:18:17 PM
humm, FYI if you have "/"  in your images names ex : "CD / DVDs" you'll get an error.

So :
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "/éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","-eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: alex9193 on July 29, 2009, 08:28:18 AM
V@no !

Неужели  кириллица не лечится

Quote
http://max-pix.com/cat-%D5%E0%EC%E0%F2%EE%E2%E0-%D7%F3%EB%EF%E0%ED-66.htm?l=russian

Тут вон и турки починили себе.

Такая хрень только в адресной строке, все ссылки при наведении мыши прекрасно отображаются на русском.



Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on July 29, 2009, 05:16:08 PM
Этот вопрос нужно адресовать создателем веб стандартов.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: alex9193 on July 29, 2009, 08:17:40 PM
А возможно ли сделать так чтобы URL брался из английской версии?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on July 30, 2009, 03:26:10 AM
А возможно ли сделать так чтобы URL брался из английской версии?
Ну, смотря что вы имеете ввиду под английской версией...возможно проще просто перекодировать кирилицу в транслит:
Re: [MOD] Google Friendly Urls For 4images Best Seo Mod (http://www.4homepages.de/forum/index.php?topic=17598.msg126772#msg126772)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: crs on August 03, 2009, 03:34:17 AM
Hello, im using this mod [MOD] Treat bots as users with less rights.
http://www.4homepages.de/forum/index.php?topic=8752.0

Thats why i am not able to do step 3 - anyone can help?

Thanks
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: fitterashes on August 18, 2009, 05:40:04 PM
For correct navigation in lightbox & search catégories :

RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}&mode=search
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}&mode=lightbox

Code: [Select]
RewriteEngine On

#RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+)\.htm$ categories.php?cat_id=$2&%{QUERY_STRING}
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}&mode=search
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}&mode=lightbox

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: wonder on August 24, 2009, 05:41:46 PM
I greet,

I am Pole.

I would like to know how  in my galery 4images  make mod_rewrite - seo. Coding in my gallery should be put UTF -8
I tried to apply with this forum many solutions - http://www.4homepages.de/forum/index.php?topic=17598.0
treat in every of them Polish signs - ą, ę, ś, ć, ż as well as German - ä, ö, ü their equivalents do not be replace
English.

help me, please ;)

I greet,
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nicky on August 24, 2009, 10:18:31 PM
hi wonder and welcome to the 4images forum:
you can controll all special chars within this post: http://www.4homepages.de/forum/index.php?topic=17598.msg137905#msg137905

file includes/sessions.php

example with char ą :

search for
Code: [Select]
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");and
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
change to

Code: [Select]
$row['cat_name'] = strtr($row['cat_name'], "ąéèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","aeeeaeauoiaabcdefghijklmnopqrstuvwxyz");and
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "ąéèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","aeeeaeauoiaabcdefghijklmnopqrstuvwxyz");
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: wonder on August 25, 2009, 09:23:23 AM
Nicky does not act at me this unfortunately...
- When I alter coding on ISO file -8952 this are also mistakes similarly then when I alter on UTF -8.

Coding my galeri this " the UTF -8" and the base of data the sql - "latin1_swedish_ci"
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Carpfish on September 26, 2009, 10:26:33 AM
Habe diesen mode jetzt auch probiert.
Funktioniert alles super, nur wenn ich in den Categorien auf Upload gehe, dann kommt immer seite nicht gefunden.
Die Uploadform htm. lässt sich nicht öffnen.
Adresse lautet zb. .,..../uploadform21
öffnet immer ohne .html endung.
Macht sie deswegen die Upload seite nicht auf.
Habe auch diesen mod instaliert http://www.4homepages.de/forum/index.php?topic=17786.0 (http://www.4homepages.de/forum/index.php?topic=17786.0)
Kann es auch daran liegen...

Gruß Andy
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: popac on September 30, 2009, 03:43:34 PM
Thank you
xox
[/b], working with 1. 7. 7
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: alex9193 on October 01, 2009, 11:31:37 PM
 V@no!

У меня Google почему-то заходит и индексит по такому варианту
Code: [Select]
http://site.com/details.php?image_id=5734но ссылки-то нормально отображаются
Code: [Select]
http://site.com/img-severine-bremond-photo-5-5734.htm
что за хрень? :?:

(http://)

мой .      htaccess ниже
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on October 02, 2009, 06:19:04 AM
Скорей всего Google использует ранее запомненные ссылки...и так-как они работающие, то остаются для будущих посещений...это чисто мое предположение, не более...
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: alex9193 on October 02, 2009, 03:09:48 PM
Спасибо!
развеял сомнения, я тоже к этому склонялся.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: nameless on October 06, 2009, 10:43:12 PM
Hi it's nice mod

but i have a problem

i have the cat name in Arabic lang

so the URL is like this
www.myweb/flashgames/cat-%C7%E1%DA%C7%C8-%D3%ED%C7%D1%C7%CA-1.htm
how can i make it in arabic like this
www.myweb/flashgames/cat-العاب سيارات-1.htm

thanks againe

I'm using 4image 1.7.6

if it can't be done

I need the url to be like this
www.myweb/flashgames/cat-1.htm
www.myweb/flashgames/cat-2.htm
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: alex9193 on October 07, 2009, 12:46:04 AM
V@no!

Подскажи как сделать 301 редирект с такого вида

Code: [Select]
http://max-pix.com/details.php?image_id=1425

на такой

Code: [Select]
http://max-pix.com/img-nicole-kidman-photo-7-1425.htm
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Bodzio on October 11, 2009, 06:09:37 PM
Can anyone tell me what to do to install it for 1.7.7, so many replies that I don;t know what to start with. I'm using polish lang.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sunny C. on October 11, 2009, 06:20:28 PM
Try this:
http://www.4homepages.de/forum/index.php?topic=17598.msg137711#msg137711
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: nameless on October 20, 2009, 12:53:10 PM
I need some help

i have the cat name in Arabic lang
I'm using 4image 1.7.6

so the URL is like this
www.myweb/flashgames/cat-%C7%E1%DA%C7%C8-%D3%ED%C7%D1%C7%CA-1.htm
how can i make it in arabic like this
www.myweb/flashgames/cat-العاب سيارات-1.htm

if it can't be done

I need the url to be like this
www.myweb/flashgames/cat-1.htm
www.myweb/flashgames/cat-2.htm
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: nameless on October 23, 2009, 03:45:47 PM
Some Help Please

http://www.4homepages.de/forum/index.php?topic=17598.msg142250#msg142250
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: _qp_ on December 27, 2009, 06:15:58 PM
Using this mod and http://www.4homepages.de/forum/index.php?topic=4743.0 (Version B) i have got such a link:
xxx://site.org/4/img-london-1.html?l=ru
or
xxx://site.org/4/img-london-1.html?l=en
How to remove the "?l=ru" or the "?l=ru" part?
Or how to make a link containing just
xxx://site.org/4/img-london
?
Please help.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: confident on January 03, 2010, 12:01:49 PM
i am getting an error like this

Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in /includes/sessions.php on line 394
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on January 03, 2010, 02:32:56 PM
Welcome to 4images forum. The solution is: restore backups and try again. You do something wrong.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: nl2dav on January 21, 2010, 03:22:02 AM
hi wonder and welcome to the 4images forum:
you can controll all special chars within this post: http://www.4homepages.de/forum/index.php?topic=17598.msg137905#msg137905

file includes/sessions.php

example with char ą :

search for
Code: [Select]
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");and
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
change to

Code: [Select]
$row['cat_name'] = strtr($row['cat_name'], "ąéèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","aeeeaeauoiaabcdefghijklmnopqrstuvwxyz");and
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "ąéèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","aeeeaeauoiaabcdefghijklmnopqrstuvwxyz");

search
Code: [Select]
function get_category_url($cat_id,$cat_url = '')
add before

Code: [Select]
function normalize ($string) {
    $table = array(
        'Š'=>'S', 'š'=>'s', 'Đ'=>'Dj', 'đ'=>'dj', 'Ž'=>'Z', 'ž'=>'z', 'Č'=>'C', 'č'=>'c', 'Ć'=>'C', 'ć'=>'c',
        'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',
        'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O',
        'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss',
        'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e',
        'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o',
        'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b',
        'ÿ'=>'y', 'Ŕ'=>'R', 'ŕ'=>'r',
    );

    return strtr($string, $table);
}

search quoted code from Nicky (start of this post).

replace with

Code: [Select]
$row['cat_name'] = normalize($row['cat_name']);
and

Code: [Select]
$row['image_name'] = normalize($row['image_name']);
If you also want lowercase characters in your url, use strtolower after normalize lines you just replaced

Code: [Select]
$row['cat_name'] = strtolower($row['cat_name']);
Code: [Select]
$row['image_name'] = strtolower($row['image_name']);
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: megna73 on January 25, 2010, 12:04:01 PM
Thanx for sharing

seo India
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: tirakle on February 14, 2010, 02:00:00 PM
i have the following problem. Maybe somebody can help ?

Some URLs are written false e.g.:

The Category name is. "Dress up Games" but the Url is: "nress-up-games"

next example:

the picture/game is called "fast track race" but the Url is written: "past-track-race"

some urls are right but most of the are wrong. Can somebody please help ?

I also have the problem the the coding seems to be wrong. I want the page coded in ISO 8859-1 but the site is displayer in UFT-8. I tried everything to change that but is wont work.

edit: So far I found out that the mistakes are only shown is you use large letters, means that ABCDEFGHIJKLMNOPQRSTUVWXYZ turns into klmnopqrstuvwxyzQRSTUVWXYZ !!!! ??????
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Crazymodder on February 27, 2010, 11:45:09 AM
Hi everybody

I have download the seo.rar and change the session.php and add the .htaccess to my gallery. Nearly everythink works perfect but in lightbox.html i get an error if i want to click on an image to get to details.php.
the links look so:
r{image_id}.lightbox.html
but i think they have to look so:
r_{cat_name}_{pic_name}_{image_id}.html

Somebody have a solution for that problem?:)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Memf on March 11, 2010, 10:08:17 PM
Hello :)

Thank you for this wonderful mod, everything works beautiful! But there is a problem with lightboxes... When viewing the album, being on the front page - all photos are added to the lightbox without problems, but on the other album pages (2, 3, etc.) gives an error:

Not Found
The requested URL /cat20.2.html was not found on this server.

.... By the way, working links to the lightbox on the first album pages look like: /cat-{cat_name}-{image_id}.htm?action=addtolightbox&id={image_id}, on the other album pages (2, 3, etc.) they have the form: /cat20.2.htm?action=addtolightbox&id={image_id}, therefore, gives an error "Not found" :( How fix it? Please help.

my .htaccess (sessions.php, the same as in the first post of this topic):

Code: [Select]
RewriteEngine On

#RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+)\.htm$ categories.php?cat_id=$2&%{QUERY_STRING}
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}

RewriteRule ^postcard\.img([0-9]+)\.htm$ postcards.php?image_id=$1&%{QUERY_STRING}

P.S. - sorry for my english  :oops:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Perce2 on March 15, 2010, 03:25:25 PM
humm, FYI if you have "/"  in your images names ex : "CD / DVDs" you'll get an error.

So :
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "/éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","-eeeaeauoiaabcdefghijklmnopqrstuvwxyz");



Even now I have made the above ammendment I still get the "404" error if a "/" is used in the image name. Any other suggestions ?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Tiburon on March 16, 2010, 08:15:43 PM
After reading the whole thread (although I don´t know if I understood the half of it  :mrgreen:) the mod works really good with 1.7.7. Thanks for the Mod and all the support by people here.  :thumbup:

Finally I have one general question.

As far as I understood, it is nescessary that the Urls have a prefix like "k" or "cat" (e.g. for category) because 4images needs this to know if it is a category or an image.

Is it also necessary that the url shows the ID of an image or category ?

I would prefer urls like "../image-on-the-beach.htm" instead of "../image-on-the-beach-15.htm"
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Memf on March 17, 2010, 09:22:33 PM
the mod works really good with 1.7.7

Hello, Tiburon

Yes, in 1.7.7 everything works cool. I also use version 1.7.7, but there is a problem with the lightboxes (see my post above), perhaps this problem is present in you too, I think. Check it out.

So, anyone else can help me? Please.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: funchiestz on March 31, 2010, 03:43:39 PM
Hi

Thank you for the mod, almost everything is cool but I find one small problem. After I install this mod, ecard function is no longer functioning, any idea how to solved it?

Thank you
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: mesut06 on April 14, 2010, 07:51:24 AM
hello. How can I remove a number of categories id

Code: [Select]
http://polatliforum.com/resim/Polatli-macun-koyu-resimleri-59.html
I want to be this way
Code: [Select]
http://polatliforum.com/resim/Polatli-macun-koyu-resimleri.html
Arkadaşlar url de e bulunan kategori id numaralarını nasıl kaldıra bilirim. bu konuda yardımlarınızı bekliyorum.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on April 14, 2010, 03:58:17 PM
you can't. (this has been discussed too many times to repeat explanation)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sunny C. on April 21, 2010, 12:55:51 PM
Is this Possible for this Mod?
http://www.4homepages.de/forum/index.php?topic=11447.0
Link: report_pic.php?cat_id=2&cat_name=2&image_id=44&image_name=XXXXX
Like: report-xxxxx-44.htm ??
Please help
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: batu544 on May 02, 2010, 02:12:51 PM
Hi All,
         I have a little problem with this mod..

Everything works fine.. but when a user is on 2nd page onwards and if he changes the number of image views from 8 to any other number.. , then my url changes to  something like  http://www.mysitename.com/k113.35.htm

Here 113 is the category number and 35 is the page number..



Is there any way to prevent this ??

Thanks,
batu544
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on May 02, 2010, 11:10:34 PM
First of all, I get different results on your site then you've described: it shows k113.2.html where 2 - is the page number I was on, not 35.

Try replace in includes/sessions.php:
            $url   = str_replace('categories.php', 'cat'.$matches1[1].'.'.$matches2[1].'.htm', $url);
            $query = str_replace('cat_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches1[1], '', $query);
            $query = str_replace('cat_id='.$matches1[1], '', $query);
            $query = str_replace('page='.$matches2[1].'&', '', $query);
            $query = str_replace('&page='.$matches2[1], '', $query);
            $query = str_replace('page='.$matches2[1], '', $query);


With:
            $cat_url = get_category_url($matches1[1]);
            $url   = str_replace('categories.php', 'cat'.$cat_url.'.htm', $url);
            $query = str_replace('cat_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches1[1], '', $query);
            $query = str_replace('cat_id='.$matches1[1], '', $query);

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: batu544 on May 17, 2010, 01:10:19 PM
Thanks V@no.. your fix works great !!.. :)   The number 35 was just an example to describe the page number.. :)

Today, I made the changes and it worked.. !!

In my sessions.php, 'cat' word of below line is replaced by 'k' only.. so I made the new changes accordingly..

Code: [Select]
            $url   = str_replace('categories.php', 'cat'.$matches1[1].'.'.$matches2[1].'.htm', $url);


Thanks again V@no.. !!!


Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: didoman on May 18, 2010, 04:32:31 AM
It's been a couple of years now of this mod, and I just want to know is it worth installing.

Does this have any benefit with search engines SEO etc... Or is how 4images originally written just as good.

there are so many changes with this MOD, I'm a bit scared and skeptical on trying to fix something that isn't broken.. If you know what I mean :mrgreen:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: batu544 on May 22, 2010, 02:33:53 PM
Hi All -
               As far as I know, removing the numbers from the category page is not possible, means after installing this mod my category page url looks like this ( k-aishwarya-rai-3.htm). If I will remove the number 3 then, this url will not work..

But Is it possible to get the url  having only category name?? like  www.bhwallpapers.com/aishwaryarai.htm .

I think its possible, because I think one website has already using this type of mod... and its "www. wallpapergate. com/alilarter.html"  ( i believe this website is using 4image )


It would be great, if someone can find out the changes required for this.. :)

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Memf on May 30, 2010, 09:17:34 PM
Hello :)

Thank you for this wonderful mod, everything works beautiful! But there is a problem with lightboxes... When viewing the album, being on the front page - all photos are added to the lightbox without problems, but on the other album pages (2, 3, etc.) gives an error:

Not Found
The requested URL /cat20.2.html was not found on this server.

.... By the way, working links to the lightbox on the first album pages look like: /cat-{cat_name}-{image_id}.htm?action=addtolightbox&id={image_id}, on the other album pages (2, 3, etc.) they have the form: /cat20.2.htm?action=addtolightbox&id={image_id}, therefore, gives an error "Not found" :( How fix it? Please help.

my .htaccess (sessions.php, the same as in the first post of this topic):

Code: [Select]
RewriteEngine On

#RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+)\.htm$ categories.php?cat_id=$2&%{QUERY_STRING}
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}

RewriteRule ^postcard\.img([0-9]+)\.htm$ postcards.php?image_id=$1&%{QUERY_STRING}

P.S. - sorry for my english  :oops:

So, V@no, please help me... or anyone else can help me?!?!

P.S. - 3 months no one has helped me with this problem!  8O
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on May 30, 2010, 11:49:38 PM
If I'm not mistaken batu544 had this problem, try this (http://www.4homepages.de/forum/index.php?topic=17598.msg147338#msg147338) fix.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: __G__ on June 06, 2010, 02:24:30 PM
HI i have this mod installed and working great i was just wondering like rite now it shoes the IMAGE AS LIKE say /img1188.htm   on address bar can it be like /image name.htm  Like what ever the image name is becomes the url
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on June 06, 2010, 08:25:21 PM
it should display img-imageName-imageID.htm
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: __G__ on June 07, 2010, 01:35:52 AM
Hmm mine only shows /image ID .htm not imagename hmm.. how can i fix this
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on June 07, 2010, 02:58:28 AM
restore backups and try again?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sxdte on June 12, 2010, 07:50:58 AM
we tried your mods on a brand new installation, and have mod_rewite enbled (I am server admin)

I unfornutalely have to said it not work for us.
When I click any images , it report a 404 error (page not found)
I can provide if you want a site to test it

Sincerely
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: satine88 on June 19, 2010, 02:08:52 PM
Hello

I have just seen that on my site when doing a search  ( http://www.fond-ecran-gratuit.biz/search.htm )

The url is like:
-http://www.fond-ecran-gratuit.biz/img47804.search.htm

I forgot some?

Thank you for your help:)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on June 19, 2010, 06:03:20 PM
That is normal and supposed to be like that. the "search" keyword in the url tells 4images to show previous/next images from search result, not from category of the current viewing image.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: satine88 on June 19, 2010, 07:21:54 PM
That is normal and supposed to be like that. the "search" keyword in the url tells 4images to show previous/next images from search result, not from category of the current viewing image.

Okay, but there is no risk that the search engines (Google, Yahoo, Bing) indexes the pages that
are not in url rewrite?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: batu544 on June 29, 2010, 07:00:06 PM
All -
      I came up with an another question. Its related to two different mods.. but I am posting the question here.. :)


Could anyone please write some MOD to put below url in SEO formatted url.. ??
Code: [Select]
http://www.bhwallpapers.com/download.php?action=resize&image_id=15982&multi_download_select=2

The expected url would be

Code: [Select]
http://www.bhwallpapers.com/d-image-name-1600x1200-15982.htm

below are conversion details

d ==> download.php?action=resize
15982 stands for the image_id
multi_download_select=2 ==> 1600x1200
multi_download_select=1 ==> 12345x6789
multi_download_select=3 ==> aaaaaxbbbbb


any help will be appreciated.. :)


Thanks,
batu544
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on June 30, 2010, 02:59:10 AM
Not tested.

In includes/sessions.php above
      elseif (strstr($url, 'postcards.php?image_id=')) {

Insert this:
      elseif (strstr($url, 'download.php?action=resize')) {
        preg_match('#image_id=([0-9]+)&multi_download_select=([0-9]+)#', $url, $matches);
        if (isset($matches[1])) {
          global $download_multi_sizes;
          $split = explode('?', $url);
          $url = $split[0];
          $query = @$split[1];
          $url   = str_replace('download.php?action=resize', 'd'.get_image_url($matches[1]).'-'.$matches[2].'-'.$download_multi_sizes[$matches[2]][0].'.htm', $url);
          $query = str_replace('image_id='.$matches[1].'&', '', $query);
          $query = str_replace('&image_id='.$matches[1], '', $query);
          $query = str_replace('image_id='.$matches[1], '', $query);
          $query = str_replace('multi_download_select='.$matches[2].'&', '', $query);
          $query = str_replace('&multi_download_select='.$matches[2], '', $query);
          $query = str_replace('multi_download_select='.$matches[2], '', $query);
          if (!empty($query)) {
            $url .= '?' . $query;
          }
        }
      }


In .htaccess add this:
Code: [Select]
RewriteRule ^d-(.*)-([0-9]+)-([0-9]+)-[0-9]+x[0-9]+\.htm$ download.php?action=resize&image_id=$2&multi_download_select=$3&%{QUERY_STRING}

since used the same function as for details.php to generate url, the final url should be the in this format:
Code: [Select]
http://www.bhwallpapers.com/d-image-name-15982-2-1600x1200.htm
Because multidownload mod uses array indexes, the 1600x1200 in the example will only be used as decoration, you can manually change the numbers, but it will not change image size.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: batu544 on June 30, 2010, 09:48:04 AM
Hi V@no -
                No Luck.. Its not working.. :( I was just trying to debug the php file and it seems the control is never going to that part of code due to the
Code: [Select]
if (!defined('IN_CP'))  line of code in url function..


Thanks,
batu544
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on June 30, 2010, 04:58:42 PM
The problem is in multidownload mod, it doesn't use $sessions->url() function for the links and it should.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: batu544 on July 01, 2010, 09:56:53 PM
Hi V@no,
               I changed the code which generates the link for multi download and I passed it thru 4images standard url function but the output link is not correct..

actual Multi download code was :
Code: [Select]
$multi_download_group .="<td align='center'><a href='".ROOT_PATH."download.php?action=resize&amp;image_id=".$image_row['image_id']."&amp;multi_download_select=".$var."'".$multi_download_var['target'].">".$download_multi_sizes[$var][0]."</a></td>";

I changed it to
Code: [Select]
$multi_download_group .= "<td align='center'><a href=\"".$site_sess->url(ROOT_PATH."download.php?action=resize&amp;image_id=".$image_row['image_id']."&amp;multi_download_select=$var"). "\" >".$download_multi_sizes[$var][0]."</a></td>";

and the resulted output after this modification is ..

http://www.bhwallpapers.com/download.php?action=resize


Is there anything left and needs to be changed.. ??

Thanks,
batu544
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on July 02, 2010, 08:36:24 AM
try replace &amp; with &
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: batu544 on July 02, 2010, 11:27:28 AM
Hi V@no,
               I changed the below line
Code: [Select]
$split = explode('?', $url);  to
Code: [Select]
$split = explode('&', $url);  and it worked .. !! :)



Thank you for your help.. !! :)

only one issue is Multi Download is not using any array for displaying the original size image.. so its not working for original size link..


Thanks again.. !!

batu544


Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Jinjo52 on July 03, 2010, 03:27:33 PM
Hi i just installed the seo Freindly Urls for 4 images but got a big problem a whole category cant be displayed and i got a blank screen when i click on the radndom image in my gallery most of this images are in "unsortierte Bilder" and none of it can be displayed.Also my new images cant be displayed there i also got a blank screen for example Look here http://www.gbbilder.eu/r-noch-unsortiere-bilder-123-da619656-31587.htm (http://www.gbbilder.eu/r-noch-unsortiere-bilder-123-da619656-31587.htm) or go to http://www.gbbilder.eu (http://www.gbbilder.eu) and Click on  Neue Bilder.Every other Category works expect zhis one and it got about 18000 Pictures which are now missing.Can somebody please help me or does somebody know how to change it to make it work?
And Yes Admin i looked in the tread found nothing on the whole 25 pages about that.

sorry for my bad english it is not verywell.
MFg Phil
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: batu544 on July 06, 2010, 08:18:54 PM
since used the same function as for details.php to generate url, the final url should be the in this format:
Code: [Select]
http://www.bhwallpapers.com/d-image-name-15982-2-1600x1200.htm
Because multidownload mod uses array indexes, the 1600x1200 in the example will only be used as decoration, you can manually change the numbers, but it will not change image size.

V@no,
             Can I put original-size at the end when I encounter &multi_download_select=30 in the url ??



Jinjo52,
            Have you checked your server error log ?? If there is any error message please post it here, may be someone can figure out what's the problem in your case.

Thanks,
batu544
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on July 07, 2010, 12:10:20 AM
@Jinjo52:
Are you sure it's after you installed this mod?
Original path of the page doesn't work either:
http://www.gbbilder.eu/details.php?image_id=31587

To troubleshoot, in global.php find:
error_reporting(E_ERROR | E_WARNING | E_PARSE);

Insert below:
error_reporting(E_ALL);
ini_set("display_errors", 1);


See if any error show, if nothing, check server's error logs (contact your host administrators for more info)


@batu544:
The problem is, neither the multi size download, nor this mod has actual image dimensions.
I think your best bet would be ask budduke to add additional item into $download_multi_sizes array that would temporary hold original image dimensions.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on July 08, 2010, 01:42:44 AM
@batu544:
try this.
in includes/functions.php find:
    $site_template->register_vars(array(
      "media_src" => $media_src,

insert above:
    global $download_multi_sizes_original;
    $download_multi_sizes_original = ($image_info) ? $image_info : false;



Then in includes/sessions.php replace the code I posted on previous page with this:
      elseif (strstr($url, 'download.php?action=resize')) {
        preg_match('#image_id=([0-9]+)&multi_download_select=([0-9]+)#', $url, $matches);
        if (isset($matches[1])) {
          global $download_multi_sizes, $download_multi_sizes_original;
          $split = explode('?', $url);
          $url = $split[0];
          $query = @$split[1];
          $dim = "0x0";
          if ($matches[2] >= count($download_multi_sizes))
          {
            if (@$download_multi_sizes_original)
              $dim = $download_multi_sizes_original[0] . "x" . $download_multi_sizes_original[1];
          }
          else
          {
            $dim = $download_multi_sizes[$matches[2]][0];
          }
          $url   = str_replace('download.php?action=resize', 'd'.get_image_url($matches[1]).'-'.$matches[2].'-'.$dim.'.htm', $url);
          $query = str_replace('image_id='.$matches[1].'&', '', $query);
          $query = str_replace('&image_id='.$matches[1], '', $query);
          $query = str_replace('image_id='.$matches[1], '', $query);
          $query = str_replace('multi_download_select='.$matches[2].'&', '', $query);
          $query = str_replace('&multi_download_select='.$matches[2], '', $query);
          $query = str_replace('multi_download_select='.$matches[2], '', $query);
          if (!empty($query)) {
            $url .= '?' . $query;
          }
        }
      }
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: budduke on July 09, 2010, 01:28:54 AM
@ V@no and batu544,
I am not sure if you saw my post on my mods thread or not...
http://www.4homepages.de/forum/index.php?topic=22741.msg148801#msg148801 (http://www.4homepages.de/forum/index.php?topic=22741.msg148801#msg148801)

If your way above is easier then what I tried then I will not bother adding the code permently to my mod. I see that it does not have any issues but if your way works better then I will not bother with mine.

@batu544,
If you can let me know what happens in your testing and what worked for you I would appreciate it...
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: batu544 on July 09, 2010, 07:24:36 AM
V@no and budduke-

Here is the test result of the code..

Original size actual link before applying the changes :  http://www.bhwallpapers.com/download-diya-mirza-14272-30-.htm  ( doesn't work )

Please note the above link got generated by processing the link in 4image session url function.


budduke's code :
  It changed the link to look like  : http://www.bhwallpapers.com/download-diya-mirza-14272-30-Original%20Size.htm 

This is what I am expecting, but when clicking on this link.. it doesn't work . It link remains same on the page but actually it displays the homepage for me.. ( the reason of displaying the home page for me is due to my .htaccess code. As per my .htaccess if a not found encountered then it redirects to my home page ).

V@no's code :
  It changed the original size link to ==> http://www.bhwallpapers.com/d-diya-mirza-14272-30-1024x768.htm 
The number 1024x768 changes to different number for different images..

Final result : Original size link not working and this change also affects other download link and non of download link works..




Thanks,
batu544
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@nо on July 09, 2010, 10:50:30 AM
That's because you altered my "original" code to produce download-imagename-imageid-downloadsize-widthxheight.htm and forgot to do the same in new version ;)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: batu544 on July 09, 2010, 11:39:32 AM
That's because you altered my "original" code to produce download-imagename-imageid-downloadsize-widthxheight.htm and forgot to do the same in new version ;)

What a silly mistake I have done ...  :oops:

Now Its working perfectly..the original size link points to the original image with a link format like

/download-imagename-imageid-downloadsize-widthxheight.htm


Thanks for all your help.. :)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: simpley on July 10, 2010, 09:33:37 PM
I have recently installed best seo mod on 1.77 and it works fine generates the url nicely within the site.

However when i check on google the pages have not been picked up. When i use a tool to see what a spider sees for search engine purposes, the url shows this,

http://www.mydomain/./image-4.htm

Where the folder i have installed 4images  to is replaced with a "."

Is there another file i have to change to make the folder show in the generated url for search engines to find ?


i used the download files from the first page
also i have upload the pre-edited files for 1.7.4 http://rapidshare.com/files/33076491/seo.rar.html
this seo.rar file contains .htaccess file and /include/sessions.php file you can use it withour modifying
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on July 10, 2010, 11:10:39 PM
do you have robots.txt file? maybe it's something there that screwing bots?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: simpley on July 10, 2010, 11:17:50 PM
No robots txt but i did write  a no follow on to a file, but i have forgot which one, i will have to go back and try and figure if it was that.

I had added <a rel="nofollow"href="' in the code of functions php when i added the keyword cloud code.
maybe i missunderstood what it would have done, it was suggested on one of the boards,  does that look like something that might cause the problem, i have removed it and will test again.
just tested and the problem is still there, apart from that i cant think of much else i have changed.



does the htaccess file look correct
RewriteEngine On
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^postcard([a-zA-Z0-9]+)\.htm$ postcards.php?postcard_id=$1&%{QUERY_STRING}
RewriteRule ^postcard\.img([0-9]+)\.htm$ postcards.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^k-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}
RewriteRule ^r-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^r([0-9]+).search.htm details.php?image_id=$1&%{QUERY_STRING}

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on July 10, 2010, 11:56:13 PM
the .htaccess files is not in issue here, there something else that make bot's report wrong addresses.
It could be in the page source
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: simpley on July 11, 2010, 08:11:45 AM
ok this morning i have created a new database and uploaded new 1.7.7.
Made no alterations to the orginal script other than add the sar file that comes at the start of this thread.

thats the
HTACCESS file AND THE SESSIONS PHP

everything looks fine, only when i check with

http://www.webconfs.com/search-engine-spider-simulator.php

i get the same problem
http://www.mydomain.com/./new-site-test-1.htm

where the period replaces the folder name ??


Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on July 11, 2010, 08:14:46 PM
Ok, now I see where the problem is - the webconfs.com itself.

Do a simple test: remove this mod and check your site through their "eyes": it will still replace the folder with a .
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: simpley on July 11, 2010, 10:21:08 PM
Thanks,

I'm very new to all this, what led me to the spider check site was that when i put the url path to one of my gallery images  on google it showed the in the search but added that it didn't match any documents, i had thought the link would at least show live, so thought there was a problem with the generated url.
If i copy and post it into to my browser it works.

Then when i checked with the spider check i noticed the period and thought that might have been another problem!

seperatley - one thing i came across
the orginal sar file at the start of the thread does not have this line in the htaccess file

RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}

which i needed to add to make the cagegory drop down box work, i dont know if it is worth mentioning somewhere on the first post?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on July 11, 2010, 11:12:23 PM
the orginal sar file at the start of the thread does not have this line in the htaccess file

RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}

which i needed to add to make the cagegory drop down box work, i dont know if it is worth mentioning somewhere on the first post?

Unless you are using 4images v1.7.4, you should restore original sessions.php and install this mod manually, including code in .htaccess ;)
I've added a note to the original mod :)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: bara_ac on July 21, 2010, 09:14:27 AM
hellor!
I'm getting this error: Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in .../imagini/includes/sessions.php  on line 411
I saw that another user had the same problem and you suggested to restore backups and try again. that didn't help. any other suggestions?
thank you!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on July 21, 2010, 09:17:36 AM
Welcome to 4images forum.

You do something wrong. Make sure you count the { and } brackets in the original block of code that you need to replace.

And also, do not use notepad or wordpad that comes with windows, or other text editors that don't support simple, plain text without any hidden formatings (MS Word is a no-no), make sure the saved .php files are in ASCII charset (single byte), not unicode/utf8 (multi byte)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: bara_ac on July 21, 2010, 09:35:11 AM
 :D you are right. I was using a bad php editor. I downloaded another and it showed me I didn't close one bracket. a class bracket.
I'm a newbie.  :oops:
thanks!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Artikulus on August 11, 2010, 05:49:49 PM
I install the seo-mod and it works fine but the old url doesn´t redirect to the new url and so there is a duplicate content problem. Example: xxxx.com/categories.php?cat_id?12 should redirect to xxxx.com/k-catname-12.htm. Is there anything to add in the .htaccess-file?

My .htaccess-file:

Code: [Select]
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^(.*) http://www.%{HTTP_HOST}/$1 [R=301]

RewriteRule ^index\.(php|html)$ http://www.xxxxx.com/ [R=301,L]


ErrorDocument 400 /index.html
ErrorDocument 401 /index.html
ErrorDocument 403 /index.html
ErrorDocument 404 /index.html
ErrorDocument 500 /index.html

RewriteEngine On

#RewriteBase /
RewriteRule ^kategorie-(.*)-([0-9]+)\.php$ categories.php?cat_id=$2&%{QUERY_STRING}
RewriteRule ^kategorie\.html$ categories.php?%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^bild-(.*)-([0-9]+)\.php$ details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^bild([0-9]+)\.search.php$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^bild([0-9]+)\.lightbox.php$ details.php?image_id=$1&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^suche\.php$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.php$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^lightbox\.php$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.php$ lightbox.php?page=$1&%{QUERY_STRING}

German: Wenn ich das Seo-Mod installiert habe, leiten die alten URL´s nicht auf die neuen URL´s, sodass bei Google ein Bild oder eine Kategorie 2 mal indexiert wird und so Duplicate Content entsteht.

Thanks for every help!

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: satine88 on September 01, 2010, 11:40:39 PM
Hello
I note that when a visitor does a search, links to images do not rewrite url, is
Can I change?

Thank you
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Abu Abdullah on September 09, 2010, 09:22:36 PM
you can remove duplicate content by using this in your robots.txt

Code: [Select]
Disallow: /*.search.*
Disallow: /*?page=
Disallow: /*&mode=search
Disallow: /*&sessionid=

the problem now with details.php?image_id=X and categories.php?cat_id=X

i don't know if we disallow these  links also it will affect search results or no

thank you
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: hemi4ever on September 13, 2010, 05:47:11 PM
done

thanxxxxxxxxxxxxxx  :D
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Artikulus on September 18, 2010, 07:47:55 PM
Hallo,

habe das SEO-Mod installiert. Vorher habe ich die URL der Detail-Seite wie folgt ausgegeben: bla.de/details.php?id={image_id}.

Nun heißt meine suchmaschinenfreundliche URL aber z.B. bla.de/bild-blabla-9574.php. Wie kann ich diese URL ausgeben?

Danke & Grüße
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nosferatu on September 24, 2010, 09:35:08 AM
Hallo,

i have a new problem.

i have some links like that:

http://www.pj-firepower.com/picgallerie/cat-u%2C-v%2C-w%2C-x%2C-y%2C-z-31.htm


but the real link ist:

http://www.pj-firepower.com/picgallerie/cat-u,-v,-w,-x,-y,-z-25.htm

how can i fix that ?




Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on September 24, 2010, 02:48:31 PM
This is not a problem, this is how it supposed to be...

http://www.blooberry.com/indexdot/html/topics/urlencoding.htm#whatwhy
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nosferatu on September 24, 2010, 04:28:05 PM
kk thx

and is that a problem for search bots / engins,... google, bing, .... ?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on September 24, 2010, 04:39:39 PM
I doubt it
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nosferatu on September 24, 2010, 05:14:34 PM
Someone send me with email that:

In includes/functions.php file,
 
find:
Code: [Select]
if (strpos($text, "@")) {
    $text = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $text);
  }
 
add below:
Code: [Select]
if (strpos($text, "%20")) {
    $text = str_replace("%20", "_", $text);
  }
  if (strpos($text, "%26")) {
    $text = str_replace("%26", "_", $text);
  }
  if (strpos($text, "%24")) {
    $text = str_replace("%24", "_", $text);
  }

That dont work :(
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on September 24, 2010, 05:57:01 PM
assuming you are using optimized version (http://www.4homepages.de/forum/index.php?topic=17598.msg126772#msg126772) of this mod, then you can add as replacement characters for spaces, commas, etc inside fix_name function:
Code: [Select]
      " " => "_", //space
      "," => "_", //comma
      "$" => "_", //dollar sign
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nosferatu on September 24, 2010, 09:48:39 PM
i think i checked it ;)

in database and so the name is right eg: u, v, w, x, y, z

in sitescript i have

u%2C-v%2C-w%2C-x%2C-y%2C-z

and "," dont work in web i thnk

if i write in the session "%2C" => "-",

it dont work...

but if i write "," => "X",

it work.....

is that right that i can't user , ?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on September 24, 2010, 10:00:46 PM
%2C - is not a character, it's an HEX code for a character, therefor you can't use it for replacement, at least not like that.

"," => "X",  - this is the same format as I showed, if it works, then what is the problem? ;)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Nosferatu on September 24, 2010, 10:09:25 PM
ok ;) "," isnt a real problem but i add now all things that i cant use ....

Code: [Select]
     "," => "",
      "/" => "",
      ":" => "",
      "ö" => "oe",
      "ä" => "ae",
      "ü" => "ue",
      "(" => "",
      ")" => "",
      "!" => "",
      "*" => "",
      "ß" => "ss",
      "?" => "",
      "&" => "and",        
      "=" => "is",
      "+" => " and ",
  "[" => "",
  "]" => "",
  "%" => "",
  "#" => "",
  "@" => "",

and i am not finish ....
Thats not normal i think ...

Edit: i am finish now ;) i hope it
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: didoman on October 13, 2010, 02:56:59 PM
I am using the .htaccess from the first page and Vano's optimized session.php
Everything works fine. Thanks.

I have been through the thread (twice) and see that a few people want a cosmetic change to the cat and img that precede the URL.
ie. Just cosmetically changing the pointers "img" and "cat" to another word

Example I would like to change the name of "img" to "movie"
http://example.com/movie-example-1132.htm

I believe Vano mentioned ages ago that those 3 letters are just cosmetic and can be changed but I can't find out how to do it. Nobody mentions how in any thread.

I assumed it would just be a simple matter of changing the line in .htaccess, --- but this doesn't work
eg. RewriteRule ^movie-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}

Is there something I have to change elsewhere in sessions.php?

Just wondering if anybody could help out with this one. Thanks

Reminder  :lol:


Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: didoman on October 25, 2010, 06:47:10 AM
Hi,
Sorry to pest, but anybody know a quick answer to my last question.  :oops:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on October 26, 2010, 03:42:10 AM
Yes, you need change a few lines in step 4.
for example search for (part of a line):
Code: [Select]
str_replace('details.php', 'img
and

Code: [Select]
str_replace('categories.php', 'cat
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: didoman on October 26, 2010, 07:27:41 AM
Excellent, changing this and also in .htaccess works great.
Once again Vano thank you for your brilliant help. Your help over the years has been an inspiration to a lot people.  :lol:

I am now trying to figure out a way for search to also show the image name. Little bit more tricky.
eg. example.com/movie222.search.htm  -->  example.com/movie222.image-name.htm

That is to include the name of the image in the search URL.
Not sure if it helps with Google, but you never know?

Any hints you can throw my way will be appreciated.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: chintan100 on November 13, 2010, 02:33:34 PM
Hi,

I have a weird problem.

My site is http://www.lotofwallpapers.com (http://www.lotofwallpapers.com)  and i have installed this mod by following the instructions in the first post. 4images version is 1.7.8.

My .htaccess file looks exactly like the one in the first post and i have also checked sessions.php twice to make sure everything is according to post.

The mod works fine for entire site except search.

As you can see, i have 28 ferrari modena wallpapers on site right now but if i search for "ferrari" in the search, it says "Your search resulted in no matching records."  8O
Same goes for searching "modena".  8O

To be sure installing the facebook mod did not have any effect, i installed the script on local server and then added only this mod but it is also giving the same problem.  :?
I searched this topic for the word "search" and went through all the resulting posts but non helped. :(

Someone please help me.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: chintan100 on November 19, 2010, 09:36:31 AM
Can anyone answer this question please?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: raghunadhreddys on December 03, 2010, 04:34:59 AM
Hi friends i am using 4images latest version.and i installed seo friendly urls plugin.

when i tried to send an e-card its showing the error message

"The requested URL /postcard.img122.htm was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."


And also,user registration verification,for got password functions are not working.

please solve my problem
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sun on January 31, 2011, 11:55:36 PM
any solution for the not-working drop down list?
hmm, rescue911,
check my site.. is it working?
No, it is not good working in you site. I explain it with example:
1. I stay in the page http://wallp.ape.rs/wallpapers-pics-galleries-albums-from-category-formula-1-season-2004-wallpapers-709.html
2. I choose anothe category with drop down list: Animal Clip Art's
3. And then i see url "http://wallp.ape.rs/wallpapers-pics-galleries-albums.html", but it must be "http://wallp.ape.rs/wallpapers-pics-galleries-albums-from-category-animal-clip-art-s-1445.html".
Do you know how to fix this?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: alekseyn1 on February 06, 2011, 08:54:10 AM
Please help.
Need input from SEO and 4images gurus...

I can not identify when this started to happen. I have many MODs installed. All seems to be working fine.
BUT Google stopped indexing my 4images pages altogether...

I started digging and found that only Googlebot does not see the pages served by 4images... all other search engines seem to be unaffected.
Analyzing the server response, I found a weird thing:

http://web-sniffer.net/
for URL like http://www.fotodvor.com/
with user agent: Googlebot

I get "Status: HTTP/1.1 302 Moved Temporarily"

any other user agent shows a good page.

renaming (thus disabling) .htaccess did not make any difference (it seems)...

Any ideas would be really appreciated!

below is my .htaccess just in case:

Code: [Select]
RewriteEngine On

# If no-www domain requested, externally redirect to www domain
RewriteCond %{HTTP_HOST} ^fotodvor\.com
RewriteRule (.*) http://www.fotodvor.com/$1 [R=301,L]
RewriteRule ^sitemap.xml$ google.php

# If www+subdomain domain requested, externally redirect to subdomain without "www"
RewriteCond %{HTTP_HOST} ^www\.([^.]+)\.fotodvor\.com
RewriteRule (.*) http://%1.fotodvor.com/$1 [R=301,L]

# If subdomain+www domain requested, externally redirect to subdomain without "www"
RewriteCond %{HTTP_HOST} ^([^.]+)\.www\.fotodvor\.com
RewriteRule (.*) http://%1.fotodvor.com/$1 [R=301,L]

# If subdomain requested, rewrite home page requests to index.php with query string user=subdomain & page="home"
RewriteCond %{REQUEST_URI} !^/search\.php
RewriteCond %{HTTP_HOST} !^www\.fotodvor\.com
RewriteCond %{HTTP_HOST} ^([^.]+)\.fotodvor\.com
RewriteRule ^$ /search.php?search_user=%1 [L]

#signature mod
RewriteRule ^signature\.png$ signature.php?%{QUERY_STRING}
RewriteRule ^go$ signature.php?go=1&%{QUERY_STRING}

#correcting a weird phpBB intergation bug...
#RewriteRule ^viewtopic.php?([^/\.]+)$ /forum/viewtopic.php?$1
RewriteRule ^viewtopic.php?$ http://www.fotodvor.com [R=301,L]

#RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+)\.htm$ categories.php?cat_id=$2&%{QUERY_STRING}
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}

#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}
RewriteRule ^postcard([a-zA-Z0-9]+)\.htm$ postcards.php?postcard_id=$1&%{QUERY_STRING}
RewriteRule ^postcard\.img([0-9]+)\.htm$ postcards.php?image_id=$1&%{QUERY_STRING}
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sun on February 23, 2011, 11:57:06 PM
I think that all work, but just now i found error with [MOD] Language select (russian - main).
Before this mod url with english has '&l=english' at the end. Now urls have '?l=english' or '&amp;l=english'. Url with '&amp;' didn't work (url, for example: member.php?action=showprofile&user_id=1&amp;l=english). How to change '&amp;'?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: alekseyn1 on February 24, 2011, 05:41:46 AM
Please help.
Need input from SEO and 4images gurus...

I can not identify when this started to happen. I have many MODs installed. All seems to be working fine.
BUT Google stopped indexing my 4images pages altogether...

I started digging and found that only Googlebot does not see the pages served by 4images... all other search engines seem to be unaffected.
Analyzing the server response, I found a weird thing:

http://web-sniffer.net/
for URL like http://www.fotodvor.com/
with user agent: Googlebot

I get "Status: HTTP/1.1 302 Moved Temporarily"

any other user agent shows a good page.

renaming (thus disabling) .htaccess did not make any difference (it seems)...

Any ideas would be really appreciated!

Problem solved. Had to disable "bots as users" function by disabling all bots in Control panel of phpBB. I am using the bridge with phpBB forum.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sun on February 25, 2011, 12:33:27 AM
I think that all work, but just now i found error with [MOD] Language select (russian - main).
Before this mod url with english has '&l=english' at the end. Now urls have '?l=english' or '&amp;l=english'. Url with '&amp;' didn't work (url, for example: member.php?action=showprofile&user_id=1&amp;l=english). How to change '&amp;'?

I don't now how correctly fix it, but i do that and now all woking:
Sessions.php find:
    if (!empty($l)) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= "l=".$l;
    }
replace:     if (!empty($l)) {
      $url .= strpos($url, '?') !== false ? '&' : "?";
      $url .= "l=".$l;
    }
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on February 25, 2011, 12:41:47 AM
There is no such line in the original code of this mod...You've must have changed something afterwards.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sun on February 25, 2011, 12:44:56 AM
<edit>
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on February 25, 2011, 12:47:31 AM
Oh, you are quick :)

I've edited my post, after realizing that the code block you showed is not from original code of this mod...
So if the rest of your code in url() function the same as in this mod, then yes, that fix is correct.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sun on February 25, 2011, 01:03:25 AM
Thank you, V@no.
For me, installation this mod was not easy, becouse there are many changes i read in the posts and i don't remember why i didn't use original code  :oops:. May be it was, becouse i use you post #267.

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: alekseyn1 on March 09, 2011, 08:17:09 AM
Dear friends from Germany  :D

maybe you already have this covered in your systems somewhere - I could not find it.
If anybody could help me with the solutions I would be very grateful

I need to convert special German symbols in image name into regular Latin. The difficulty is that my sessions.php needs to be in win-1251 encoding... is there a way to go around this problem and still have german, ukranian and russian characters to show properly?

so basically the below function does not work properly if I encode the file in win-1251 (because the first block of characters gets encoded improperly):

Code: [Select]
function fixname($text)
{
  return strtolower(strtr(
    $text,
     array(
      "é" => "e",
      "è" => "e",
      "ê" => "e",
      "à" => "a",
      "ë" => "e",
      "â" => "a",
      "ú" => "a",
      "ó" => "o",
      "í" => "i",
      "á" => "a",
      "ä"  => "a", //new line

      //russian UTF8 encoded alphabet (lower and upper cases)
      "&#1040;" => "a",
      "&#1072;" => "a",
      "&#1041;" => "b",
      "&#1073;" => "b",
      "&#1042;" => "v",
      "&#1074;" => "v",
      "&#1043;" => "g",
      "&#1075;" => "g",
      "&#1044;" => "d",
      "&#1076;" => "d",
      "&#1045;" => "e",
      "&#1077;" => "e",
      "&#1025;" => "yo",
      "&#1105;" => "yo",
      "&#1046;" => "zh",
      "&#1078;" => "zh",
      "&#1047;" => "z",
      "&#1079;" => "z",
      "&#1048;" => "i",
      "&#1080;" => "i",
      "&#1049;" => "j",
      "&#1081;" => "j",
      "&#1050;" => "k",
      "&#1082;" => "k",
      "&#1051;" => "l",
      "&#1083;" => "l",
      "&#1052;" => "m",
      "&#1084;" => "m",
      "&#1053;" => "n",
      "&#1085;" => "n",
      "&#1054;" => "o",
      "&#1086;" => "o",
      "&#1055;" => "p",
      "&#1087;" => "p",
      "&#1056;" => "r",
      "&#1088;" => "r",
      "&#1057;" => "s",
      "&#1089;" => "s",
      "&#1058;" => "t",
      "&#1090;" => "t",
      "&#1059;" => "u",
      "&#1091;" => "u",
      "&#1060;" => "f",
      "&#1092;" => "f",
      "&#1061;" => "h",
      "&#1093;" => "h",
      "&#1062;" => "c",
      "&#1094;" => "c",
      "&#1063;" => "ch",
      "&#1095;" => "ch",
      "&#1064;" => "sh",
      "&#1096;" => "sh",
      "&#1065;" => "sch",
      "&#1097;" => "sch",
      "&#1066;" => "",
      "&#1098;" => "",
      "&#1067;" => "i",
      "&#1110;" => "i", //ukranian i
      "&#1099;" => "i",
      "&#1068;" => "'",
      "&#1100;" => "'",
      "&#1069;" => "e",
      "&#1101;" => "e",
      "&#1070;" => "yu",
      "&#1102;" => "yu",
      "&#1071;" => "ya",
      "&#1103;" => "ya",
  //russian 1251 encoded alphabet (lower and upper cases)
      "а" => "a",
      "А" => "a",
      "б" => "b",
      "Б" => "b",
      "в" => "v",
      "В" => "v",
      "г" => "g",
      "Г" => "g",
      "д" => "d",
      "Д" => "d",
      "е" => "e",
      "Е" => "e",
      "ё" => "yo",
      "Ё" => "yo",
      "ж" => "zh",
      "Ж" => "zh",
      "з" => "z",
      "З" => "z",
      "и" => "i",
      "И" => "i",
      "й" => "j",
      "Й" => "j",
      "к" => "k",
      "К" => "k",
      "л" => "l",
      "Л" => "l",
      "м" => "m",
      "М" => "m",
      "н" => "n",
      "Н" => "n",
      "о" => "o",
      "О" => "o",
      "п" => "p",
      "П" => "p",
      "р" => "r",
      "Р" => "r",
      "с" => "s",
      "С" => "s",
      "т" => "t",
      "Т" => "t",
      "у" => "u",
      "У" => "u",
      "ф" => "f",
      "Ф" => "f",
      "х" => "h",
      "Х" => "h",
      "ц" => "c",
      "Ц" => "c",
      "ч" => "ch",
      "Ч" => "ch",
      "ш" => "sh",
      "Ш" => "sh",
      "щ" => "sch",
      "Щ" => "sch",
      "ъ" => "",
      "Ъ" => "",
      "ы" => "i",
      "Ы" => "i",
      "ь" => "'",
      "Ь" => "'",
      "э" => "e",
      "Э" => "e",
      "ю" => "yu",
      "Ю" => "yu",
      "я" => "ya",
      "Я" => "ya",
      "/" => "",
  "&" => "-",
  "№" => "",
  "," => "-",
  "°" => "",
  "\"" => "",
  "і" => "i", //ukranian i  
  "ї" => "i", //ukranian ї
  "є" => "e", //ukranian є
  "«" => "",
  "»" => "",  
  )));
}
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Sun on March 09, 2011, 11:47:42 PM
May be, you can change your german simvols for codes (for example &uuml;)?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: lisandru on March 14, 2011, 02:29:37 AM
XOX Thank you  very much man for this archive .. it really works on me (just add that 2 files) and from now it works.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: eybabi on April 21, 2011, 10:03:24 PM
Hi everyone,
I have a problem too with this wonderful mode :)

When i look my Webmaster Tool on Google , i see there are some duplicate content problems.

xxx: xxx: resims. net/araba-resimleri-audi-7-audi-q-serisi-359-audi-q5-360. htm

xxx: xxx: resims. net/araba-resimleri-audi-q5-360. htm

xxx: xxx: resims. net/araba-resimleri-audi-q5-360. htm?page=1

3 pages are same,but different urls. How can i fix this problem?

And  I have another problem with details

xxx: xxx: resims. net/arabalar-hummer-2118. htm

xxx: xxx: resims. net/arabalar-saab-2118. htm

2 pages are some but have different urls. xxx: xxx: resims. net/arabalar-hummer-2118. htm is the wrong one. What is wrong with my seo do you think. Here is my sessions.php and .htaccess  

Thanks for your help...

HTACCESS

Code: [Select]
RewriteEngine On


#Mod_bmollet : Cat name in URL
RewriteRule ^araba-resimleri\.htm$ categories.php?%{QUERY_STRING}
RewriteRule ^araba-resimleri-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}

#Mod_bmollet : Image name in URL
RewriteRule ^arabalar-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}


#Mod_bmollet : This is to make search function work  ( redirect links from search arabaults )
RewriteRule ^modifiyeli-arabalar\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^modifiyeli-arabalar\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^arabalar([0-9]+).modifiyeli-arabalar.htm$ details.php?image_id=$1&%{QUERY_STRING}

RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^arabalar([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}

RewriteRule ^postcard([a-zA-Z0-9]+)\.htm$ postcards.php?postcard_id=$1&%{QUERY_STRING}
RewriteRule ^postcard\.img([0-9]+)\.htm$ postcards.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^postcard\.img([0-9]+)\.htm$ postcards.php?image_id=$1&%{QUERY_STRING}



RewriteRule ^sitemap.xml$ sitemap.php

RewriteRule ^en_iyi_araba_resimleri.html$ top.php

# End search engine friendly links code

SESSIONS

..................


     <?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: sessions.php                                         *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.6                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
if (!defined('ROOT_PATH')) {
  die("Security violation");
}

//-----------------------------------------------------
//--- Start Configuration -----------------------------
//-----------------------------------------------------

define('SESSION_NAME', 'sessionid');

$user_table_fields = array(
  "user_id" => "user_id",
  "user_level" => "user_level",
  "user_name" => "user_name",
  "user_password" => "user_password",
  "user_email" => "user_email",
  "user_showemail" => "user_showemail",
  "user_allowemails" => "user_allowemails",
  "user_invisible" => "user_invisible",
  "user_joindate" => "user_joindate",
  "user_activationkey" => "user_activationkey",
  "user_lastaction" => "user_lastaction",
  "user_location" => "user_location",
  "user_lastvisit" => "user_lastvisit",
  "user_comments" => "user_comments",
  "user_homepage" => "user_homepage",
  "user_icq" => "user_icq"
);

//-----------------------------------------------------
//--- End Configuration -------------------------------
//-----------------------------------------------------

function get_user_table_field($add, $user_field) {
  global $user_table_fields;
  return (!empty($user_table_fields[$user_field])) ? $add.$user_table_fields[$user_field] : "";
}

class Session {

  var $session_id;
  var $session_key;
  var $user_ip;
  var $user_location;
  var $current_time;
  var $session_timeout;
  var $mode = "get";
  var $session_info = array();
  var $user_info = array();

  function Session() {
    global $config;
    $this->session_timeout = $config['session_timeout'] * 60;
    $this->user_ip = $this->get_user_ip();
    $this->user_location = $this->get_user_location();
    $this->current_time = time();

    if (defined('SESSION_KEY') && SESSION_KEY != '') {
        $this->session_key = SESSION_KEY;
    } else {
        $this->session_key = md5('4images' . realpath(ROOT_PATH));
    }

    // Stop adding SID to URLs
    @ini_set('session.use_trans_sid', 0);

    //@ini_set('session.cookie_lifetime', $this->session_timeout);

    session_name(urlencode(SESSION_NAME));
    @session_start();

    $this->demand_session();
  }

  function set_cookie_data($name, $value, $permanent = 1) {
    $cookie_expire = ($permanent) ? $this->current_time + 60 * 60 * 24 * 365 : 0;
    $cookie_name = COOKIE_NAME.$name;
    setcookie($cookie_name, $value, $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);
    $HTTP_COOKIE_VARS[$cookie_name] = $value;
  }

  function read_cookie_data($name) {
    global $HTTP_COOKIE_VARS;
    $cookie_name = COOKIE_NAME.$name;
    return (isset($HTTP_COOKIE_VARS[$cookie_name])) ? $HTTP_COOKIE_VARS[$cookie_name] : false;
  }

  function get_session_id() {
    if (SID == '') {
      $this->mode = "cookie";
    }

    if (preg_match('/[^a-z0-9]+/i', session_id())) {
      @session_regenerate_id();
    }

    $this->session_id = session_id();
  }

  function demand_session() {
    $this->get_session_id();
    if (!$this->load_session_info()) {
      $this->delete_old_sessions();
      $user_id = ($this->read_cookie_data("userid")) ? intval($this->read_cookie_data("userid")) : GUEST;
      $this->start_session($user_id);
    }
    else {
      $this->user_info = $this->load_user_info($this->session_info['session_user_id']);
      $update_cutoff = ($this->user_info['user_id'] != GUEST) ? $this->current_time - $this->user_info['user_lastaction'] : $this->current_time - $this->session_info['session_lastaction'];
      if ($update_cutoff > 60) {
        $this->update_session();
        $this->delete_old_sessions();
      }
    }
  }

  function start_session($user_id = GUEST, $login_process = 0) {
    global $site_db;

    $this->user_info = $this->load_user_info($user_id);
    if ($this->user_info['user_id'] != GUEST && !$login_process) {
      if ($this->read_cookie_data("userpass") == $this->user_info['user_password'] && $this->user_info['user_level'] > USER_AWAITING) {
        $this->set_cookie_data("userpass", $this->user_info['user_password']);
      }
      else {
        $this->set_cookie_data("userpass", "", 0);
        $this->user_info = $this->load_user_info(GUEST);
      }
    }

    //if (!$login_process) {
      $sql = "REPLACE INTO ".SESSIONS_TABLE."
              (session_id, session_user_id, session_lastaction, session_location, session_ip)
              VALUES
              ('".addslashes($this->session_id)."', ".$this->user_info['user_id'].", $this->current_time, '$this->user_location', '$this->user_ip')";
      $site_db->query($sql);
    //}

    $this->session_info['session_user_id'] = $this->user_info['user_id'];
    $this->session_info['session_lastaction'] = $this->current_time;
    $this->session_info['session_location'] = $this->user_location;
    $this->session_info['session_ip'] = $this->user_ip;

    if ($this->user_info['user_id'] != GUEST) {
      $this->user_info['user_lastvisit'] = (!empty($this->user_info['user_lastaction'])) ? $this->user_info['user_lastaction'] : $this->current_time;
      $sql = "UPDATE ".USERS_TABLE."
              SET ".get_user_table_field("", "user_lastaction")." = $this->current_time, ".get_user_table_field("", "user_location")." = '$this->user_location', ".get_user_table_field("", "user_lastvisit")." = ".$this->user_info['user_lastvisit']."
              WHERE ".get_user_table_field("", "user_id")." = ".$this->user_info['user_id'];
      $site_db->query($sql);
    }
    $this->set_cookie_data("lastvisit", $this->user_info['user_lastvisit']);
    $this->set_cookie_data("userid", $this->user_info['user_id']);
    return true;
  }

  function login($user_name = "", $user_password = "", $auto_login = 0, $set_auto_login = 1) {
    global $site_db, $user_table_fields;

    if (empty($user_name) || empty($user_password)) {
      return false;
    }
    $sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_password")."
            FROM ".USERS_TABLE."
            WHERE ".get_user_table_field("", "user_name")." = '$user_name' AND ".get_user_table_field("", "user_level")." <> ".USER_AWAITING;
    $row = $site_db->query_firstrow($sql);

    $user_id = (isset($row[$user_table_fields['user_id']])) ? $row[$user_table_fields['user_id']] : GUEST;
    $user_password = md5($user_password);
    if ($user_id != GUEST) {
      if ($row[$user_table_fields['user_password']] == $user_password) {
        $sql = "UPDATE ".SESSIONS_TABLE."
                SET session_user_id = $user_id
                WHERE session_id = '".addslashes($this->session_id)."'";
        $site_db->query($sql);
        if ($set_auto_login) {
          $this->set_cookie_data("userpass", ($auto_login) ? $user_password : "");
        }
        $this->start_session($user_id, 1);
        return true;
      }
    }
    return false;
  }

  function logout($user_id) {
    global $site_db;
    $sql = "DELETE FROM ".SESSIONS_TABLE."
            WHERE session_id = '".addslashes($this->session_id)."' OR session_user_id = $user_id";
    $site_db->query($sql);
    $this->set_cookie_data("userpass", "", 0);
    $this->set_cookie_data("userid", GUEST);

    $this->session_info = array();

    return true;
  }

  function delete_old_sessions() {
    global $site_db;
    $expiry_time = $this->current_time - $this->session_timeout;
    $sql = "DELETE FROM ".SESSIONS_TABLE."
            WHERE session_lastaction < $expiry_time";
    $site_db->query($sql);

    return true;
  }

  function update_session() {
    global $site_db;

    $sql = "REPLACE INTO ".SESSIONS_TABLE."
           (session_id, session_user_id, session_lastaction, session_location, session_ip)
           VALUES
           ('".addslashes($this->session_id)."', ".$this->user_info['user_id'].", $this->current_time, '$this->user_location', '$this->user_ip')";
    $site_db->query($sql);

    $this->session_info['session_lastaction'] = $this->current_time;
    $this->session_info['session_location'] = $this->user_location;
    $this->session_info['session_ip'] = $this->user_ip;

    if ($this->user_info['user_id'] != GUEST) {
      $sql = "UPDATE ".USERS_TABLE."
              SET ".get_user_table_field("", "user_lastaction")." = $this->current_time, ".get_user_table_field("", "user_location")." = '$this->user_location'
              WHERE ".get_user_table_field("", "user_id")." = ".$this->user_info['user_id'];
      $site_db->query($sql);
    }
    return;
  }

  function return_session_info() {
    return $this->session_info;
  }

  function return_user_info() {
    return $this->user_info;
  }

  function freeze() {
    return;
  }

  function load_session_info() {
    if (@ini_get('register_globals')) {
      session_register($this->session_key);

      if (!isset($GLOBALS[$this->session_key])) {
        $GLOBALS[$this->session_key] = array();
      }

      $this->session_info = &$GLOBALS[$this->session_key];

    } else {
      if (isset($_SESSION)) {
        if (!isset($_SESSION[$this->session_key])) {
          $_SESSION[$this->session_key] = array();
        }

        $this->session_info = &$_SESSION[$this->session_key];

      } else {
        if (!isset($GLOBALS['HTTP_SESSION_VARS'][$this->session_key])) {
          $GLOBALS['HTTP_SESSION_VARS'][$this->session_key] = array();
        }

        $this->session_info = &$GLOBALS['HTTP_SESSION_VARS'][$this->session_key];
      }
    }

    if (!isset($this->session_info['session_ip'])) {
      $this->session_info = array();
      return false;
    }

    if ($this->mode == "get" && $this->session_info['session_ip'] != $this->user_ip) {
      if (function_exists('session_regenerate_id')) {
        @session_regenerate_id();
      }
      $this->get_session_id();
      $this->session_info = array();
      return false;
    }

    return $this->session_info;
  }

  function load_user_info($user_id = GUEST) {
    global $site_db, $user_table_fields;

    if ($user_id != GUEST) {
      $sql = "SELECT u.*, l.*
              FROM ".USERS_TABLE." u, ".LIGHTBOXES_TABLE." l
              WHERE ".get_user_table_field("u.", "user_id")." = $user_id AND l.user_id = ".get_user_table_field("u.", "user_id");
      $user_info = $site_db->query_firstrow($sql);
      if (!$user_info) {
        $sql = "SELECT *
                FROM ".USERS_TABLE."
                WHERE ".get_user_table_field("", "user_id")." = $user_id";
        $user_info = $site_db->query_firstrow($sql);
        if ($user_info) {
          $lightbox_id = get_random_key(LIGHTBOXES_TABLE, "lightbox_id");
          $sql = "INSERT INTO ".LIGHTBOXES_TABLE."
                  (lightbox_id, user_id, lightbox_lastaction, lightbox_image_ids)
                  VALUES
                  ('$lightbox_id', ".$user_info[$user_table_fields['user_id']].", $this->current_time, '')";
          $site_db->query($sql);
          $user_info['lightbox_lastaction'] = $this->current_time;
          $user_info['lightbox_image_ids'] = "";
        }
      }
    }
    if (empty($user_info[$user_table_fields['user_id']])) {
      $user_info = array();
      $user_info['user_id'] = GUEST;
      $user_info['user_level'] = GUEST;
      $user_info['user_lastaction'] = $this->current_time;
      $user_info['user_lastvisit'] = ($this->read_cookie_data("lastvisit")) ? $this->read_cookie_data("lastvisit") : $this->current_time;
    }
    foreach ($user_table_fields as $key => $val) {
      if (isset($user_info[$val])) {
        $user_info[$key] = $user_info[$val];
      }
      elseif (!isset($user_info[$key])) {
        $user_info[$key] = "";
      }
    }
    return $user_info;
  }

  function set_session_var($var_name, $value) {
    $this->session_info[$var_name] = $value;
    return true;
  }

  function get_session_var($var_name) {
    if (isset($this->session_info[$var_name])) {
      return $this->session_info[$var_name];
    }

    return '';
  }

  function drop_session_var($var_name) {
    unset($this->session_info[$var_name]);
  }

  function get_user_ip() {
    global $HTTP_SERVER_VARS, $HTTP_ENV_VARS;
    $ip = (!empty($HTTP_SERVER_VARS['REMOTE_ADDR'])) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ((!empty($HTTP_ENV_VARS['REMOTE_ADDR'])) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv("REMOTE_ADDR"));
    $ip = preg_replace("/[^\.0-9]+/", "", $ip);
    return substr($ip, 0, 50);
  }

  function get_user_location() {
    global $self_url;
    return (defined("IN_CP")) ? "Control Panel" : preg_replace(array("/([?|&])action=[^?|&]*/", "/([?|&])mode=[^?|&]*/", "/([?|&])phpinfo=[^?|&]*/", "/([?|&])printstats=[^?|&]*/", "/[?|&]".URL_ID."=[^?|&]*/", "/[?|&]l=[^?|&]*/", "/[&?]+$/"), array("", "", "", "", "", "", ""), addslashes($self_url));
  }

/* ORIGINAL CODE
  function url($url, $amp = "&amp;") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && !preg_match("/".SESSION_NAME."=/i", $url)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }
*/
  function url($url, $amp = "&amp;") {
    global $l, $user_info;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];
    $url = str_replace('&amp;', '&', $url);
    if (!defined('IN_CP')) {
      if (strstr($url, 'index.php')) {
        $url = str_replace('index.php', '', $url);
      }
      elseif (strstr($url, 'search.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('search.php', 'modifiyeli-arabalar.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('search.php', 'modifiyeli-arabalar.htm', $url);
        }
      }
      elseif (strstr($url, 'lightbox.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('lightbox.php', 'lightbox.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
                $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('lightbox.php', 'lightbox.htm', $url);
        }
      }
      elseif (strstr($url, 'categories.php')) {
        if (strstr($url, 'cat_id=') && strstr($url, 'page=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#page=([0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('categories.php', 'araba-resimleri'.$matches1[1].'.'.$matches2[1].'.htm', $url);
            $query = str_replace('cat_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches1[1], '', $query);
            $query = str_replace('cat_id='.$matches1[1], '', $query);
            $query = str_replace('page='.$matches2[1].'&', '', $query);
            $query = str_replace('&page='.$matches2[1], '', $query);
            $query = str_replace('page='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        elseif (strstr($url, 'cat_id=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $cat_url = get_category_url($matches[1]);
            $url   = str_replace('categories.php', 'araba-resimleri'.$cat_url.'.htm', $url);
            $query = str_replace('cat_id='.$matches[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches[1], '', $query);
            $query = str_replace('cat_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('categories.php', 'araba-resimleri.htm', $url);
        }
      }
      elseif (strstr($url, 'details.php?image_id=')) {
        if (strstr($url, 'image_id=') && strstr($url, 'mode=')) {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#mode=([a-zA-Z0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'arabalar'.get_image_url($matches1[1]).'.htm', $url);
            $query = str_replace('image_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches1[1], '', $query);
            $query = str_replace('image_id='.$matches1[1], '', $query);
            $query = str_replace('mode='.$matches2[1].'&', '', $query);
            $query = str_replace('&mode='.$matches2[1], '', $query);
            $query = str_replace('mode='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'arabalar'.get_image_url($matches[1]).'.htm', $url);
            $query = str_replace('image_id='.$matches[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches[1], '', $query);
            $query = str_replace('image_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
      }
      elseif (strstr($url, 'postcards.php?image_id=')) {
        preg_match('#image_id=([0-9]+)&?#', $url, $matches);
        if (isset($matches[1])) {
          $split = explode('?', $url);
          $url = $split[0];
          $query = @$split[1];
          $url   = str_replace('postcards.php', 'postcard.img'.$matches[1].'.htm', $url);
          $query = str_replace('image_id='.$matches[1].'&', '', $query);
          $query = str_replace('&image_id='.$matches[1], '', $query);
          $query = str_replace('image_id='.$matches[1], '', $query);
          if (!empty($query)) {
            $url .= '?' . $query;
          }
        }
      }
    }
    if ($this->mode == "get" && strstr($url, $this->session_id)) {
      $url .= strpos($url, '?') !== false ? '&' : '?';
      $url .= SESSION_NAME."=".$this->session_id;
    }
    if (!empty($l)) {
      $url .= strpos($url, '?') ? '&' : '?';
      $url .= "l=".$l;
    }
    $url = str_replace('&', $amp, $url);
    $url .= isset($dummy_array[1]) ? "#".$dummy_array[1] : "";
    return $url;
  }
} //end of class

//-----------------------------------------------------
//--- Start Session -----------------------------------
//-----------------------------------------------------
define('COOKIE_NAME', '4images_');
define('COOKIE_PATH', '');
define('COOKIE_DOMAIN', '');
define('COOKIE_SECURE', '0');

$site_sess = new Session();

// Get Userinfo
$session_info = $site_sess->return_session_info();
$user_info = $site_sess->return_user_info();

//-----------------------------------------------------
//--- Get User Caches ---------------------------------
//-----------------------------------------------------
$num_total_online = 0;
$num_visible_online = 0;
$num_invisible_online = 0;
$num_registered_online = 0;
$num_guests_online = 0;
$user_online_list = "";
$prev_user_ids = array();
$prev_session_ips = array();

if (defined("GET_USER_ONLINE") && ($config['display_whosonline'] == 1 || $user_info['user_level'] == ADMIN)) {
  $time_out = time() - 300;
  $sql = "SELECT s.session_user_id, s.session_lastaction, s.session_ip".get_user_table_field(", u.", "user_id").get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_invisible")."
      FROM ".SESSIONS_TABLE." s
      LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = s.session_user_id)
      WHERE s.session_lastaction >= $time_out
      ORDER BY ".get_user_table_field("u.", "user_id")." ASC, s.session_ip ASC";
  $result = $site_db->query($sql);
  while ($row = $site_db->fetch_array($result)) {
    if ($row['session_user_id'] != GUEST && (isset($row[$user_table_fields['user_id']]) && $row[$user_table_fields['user_id']] != GUEST)) {
      if (!isset($prev_user_ids[$row['session_user_id']])) {
        $is_invisible = (isset($row[$user_table_fields['user_invisible']]) && $row[$user_table_fields['user_invisible']] == 1) ? 1 : 0;
        $invisibleuser = ($is_invisible) ? "*" : "";
        $username = (isset($row[$user_table_fields['user_level']]) && $row[$user_table_fields['user_level']] == ADMIN && $config['highlight_admin'] == 1) ? sprintf("<b>%s</b>", $row[$user_table_fields['user_name']]) : $row[$user_table_fields['user_name']];
        if (!$is_invisible || $user_info['user_level'] == ADMIN) {
          $user_online_list .= ($user_online_list != "") ? ", " : "";
          $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];
          $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$username."</a>".$invisibleuser;
        }
        (!$is_invisible) ? $num_visible_online++ : $num_invisible_online++;
        $num_registered_online++;
      }
      $prev_user_ids[$row['session_user_id']] = 1;
    }
    else {
      if (!isset($prev_session_ips[$row['session_ip']])) {
        $num_guests_online++;
      }
    }
    $prev_session_ips[$row['session_ip']] = 1;
  }
  $num_total_online = $num_registered_online + $num_guests_online;
  //$num_invisible_online = $num_registered_online - $num_visible_online;

  $site_template->register_vars(array(
    "num_total_online" => $num_total_online,
    "num_invisible_online" => $num_invisible_online,
    "num_registered_online" => $num_registered_online,
    "num_guests_online" => $num_guests_online,
    "user_online_list" => $user_online_list,
    "lang_user_online" => str_replace('{num_total_online}', $num_total_online, $lang['user_online']),
    "lang_user_online_detail" => str_replace(array('{num_registered_online}','{num_invisible_online}','{num_guests_online}'), array($num_registered_online,$num_invisible_online,$num_guests_online), $lang['user_online_detail']),
  ));
  $whos_online = $site_template->parse_template("whos_online");
  $site_template->register_vars("whos_online", $whos_online);
  unset($whos_online);
  unset($prev_user_ids);
  unset($prev_session_ips);
}
//Mod_bmollet
/**
 * Get the category url
 * @param int $cat_id The id of the category
 * @param string $cat_url The current status of the URL
 */
function get_category_url($cat_id,$cat_url = '')
{
global $site_db;
$sql = "SELECT cat_name,cat_parent_id FROM ".CATEGORIES_TABLE." WHERE cat_id = '".$cat_id."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCÇDEFGĞHIİJKLMNOÖPQRSŞTUÜVWXYZğıçşü","eeeaeauoiaabccdefgghiijklmnoopqrsstuuvwxyzgicsu");
$cat_url  = '-'.str_replace('+','-',urlencode($row['cat_name'])).'-'.$cat_id.$cat_url;
// if you want full path of category in url, put next line in comment
return $cat_url;
if( $row['cat_parent_id'] != 0)
{
return get_category_url($row['cat_parent_id'],$cat_url);
}
else
{
return $cat_url;
}
}
//Mod_bmollet
/**
 * Get the image url
 * @param int $image_id The id of the image
 */
function get_image_url($image_id)
{
global $site_db;
$sql = "SELECT cat_id,image_name FROM ".IMAGES_TABLE." WHERE image_id = '".$image_id."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCÇDEFGĞHIİJKLMNOÖPQRSŞTUÜVWXYZğıçşü","eeeaeauoiaabccdefgghiijklmnoopqrsstuuvwxyzgicsu");
// if you want comlpete path to image in url, remove comment from following line
//return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
return '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
}
?>

.....................
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: didoman on April 23, 2011, 01:22:45 PM
I posted before to change the three letters "img" in the URL to something else.

Vano suggested to change a few lines in step 4 and it worked fine.

eg.
str_replace('details.php', 'img was replaced with str_replace('details.php', 'movie
And I also updated my .htaccess file as well to reflect the new word "movie"

This worked great and now all my URL's are working fine eg. www.example.com/movie-star-wars-333.htm

My problem is that in my traffic logs I am continually seeing "File Not Found" error for the old URL eg. www.example.com/img-star-wars-333.htm

Is there something else I should have changed.

I had the "img" url for about 1 month before I changed it, so I think most of the errors I am getting are coming from googlebot.

why is google still think I have that URL structure. I changed it back in October last year
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: didoman on May 05, 2011, 07:33:55 AM
just did a couple of hours searching and found this is just a stupid indexing method by Google.
a lot of people still have old crawl index errors too. some up to months of still having errors even though the links have been fixed.
you can remove them via google webmaster central in the remove link section.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: yousaf on June 03, 2011, 11:01:21 PM
@ V@no,

i used your optimized code for session.php and im extremely glad that with that help i reduced my server load to half. now i want to modify the permalink structure in .htaccess, i changed the structure on a demo site and it worked but i need help in one thing n that is Redirection of old permalink structure to the new one

right now i have this structure in .htaccess

RewriteRule ^img-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}

so when i change it to

RewriteRule ^Wallpaper-(.*)-([0-9]+)\.html$ details.php?image_id=$2&%{QUERY_STRING}

how do i redirect the old one to the new structure for Search engine bots and backlinks ? so if someone come from google's search result they go through the new structure instead of a finding a 404 error

regards
Yousaf
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sunl on June 27, 2011, 03:35:57 AM
Hello All Fellow Members

I have problem with related to this mode. You see i try facebook comment box to put in site but i am not able to figure out to get current page. Please help.

Code: [Select]
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:comments href="http://example.com" num_posts="2" width="500"></fb:comments>
What is the replacement code for (http://example.com) so i can get current page not main domain


Thanks
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Szooguun on June 30, 2011, 04:02:15 PM
I made this modification, but after a while I went back to standard. Google zaindeksowało new url. Now the question. How to do a 301 redirect to the standard URL:


cat.***.htm
on
categories.php?cat_id=

and

img.***.htm
on
details.php?image_id=

and

postcard.img***.htm
on
postcards.php?image_id=


Sorry for my English. Please help.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: yousaf on July 03, 2011, 10:56:05 PM
No Response coming from anywhere :( not even from author nor Mods
is everyone on Vacations?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sathishIPL on July 22, 2011, 11:45:50 AM
@ V@no,

i used your optimized code for session.php and im extremely glad that with that help i reduced my server load to half. now i want to modify the permalink structure in .htaccess, i changed the structure on a demo site and it worked but i need help in one thing n that is Redirection of old permalink structure to the new one

right now i have this structure in .htaccess

RewriteRule ^img-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}

so when i change it to

RewriteRule ^Wallpaper-(.*)-([0-9]+)\.html$ details.php?image_id=$2&%{QUERY_STRING}


how do i redirect the old one to the new structure for Search engine bots and backlinks ? so if someone come from google's search result they go through the new structure instead of a finding a 404 error

regards
Yousaf

open /include/sessions.php and replace the below code with the old one.  


I didnt test the code and i hope it will work for you

/* ORIGINAL CODE
  function url($url, $amp = "&amp;") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && !preg_match("/".SESSION_NAME."=/i", $url)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }
*/
  function url($url, $amp = "&amp;") {
    global $l, $user_info;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];
    $url = str_replace('&amp;', '&', $url);
    if (!defined('IN_CP')) {
      if (strstr($url, 'index.php')) {
        $url = str_replace('index.php', '', $url);
      }
      elseif (strstr($url, 'search.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('search.php', 'search.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('search.php', 'search.htm', $url);
        }
      }
      elseif (strstr($url, 'lightbox.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('lightbox.php', 'lightbox.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
                $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('lightbox.php', 'lightbox.htm', $url);
        }
      }
      elseif (strstr($url, 'categories.php')) {
        if (strstr($url, 'cat_id=') && strstr($url, 'page=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#page=([0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('categories.php', 'cat'.$matches1[1].'.'.$matches2[1].'.htm', $url);
            $query = str_replace('cat_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches1[1], '', $query);
            $query = str_replace('cat_id='.$matches1[1], '', $query);
            $query = str_replace('page='.$matches2[1].'&', '', $query);
            $query = str_replace('&page='.$matches2[1], '', $query);
            $query = str_replace('page='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        elseif (strstr($url, 'cat_id=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $cat_url = get_category_url($matches[1]);
            $url   = str_replace('categories.php', 'cat'.$cat_url.'.htm', $url);
            $query = str_replace('cat_id='.$matches[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches[1], '', $query);
            $query = str_replace('cat_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('categories.php', 'cat.htm', $url);
        }
      }
      elseif (strstr($url, 'details.php?image_id=')) {
        if (strstr($url, 'image_id=') && strstr($url, 'mode=')) {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#mode=([a-zA-Z0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'wallpaper'.$matches1[1].'.'.$matches2[1].'.html', $url);
            $query = str_replace('image_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches1[1], '', $query);
            $query = str_replace('image_id='.$matches1[1], '', $query);
            $query = str_replace('mode='.$matches2[1].'&', '', $query);
            $query = str_replace('&mode='.$matches2[1], '', $query);
            $query = str_replace('mode='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'Wallpaper'.get_image_url($matches[1]).'.html', $url);
            $query = str_replace('image_id='.$matches[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches[1], '', $query);
            $query = str_replace('image_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
      }
      elseif (strstr($url, 'postcards.php?image_id=')) {
        preg_match('#image_id=([0-9]+)&?#', $url, $matches);
        if (isset($matches[1])) {
          $split = explode('?', $url);
          $url = $split[0];
          $query = @$split[1];
          $url   = str_replace('postcards.php', 'postcard.img'.$matches[1].'.htm', $url);
          $query = str_replace('image_id='.$matches[1].'&', '', $query);
          $query = str_replace('&image_id='.$matches[1], '', $query);
          $query = str_replace('image_id='.$matches[1], '', $query);
          if (!empty($query)) {
            $url .= '?' . $query;
          }
        }
      }
    }
    if ($this->mode == "get" && strstr($url, $this->session_id)) {
      $url .= strpos($url, '?') !== false ? '&' : '?';
      $url .= SESSION_NAME."=".$this->session_id;
    }
    if (!empty($l)) {
      $url .= strpos($url, '?') ? '&' : '?';
      $url .= "l=".$l;
    }
    $url = str_replace('&', $amp, $url);
    $url .= isset($dummy_array[1]) ? "#".$dummy_array[1] : "";
    return $url;
  }




Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: yousaf on July 22, 2011, 12:33:43 PM
Sathish Thank you, i have done this already in Sessions.php but i need to redirect my indexed links to the new Permalink structure. so if someone is following the old link structure from search engines may ends up in the new one.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sathishIPL on July 22, 2011, 09:18:17 PM
Sathish Thank you, i have done this already in Sessions.php but i need to redirect my indexed links to the new Permalink structure. so if someone is following the old link structure from search engines may ends up in the new one.

hi redirect to permalink structure is possible but there is loads of manual work we have to do.for each dynamic link have redirect.

Google and other major search engines has introduced canonical tag to overcome the duplicate links.

i have done little modification for details page alone  and i hope it will help you.

i am a newbie to 4images and novice to PHP[i am just learning here]

copy the below code into session.php  before ?>

if($image_id>0)
{
$site_template->register_vars(array(
      "has_imageid"   => true,
      "domain" =>"<link rel=\"canonical\"  href=\"".$script_url."/wallpaper".get_image_url($image_id).".htm\">"
        ));
}


goto templates/yourtemplates/header.html and paste the below code between <head> </head>
{if has_imageid}
{domain}
{endif has_imageid}


Above changes will give you a URL Like <link rel="canonical" href= "http://www.yourdomain.com/wallpaper-someting-1.html">
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: rsmler on July 23, 2011, 01:19:25 AM
in the final version of this add-on brings the problem. can not log in admin panel. how do I solve this problem?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: jeyjoo on August 09, 2011, 11:29:39 AM
@Veno
I have this working now, so thanks for that.
I came across a problem where by the image names in URL are not correct (where a capital letter was used. It had something to do with the function below:

Quote
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");

For example in this URL http://www.jeyjoo.com/gallery/img-prench-fisherman-487.htm, the Capital "F" for France is actually replaced by a "p".

Anyway, now idea why, but I changed the order as below, and all is ok now:

Quote
$row['image_name'] = strtr($row['image_name'], "ABCDEFGHIJKLMNOPQRSTUVWXYZéèêàëâúóíá","abcdefghijklmnopqrstuvwxyzeeeaeauoia");



Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: jeyjoo on September 02, 2011, 11:02:48 PM
I have implemented this mod. What I would like is to add a canonical URL to my images for SEO purposes.

That I know of, each image in my gallery has 2 URLs depending on whether it came through search results or not. For example, the following URLs refer to the same image:

http://www.jeyjoo.com/gallery/img254.search.htm
http://www.jeyjoo.com/gallery/img-green-spider-on-red-strawberry-254.htm

To counter this I want to add a canonical URL in the head section of both pages, so esearch engines understand that it is effectively just 1 page:

<link rel="canonical" href="http://www.jeyjoo.com/gallery/img-green-spider-on-red-strawberry-254.htm" />

The canonical link is supported by Google, and tells a search engine which of the mutliple URLs to give importance to (link juice).

Much appreciated
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: jeyjoo on October 09, 2011, 04:18:52 PM
Sathish Thank you, i have done this already in Sessions.php but i need to redirect my indexed links to the new Permalink structure. so if someone is following the old link structure from search engines may ends up in the new one.

hi redirect to permalink structure is possible but there is loads of manual work we have to do.for each dynamic link have redirect.

Google and other major search engines has introduced canonical tag to overcome the duplicate links.

i have done little modification for details page alone  and i hope it will help you.

i am a newbie to 4images and novice to PHP[i am just learning here]

copy the below code into session.php  before ?>

if($image_id>0)
{
$site_template->register_vars(array(
      "has_imageid"   => true,
      "domain" =>"<link rel=\"canonical\"  href=\"".$script_url."/wallpaper".get_image_url($image_id).".htm\">"
        ));
}


goto templates/yourtemplates/header.html and paste the below code between <head> </head>
{if has_imageid}
{domain}
{endif has_imageid}


Above changes will give you a URL Like <link rel="canonical" href= "http://www.yourdomain.com/wallpaper-someting-1.html">

Perfect. Thats exactly what I was looking for.
Thanks
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: alekseyn1 on October 20, 2011, 11:18:06 AM
i am soory if I missed the solution to this problem, but it's been bothering me for a while...

I have a bridge installed 4images<->phpBB3 (http://www.4homepages.de/forum/index.php?topic=26013.msg159410#msg159410) and after login and logout, phpBB redirects me to the page where I have been when I clicked the submit button on the login form... I am positive that phpBB redirects correctly.

I then have a script that logs the user in/out:


// login/logout 4images user on phpBB session data
if($bbuser->data['user_id'] != ANONYMOUS && ($user_info['user_id'] == -1 || $user_info['user_name'] != $bbuser->data['username'])){

$user_exists = $site_sess->login($bbuser->data['username'], $bbuser->data['user_password'], 0, 1, false);

    if ($referer = $_SERVER['HTTP_REFERER']) {  //this was an attempt to fix my problem from this tipic - http://www.4homepages.de/forum/index.php?topic=22887.0
    redirect($referer);
}
  
    // if (!ereg("index.php", $url) && !ereg("login.php", $url) && !ereg("register.php", $url) && !ereg("member.php", $url)) {
      // redirect($url);
    // }
     else {
       redirect("index.php");
    }

}


I am still unable to make it work correctly.... I am being redirected to the index.php all the time no matter what I do... any ideas will be much appreciated...
v@no suggested  here  (http://www.4homepages.de/forum/index.php?topic=22950.msg126444#msg126444)that I'd post here since my issue could be related to this MOD...
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: khansahib on November 15, 2011, 10:24:53 PM
i'm trying to add the optimized code of vano but i'm getting this..

Cannot redeclare fixname()
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on November 16, 2011, 05:23:22 AM
just remove the fixname function from my code (make sure you match { and } brackets)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: khansahib on November 16, 2011, 03:36:05 PM
now,

Fatal error: Cannot redeclare get_category_url()

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on November 16, 2011, 05:06:51 PM
looks like you've installed this mod before...
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: khansahib on November 16, 2011, 05:52:09 PM
my session.php without your optimized code..
may be this would help in finding out wts wrong with my code

<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: sessions.php                                         *
 *        Copyright: (C) 2002-2011 Jan Sorgalla                           *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.10                                               *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
if (!defined('ROOT_PATH')) {
  die("Security violation");
}

//-----------------------------------------------------
//--- Start Configuration -----------------------------
//-----------------------------------------------------

define('SESSION_NAME', 'sessionid');

$user_table_fields = array(
  "user_id" => "user_id",
  "user_level" => "user_level",
  "user_name" => "user_name",
  "user_password" => "user_password",
  "user_email" => "user_email",
  "user_showemail" => "user_showemail",
  "user_allowemails" => "user_allowemails",
  "user_invisible" => "user_invisible",
  "user_joindate" => "user_joindate",
  "user_activationkey" => "user_activationkey",
  "user_lastaction" => "user_lastaction",
  "user_location" => "user_location",
  "user_lastvisit" => "user_lastvisit",
  "user_comments" => "user_comments",
  "user_homepage" => "user_homepage",
  "user_icq" => "user_icq"
);

//-----------------------------------------------------
//--- End Configuration -------------------------------
//-----------------------------------------------------

function get_user_table_field($add, $user_field) {
  global $user_table_fields;
  return (!empty($user_table_fields[$user_field])) ? $add.$user_table_fields[$user_field] : "";
}

class Session {

  var $session_id;
  var $session_key;
  var $user_ip;
  var $user_location;
  var $current_time;
  var $session_timeout;
  var $mode = "get";
  var $session_info = array();
  var $user_info = array();

  function Session() {
    global $config;
    $this->session_timeout = $config['session_timeout'] * 60;
    $this->user_ip = $this->get_user_ip();
    $this->user_location = $this->get_user_location();
    $this->current_time = time();

    if (defined('SESSION_KEY') && SESSION_KEY != '') {
        $this->session_key = SESSION_KEY;
    } else {
        $this->session_key = md5('4images' . realpath(ROOT_PATH));
    }

    // Stop adding SID to URLs
    @ini_set('session.use_trans_sid', 0);

    //@ini_set('session.cookie_lifetime', $this->session_timeout);

    session_name(urlencode(SESSION_NAME));
    @session_start();

    $this->demand_session();
  }

  function set_cookie_data($name, $value, $permanent = 1) {
    $cookie_expire = ($permanent) ? $this->current_time + 60 * 60 * 24 * 365 : 0;
    $cookie_name = COOKIE_NAME.$name;
    setcookie($cookie_name, $value, $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);
    $HTTP_COOKIE_VARS[$cookie_name] = $value;
  }

  function read_cookie_data($name) {
    global $HTTP_COOKIE_VARS;
    $cookie_name = COOKIE_NAME.$name;
    return (isset($HTTP_COOKIE_VARS[$cookie_name])) ? $HTTP_COOKIE_VARS[$cookie_name] : false;
  }

  function get_session_id() {
    if (SID == '') {
      $this->mode = "cookie";
    }

    if (preg_match('/[^a-z0-9]+/i', session_id())) {
      @session_regenerate_id();
    }

    $this->session_id = session_id();
  }

  function demand_session() {
    $this->get_session_id();
    if (!$this->load_session_info()) {
      $this->delete_old_sessions();
      $user_id = ($this->read_cookie_data("userid")) ? intval($this->read_cookie_data("userid")) : GUEST;
      $this->start_session($user_id);
    }
    else {
      $this->user_info = $this->load_user_info($this->session_info['session_user_id']);
      $update_cutoff = ($this->user_info['user_id'] != GUEST) ? $this->current_time - $this->user_info['user_lastaction'] : $this->current_time - $this->session_info['session_lastaction'];
      if ($update_cutoff > 60) {
        $this->update_session();
        $this->delete_old_sessions();
      }
    }
  }

  function start_session($user_id = GUEST, $login_process = 0) {
    global $site_db;

    $this->user_info = $this->load_user_info($user_id);
    if ($this->user_info['user_id'] != GUEST && !$login_process) {
      if (secure_compare($this->read_cookie_data("userpass"), md5($this->user_info['user_password'])) && $this->user_info['user_level'] > USER_AWAITING) {
        $this->set_cookie_data("userpass", $this->user_info['user_password']);
      }
      else {
        $this->set_cookie_data("userpass", "", 0);
        $this->user_info = $this->load_user_info(GUEST);
      }
    }

    //if (!$login_process) {
      $sql = "REPLACE INTO ".SESSIONS_TABLE."
              (session_id, session_user_id, session_lastaction, session_location, session_ip)
              VALUES
              ('".addslashes($this->session_id)."', ".$this->user_info['user_id'].", $this->current_time, '$this->user_location', '$this->user_ip')";
      $site_db->query($sql);
    //}

    $this->session_info['session_user_id'] = $this->user_info['user_id'];
    $this->session_info['session_lastaction'] = $this->current_time;
    $this->session_info['session_location'] = $this->user_location;
    $this->session_info['session_ip'] = $this->user_ip;

    if ($this->user_info['user_id'] != GUEST) {
      $this->user_info['user_lastvisit'] = (!empty($this->user_info['user_lastaction'])) ? $this->user_info['user_lastaction'] : $this->current_time;
      $sql = "UPDATE ".USERS_TABLE."
              SET ".get_user_table_field("", "user_lastaction")." = $this->current_time, ".get_user_table_field("", "user_location")." = '$this->user_location', ".get_user_table_field("", "user_lastvisit")." = ".$this->user_info['user_lastvisit']."
              WHERE ".get_user_table_field("", "user_id")." = ".$this->user_info['user_id'];
      $site_db->query($sql);
    }
    $this->set_cookie_data("lastvisit", $this->user_info['user_lastvisit']);
    $this->set_cookie_data("userid", $this->user_info['user_id']);
    return true;
  }

  function login($user_name = "", $user_password = "", $auto_login = 0, $set_auto_login = 1) {
    global $site_db, $user_table_fields;

    if (empty($user_name) || empty($user_password)) {
      return false;
    }
    $sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_password")."
            FROM ".USERS_TABLE."
            WHERE ".get_user_table_field("", "user_name")." = '$user_name' AND ".get_user_table_field("", "user_level")." <> ".USER_AWAITING;
    $row = $site_db->query_firstrow($sql);

    $user_id = (isset($row[$user_table_fields['user_id']])) ? $row[$user_table_fields['user_id']] : GUEST;
    if ($user_id != GUEST) {
      if (compare_passwords($user_password, $row[$user_table_fields['user_password']])) {
        $sql = "UPDATE ".SESSIONS_TABLE."
                SET session_user_id = $user_id
                WHERE session_id = '".addslashes($this->session_id)."'";
        $site_db->query($sql);
        if ($set_auto_login) {
          $this->set_cookie_data("userpass", ($auto_login) ? md5($row[$user_table_fields['user_password']]) : "");
        }
        $this->start_session($user_id, 1);
        return true;
      }
    }
    return false;
  }

  function logout($user_id) {
    global $site_db;
    $sql = "DELETE FROM ".SESSIONS_TABLE."
            WHERE session_id = '".addslashes($this->session_id)."' OR session_user_id = $user_id";
    $site_db->query($sql);
    $this->set_cookie_data("userpass", "", 0);
    $this->set_cookie_data("userid", GUEST);

    $this->session_info = array();

    return true;
  }

  function delete_old_sessions() {
    global $site_db;
    $expiry_time = $this->current_time - $this->session_timeout;
    $sql = "DELETE FROM ".SESSIONS_TABLE."
            WHERE session_lastaction < $expiry_time";
    $site_db->query($sql);

    return true;
  }

  function update_session() {
    global $site_db;

    $sql = "REPLACE INTO ".SESSIONS_TABLE."
           (session_id, session_user_id, session_lastaction, session_location, session_ip)
           VALUES
           ('".addslashes($this->session_id)."', ".$this->user_info['user_id'].", $this->current_time, '$this->user_location', '$this->user_ip')";
    $site_db->query($sql);

    $this->session_info['session_lastaction'] = $this->current_time;
    $this->session_info['session_location'] = $this->user_location;
    $this->session_info['session_ip'] = $this->user_ip;

    if ($this->user_info['user_id'] != GUEST) {
      $sql = "UPDATE ".USERS_TABLE."
              SET ".get_user_table_field("", "user_lastaction")." = $this->current_time, ".get_user_table_field("", "user_location")." = '$this->user_location'
              WHERE ".get_user_table_field("", "user_id")." = ".$this->user_info['user_id'];
      $site_db->query($sql);
    }
    return;
  }

  function return_session_info() {
    return $this->session_info;
  }

  function return_user_info() {
    return $this->user_info;
  }

  function freeze() {
    return;
  }

  function load_session_info() {
    $register_globals = strtolower(@ini_get('register_globals'));
    if ($register_globals && $register_globals != "off" && $register_globals != "false") {
      session_register($this->session_key);

      if (!isset($GLOBALS[$this->session_key])) {
        $GLOBALS[$this->session_key] = array();
      }

      $this->session_info = &$GLOBALS[$this->session_key];

    } else {
      if (isset($_SESSION)) {
        if (!isset($_SESSION[$this->session_key])) {
          $_SESSION[$this->session_key] = array();
        }

        $this->session_info = &$_SESSION[$this->session_key];

      } else {
        if (!isset($GLOBALS['HTTP_SESSION_VARS'][$this->session_key])) {
          $GLOBALS['HTTP_SESSION_VARS'][$this->session_key] = array();
        }

        $this->session_info = &$GLOBALS['HTTP_SESSION_VARS'][$this->session_key];
      }
    }

    if (!isset($this->session_info['session_ip'])) {
      $this->session_info = array();
      return false;
    }

    if ($this->mode == "get" && $this->session_info['session_ip'] != $this->user_ip) {
      if (function_exists('session_regenerate_id')) {
        @session_regenerate_id();
      }
      $this->get_session_id();
      $this->session_info = array();
      return false;
    }

    return $this->session_info;
  }

  function load_user_info($user_id = GUEST) {
    global $site_db, $user_table_fields, $additional_user_fields;

    if ($user_id != GUEST) {
      $sql = "SELECT u.*, l.*
              FROM ".USERS_TABLE." u, ".LIGHTBOXES_TABLE." l
              WHERE ".get_user_table_field("u.", "user_id")." = $user_id AND l.user_id = ".get_user_table_field("u.", "user_id");
      $user_info = $site_db->query_firstrow($sql);
      if (!$user_info) {
        $sql = "SELECT *
                FROM ".USERS_TABLE."
                WHERE ".get_user_table_field("", "user_id")." = $user_id";
        $user_info = $site_db->query_firstrow($sql);
        if ($user_info) {
          $lightbox_id = get_random_key(LIGHTBOXES_TABLE, "lightbox_id");
          $sql = "INSERT INTO ".LIGHTBOXES_TABLE."
                  (lightbox_id, user_id, lightbox_lastaction, lightbox_image_ids)
                  VALUES
                  ('$lightbox_id', ".$user_info[$user_table_fields['user_id']].", $this->current_time, '')";
          $site_db->query($sql);
          $user_info['lightbox_lastaction'] = $this->current_time;
          $user_info['lightbox_image_ids'] = "";
        }
      }
    }
    if (empty($user_info[$user_table_fields['user_id']])) {
      $user_info = array();
      $user_info['user_id'] = GUEST;
      $user_info['user_level'] = GUEST;
      $user_info['user_lastaction'] = $this->current_time;
      $user_info['user_lastvisit'] = ($this->read_cookie_data("lastvisit")) ? $this->read_cookie_data("lastvisit") : $this->current_time;
    }
    foreach ($user_table_fields as $key => $val) {
      if (isset($user_info[$val])) {
        $user_info[$key] = $user_info[$val];
      }
      elseif (!isset($user_info[$key])) {
        $user_info[$key] = "";
      }
    }
    foreach ($additional_user_fields as $key => $val)
    {
      if (!isset($user_info[$key]))
      {
        $user_info[$key] = "";
      }
    }
    return $user_info;
  }

  function set_session_var($var_name, $value) {
    $this->session_info[$var_name] = $value;
    return true;
  }

  function get_session_var($var_name) {
    if (isset($this->session_info[$var_name])) {
      return $this->session_info[$var_name];
    }

    return '';
  }

  function drop_session_var($var_name) {
    unset($this->session_info[$var_name]);
  }

  function get_user_ip() {
    global $HTTP_SERVER_VARS, $HTTP_ENV_VARS;
    $ip = (!empty($HTTP_SERVER_VARS['REMOTE_ADDR'])) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ((!empty($HTTP_ENV_VARS['REMOTE_ADDR'])) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv("REMOTE_ADDR"));
    $ip = preg_replace("/[^\.0-9]+/", "", $ip);
    return substr($ip, 0, 50);
  }

  function get_user_location() {
    global $self_url;
    return (defined("IN_CP")) ? "Control Panel" : preg_replace(array("/([?|&])action=[^?|&]*/", "/([?|&])mode=[^?|&]*/", "/([?|&])phpinfo=[^?|&]*/", "/([?|&])printstats=[^?|&]*/", "/[?|&]".URL_ID."=[^?|&]*/", "/[?|&]l=[^?|&]*/", "/[&?]+$/"), array("", "", "", "", "", "", ""), addslashes($self_url));
  }

 /* ORIGINAL CODE
  function url($url, $amp = "&amp;") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && !preg_match("/".SESSION_NAME."=/i", $url)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= preg_match("/\?/", $url) ? "$amp" : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }
*/
  function url($url, $amp = "&amp;") {
    global $l, $user_info;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];
    $url = str_replace('&amp;', '&', $url);
    if (!defined('IN_CP')) {
      if (strstr($url, 'index.php')) {
        $url = str_replace('index.php', '', $url);
      }
      elseif (strstr($url, 'search.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('search.php', 'search.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('search.php', 'search.htm', $url);
        }
      }
      elseif (strstr($url, 'lightbox.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('lightbox.php', 'lightbox.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
                $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('lightbox.php', 'lightbox.htm', $url);
        }
      }
      elseif (strstr($url, 'categories.php')) {
        if (strstr($url, 'cat_id=') && strstr($url, 'page=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#page=([0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $cat_url = get_category_url($matches1[1]);
            $url   = str_replace('categories.php', 'cat'.$cat_url.'.htm', $url);
            $query = str_replace('cat_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches1[1], '', $query);
            $query = str_replace('cat_id='.$matches1[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        elseif (strstr($url, 'cat_id=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $cat_url = get_category_url($matches[1]);
            $url   = str_replace('categories.php', 'cat'.$cat_url.'.htm', $url);
            $query = str_replace('cat_id='.$matches[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches[1], '', $query);
            $query = str_replace('cat_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('categories.php', 'cat.htm', $url);
        }
      }
      elseif (strstr($url, 'details.php?image_id=')) {
        if (strstr($url, 'image_id=') && strstr($url, 'mode=')) {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#mode=([a-zA-Z0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'app'.$matches1[1].'.'.$matches2[1].'.htm', $url);
            $query = str_replace('image_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches1[1], '', $query);
            $query = str_replace('image_id='.$matches1[1], '', $query);
            $query = str_replace('mode='.$matches2[1].'&', '', $query);
            $query = str_replace('&mode='.$matches2[1], '', $query);
            $query = str_replace('mode='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'app'.get_image_url($matches[1]).'.htm', $url);
            $query = str_replace('image_id='.$matches[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches[1], '', $query);
            $query = str_replace('image_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
      }
      elseif (strstr($url, 'postcards.php?image_id=')) {
        preg_match('#image_id=([0-9]+)&?#', $url, $matches);
        if (isset($matches[1])) {
          $split = explode('?', $url);
          $url = $split[0];
          $query = @$split[1];
          $url   = str_replace('postcards.php', 'postcard.img'.$matches[1].'.htm', $url);
          $query = str_replace('image_id='.$matches[1].'&', '', $query);
          $query = str_replace('&image_id='.$matches[1], '', $query);
          $query = str_replace('image_id='.$matches[1], '', $query);
          if (!empty($query)) {
            $url .= '?' . $query;
          }
        }
      }
    }
    if ($this->mode == "get" && strstr($url, $this->session_id)) {
      $url .= strpos($url, '?') !== false ? '&' : '?';
      $url .= SESSION_NAME."=".$this->session_id;
    }
    if (!empty($l)) {
      $url .= strpos($url, '?') ? '&' : '?';
      $url .= "l=".$l;
    }
    $url = str_replace('&', $amp, $url);
    $url .= isset($dummy_array[1]) ? "#".$dummy_array[1] : "";
    return $url;
  }

} //end of class

//-----------------------------------------------------
//--- Start Session -----------------------------------
//-----------------------------------------------------
define('COOKIE_NAME', '4images_');
define('COOKIE_PATH', '');
define('COOKIE_DOMAIN', '');
define('COOKIE_SECURE', '0');

$site_sess = new Session();

// Get Userinfo
$session_info = $site_sess->return_session_info();
$user_info = $site_sess->return_user_info();

//-----------------------------------------------------
//--- Get User Caches ---------------------------------
//-----------------------------------------------------
$num_total_online = 0;
$num_visible_online = 0;
$num_invisible_online = 0;
$num_registered_online = 0;
$num_guests_online = 0;
$user_online_list = "";
$prev_user_ids = array();
$prev_session_ips = array();

if (defined("GET_USER_ONLINE") && ($config['display_whosonline'] == 1 || $user_info['user_level'] == ADMIN)) {
  $time_out = time() - 300;
  $sql = "SELECT s.session_user_id, s.session_lastaction, s.session_ip".get_user_table_field(", u.", "user_id").get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_invisible")."
      FROM ".SESSIONS_TABLE." s
      LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = s.session_user_id)
      WHERE s.session_lastaction >= $time_out
      ORDER BY ".get_user_table_field("u.", "user_id")." ASC, s.session_ip ASC";
  $result = $site_db->query($sql);
  while ($row = $site_db->fetch_array($result)) {
    if ($row['session_user_id'] != GUEST && (isset($row[$user_table_fields['user_id']]) && $row[$user_table_fields['user_id']] != GUEST)) {
      if (!isset($prev_user_ids[$row['session_user_id']])) {
        $is_invisible = (isset($row[$user_table_fields['user_invisible']]) && $row[$user_table_fields['user_invisible']] == 1) ? 1 : 0;
        $invisibleuser = ($is_invisible) ? "*" : "";
        $username = (isset($row[$user_table_fields['user_level']]) && $row[$user_table_fields['user_level']] == ADMIN && $config['highlight_admin'] == 1) ? sprintf("<b>%s</b>", $row[$user_table_fields['user_name']]) : $row[$user_table_fields['user_name']];
        if (!$is_invisible || $user_info['user_level'] == ADMIN) {
          $user_online_list .= ($user_online_list != "") ? ", " : "";
          $user_profile_link = (!empty($url_show_profile)) ? str_replace("{user_id}", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];
          $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".str_replace(array("{", "}"), array("&#123;", "&#125;"), $username)."</a>".$invisibleuser;
        }
        (!$is_invisible) ? $num_visible_online++ : $num_invisible_online++;
        $num_registered_online++;
      }
      $prev_user_ids[$row['session_user_id']] = 1;
    }
    else {
      if (!isset($prev_session_ips[$row['session_ip']])) {
        $num_guests_online++;
      }
    }
    $prev_session_ips[$row['session_ip']] = 1;
  }
  $num_total_online = $num_registered_online + $num_guests_online;
  //$num_invisible_online = $num_registered_online - $num_visible_online;

  $site_template->register_vars(array(
    "num_total_online" => $num_total_online,
    "num_invisible_online" => $num_invisible_online,
    "num_registered_online" => $num_registered_online,
    "num_guests_online" => $num_guests_online,
    "user_online_list" => $user_online_list,
    "lang_user_online" => str_replace('{num_total_online}', $num_total_online, $lang['user_online']),
    "lang_user_online_detail" => str_replace(array('{num_registered_online}','{num_invisible_online}','{num_guests_online}'), array($num_registered_online,$num_invisible_online,$num_guests_online), $lang['user_online_detail']),
  ));
  $whos_online = $site_template->parse_template("whos_online");
  $site_template->register_vars("whos_online", $whos_online);
  unset($whos_online);
  unset($prev_user_ids);
  unset($prev_session_ips);
}
?>
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: V@no on November 16, 2011, 06:26:02 PM
perhaps conflict with other mod(s)? just exclude the functions from this code.

P.S. just for your future reference, when you referring to a code or other reply, make sure you provide a link to it. Also, when posting an error message, make sure you quote it exactly as it showed (you can change paths if you wish), complete message is more useful then "something like".
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: khansahib on November 16, 2011, 06:44:35 PM
Sorry will be careful next time..
i excluded the functions one by one and i'm left with none of the functions of your optimized code...

here are the errors
1.
Fatal error: Cannot redeclare fixname() in /home/xxxx/public_html/includes/sessions.php on line 678
2.
Fatal error: Cannot redeclare get_category_url() in /home/xxxx/public_html/includes/sessions.php on line 678
3.
Fatal error: Cannot redeclare get_image_url() in /home/xxxx/public_html/includes/sessions.php on line 678
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Gautxori on December 29, 2011, 01:58:35 PM
Hi everybody!

I have added this MOD to my page and works fine!

But when I try making a sitemap for google, p.e with http://www.pctimelimit.com/site_map_generator.html and others, generate errors an a lot of invalid and repeated URL.

The main url is https://viviendasprefabricadas.es and the directory with the 4images is https://viviendasprefabricadas.es. I try to generate a sitemap from all the domain (including url in viviendasprefabricadas.es and in viviendasprefabricadas.es/fotos).
My .htaccess is ubicated in http://www.viviendasprefabricadas.es . Some help, please?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Jan-Lukas on January 02, 2012, 05:53:17 PM
Voll 1.7.10 funktionstüchtig

LG und frohes neues Jahr
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Rembrandt on January 02, 2012, 07:34:21 PM
Hi!
Voll 1.7.10 funktionstüchtig

LG und frohes neues Jahr
Hast du alles nur aus dem ersten Post?

Wünsche dir auch alles Gute!

mfg Andi
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Jan-Lukas on January 02, 2012, 07:40:20 PM
Ja, nur daraus
LG

PS, habe nur gerade Probleme mit dem mms Mod, muss ich testen ob es daran liegt ?

LG
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Rembrandt on January 02, 2012, 07:41:57 PM
Danke für die Info!

Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Jan-Lukas on January 02, 2012, 07:56:31 PM
OK, mms geht jetzt auch, also das im ersten Posting klappt
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: cch on February 19, 2012, 01:55:20 AM
Hey guys

I've recently installed this mod but I need help with changing a few things:

How do I change this >> http://coverplanet.in/covers/cat-katy-b---on-a-mission-(2011)-675.htm
To this >> http://coverplanet.in/covers/katy-b-on-a-mission-2011-675.htm

These characters appear in the url >> ( ) : % << How do I remove them or stop them from appearing?

Thank you :)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sathishIPL on February 19, 2012, 07:17:17 AM
Hi ,

By using regex function, we can remove it


goto session.php in function get_image_url()

find
  $row['image_name'] = fixname($row['image_name']);

replace with below code.

  $row['image_name'] = preg_replace("#[-_'`´\^\$\(\)<>\"\|,@\?%~\+\.\[\]{}:\/=!§\\\\]+#s","-",fixname($row['image_name']));

it will replace ( with -

Hope it will helps you ..I didnt test it.   It's a 4images native regex
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: cch on February 19, 2012, 10:50:38 AM
Hi sathishIPL

That didn't work, after replacing with that piece of code do I need to change anything in the .htaccess?

Thanks
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sathishIPL on February 19, 2012, 11:15:03 AM
Hi,

No need to change anything in .htaccess.

Could you please attach your session.php file? 
I will have a look.

Br,
Satz
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: cch on February 19, 2012, 11:49:25 AM
Hi sathishIPL

See attached. Thank you
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sathishIPL on February 19, 2012, 12:10:21 PM
Hi

I have incorporated the changes in the attached session.php

Upload the session.php file into your includes folder.

For eg. i have given a Image name as    Love <><> (2012) and URL generated was  love----2012--97.htm

I have tested it in my local host.

It's working fine for me. Hope it will work for you as well

If still didn't work ,PM me .

br,
satz
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: cch on February 19, 2012, 12:14:47 PM
Hi sathishIPL

With the new sessions.php file added the urls are still the same :?:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: sathishIPL on February 19, 2012, 12:24:46 PM
Hi ,

I got it,  its my mistake.

By seeing your webpage i noticed that ,You are looking for category URL. I didnt change that one.
Download the attach file now. It will definetly work for you. 

Br,
satz
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: cch on February 19, 2012, 01:09:17 PM
Thank you sathishIPL

But I got help from a Webmaster forum and its working now :D
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Tahseen on February 23, 2012, 07:52:55 PM
i apply all setting of Best SEO Mod but still i have sessionid issue in my page

see my gallery below : xxx: xxx: pakheaven. org/ringtones/

here is my session page code

Quote
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: sessions.php                                         *
 *        Copyright: (C) 2002-2011 Jan Sorgalla                           *
 *            Email: jan@4homepages.de                                    *
 *              Web: xxx: xxx: 4homepages. de                             *
 *    Scriptversion: 1.7.10                                               *
 *                                                                        *
 *    Never released without support from: Nicky (xxx: xxx: nicky. net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
if (!defined('ROOT_PATH')) {
  die("Security violation");
}

//-----------------------------------------------------
//--- Start Configuration -----------------------------
//-----------------------------------------------------

define('SESSION_NAME', 'sessionid');

$user_table_fields = array(
  "user_id" => "user_id",
  "user_level" => "user_level",
  "user_name" => "user_name",
  "user_password" => "user_password",
  "user_email" => "user_email",
  "user_showemail" => "user_showemail",
  "user_allowemails" => "user_allowemails",
  "user_invisible" => "user_invisible",
  "user_joindate" => "user_joindate",
  "user_activationkey" => "user_activationkey",
  "user_lastaction" => "user_lastaction",
  "user_location" => "user_location",
  "user_lastvisit" => "user_lastvisit",
  "user_comments" => "user_comments",
  "user_homepage" => "user_homepage",
  "user_icq" => "user_icq"
);

//-----------------------------------------------------
//--- End Configuration -------------------------------
//-----------------------------------------------------

function get_user_table_field($add, $user_field) {
  global $user_table_fields;
  return (!empty($user_table_fields[$user_field])) ? $add.$user_table_fields[$user_field] : "";
}

class Session {

  var $session_id;
  var $session_key;
  var $user_ip;
  var $user_location;
  var $current_time;
  var $session_timeout;
  var $mode = "get";
  var $session_info = array();
  var $user_info = array();

  function Session() {
    global $config;
    $this->session_timeout = $config['session_timeout'] * 60;
    $this->user_ip = $this->get_user_ip();
    $this->user_location = $this->get_user_location();
    $this->current_time = time();

    if (defined('SESSION_KEY') && SESSION_KEY != '') {
        $this->session_key = SESSION_KEY;
    } else {
        $this->session_key = md5('4images' . realpath(ROOT_PATH));
    }

    // Stop adding SID to URLs
    @ini_set('session.use_trans_sid', 0);

    //@ini_set('session.cookie_lifetime', $this->session_timeout);

    session_name(urlencode(SESSION_NAME));
    @session_start();

    $this->demand_session();
  }

  function set_cookie_data($name, $value, $permanent = 1) {
    $cookie_expire = ($permanent) ? $this->current_time + 60 * 60 * 24 * 365 : 0;
    $cookie_name = COOKIE_NAME.$name;
    setcookie($cookie_name, $value, $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);
    $HTTP_COOKIE_VARS[$cookie_name] = $value;
  }

  function read_cookie_data($name) {
    global $HTTP_COOKIE_VARS;
    $cookie_name = COOKIE_NAME.$name;
    return (isset($HTTP_COOKIE_VARS[$cookie_name])) ? $HTTP_COOKIE_VARS[$cookie_name] : false;
  }

  function get_session_id() {
    if (SID == '') {
      $this->mode = "cookie";
    }

    if (preg_match('/[^a-z0-9]+/i', session_id())) {
      @session_regenerate_id();
    }

    $this->session_id = session_id();
  }

  function demand_session() {
    $this->get_session_id();
    if (!$this->load_session_info()) {
      $this->delete_old_sessions();
      $user_id = ($this->read_cookie_data("userid")) ? intval($this->read_cookie_data("userid")) : GUEST;
      $this->start_session($user_id);
    }
    else {
      $this->user_info = $this->load_user_info($this->session_info['session_user_id']);
      $update_cutoff = ($this->user_info['user_id'] != GUEST) ? $this->current_time - $this->user_info['user_lastaction'] : $this->current_time - $this->session_info['session_lastaction'];
      if ($update_cutoff > 60) {
        $this->update_session();
        $this->delete_old_sessions();
      }
    }
  }

  function start_session($user_id = GUEST, $login_process = 0) {
    global $site_db;

    $this->user_info = $this->load_user_info($user_id);
    if ($this->user_info['user_id'] != GUEST && !$login_process) {
      if (secure_compare($this->read_cookie_data("userpass"), md5($this->user_info['user_password'])) && $this->user_info['user_level'] > USER_AWAITING) {
        $this->set_cookie_data("userpass", $this->user_info['user_password']);
      }
      else {
        $this->set_cookie_data("userpass", "", 0);
        $this->user_info = $this->load_user_info(GUEST);
      }
    }

    //if (!$login_process) {
      $sql = "REPLACE INTO ".SESSIONS_TABLE."
              (session_id, session_user_id, session_lastaction, session_location, session_ip)
              VALUES
              ('".addslashes($this->session_id)."', ".$this->user_info['user_id'].", $this->current_time, '$this->user_location', '$this->user_ip')";
      $site_db->query($sql);
    //}

    $this->session_info['session_user_id'] = $this->user_info['user_id'];
    $this->session_info['session_lastaction'] = $this->current_time;
    $this->session_info['session_location'] = $this->user_location;
    $this->session_info['session_ip'] = $this->user_ip;

    if ($this->user_info['user_id'] != GUEST) {
      $this->user_info['user_lastvisit'] = (!empty($this->user_info['user_lastaction'])) ? $this->user_info['user_lastaction'] : $this->current_time;
      $sql = "UPDATE ".USERS_TABLE."
              SET ".get_user_table_field("", "user_lastaction")." = $this->current_time, ".get_user_table_field("", "user_location")." = '$this->user_location', ".get_user_table_field("", "user_lastvisit")." = ".$this->user_info['user_lastvisit']."
              WHERE ".get_user_table_field("", "user_id")." = ".$this->user_info['user_id'];
      $site_db->query($sql);
    }
    $this->set_cookie_data("lastvisit", $this->user_info['user_lastvisit']);
    $this->set_cookie_data("userid", $this->user_info['user_id']);
    return true;
  }

  function login($user_name = "", $user_password = "", $auto_login = 0, $set_auto_login = 1) {
    global $site_db, $user_table_fields;

    if (empty($user_name) || empty($user_password)) {
      return false;
    }
    $sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_password")."
            FROM ".USERS_TABLE."
            WHERE ".get_user_table_field("", "user_name")." = '$user_name' AND ".get_user_table_field("", "user_level")." <> ".USER_AWAITING;
    $row = $site_db->query_firstrow($sql);

    $user_id = (isset($row[$user_table_fields['user_id']])) ? $row[$user_table_fields['user_id']] : GUEST;
    if ($user_id != GUEST) {
      if (compare_passwords($user_password, $row[$user_table_fields['user_password']])) {
        $sql = "UPDATE ".SESSIONS_TABLE."
                SET session_user_id = $user_id
                WHERE session_id = '".addslashes($this->session_id)."'";
        $site_db->query($sql);
        if ($set_auto_login) {
          $this->set_cookie_data("userpass", ($auto_login) ? md5($row[$user_table_fields['user_password']]) : "");
        }
        $this->start_session($user_id, 1);
        return true;
      }
    }
    return false;
  }

  function logout($user_id) {
    global $site_db;
    $sql = "DELETE FROM ".SESSIONS_TABLE."
            WHERE session_id = '".addslashes($this->session_id)."' OR session_user_id = $user_id";
    $site_db->query($sql);
    $this->set_cookie_data("userpass", "", 0);
    $this->set_cookie_data("userid", GUEST);

    $this->session_info = array();

    return true;
  }

  function delete_old_sessions() {
    global $site_db;
    $expiry_time = $this->current_time - $this->session_timeout;
    $sql = "DELETE FROM ".SESSIONS_TABLE."
            WHERE session_lastaction < $expiry_time";
    $site_db->query($sql);

    return true;
  }

  function update_session() {
    global $site_db;

    $sql = "REPLACE INTO ".SESSIONS_TABLE."
           (session_id, session_user_id, session_lastaction, session_location, session_ip)
           VALUES
           ('".addslashes($this->session_id)."', ".$this->user_info['user_id'].", $this->current_time, '$this->user_location', '$this->user_ip')";
    $site_db->query($sql);

    $this->session_info['session_lastaction'] = $this->current_time;
    $this->session_info['session_location'] = $this->user_location;
    $this->session_info['session_ip'] = $this->user_ip;

    if ($this->user_info['user_id'] != GUEST) {
      $sql = "UPDATE ".USERS_TABLE."
              SET ".get_user_table_field("", "user_lastaction")." = $this->current_time, ".get_user_table_field("", "user_location")." = '$this->user_location'
              WHERE ".get_user_table_field("", "user_id")." = ".$this->user_info['user_id'];
      $site_db->query($sql);
    }
    return;
  }

  function return_session_info() {
    return $this->session_info;
  }

  function return_user_info() {
    return $this->user_info;
  }

  function freeze() {
    return;
  }

  function load_session_info() {
    $register_globals = strtolower(@ini_get('register_globals'));
    if ($register_globals && $register_globals != "off" && $register_globals != "false") {
      session_register($this->session_key);

      if (!isset($GLOBALS[$this->session_key])) {
        $GLOBALS[$this->session_key] = array();
      }

      $this->session_info = &$GLOBALS[$this->session_key];

    } else {
      if (isset($_SESSION)) {
        if (!isset($_SESSION[$this->session_key])) {
          $_SESSION[$this->session_key] = array();
        }

        $this->session_info = &$_SESSION[$this->session_key];

      } else {
        if (!isset($GLOBALS['HTTP_SESSION_VARS'][$this->session_key])) {
          $GLOBALS['HTTP_SESSION_VARS'][$this->session_key] = array();
        }

        $this->session_info = &$GLOBALS['HTTP_SESSION_VARS'][$this->session_key];
      }
    }

    if (!isset($this->session_info['session_ip'])) {
      $this->session_info = array();
      return false;
    }

    if ($this->mode == "get" && $this->session_info['session_ip'] != $this->user_ip) {
      if (function_exists('session_regenerate_id')) {
        @session_regenerate_id();
      }
      $this->get_session_id();
      $this->session_info = array();
      return false;
    }

    return $this->session_info;
  }

  function load_user_info($user_id = GUEST) {
    global $site_db, $user_table_fields, $additional_user_fields;

    if ($user_id != GUEST) {
      $sql = "SELECT u.*, l.*
              FROM ".USERS_TABLE." u, ".LIGHTBOXES_TABLE." l
              WHERE ".get_user_table_field("u.", "user_id")." = $user_id AND l.user_id = ".get_user_table_field("u.", "user_id");
      $user_info = $site_db->query_firstrow($sql);
      if (!$user_info) {
        $sql = "SELECT *
                FROM ".USERS_TABLE."
                WHERE ".get_user_table_field("", "user_id")." = $user_id";
        $user_info = $site_db->query_firstrow($sql);
        if ($user_info) {
          $lightbox_id = get_random_key(LIGHTBOXES_TABLE, "lightbox_id");
          $sql = "INSERT INTO ".LIGHTBOXES_TABLE."
                  (lightbox_id, user_id, lightbox_lastaction, lightbox_image_ids)
                  VALUES
                  ('$lightbox_id', ".$user_info[$user_table_fields['user_id']].", $this->current_time, '')";
          $site_db->query($sql);
          $user_info['lightbox_lastaction'] = $this->current_time;
          $user_info['lightbox_image_ids'] = "";
        }
      }
    }
    if (empty($user_info[$user_table_fields['user_id']])) {
      $user_info = array();
      $user_info['user_id'] = GUEST;
      $user_info['user_level'] = GUEST;
      $user_info['user_lastaction'] = $this->current_time;
      $user_info['user_lastvisit'] = ($this->read_cookie_data("lastvisit")) ? $this->read_cookie_data("lastvisit") : $this->current_time;
    }
    foreach ($user_table_fields as $key => $val) {
      if (isset($user_info[$val])) {
        $user_info[$key] = $user_info[$val];
      }
      elseif (!isset($user_info[$key])) {
        $user_info[$key] = "";
      }
    }
    foreach ($additional_user_fields as $key => $val)
    {
      if (!isset($user_info[$key]))
      {
        $user_info[$key] = "";
      }
    }
    return $user_info;
  }

  function set_session_var($var_name, $value) {
    $this->session_info[$var_name] = $value;
    return true;
  }

  function get_session_var($var_name) {
    if (isset($this->session_info[$var_name])) {
      return $this->session_info[$var_name];
    }

    return '';
  }

  function drop_session_var($var_name) {
    unset($this->session_info[$var_name]);
  }

  function get_user_ip() {
    global $HTTP_SERVER_VARS, $HTTP_ENV_VARS;
    $ip = (!empty($HTTP_SERVER_VARS['REMOTE_ADDR'])) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ((!empty($HTTP_ENV_VARS['REMOTE_ADDR'])) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv("REMOTE_ADDR"));
    $ip = preg_replace("/[^\.0-9]+/", "", $ip);
    return substr($ip, 0, 50);
  }

  function get_user_location() {
    global $self_url;
    return (defined("IN_CP")) ? "Control Panel" : preg_replace(array("/([?|&])action=[^?|&]*/", "/([?|&])mode=[^?|&]*/", "/([?|&])phpinfo=[^?|&]*/", "/([?|&])printstats=[^?|&]*/", "/[?|&]".URL_ID."=[^?|&]*/", "/[?|&]l=[^?|&]*/", "/[&?]+$/"), array("", "", "", "", "", "", ""), addslashes($self_url));
  }

  function url($url, $amp = "&amp;") {
    global $l, $user_info;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];
    $url = str_replace('&amp;', '&', $url);
    if (!defined('IN_CP')) {
      if (strstr($url, 'index.php')) {
        $url = str_replace('index.php', '', $url);
      }
      elseif (strstr($url, 'search.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('search.php', 'search.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('search.php', 'search.htm', $url);
        }
      }
      elseif (strstr($url, 'lightbox.php')) {
        if (strstr($url, 'page=')) {
          preg_match('#page=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('lightbox.php', 'lightbox.'.$matches[1].'.htm', $url);
            $query = str_replace('page='.$matches[1].'&', '', $query);
            $query = str_replace('&page='.$matches[1], '', $query);
            $query = str_replace('page='.$matches[1], '', $query);
            if (!empty($query)) {
                $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('lightbox.php', 'lightbox.htm', $url);
        }
      }
      elseif (strstr($url, 'categories.php')) {
        if (strstr($url, 'cat_id=') && strstr($url, 'page=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#page=([0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('categories.php', 'cat'.$matches1[1].'.'.$matches2[1].'.htm', $url);
            $query = str_replace('cat_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches1[1], '', $query);
            $query = str_replace('cat_id='.$matches1[1], '', $query);
            $query = str_replace('page='.$matches2[1].'&', '', $query);
            $query = str_replace('&page='.$matches2[1], '', $query);
            $query = str_replace('page='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        elseif (strstr($url, 'cat_id=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $cat_url = get_category_url($matches[1]);
            $url   = str_replace('categories.php', 'cat'.$cat_url.'.htm', $url);
            $query = str_replace('cat_id='.$matches[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches[1], '', $query);
            $query = str_replace('cat_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('categories.php', 'cat.htm', $url);
        }
      }
      elseif (strstr($url, 'details.php?image_id=')) {
        if (strstr($url, 'image_id=') && strstr($url, 'mode=')) {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches1);
          preg_match('#mode=([a-zA-Z0-9]+)&?#', $url, $matches2);
          if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'ringtone'.$matches1[1].'.'.$matches2[1].'.htm', $url);
            $query = str_replace('image_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches1[1], '', $query);
            $query = str_replace('image_id='.$matches1[1], '', $query);
            $query = str_replace('mode='.$matches2[1].'&', '', $query);
            $query = str_replace('&mode='.$matches2[1], '', $query);
            $query = str_replace('mode='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          preg_match('#image_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('details.php', 'ringtone'.get_image_url($matches[1]).'.htm', $url);
            $query = str_replace('image_id='.$matches[1].'&', '', $query);
            $query = str_replace('&image_id='.$matches[1], '', $query);
            $query = str_replace('image_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
      }
      elseif (strstr($url, 'postcards.php?image_id=')) {
        preg_match('#image_id=([0-9]+)&?#', $url, $matches);
        if (isset($matches[1])) {
          $split = explode('?', $url);
          $url = $split[0];
          $query = @$split[1];
          $url   = str_replace('postcards.php', 'postcard.img'.$matches[1].'.htm', $url);
          $query = str_replace('image_id='.$matches[1].'&', '', $query);
          $query = str_replace('&image_id='.$matches[1], '', $query);
          $query = str_replace('image_id='.$matches[1], '', $query);
          if (!empty($query)) {
            $url .= '?' . $query;
          }
        }
      }
    }
    if ($this->mode == "get" && strpos($url, $this->session_id) === false) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= "l=".$l;
    }

    $url = str_replace('&', $amp, $url);
    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }

//Mod_bmollet
/**
 * Get the category id
 * @param array $path An array with the path of the category
 * @param int $parent_id The parent id of the first item in the $path
 */
function get_category_id($path,$parent_id = 0)
{
   $cat_name = array_shift($path);
   global $site_db;
   $sql = "SELECT cat_id FROM ".CATEGORIES_TABLE." WHERE cat_parent_id = $parent_id AND cat_name = '".mysql_real_escape_string($cat_name)."'";
   $result = $site_db->query($sql);
   $row = $site_db->fetch_array($result);   
   if( count($path) != 0)
   {
      return get_category_id($path,$row['cat_id']);   
   }
   else
   {
      return $row['cat_id'];
   }
}
//Mod_bmollet
/**
 * Get the image id
 * @param array $path An array with the path of the image
 */
function get_image_id($path)
{
   global $site_db;
   $image_name = array_pop($path);
   $cat_id = get_category_id($path);
   $sql = "SELECT image_id FROM ".IMAGES_TABLE." WHERE image_name = '".mysql_real_escape_string($image_name)."' AND cat_id = $cat_id";
   $result = $site_db->query($sql);
   $row = $site_db->fetch_array($result);
   return $row['image_id'];
}
} //end of class

//-----------------------------------------------------
//--- Start Session -----------------------------------
//-----------------------------------------------------
define('COOKIE_NAME', '4images_');
define('COOKIE_PATH', '');
define('COOKIE_DOMAIN', '');
define('COOKIE_SECURE', '0');

$site_sess = new Session();

// Get Userinfo
$session_info = $site_sess->return_session_info();
$user_info = $site_sess->return_user_info();

//-----------------------------------------------------
//--- Get User Caches ---------------------------------
//-----------------------------------------------------
$num_total_online = 0;
$num_visible_online = 0;
$num_invisible_online = 0;
$num_registered_online = 0;
$num_guests_online = 0;
$user_online_list = "";
$prev_user_ids = array();
$prev_session_ips = array();

if (defined("GET_USER_ONLINE") && ($config['display_whosonline'] == 1 || $user_info['user_level'] == ADMIN)) {
  $time_out = time() - 300;
  $sql = "SELECT s.session_user_id, s.session_lastaction, s.session_ip".get_user_table_field(", u.", "user_id").get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_invisible")."
      FROM ".SESSIONS_TABLE." s
      LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = s.session_user_id)
      WHERE s.session_lastaction >= $time_out
      ORDER BY ".get_user_table_field("u.", "user_id")." ASC, s.session_ip ASC";
  $result = $site_db->query($sql);
  while ($row = $site_db->fetch_array($result)) {
    if ($row['session_user_id'] != GUEST && (isset($row[$user_table_fields['user_id']]) && $row[$user_table_fields['user_id']] != GUEST)) {
      if (!isset($prev_user_ids[$row['session_user_id']])) {
        $is_invisible = (isset($row[$user_table_fields['user_invisible']]) && $row[$user_table_fields['user_invisible']] == 1) ? 1 : 0;
        $invisibleuser = ($is_invisible) ? "*" : "";
        $username = (isset($row[$user_table_fields['user_level']]) && $row[$user_table_fields['user_level']] == ADMIN && $config['highlight_admin'] == 1) ? sprintf("<b>%s</b>", $row[$user_table_fields['user_name']]) : $row[$user_table_fields['user_name']];
        if (!$is_invisible || $user_info['user_level'] == ADMIN) {
          $user_online_list .= ($user_online_list != "") ? ", " : "";
          $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];
          $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".str_replace(array("{", "}"), array("&#123;", "&#125;"), $username)."</a>".$invisibleuser;
        }
        (!$is_invisible) ? $num_visible_online++ : $num_invisible_online++;
        $num_registered_online++;
      }
      $prev_user_ids[$row['session_user_id']] = 1;
    }
    else {
      if (!isset($prev_session_ips[$row['session_ip']])) {
        $num_guests_online++;
      }
    }
    $prev_session_ips[$row['session_ip']] = 1;
  }
  $num_total_online = $num_registered_online + $num_guests_online;
  //$num_invisible_online = $num_registered_online - $num_visible_online;

  $site_template->register_vars(array(
    "num_total_online" => $num_total_online,
    "num_invisible_online" => $num_invisible_online,
    "num_registered_online" => $num_registered_online,
    "num_guests_online" => $num_guests_online,
    "user_online_list" => $user_online_list,
    "lang_user_online" => str_replace('{num_total_online}', $num_total_online, $lang['user_online']),
    "lang_user_online_detail" => str_replace(array('{num_registered_online}','{num_invisible_online}','{num_guests_online}'), array($num_registered_online,$num_invisible_online,$num_guests_online), $lang['user_online_detail']),
  ));
  $whos_online = $site_template->parse_template("whos_online");
  $site_template->register_vars("whos_online", $whos_online);
  unset($whos_online);
  unset($prev_user_ids);
  unset($prev_session_ips);
}
//Mod_bmollet
/**
 * Get the category url
 * @param int $cat_id The id of the category
 * @param string $cat_url The current status of the URL
 */
function get_category_url($cat_id,$cat_url = '')
{
   global $site_db;
   $sql = "SELECT cat_name,cat_parent_id FROM ".CATEGORIES_TABLE." WHERE cat_id = '".$cat_id."'";
   $result = $site_db->query($sql);
   $row = $site_db->fetch_array($result);
   $row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
   $cat_url  = '-'.str_replace('+','-',urlencode($row['cat_name'])).'-'.$cat_id.$cat_url;
   // if you want full path of category in url, put next line in comment   
   return $cat_url;
   if( $row['cat_parent_id'] != 0)
   {
      return get_category_url($row['cat_parent_id'],$cat_url);   
   }
   else
   {
      return $cat_url;
   }
}
//Mod_bmollet
/**
 * Get the image url
 * @param int $image_id The id of the image
 */
function get_image_url($image_id)
{
   global $site_db;
   $sql = "SELECT cat_id,image_name FROM ".IMAGES_TABLE." WHERE image_id = '".$image_id."'";
   $result = $site_db->query($sql);
   $row = $site_db->fetch_array($result);
   $row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
   // if you want comlpete path to image in url, remove comment from following line
   //return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;   
   return '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
}
?>

my .htacess page code

Quote
RewriteEngine On

#RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+)\.htm$ categories.php?cat_id=$2&%{QUERY_STRING}
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^ringtone-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^ringtone([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}&mode=search
RewriteRule ^ringtone([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}&mode=lightbox

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}

please check this i want to remove session id link on my URL also guide me META SEO KEYWORDS & DESCRIPTION

thanks.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: jimraynor on March 31, 2012, 01:49:46 PM
after installation mod google frienly url to http://www.4homepages.de/forum/index.php?topic=17598.435

i cant login admin panel now.

i have to change my admin password from phpmyadmin each time when i want to login.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: wallward on May 04, 2012, 09:41:45 AM
Hi sathishIPL
good job Man :)
but after read all post I Confused and i do not now how apply this change  8O
if it possible please modify attach file for me
Is there a way to have url structure like this:
site.com/category-id/subcetogry-id/filename-id.htm

sorry for my bad English, and thank you for job
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: wallward on May 28, 2012, 09:12:00 AM
category drop down menu not working correctly,   :|
please check my site:
http://www.wallward.net  

how to fix it :(
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: ZHAKKAS.com on June 22, 2012, 08:40:55 AM
Helllo Sir,
     I have integrated the SEO module and it is working fine for me.

The module i have used is: http://www.4homepages.de/forum/index.php?topic=17598.0

Sir i need some changes in the url of Category and Images:

1) Currently It is showing Category url as: www(.)wallpapers.zhakkas(.)com/cat1.htm

I want it to be shown as: www(.)wallpapers.zhakkas(.)com/[categoryname].html

2) 1) Currently It is showing Image url as: www(.)wallpapers.zhakkas(.)com/img2474.htm

I want it to be shown as: www(.)wallpapers.zhakkas(.)com/[categoryname]/[imageid].html

So, please tell me what changes i should do in order it to work like above example i have given.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Naveen on July 09, 2012, 02:22:26 PM
Hi,

I am currently using the other SEO mod which has category and images as    /cat1.htm and /img1234.htm

I am planning to move to this mod with the new 4images update.

My concerns are

1) How do I 301 redirect old urls (ca1.htm / img1234.htm) to new urls
2) How can I have all images into another structure/folder (/images/image-name-id.htm) and keep categories in root.

This is the current htaccess

Code: [Select]
# Begin search engine friendly links code
RewriteEngine On
#RewriteBase /
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}

RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}

RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
RewriteRule ^cat([0-9]+)\.([0-9]+)\.htm$ categories.php?cat_id=$1&page=$2&%{QUERY_STRING}
RewriteRule ^cat([0-9]+)\.htm$ categories.php?cat_id=$1&%{QUERY_STRING}

RewriteRule ^img([0-9]+)\.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.([a-zA-Z0-9]+)\.htm$ details.php?image_id=$1&mode=$2&%{QUERY_STRING}

RewriteRule ^postcard([a-zA-Z0-9]+)\.htm$ postcards.php?postcard_id=$1&%{QUERY_STRING}
RewriteRule ^postcard\.img([0-9]+)\.htm$ postcards.php?image_id=$1&%{QUERY_STRING}

# End search engine friendly links code
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Naveen on September 03, 2012, 09:06:18 PM
Anyone to help with the above? It's been a while and I'm still trying to find ways.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: silent-art on October 19, 2012, 03:58:14 PM
Super Mod :-) "Thank You" gegeben :)

gibt ein paar kleinere probleme damit:

in .htaccess werden noch erweiterungen benötigt damit alles läuft!
z.B damit dass "Bilder Sortieren nach" funktioniert wenn man nicht auf der ersten seite in einer kategorie ist:
Code: [Select]
RewriteRule ^cat([0-9]+)\.([0-9]+)\.htm$ categories.php?cat_id=$1&page=$2&%{QUERY_STRING}

PS: ich werde weitere probleme hier mitteilen, falls ich noch welche auffinden sollte..
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: relu on November 15, 2012, 04:07:37 AM
vano's update rocks. fixed my queries from 2014 for index to 76...thanks for topic & solutions... allways i find my answers on forum and i use hard the 4image script from 3-4 years. Server load,lots of queries was my main issue for years. Thanks again.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: yellows on November 21, 2012, 01:48:29 PM
last few days had a few probs with this mod

basically scroll over an images and shows links as

http://www.sexymalecelebs.co.uk/Galeries/img-danny-kent---14-30363.htm

which is the way it should be

then click on link and loads as

http://www.sexymalecelebs.co.uk/Galeries/index.php?image_id=30471

which is not correct, so just reloads the homepage

Any ideas?

J x
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: malwin23 on December 24, 2012, 03:49:24 PM
Hello guys.

I need help, can someone help me to fix that Module with:

[MOD] Pfeile als Overlay auf Bild (arrows as overlay on picture)

http://www.4homepages.de/forum/index.php?topic=31028.0 (http://www.4homepages.de/forum/index.php?topic=31028.0)

That Module is using function $prev... and $next... image_name, image_url, image_file, thumb_file from categories.php file.

After i do arrow navigation it is giving me: www.yourwebsite.com/%C2%A0

My .htaccess file is:

RewriteEngine On

#RewriteBase /

RewriteRule ^cat-(.*)-([0-9]+)\.htm$ categories.php?cat_id=$2&%{QUERY_STRING}
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^next_image_url-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}

Please HELP!

Thank You:)
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Szooguun on September 19, 2013, 03:33:27 PM
Welcome. Sorry for my English. Mod works great.

However, Google have hundreds of thousands of indexed pages in standard format: / details.php? Image_id =, / categories.php? Image_id =, etc. Is there a way that the original links lead to new urls? I do not want to block the old urls in robots.txt and the new index the entire page.

The second problem is to edit the name of the photo or category.

We have, for example, an image with the name "Test"

Change the name of the photo on: test2

I now work earlier link: / img-test-123.htm and in addition there is another link: / img-test2-123.htm

For Google, it will appear as a copy. What to do to address / img-test-123.htm was redirected to the new address / img-test2-123.htm?

And the same question about the category after the name change.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Szooguun on October 09, 2013, 03:28:49 PM
Nobody is able to help me? Please help!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: bergblume on December 04, 2013, 09:04:22 AM
Since we are on optimizing rage today, little more optimized nic_bck's version:

Code: [Select]
function fixname($text)
{
  return strtolower(strtr(
    $text,
     array(
      "é" => "e",
      "è" => "e",
      "ê" => "e",
      "à" => "a",
      "ë" => "e",
      "â" => "a",
      "ú" => "a",
      "ó" => "o",
      "í" => "i",
      "á" => "a",

      //russian UTF8 encoded alphabet (lower and upper cases)
      "&#1040;" => "a",
      "&#1072;" => "a",
      "&#1041;" => "b",
      "&#1073;" => "b",
      "&#1042;" => "v",
      "&#1074;" => "v",
      "&#1043;" => "g",
      "&#1075;" => "g",
      "&#1044;" => "d",
      "&#1076;" => "d",
      "&#1045;" => "e",
      "&#1077;" => "e",
      "&#1025;" => "yo",
      "&#1105;" => "yo",
      "&#1046;" => "zh",
      "&#1078;" => "zh",
      "&#1047;" => "z",
      "&#1079;" => "z",
      "&#1048;" => "i",
      "&#1080;" => "i",
      "&#1049;" => "j",
      "&#1081;" => "j",
      "&#1050;" => "k",
      "&#1082;" => "k",
      "&#1051;" => "l",
      "&#1083;" => "l",
      "&#1052;" => "m",
      "&#1084;" => "m",
      "&#1053;" => "n",
      "&#1085;" => "n",
      "&#1054;" => "o",
      "&#1086;" => "o",
      "&#1055;" => "p",
      "&#1087;" => "p",
      "&#1056;" => "r",
      "&#1088;" => "r",
      "&#1057;" => "s",
      "&#1089;" => "s",
      "&#1058;" => "t",
      "&#1090;" => "t",
      "&#1059;" => "u",
      "&#1091;" => "u",
      "&#1060;" => "f",
      "&#1092;" => "f",
      "&#1061;" => "h",
      "&#1093;" => "h",
      "&#1062;" => "c",
      "&#1094;" => "c",
      "&#1063;" => "ch",
      "&#1095;" => "ch",
      "&#1064;" => "sh",
      "&#1096;" => "sh",
      "&#1065;" => "sch",
      "&#1097;" => "sch",
      "&#1066;" => "",
      "&#1098;" => "",
      "&#1067;" => "i",
      "&#1099;" => "i",
      "&#1068;" => "'",
      "&#1100;" => "'",
      "&#1069;" => "e",
      "&#1101;" => "e",
      "&#1070;" => "yu",
      "&#1102;" => "yu",
      "&#1071;" => "ya",
      "&#1103;" => "ya",
  )));
}
function get_category_url($cat_id,$cat_url = '')
{
  global $site_db, $cat_cache;
  static $urlname = array(); //cache names in this array
  if (isset($urlname[$cat_id]))
    return $urlname[$cat_id];
  if (!empty($cat_cache))
  {
    $row['cat_name'] = @$cat_cache[$cat_id]['cat_name'];
    $row['cat_parent_id'] = @$cat_cache[$cat_id]['cat_parent_id'];
  }
  else
  {
    $sql = "SELECT cat_name,cat_parent_id FROM ".CATEGORIES_TABLE." WHERE cat_id = '".$cat_id."'";
    $row = $site_db->query_firstrow($sql);
  }
  $row['cat_name'] = fixname($row['cat_name']);
  $cat_url  = '-'.str_replace('+','-',urlencode($row['cat_name'])).'-'.$cat_id.$cat_url;
  // if you want full path of category in url, put next line in comment
  $row['cat_parent_id'] = 0;
  if($row['cat_parent_id'] != 0)
  {
    $urlname[$cat_id] = get_category_url($row['cat_parent_id'],$cat_url);
  }
  else
  {
    $urlname[$cat_id] = $cat_url;
  }
  return $urlname[$cat_id];
}
//Mod_bmollet
/**
 * Get the image url
 * @param int $image_id The id of the image
 */
function get_image_url($image_id)
{
  global $site_db;
  static $urlname = array(); //cache names in this array
  if (isset($urlname[$image_id]))
    return $urlname[$image_id];
 
  $sql = "SELECT cat_id,image_name FROM ".IMAGES_TABLE." WHERE image_id = '".$image_id."'";
  $row = $site_db->query_firstrow($sql);
  $row['image_name'] = fixname($row['image_name']);
  // if you want comlpete path to image in url, remove comment from following line
  //$urlname[$image_id] = get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id; 
  $urlname[$image_id] = '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
  return $urlname[$image_id];
}


Results:

index.php
Original
Code: [Select]
Page generated in 0.109686 seconds with 36 queries, spending 0.059000 seconds doing MySQL queries and 0.050686 doing PHP things. GZIP compression disabledOptimized
Code: [Select]
Page generated in 0.095068 seconds with 11 queries, spending 0.059000 seconds doing MySQL queries and 0.036068 doing PHP things. GZIP compression disabled
categories.php (30 images per page)
Original:
Code: [Select]
Page generated in 0.227558 seconds with 195 queries, spending 0.051000 seconds doing MySQL queries and 0.176558 doing PHP things. GZIP compression disabledOptimized:
Code: [Select]
Page generated in 0.179981 seconds with 37 queries, spending 0.050000 seconds doing MySQL queries and 0.129981 doing PHP things. GZIP compression disabled
details.php
Original
Code: [Select]
Page generated in 0.219341 seconds with 22 queries, spending 0.110000 seconds doing MySQL queries and 0.109341 doing PHP things. GZIP compression disabledOptimized
Code: [Select]
Page generated in 0.060998 seconds with 14 queries, spending 0.028000 seconds doing MySQL queries and 0.032998 doing PHP things. GZIP compression disabled

Many thanks V@no for this great optimization'!!'  :thumbup:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: wallward on February 19, 2014, 10:31:05 AM
How remove at, with, in, to from url
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: wflorian on February 20, 2014, 09:58:54 PM
hi guys.

i have problems getting the mod working for some special polish characters which are UTF8. sadly there seems no really easy working solution yet :(

i am trying to add a character like "ł" (&#38;#322;) to the sessions.php:


//Mod_bmollet
/**
 * Get the category url
 * @param int $cat_id The id of the category
 * @param string $cat_url The current status of the URL
 */
function fixname($text)
{
  return strtolower(strtr(
    $text,
     array(
      "é" => "e",
      "ł" => "l",


after the insertion of the character "ł" i have to save the file as UTF8. after this the replacing of the sepcial characters at all does not work anymore for the google friendly URLs.

Is there no possible work around to solve this issue? I would be willing to pay for some working help! :(

looking forward to somebody who can help!
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: nameless on June 09, 2014, 03:06:53 PM
I need some help

i have the cat name in Arabic lang
I'm using 4image 1.7.11

so the URL is like this
http://www.arabmobile.mobi/sklans/cat-%C7%CE%C8%C7%D1-%C7%E1%E3%E6%C8%C7%ED%E1-%E6%C7%E1%CA%DF%E4%E6%E1%E6%CC%ED%C7-1.htm
how can i make it in arabic like this
http://www.arabmobile.mobi/sklans/cat-اخبار الموبايل والتكنولوجيا.htm

thanks
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: twiter on September 22, 2014, 09:37:21 PM
I have a huge problem my oldest website.,
I saw this problem on webmaster tools and it gives me over 2000 not found page error.
One of them is :
http://www.citypictures.org/r-europe-148-spain-228-alcazar-castle-segovia-spain2844.htmttp://www.citypictures.org/postcard.img4343.htm


If you look carefull you can see end of the link problem.
When I click on the webmaster tools link which url gives this url
it shows me this page

http://www.citypictures.org/r-europe-148-spain-228-alcazar-castle-segovia-spain2844.htmttp://www.citypictures.org/r-middle-mast-149-united-arab-emirates-172-dubai-14-dubai-skyscrapers2-4343.htm

i click on this url and it seems a page like without css.


My . htaccess file is:


RewriteEngine On
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^postcard([a-zA-Z0-9]+)\.htm$ postcards.php?postcard_id=$1&%{QUERY_STRING}
RewriteRule ^postcard\.img([0-9]+)\.htm$ postcards.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^k-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}
RewriteRule ^r-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^r([0-9]+).search.htm details.php?image_id=$1&%{QUERY_STRING}
I cant fix this.
Please help me asap.
Thank you.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: twiter on September 24, 2014, 10:54:38 AM
77 views and no reply?
Is there any mods in here?
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Szooguun on June 15, 2015, 02:04:46 PM
How to make a 301 redirect in .htaccess old addresses to the new?

example:
old: /categories.php?cat_id=1
new: /cat-test-1.htm

old: /details.php?image_id=1
new: /img-test-1.htm

Please help.


I was able to do so far "incomplete" 301 redirect in PHP. The file categories.php added at the beginning:

if (strpos($_SERVER['REQUEST_URI'], 'cat_id') !== FALSE) {
header('HTTP/1.1 301 Moved Permanently');
header('Location: cat-'.$_GET['cat_name'].'-'.$_GET['cat_id'].'.htm');
exit;
}

But I do not know how to download the MYSQL database category name ['cat_name'] - Help
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: wflorian on July 10, 2015, 03:23:30 PM
Hello folks!

The SEO friendly URLs are great, but I discovered a majored bug, which can lead to NON-Google friendly behaviour because of so called duplicate content!  :!:

Fore example, a category with the following URL:

http://www.somename.com/cat-test-2.htm

-----

Can also be opened like this:

http://www.somename.com/cat-test8472874234dgdfjgdhkjghdkghf-2.htm

or like this:

http://www.somename.com/cat-different-1.html/cat-test-2.htm
(this one even makes all other internal links on the website uncorrect, because of realtive internal linking)

-----

Both URLs DO NOT lead to a 404, which is critically because Google can index those URLs, and this generates duplicate content, harming the rankings for the actual URL.

Is anybody aware of this bug?
Does anybody has an idea of a bugfix?

Really looking forward to some discussion because of this.....

Thanks!!

Best,
Florian
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: FairyCosmo on December 19, 2015, 09:02:57 PM
Don't even try it. This Mod is dead.. Like the whole community  :evil:
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: IndoX on January 01, 2016, 07:55:19 PM
As of 1.7.13 this mod is no longer working.
Title: Re: [MOD] Google Friendly Urls For 4images Best Seo Mod
Post by: Szooguun on October 24, 2018, 11:06:21 PM
Hi. Has anyone modified this mod and it works correctly on version 1.7.13? I would like to change the links to SEO Friendly however this mod contains many bugs.