I have make a new extension for a component but don't work fine...
function create (&$string) {
...
...
...
// Top7, except search
// func=top7, sorting=$var1
if (stristr($string,"&func=top7")) {
if (stristr($string,"&date=")) {
$temp = explode("&date=", $string);
$temp = explode("&", $temp[1]);
$date_sort = $temp[0];
switch ($date_sort) {
case "year" :
$date_sort = "Anno/";
break;
case "week" :
$date_sort = "Last.Event/";
break;
case "month" :
$date_sort = "Mese/";
break;
}
}
if (stristr($string,"&orderby=")) {
$temp = explode("&orderby=", $string);
$temp = explode("&", $temp[1]);
$orderby = $temp[0];
switch ($orderby) {
case "comments" :
$orderby = "Commenti/";
break;
case "views" :
$orderby = "Visite/";
break;
case "rating" :
$orderby = "Voti/";
break;
}
}
$tempstring = "Top.7";
$sefstring .= $tempstring.'/'.$date_sort.$orderby;
return $sefstring;
}
}
function revert (&$url_array, &$pos) {
....
....
...
// description: Top7
// variables: func=special, sorting=$var1
if (isset($url_array[$pos+2]) && $url_array[$pos+2] != '' && ($url_array[$pos+2] == "Top.7" )) {
$func = "top7";
$_REQUEST['func'] = $func;
$QUERY_STRING .= "&func=$func";
switch ($url_array[$pos+3]) {
case "Anno":
$date = "year";
break;
case "Last.Event":
$date = "week";
break;
case "Mese":
$date = "month";
break;
}
if( $date != null ){
$_REQUEST['date'] = $date;
$QUERY_STRING .= "&date=$date";
}
switch ($url_array[$pos+3]) {
case "Commenti":
$orderby = "comments";
break;
case "Visite":
$orderby = "views";
break;
case "Voti":
$orderby = "rating";
break;
}
switch ($url_array[$pos+4]) {
case "Commenti":
$orderby = "comments";
break;
case "Visite":
$orderby = "views";
break;
case "Voti":
$orderby = "rating";
break;
}
if( $orderby != null ){
$_REQUEST['orderby'] = $orderby;
$QUERY_STRING .= "&orderby=$orderby";
}
echo $QUERY_STRING;
return $QUERY_STRING;
}
...
..
The Url rewrite is correct but there are 2 mistake:
1: I have in my component a multi ordering/sort buttons in Top7 function with Ordering by date(year, month, lastEvent) and a ordering by gender(rating, views, comments)
The links works in this ways [if I click on year for example charge the page and then if I click on order by comments the page charged output a chart order by date "YEAR" select first and with order by "COMMENTS"]. The problem is now with this code don't charge the page with the past selection I have make, but only the last

2: If I select button year or any other buttons the link are correct but don't charge the correct page with the result but recharge this page without consider my choice!
the url without sef enable are like this:
http://www.mysite.it/index.php?option=com_gallery&func=top7&date=year&orderby=commentsSef url I make based on the code up are like this:
http://www.mysite.it/gallery/Top.7/Anno/This doesn't work I don't know why sef don't generate this url..
http://www.mysite.it/gallery/Top.7/Anno/Commenti/