Skocz do zawartości

mambo + 404 sef


AQQry

Rekomendowane odpowiedzi

nie chce mi sie analizować całego dodatku , ale najprościej możesz sobie ustawić pojedyncze adresy na sztywno w tym dodatku.

Przestałem olewać Skuteczne SEO . Zanim zapytasz gugla naucz się zadawać pytania ....

Moja  fotografia kulinarna  :D Jak Ciebie robią w ..... Wuja dowiesz się na seoinfo.edu.pl, Fu*k Google ......Ask me .... 

Odnośnik do komentarza
Udostępnij na innych stronach

W panelu administracyjnym komponentu 404sef wybierasz tam, gdzie masz wszystkie adresy stworzone przez 404sef, wybierasz ten, który chcesz zmienić, edytujesz go wpisując zamiast "-" "l" i zapisujesz :D

Bardzo płatny katalog stron oparty na WordPressie.


Naukowo o kulturystyce i fitness w serwisie FitnessLab.pl.

Odnośnik do komentarza
Udostępnij na innych stronach

10 000 roznych linkow bedzie trodno recznie zmienic...

troche pozmienialem sobie grzebiac w bazie danych i zmieniajac wszsytko za 1razem... ale nastepne linki powstaja... i co zawsze to samo mam robic :-)

