4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
July 24, 2014, 12:39:53 PM

Login with username, password and session length
Search:     Advanced search
Check the new Tutorial subforum with helpfull guides and tutorials for modifications and tweaks.
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support) (Moderators: mawenzi, Rembrandt)
| | |-+  [MOD] Google Friendly Urls For 4images Best Seo Mod
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: «« « 1 ... 27 28 29 30 [31] 32 » »» Print
Current Topic Rating: *****
Author Topic: [MOD] Google Friendly Urls For 4images Best Seo Mod  (Read 311658 times)
sathishIPL
Jr. Member
**
Offline Offline

Posts: 54

Thank You
-Given: 1
-Receive: 18


View Profile
« Reply #450 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

* sessions.php (29.54 KB - downloaded 19 times.)
Logged
cch
Jr. Member
**
Offline Offline

Posts: 95

Thank You
-Given: 2
-Receive: 0


View Profile
« Reply #451 on: February 19, 2012, 12:14:47 PM »

Hi sathishIPL

With the new sessions.php file added the urls are still the same Question
Logged
sathishIPL
Jr. Member
**
Offline Offline

Posts: 54

Thank You
-Given: 1
-Receive: 18


View Profile
« Reply #452 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

* sessions.php (29.72 KB - downloaded 31 times.)
Logged
cch
Jr. Member
**
Offline Offline

Posts: 95

Thank You
-Given: 2
-Receive: 0


View Profile
« Reply #453 on: February 19, 2012, 01:09:17 PM »

Thank you sathishIPL

But I got help from a Webmaster forum and its working now Very Happy
Logged
Tahseen
Pre-Newbie

Offline Offline

Posts: 1

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #454 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  [Expand]
<?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) fr 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  [Expand]
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.
Logged
jimraynor
Jr. Member
**
Offline Offline

Posts: 53

Thank You
-Given: 12
-Receive: 1


View Profile
« Reply #455 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.
Logged
wallward
Jr. Member
**
Offline Offline

Posts: 52

Thank You
-Given: 273
-Receive: 0


View Profile
« Reply #456 on: May 04, 2012, 09:41:45 AM »

Hi sathishIPL
good job Man Smile
but after read all post I Confused and i do not now how apply this change  Shocked
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

* sessions.zip (4.74 KB - downloaded 0 times.)
Logged

wallward
Jr. Member
**
Offline Offline

Posts: 52

Thank You
-Given: 273
-Receive: 0


View Profile
« Reply #457 on: May 28, 2012, 09:12:00 AM »

category drop down menu not working correctly,   Neutral
please check my site:
http://www.wallward.net  

how to fix it Sad
« Last Edit: May 28, 2012, 09:38:09 AM by wallward » Logged

ZHAKKAS.com
Pre-Newbie

Offline Offline

Posts: 7

Thank You
-Given: 0
-Receive: 1


View Profile WWW
« Reply #458 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.
Logged
Naveen
Newbie
*
Offline Offline

Posts: 43

Thank You
-Given: 1
-Receive: 0


View Profile
« Reply #459 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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 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
« Last Edit: July 09, 2012, 07:53:08 PM by Naveen » Logged
Naveen
Newbie
*
Offline Offline

Posts: 43

Thank You
-Given: 1
-Receive: 0


View Profile
« Reply #460 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.
Logged
silent-art
Newbie
*
Offline Offline

Posts: 39

Thank You
-Given: 6
-Receive: 0


View Profile
« Reply #461 on: October 19, 2012, 03:58:14 PM »

Super Mod Smile "Thank You" gegeben Smile

gibt ein paar kleinere probleme damit:

in .htaccess werden noch erweiterungen bentigt damit alles luft!
z.B damit dass "Bilder Sortieren nach" funktioniert wenn man nicht auf der ersten seite in einer kategorie ist:
1
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..
Logged
relu
Newbie
*
Offline Offline

Posts: 44

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #462 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.
Logged

yellows
Newbie
*
Offline Offline

Posts: 39

Thank You
-Given: 1
-Receive: 0


View Profile
« Reply #463 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
Logged
malwin23
Newbie
*
Offline Offline

Posts: 10

Thank You
-Given: 1
-Receive: 0


View Profile
« Reply #464 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

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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
RewriteEngine On 

#RewriteBase /

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

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

Please HELP!

Thank You:)
Logged
Pages: «« « 1 ... 27 28 29 30 [31] 32 » »» Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.184 seconds with 20 queries.