/** * @version $Id: sef.php 6024 2006-12-18 22:30:07Z friesengeist $ * @package Joomla * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ // no direct access defined( '_VALID_MOS' ) or die( 'Restricted access' ); if ($mosConfig_sef) { $url_array = explode('/', $_SERVER['REQUEST_URI']); if (in_array('content', $url_array)) { /** * Content * http://www.domain.com/$option/$task/$sectionid/$id/$Itemid/$limit/$limitstart */ $uri = explode('content/', $_SERVER['REQUEST_URI']); $option = 'com_content'; $_GET['option'] = $option; $_REQUEST['option'] = $option; $pos = array_search ('content', $url_array); // language hook for content $lang = ''; foreach($url_array as $key=>$value) { if ( !strcasecmp(substr($value,0,5),'lang,') ) { $temp = explode(',', $value); if (isset($temp[0]) && $temp[0] != '' && isset($temp[1]) && $temp[1] != '') { $_GET['lang'] = $temp[1]; $_REQUEST['lang'] = $temp[1]; $lang = $temp[1]; } unset($url_array[$key]); } } if (isset($url_array[$pos+8]) && $url_array[$pos+8] != '' && in_array('category', $url_array) && ( strpos( $url_array[$pos+5], 'order,' ) !== false ) && ( strpos( $url_array[$pos+6], 'filter,' ) !== false ) ) { // $option/$task/$sectionid/$id/$Itemid/$order/$filter/$limit/$limitstart $task = $url_array[$pos+1]; $sectionid = $url_array[$pos+2]; $id = $url_array[$pos+3]; $Itemid = $url_array[$pos+4]; $order = str_replace( 'order,', '', $url_array[$pos+5] ); $filter = str_replace( 'filter,', '', $url_array[$pos+6] ); $limit = $url_array[$pos+7]; $limitstart = $url_array[$pos+8]; // pass data onto global variables $_GET['task'] = $task; $_REQUEST['task'] = $task; $_GET['sectionid'] = $sectionid; $_REQUEST['sectionid'] = $sectionid; $_GET['id'] = $id; $_REQUEST['id'] = $id; $_GET['Itemid'] = $Itemid; $_REQUEST['Itemid'] = $Itemid; $_GET['order'] = $order; $_REQUEST['order'] = $order; $_GET['filter'] = $filter; $_REQUEST['filter'] = $filter; $_GET['limit'] = $limit; $_REQUEST['limit'] = $limit; $_GET['limitstart'] = $limitstart; $_REQUEST['limitstart'] = $limitstart; $QUERY_STRING = "option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid&order=$order&filter=$filter&limit=$limit&limitstart=$limitstart"; } else if (isset($url_array[$pos+7]) && $url_array[$pos+7] != '' && $url_array[$pos+5] > 1000 && ( in_array('archivecategory', $url_array) || in_array('archivesection', $url_array) ) ) { // $option/$task/$id/$limit/$limitstart/year/month/module $task = $url_array[$pos+1]; $id = $url_array[$pos+2]; $limit = $url_array[$pos+3]; $limitstart = $url_array[$pos+4]; $year = $url_array[$pos+5]; $month = $url_array[$pos+6]; $module = $url_array[$pos+7]; // pass data onto global variables $_GET['task'] = $task; $_REQUEST['task'] = $task; $_GET['id'] = $id; $_REQUEST['id'] = $id; $_GET['limit'] = $limit; $_REQUEST['limit'] = $limit; $_GET['limitstart'] = $limitstart; $_REQUEST['limitstart'] = $limitstart; $_GET['year'] = $year; $_REQUEST['year'] = $year; $_GET['month'] = $month; $_REQUEST['month'] = $month; $_GET['module'] = $module; $_REQUEST['module'] = $module; $QUERY_STRING = "option=com_content&task=$task&id=$id&limit=$limit&limitstart=$limitstart&year=$year&month=$month&module=$module"; } else if (isset($url_array[$pos+7]) && $url_array[$pos+7] != '' && $url_array[$pos+6] > 1000 && ( in_array('archivecategory', $url_array) || in_array('archivesection', $url_array) ) ) { // $option/$task/$id/$Itemid/$limit/$limitstart/year/month $task = $url_array[$pos+1]; $id = $url_array[$pos+2]; $Itemid = $url_array[$pos+3]; $limit = $url_array[$pos+4]; $limitstart = $url_array[$pos+5]; $year = $url_array[$pos+6]; $month = $url_array[$pos+7]; // pass data onto global variables $_GET['task'] = $task; $_REQUEST['task'] = $task; $_GET['id'] = $id; $_REQUEST['id'] = $id; $_GET['Itemid'] = $Itemid; $_REQUEST['Itemid'] = $Itemid; $_GET['limit'] = $limit; $_REQUEST['limit'] = $limit; $_GET['limitstart'] = $limitstart; $_REQUEST['limitstart'] = $limitstart; $_GET['year'] = $year; $_REQUEST['year'] = $year; $_GET['month'] = $month; $_REQUEST['month'] = $month; $QUERY_STRING = "option=com_content&task=$task&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart&year=$year&month=$month"; } else if (isset($url_array[$pos+7]) && $url_array[$pos+7] != '' && in_array('category', $url_array) && ( strpos( $url_array[$pos+5], 'order,' ) !== false )) { // $option/$task/$sectionid/$id/$Itemid/$order/$limit/$limitstart $task = $url_array[$pos+1]; $sectionid = $url_array[$pos+2]; $id = $url_array[$pos+3]; $Itemid = $url_array[$pos+4]; $order = str_replace( 'order,', '', $url_array[$pos+5] ); $limit = $url_array[$pos+6]; $limitstart = $url_array[$pos+7]; // pass data onto global variables $_GET['task'] = $task; $_REQUEST['task'] = $task; $_GET['sectionid'] = $sectionid; $_REQUEST['sectionid'] = $sectionid; $_GET['id'] = $id; $_REQUEST['id'] = $id; $_GET['Itemid'] = $Itemid; $_REQUEST['Itemid'] = $Itemid; $_GET['order'] = $order; $_REQUEST['order'] = $order; $_GET['limit'] = $limit; $_REQUEST['limit'] = $limit; $_GET['limitstart'] = $limitstart; $_REQUEST['limitstart'] = $limitstart; $QUERY_STRING = "option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid&order=$order&limit=$limit&limitstart=$limitstart"; } else if (isset($url_array[$pos+6]) && $url_array[$pos+6] != '') { // $option/$task/$sectionid/$id/$Itemid/$limit/$limitstart $task = $url_array[$pos+1]; $sectionid = $url_array[$pos+2]; $id = $url_array[$pos+3]; $Itemid = $url_array[$pos+4]; $limit = $url_array[$pos+5]; $limitstart = $url_array[$pos+6]; // pass data onto global variables $_GET['task'] = $task; $_REQUEST['task'] = $task; $_GET['sectionid'] = $sectionid; $_REQUEST['sectionid'] = $sectionid; $_GET['id'] = $id; $_REQUEST['id'] = $id; $_GET['Itemid'] = $Itemid; $_REQUEST['Itemid'] = $Itemid; $_GET['limit'] = $limit; $_REQUEST['limit'] = $limit; $_GET['limitstart'] = $limitstart; $_REQUEST['limitstart'] = $limitstart; $QUERY_STRING = "option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart"; } else if (isset($url_array[$pos+5]) && $url_array[$pos+5] != '') { // $option/$task/$id/$Itemid/$limit/$limitstart $task = $url_array[$pos+1]; $id = $url_array[$pos+2]; $Itemid = $url_array[$pos+3]; $limit = $url_array[$pos+4]; $limitstart = $url_array[$pos+5]; // pass data onto global variables $_GET['task'] = $task; $_REQUEST['task'] = $ta