Pozdrawiam, (-;

www.topposition.pl - Top Position

tp468x60_banerrr.png

Odnośnik do komentarza
Udostępnij na innych stronach

  • 2 tygodnie później...

ok wracajac do tematu....

oto 2 pliki z tego komponentu

<?php
/*
* @version $Id: sef.php,v 1.15 2004/11/14 16:00:11 m2k Exp $
* @package Mambo_4.5.1
* @copyright (C) 2004 - 2004 W.H.Welch
* @license https://www.gnu.org/copyleft/gpl.html GNU/GPL
* Mambo is Free Software
*/

/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

if ($mosConfig_sef) {

// load the config data
$sef_config_class = $mosConfig_absolute_path."/administrator/components/com_sef/sef.class.php";
$sef_config_file = $mosConfig_absolute_path."/administrator/components/com_sef/config.sef.php";
require_once($sef_config_class);
$sefconfig = new SEF_config;

$index = str_replace($mosConfig_live_site,"",$_SERVER['PHP_SELF']);
$base = dirname($index);
if ($base =="\\") $base = "/";
$base .= (($base == "/") ? "" :"/");
$index = basename($index);

// Hack for IIS -- Please note I have only tested on IIS 5.0 on W2K
if (!(strpos($_SERVER['SERVER_SOFTWARE'],"Microsoft-IIS") === false)) {
	if (!empty($_SERVER['QUERY_STRING'])){
		$REQUEST_URI = preg_replace("/^[0-9]+\;/","",$_SERVER['QUERY_STRING']);
		$REQUEST_URI = str_replace($mosConfig_live_site,"",$REQUEST_URI);
		$REQUEST_URI = preg_replace("/:[0-9]+/","",$REQUEST_URI);
		$REQUEST_URI = preg_replace("/^\//","",$REQUEST_URI);
	}else{
		$REQUEST_URI = $index;
	}
	$_SERVER['REQUEST_URI'] = $REQUEST_URI;
}
if ($sefconfig->Enabled) {
	include($mosConfig_absolute_path."/components/com_sef/sef404.php");
}else{
	include($mosConfig_absolute_path."/includes/sef.php");
}
}else{
function sefRelToAbs( $string ) {
	return $string;
}
}
?>

i 2 plik

<?php

/*

* @version $Id: sef404.php,v 1.6 2004/11/19 05:18:24 m2k Exp $

* @package Mambo_4.5.1

* @copyright (C) 2004 - 2004 W.H.Welch

* @license https://www.gnu.org/copyleft/gpl.html GNU/GPL

* Mambo is Free Software

*/

/*

* The database is compatible with Redirection_Manager on mamboforge, but requires the following change

* ALTER TABLE `mos_redirection` CHANGE `newurl` `newurl` VARCHAR( 150 ) NOT NULL

*/

/** ensure this file is being included by a parent file */

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

$debug = 0;

// Hack in mos database as required

if( !is_object( @$database ) )

$database = new database( $mosConfig_host, $mosConfig_user, $mosConfig_password, $mosConfig_db, $mosConfig_dbprefix );

if ( $debug) {

echo "INDEX=$index:BASE=$base:<br>";

echo $_SERVER['REQUEST_URI']."<br>";

die($_SERVER['QUERY_STRING']);

}

if (!(eregi("index[0-9]*.php",$_SERVER['REQUEST_URI']))) {

switch ($_SERVER['REQUEST_URI']) {

case $index:

case $base:

break;

case "":

die("Something strange has occured. This should not happen");

default:

$SRU = $_SERVER['REQUEST_URI'];

if (process_uri()){

// needed to enable pathway

$QUERY_STRING = end(explode("?",$_SERVER['REQUEST_URI']));

$REQUEST_URI = $_SERVER['REQUEST_URI'];

if (preg_match("/option=([a-zA-Z_]+)/",$QUERY_STRING,$matches)) {

$option=$matches[1];

$_GET['option'] = $_REQUEST['option'] = $option;

}

unset($matches);

//echo "REQUEST_URI=$REQUEST_URI:<br>QUERY_STRING=$QUERY_STRING:<br>OPTION=$option:<br>KEYS:";

// Extract to globals

while(list($key,$value)=each($_GET)){

// echo "<br>$key=$value:";

$GLOBALS[$key]=$value;

}

// Don't allow config vars to be passed as global

include( "configuration.php" );

header('HTTP/1.0 200 OK');

}else{

header('HTTP/1.0 404 NOT FOUND');

// bad URL, so check to see if we've seen it before

$query = "SELECT * FROM #__redirection WHERE oldurl = '".$SRU."'";

$database->setQuery($query);

$results=$database->loadObjectList();

if ($results){

// we have, so update counter

$database->setQuery("UPDATE #__redirection SET cpt=(cpt+1) WHERE oldurl = '".$SRU."'");

$database->query();

}else{

// record the bad URL

$query = 'INSERT INTO `#__redirection` ( `cpt` , `oldurl` , `newurl` , `dateadd` ) '

. ' VALUES ( \'1\', \''.$SRU.'\', \'\', CURDATE() );'

. ' ';

$database->setQuery($query);

$database->query();

}

// redirect to the error page

// You MUST create a static content page with the title 404 for this to work properly

$mosmsg = "FILE NOT FOUND: ".$SRU;

$_GET['mosmsg'] = $_REQUEST['mosmsg'] = $mosmsg;

$option="com_content";

$task="view";

if ($sefconfig->page404 == "0") {

$sql='SELECT id FROM #__content WHERE `title`="404"';

$database->setQuery( $sql );

if ($id = $database->loadResult()){

$Itemid = $id;

$_SERVER['QUERY_STRING'] = "option=com_content&task=view&id=$id&Itemid=$id";

$_SERVER['REQUEST_URI'] = $mosConfig_live_site."/index.php?".$_SERVER['QUERY_STRING'];

$_GET['option'] = $_REQUEST['option'] = $option;

$_GET['task'] = $_REQUEST['task'] = $task;

$_GET['Itemid'] = $_REQUEST['Itemid'] = $Itemid;

$_GET['id'] = $_REQUEST['id'] = $id;

}else{

die("<h1>404: Not Found</h1><h4>Sorry, but the content you requested could not be found</h4>".$mosmsg."<br>URI:".$_SERVER['REQUEST_URI']);

}

}else{

$id = $Itemid = $sefconfig->page404;

$_SERVER['QUERY_STRING'] = "option=com_content&task=view&id=$id&Itemid=$id";

$_SERVER['REQUEST_URI'] = $mosConfig_live_site."/index.php?".$_SERVER['QUERY_STRING'];

$_GET['option'] = $_REQUEST['option'] = $option;

$_GET['task'] = $_REQUEST['task'] = $task;

$_GET['Itemid'] = $_REQUEST['Itemid'] = $Itemid;

$_GET['id'] = $_REQUEST['id'] = $id;

}

} //end bad url

} //end swtich

}// check for index[0-9]*.php

//die("<br>".$_SERVER['REQUEST_URI']);

//////////////////////////

// FUNCTIONS

//////////////////////////

function process_uri(){

GLOBAL $database, $sefconfig, $mosConfig_live_site, $base;

GLOBAL $_GET, $_REQUEST, $_SERVER;

$state = false;

$debug=0;

//compenstate for mambo in subdir

if ($base !=="/")

$req = str_replace($base,"",$_SERVER['REQUEST_URI']);

else

$req = substr($_SERVER['REQUEST_URI'],1);

// is there a named anchor attached to the URL, strip it and save for later.

$namedanchor = end(split("\#", $req));

if ($namedanchor != $req )

$req = str_replace("#".$namedanchor,"",$req);

else

$namedanchor = '';

//is there data attached to the URI, strip it and save for later.

$datastring =end(split("\?",$req));

if ($datastring != $req )

$req = str_replace("?".$datastring,"",$req);

else

$datastring='';

// die("REQ=$req:<br>QUERYSTRING=$datastring:<br>NAMEDANCHOR=$namedanchor:");

$uri = explode("/", $req);

// print_r($uri);

// die($_SERVER['REQUEST_URI']);

if ((!(strpos($uri[0],"com_") === false)) or ($uri[0] == "component")){

//this is an old style or noncached SEF url for a component

if ($uri[0] != "component") $uri[0] = "option,".$uri[0];

$QUERY_STRING = "";

foreach($uri as $value) {

$temp = explode(",", $value);

if (isset($temp[0]) && $temp[0]!="" && isset($temp[1]) && $temp[1]!="") {

$_GET[$temp[0]] = $_REQUEST[$temp[0]] = $temp[1];

$QUERY_STRING .= $temp[0]=="option" ? "$temp[0]=$temp[1]" : "&$temp[0]=$temp[1]";

}

}

if (is_valid_component($_GET['option'])){

$state = true;

$_SERVER['QUERY_STRING'] = $QUERY_STRING . ((!empty($datastring)) ? "&".$datastring : "" ).((!empty($namedanchor)) ? "#".$namedanchor : "" );

$REQUEST_URI = $mosConfig_live_site."/index.php?".$QUERY_STRING;

$_SERVER['REQUEST_URI'] = $REQUEST_URI;

}

//die($_SERVER['REQUEST_URI']);

}elseif($uri[0] == 'content'){

//this is an old style SEF url for content

$option = "com_content";

$_GET['option'] = $_REQUEST['option'] = $option;

$url_array = explode("&",$uri[1]);

$pos = array_search ("content", $uri);

$c=count(array_filter($uri)) - strval($pos);

//echo "<pre>URI:";

//print_r($uri);

//print("POS=$pos:C=$c:");

switch ($c){

//$option/$task/$sectionid/$id/$Itemid/$limit/$limitstart

case 7:

$task = $uri[$pos+1];

$sectionid = $uri[$pos+2];

$id = $uri[$pos+3];

$Itemid = $uri[$pos+4];

$limit = $uri[$pos+5];

$limitstart = $uri[$pos+6];

break;

// $option/$task/$id/$Itemid/$limit/$limitstart

case 6:

$task = $uri[$pos+1];

$id = $uri[$pos+2];

$Itemid = $uri[$pos+3];

$limit = $uri[$pos+4];

$limitstart = $uri[$pos+5];

break;

// $option/$task/$sectionid/$id/$Itemid

case 5:

$task = $uri[$pos+1];

$sectionid = $uri[$pos+2];

$id = $uri[$pos+3];

$Itemid = $uri[$pos+4];

break;

// $option/$task/$id/$Itemid

case 4:

$task = $uri[$pos+1];

$id = $uri[$pos+2];

$Itemid = $uri[$pos+3];

break;

// $option/$task/$id

case 3:

$task = $uri[$pos+1];

$id = $uri[$pos+2];

break;

// $option/$task

case 2:

$task = $uri[$pos+1];

}

//$QUERY_STRING = "option=com_content&task=$task&sectionid=$sectionid&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart";

$_GET['task'] = $task;

$_REQUEST['task'] = $task;

$QUERY_STRING = "option=com_content&task=$task";

if (@$sectionid) {

$_GET['sectionid'] = $_REQUEST['sectionid'] = $sectionid;

$QUERY_STRING .= "&sectionid=$sectionid";

}

if (@$id) {

$_GET['id'] = $_REQUEST['id'] = $id;

$QUERY_STRING .= "&id=$id";

}

if (@$Itemid) {

$_GET['Itemid'] = $_REQUEST['Itemid'] = $Itemid;

$QUERY_STRING .= "&Itemid=$Itemid";

}

if (@$limit) {

$_GET['limit'] = $_REQUEST['limit'] = $limit;

$_GET['limitstart'] = $_REQUEST['limitstart'] = $limitstart;

$QUERY_STRING .= "&limit=$limit&limitstart=$limitstart";

}

$QUERY_STRING .= ((!empty($datastring)) ? "&".$datastring : "" ).((!empty($namedanchor)) ? "#".$namedanchor : "" );

// validate to see if content exists

$title=getContentTitles($task,$id);

//die(count($title));

if (count($title) === 0) {

$state = false;

}else{

//content exists so we create a new style url for it and redirect them

if ((@$_GET['task'] == "view") && isset($sefconfig->suffix)) {

// throw the suffix on the last item

if ($sefconfig->suffix == "/") {

$title[] = "/";

}else{

$title[count($title)-1] .= $sefconfig->suffix;

}

}

array_walk($title, "titleToLocation");

$location = str_replace("//","/",implode("/",$title));

$location = str_replace("//","/",str_replace("/".$sefconfig->replacement,"/",$location));

//die("LOC:$location");

mosRedirect($mosConfig_live_site."/".$location);

}

}elseif(($uri[0] == $sefconfig->simpleboard) && (count($uri)>2) &&

((strpos(end($uri),"showcat") === false)

and (strpos(end($uri),"flat") === false)

and (strpos(end($uri),"threaded") === false))){

if ($debug) echo "$req<br>";

$req = $uri[0]."/".$uri[1]."/showcat";

if ($debug) {

echo "$req<pre>";

print_r($uri);

}

$sql="SELECT oldurl, newurl FROM #__redirection".

" WHERE oldurl".

" LIKE '%".$req."%'".

" LIMIT 1";

//die($sql);

$database->setQuery($sql);

if ($database->loadObject($row)) {

// use the cached url

$string = $row->newurl;

$sefstring='';

$temp = split("\?", $string);

if (isset($temp[1])) {

$temp2 = split("\&", $temp[1]);

foreach($temp2 as $key => $value) {

$temp = explode("=", $value);

if (isset($temp[0]) && $temp[0]!="" && isset($temp[1]) && $temp[1]!="") {

$var[$temp[0]] = $temp[1];

$sefstring .= $value."/";

}

}

}

$string = str_replace( '=', ',', $sefstring );

$string = preg_replace("/func,([a-zA-Z]+)/","func,".$uri[2],$string);

if (is_numeric($uri[3])) {

$string .= "id,".$uri[3]."/";

}else{

$string .= "do,".$uri[3]."/".((($uri[3] == "reply")|($uri[3] == "quote")) ?"replyto,".$uri[4]."/" :"id,".$uri[4]."/");

}

}else{

die("SQL=$sql:<br>FATAL ERROR RETRIEVING SIMPLEBOARD URL");

}

$uri = explode("/", $string);

$QUERY_STRING = "";

foreach($uri as $value) {

$temp = explode(",", $value);

if (isset($temp[0]) && $temp[0]!="" && isset($temp[1]) && $temp[1]!="") {

$_GET[$temp[0]] = $_REQUEST[$temp[0]] = $temp[1];

$QUERY_STRING .= $temp[0]=="option" ? "$temp[0]=$temp[1]" : "&$temp[0]=$temp[1]";

}

}

if ($debug) {

echo "STRING=$string:<br>";

echo "QUERY_STRING=$QUERY_STRING:<br>";

print_r($_GET);

die("Processing Simpleboard");

}

return true;

}else{

// must be one of our new style SEF urls

$sql="SELECT oldurl, newurl FROM #__redirection".

" WHERE oldurl".

" LIKE '".$req."'".

" LIMIT 1";

//die($sql);

$database->setQuery($sql);

if ($database->loadObject($row)) {

// use the cached url

$string = $row->newurl;

// update the count

$database->setQuery("UPDATE #__redirection SET cpt=(cpt+1) WHERE `newurl` LIKE '".$row->newurl."'");

$database->query();

$string = str_replace( '&', '&', $string );

$string = str_replace( '&', '&', $string );

$uri = explode("?",$string);

if (isset($uri[1])) {

if ($debug) {

echo "<pre>URI:";

print_r($uri);

}

$url_array = explode("&",$uri[1]);

if ($debug) {

echo "<br>URL";

print_r($url_array);

}

foreach($url_array as $value) {

$temp = explode("=", $value);

if (isset($temp[0]) && $temp[0]!="" && isset($temp[1]) && $temp[1]!="") {

$_GET[$temp[0]] = $_REQUEST[$temp[0]] = $temp[1];

}

}

if ($debug) {

echo "<br>GET:";

print_r($_GET);

echo "<br>REQ:";

print_r($_REQUEST);

}

$_SERVER['QUERY_STRING'] = $uri[1]. ((!empty($datastring)) ? "&".$datastring : "" ).((!empty($namedanchor)) ? "#".$namedanchor : "" );

}else{

return false;

}

$_SERVER['REQUEST_URI'] = $mosConfig_live_site."/".$string . ((!empty($datastring)) ? "&".$datastring : "" ).((!empty($namedanchor)) ? "#".$namedanchor : "" );

unset($uri);

unset($url_array);

//die();

return true;

}

}

if ($debug) {

echo "<pre>GET:";

print_r($_GET);

echo "<pre>";

die($_SERVER['REQUEST_URI']);

}

return $state;

}

function sefRelToAbs( $string ) {

GLOBAL $mosConfig_absolute_path, $mosConfig_live_site, $sefconfig, $database;

$var=array();

// $skip = $sefconfig->skip;

// $chkrefer = $sefconfig->chkrefer;

$debug=0;

if ((!strcasecmp(substr($string,0,9),"index.php"))

&& !eregi("^(([^:/?#]+):)",$string)

&& !eregi("this\.options\[selectedIndex\]\.value",$string) ) {

// Replace all & with &

$string = str_replace( '&', '&', $string );

$string = str_replace( '&', '&', $string );

/*

Home

index.php

*/

$index = str_replace($mosConfig_live_site,"",$_SERVER['PHP_SELF']);

$base = dirname($index);

$base .= (($base == "/") ? "" :"/");

$index = basename($index);

if ($debug) echo "INDEX=$index:BASE=$base:";

if (($string==$index) or ($string==$base)) {

return $index;

}

// is there a named anchor attached to the URL, strip it and save for later.

$namedanchor = end(split("\#", $string));

if ($namedanchor != $string )

$string = str_replace("#".$namedanchor,"",$string);

else

$namedanchor = '';

$sefstring = '';

if ($debug) echo "STRING=$string:<br>";

$temp = split("\?", $string);

if (isset($temp[1])) {

$temp2 = split("&", $temp[1]);

foreach($temp2 as $key => $value) {

$temp = explode("=", $value);

if (isset($temp[0]) && $temp[0]!="" && isset($temp[1]) && $temp[1]!="") {

$var[$temp[0]] = $temp[1];

$sefstring .= $value."/";

}

}

}

$sefstring = str_replace( '=', ',', $sefstring );

$sefstring = str_replace( 'option,', '', $sefstring );

$sefstring .= ((!empty($namedanchor)) ? "#".$namedanchor : "" );

if ($debug) {

echo "<pre>";

print_r($var);

echo "</pre>";

}

extract($var,EXTR_REFS);

if ( (@$task != "new") && (@$task != "edit") && isset($option)) {

switch ($option) {

case (in_array($option,$sefconfig->skip)):

break;

case (in_array($option,$sefconfig->nocache)):

$string = $sefstring;

break;

case 'com_banners':

break;

case 'content' :

case 'com_content' :

switch ($task) {

case 'archivecategory':

case 'archivesection' :

if (eregi($task.".*id=".$id,$_SERVER['REQUEST_URI'])) break;

default:

$title = getContentTitles($task,$id);

if (count($title) === 0) $title = getMenuTitle($option,$task,$Itemid);

if ((@$task == "view") && isset($sefconfig->suffix)) {

// throw the suffix on the last item

if ($sefconfig->suffix == "/") {

&n

Pozdrawiam, (-;

www.topposition.pl - Top Position

tp468x60_banerrr.png

Odnośnik do komentarza
Udostępnij na innych stronach

tez z tym miałem problem, ale dalem rade

plik : sef404.php

i ta linijka kodu odpwoiada za zamiane

// remove accented characters

$title = strtr($title, "©¦®±¶µĄˇµŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖŘŮÚŰÜÝßŕáâăäĺćçčéęëěíîďđńňóôőöřůúűüý˙łŁ±ˇżŻĄ¬ęĘćĆóÓńѶ¦", "SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyylLaAzZzZeEcCoOnNsS");

tylko cos tu sie poknocilo z kodowanie znaków

ale ogolnie to polega na tym ze

$title = strtr($title, "śćą","sca")

i wtedy dziala ok

Zajmujesz się pozycjonowaniem stron i szukasz kolejnych branż, w których możesz zarabiać? - seo.biznesmlm.pl- zarabiaj na suplementach

Znaczenie snów w sennik.biz

Nowy serwis z artykułami : www.magazynallinclusive.pl

Odnośnik do komentarza
Udostępnij na innych stronach

tz

// remove accented characters

$title = strtr($title, "©¦®±¶µĄˇµŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖŘŮÚŰÜÝßŕáâăäĺćçčéęëěíîďđńňóôőöřůúűüý˙łŁ±ˇżŻĄ¬ęĘćĆóÓńѶ¦", & quot;SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyylLaAzZ

zZeEcCoOnNsS");

to mam gdzies wstawic czy co ? bo u mnie nic takego nie ma...

Pozdrawiam, (-;

www.topposition.pl - Top Position

tp468x60_banerrr.png

Odnośnik do komentarza
Udostępnij na innych stronach

zobacz tutaj co robi dokladnie funkcja strtr

https://pl2.php.net/strtr

Zajmujesz się pozycjonowaniem stron i szukasz kolejnych branż, w których możesz zarabiać? - seo.biznesmlm.pl- zarabiaj na suplementach

Znaczenie snów w sennik.biz

Nowy serwis z artykułami : www.magazynallinclusive.pl

Odnośnik do komentarza
Udostępnij na innych stronach

  • 3 tygodnie później...

niestety nie udalo mi sie nic zrobic w tej sprawie .... ;/ ma ktos pomysl na to ?

i tu jest od jeszcze jednego pliku z ktorym cos kombinowalem / z katalogu includes

<?php
/**
* @version $Id: sef.php 1138 2005-11-20 21:44:18Z Saka $
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license https://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']);
/**
* Content
* https://www.domain.com/$option/$task/$sectionid/$id/$Itemid/$limit/$limitstart
*/
if (in_array('content', $url_array)) {

	$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]);
		}
	}

	// $option/$task/$sectionid/$id/$Itemid/$limit/$limitstart
	if (isset($url_array[$pos+6]) && $url_array[$pos+6]!='') {
		$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&sectionid=$sectionid&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart";
		// $option/$task/$id/$Itemid/$limit/$limitstart
	} else if (isset($url_array[$pos+5]) && $url_array[$pos+5]!='') {
		$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'] 		= $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;

		$QUERY_STRING = "option=com_content&task=$task&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart";
		// $option/$task/$sectionid/$id/$Itemid
	} else if (!(isset($url_array[$pos+5]) && $url_array[$pos+5]!='') && isset($url_array[$pos+4]) && $url_array[$pos+4]!='') {
		$task 					= $url_array[$pos+1];
		$sectionid 				= $url_array[$pos+2];
		$id 					= $url_array[$pos+3];
		$Itemid 				= $url_array[$pos+4];

		// 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;

		$QUERY_STRING = "option=com_content&task=$task&sectionid=$sectionid&id=$id&Itemid=$Itemid";
		// $option/$task/$id/$Itemid
	} else if (!(isset($url_array[$pos+4]) && $url_array[$pos+4]!='') && (isset($url_array[$pos+3]) && $url_array[$pos+3]!='')) {
		$task 					= $url_array[$pos+1];
		$id 					= $url_array[$pos+2];
		$Itemid 				= $url_array[$pos+3];

		// pass data onto global variables
		$_GET['task'] 			= $task;
		$_REQUEST['task'] 		= $task;
		$_GET['id'] 			= $id;
		$_REQUEST['id'] 		= $id;
		$_GET['Itemid'] 		= $Itemid;
		$_REQUEST['Itemid'] 	= $Itemid;

		$QUERY_STRING = "option=com_content&task=$task&id=$id&Itemid=$Itemid";
		// $option/$task/$id
	} else if (!(isset($url_array[$pos+3]) && $url_array[$pos+3]!='') && (isset($url_array[$pos+2]) && $url_array[$pos+2]!='')) {
		$task 					= $url_array[$pos+1];
		$id 					= $url_array[$pos+2];

		// pass data onto global variables
		$_GET['task'] 			= $task;
		$_REQUEST['task'] 		= $task;
		$_GET['id'] 			= $id;
		$_REQUEST['id'] 		= $id;

		$QUERY_STRING = "option=com_content&task=$task&id=$id";
		// $option/$task
	} else if (!(isset($url_array[$pos+2]) && $url_array[$pos+2]!='') && (isset($url_array[$pos+1]) && $url_array[$pos+1]!='')) {
		$task = $url_array[$pos+1];

		$_GET['task'] 			= $task;
		$_REQUEST['task'] 		= $task;

		$QUERY_STRING = 'option=com_content&task='. $task;
	}

	if ($lang!='') {
		$QUERY_STRING .= '〈='. $lang;
	}

	$_SERVER['QUERY_STRING'] 	= $QUERY_STRING;
	$REQUEST_URI 				= $uri[0].'index.php?'.$QUERY_STRING;
	$_SERVER['REQUEST_URI'] 	= $REQUEST_URI;
}

/*
Components
https://www.domain.com/component/$name,$value
*/
if (in_array('component', $url_array)) {

	$uri = explode('component/', $_SERVER['REQUEST_URI']);
	$uri_array = explode('/', $uri[1]);
	$QUERY_STRING = '';

	foreach($uri_array as $value) {
		$temp = explode(',', $value);
		if (isset($temp[0]) && $temp[0]!='' && isset($temp[1]) && $temp[1]!='') {
			$_GET[$temp[0]] 	= $temp[1];
			$_REQUEST[$temp[0]] = $temp[1];
			$QUERY_STRING .= $temp[0]=='option' ? "$temp[0]=$temp[1]" : "&$temp[0]=$temp[1]";
		}
	}

	$_SERVER['QUERY_STRING'] 	= $QUERY_STRING;
	$REQUEST_URI 				= $uri[0].'index.php?'.$QUERY_STRING;
	$_SERVER['REQUEST_URI'] 	= $REQUEST_URI;
}
if (defined('RG_EMULATION') && RG_EMULATION == 1) {
	// Extract to globals
	while(list($key,$value)=each($_GET)) {
		if ($key!="GLOBALS") {
			$GLOBALS[$key]=$value;
		}
	}
	// Don't allow config vars to be passed as global
	include( 'configuration.php' );
}
}

function sefRelToAbs( $string ) {
global $mosConfig_live_site, $mosConfig_sef, $mosConfig_mbf_content;
global $iso_client_lang;

if( $mosConfig_mbf_content && $string!='index.php' && !eregi("^(([^:/?#]+):)",$string) && !strcasecmp(substr($string,0,9),'index.php') && !eregi('lang=', $string) ) {
	$string .= '〈='. $iso_client_lang;
}

if ($mosConfig_sef && !eregi("^(([^:/?#]+):)",$string) && !strcasecmp(substr($string,0,9),'index.php')) {

	// Replace all & with &
	$string = str_replace( '&', '&', $string );

	/*
	Home
	index.php
	*/
	if ($string=='index.php') {
		$string='';
	}

	$sefstring = '';
	if ( (eregi('option=com_content',$string) || eregi('option=content',$string) ) && !eregi('task=new',$string) && !eregi('task=edit',$string) ) {
		/*
		Content
		index.php?option=com_content&task=$task&sectionid=$sectionid&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart
		*/
		$sefstring .= 'content/';
		if (eregi('&task=',$string)) {
			$temp = split('&task=', $string);
			$temp = split('&', $temp[1]);

			$sefstring .= $temp[0].'/';
		}
		if (eregi('&sectionid=',$string)) {
			$temp = split('&sectionid=', $string);
			$temp = split('&', $temp[1]);

			$sefstring .= $temp[0].'/';
		}
		if (eregi('&id=',$string)) {
			$temp = split('&id=', $string);
			$temp = split('&', $temp[1]);

			$sefstring .= $temp[0].'/';
		}
		if (eregi('&Itemid=',$string)) {
			$temp = split('&Itemid=', $string);
			$temp = split('&', $temp[1]);

			if ( $temp[0] !=  99999999 ) {
				$sefstring .= $temp[0].'/';
			}
		}
		if (eregi('&limit=',$string)) {
			$temp = split('&limit=', $string);
			$temp = split('&', $temp[1]);

			$sefstring .= $temp[0].'/';
		}
		if (eregi('&limitstart=',$string)) {
			$temp = split('&limitstart=', $string);
			$temp = split('&', $temp[1]);

			$sefstring .= $temp[0].'/';
		}
		if (eregi('〈=',$string)) {
			$temp = split('〈=', $string);
			$temp = split('&', $temp[1]);

			$sefstring .= 'lang,'.$temp[0].'/';
		}
		$string = $sefstring;
	} else if (eregi('option=com_',$string) && !eregi('task=new',$string) && !eregi('task=edit',$string)) {
		/*
		Components
		index.php?option=com_xxxx&...
		*/
		$sefstring 	= 'component/';
		$temp 		= split("\?", $string);
		$temp 		= split('&', $temp[1]);

		foreach($temp as $key => $value) {
			$sefstring .= $value.'/';
		}
		$string = str_replace( '=', ',', $sefstring );
	}

	return $mosConfig_live_site.'/'.$string;

	// allows SEF without mod_rewrite
	// uncomment Line 273 and comment out Line 269
	//return $mosConfig_live_site.'/index.php/'.$string;
} else {
	return $string;
}
}
?>

Pozdrawiam, (-;

www.topposition.pl - Top Position

tp468x60_banerrr.png

Odnośnik do komentarza
Udostępnij na innych stronach

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę. Warunki użytkowania Polityka prywatności