sitemap  |  contact

Sakic.Net Forum
12 October 2008, 09:02 *
Welcome, Guest. Please login or register.
Did you miss your activation email?
Login with username, password and session length
News: Save money on product bundles: http://www.sakic.net/support/order/
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Make Extension some Problem  (Read 1323 times)
Aquilasfx
Newbie
*
Posts: 15


View Profile
« on: 06 May 2008, 01:34 »

I have make a new extension for a component but don't work fine...


Code:

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 Sad

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=comments

Sef 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/
Logged
Aquilasfx
Newbie
*
Posts: 15


View Profile
« Reply #1 on: 19 May 2008, 09:22 »

sakic please considere my request for help
Logged
Saka
Administrator
Hero Member
*****
Posts: 1,233


View Profile WWW
« Reply #2 on: 19 May 2008, 15:17 »

I can't answer this because I would need to test your component and also test your extension.
To create a custom extensions costs extra fee, you can contact me on mail if you are interested.
Logged

Aquilasfx
Newbie
*
Posts: 15


View Profile
« Reply #3 on: 20 May 2008, 15:19 »

I want to create myself extension.... I only request why there are these mystake.. but nothing.. you request more fee for this.. ... ... My question not is HOW make the extension but WHY  it's wrong .. I considered the tutorial to make new extension... I think would You have to appreciate that people make own extension by themselves..
Logged
Saka
Administrator
Hero Member
*****
Posts: 1,233


View Profile WWW
« Reply #4 on: 22 May 2008, 23:15 »

I can't answer what is wrong with your extension without debugging it with your component, and that's custom job.
Logged

Pages: [1]
  Print  
 
Jump to: