öffne datei /contenido/classes/class.modrewrite.php
suche nach der funktion "build_new_url()" (zeile 407) und ersetze diese mit folgender:
Code: Alles auswählen
	/**
     * build_new_url()
	 *
     * build new url from given arguments
	 *
	 * get querystring of front_content.php and 
	 * convert this url to the new mod_rewrite url
	 * method will be startet before the complete 
	 * output of the front site will be executed
	 *
	 * @param	string	given arguments
     * @return 	string	new url
     */
	function build_new_url ( $str_args = "" ) {
		global $cfg, $lang, $client;
		
		$str_new_url = "";
		$str_categories = "";
		$str_article = "";
		
		// check arguments ... and split
		$str_args = str_replace ( "?", "", $str_args );
		$str_args = str_replace ( "&", "&", $str_args );
		parse_str ($str_args);
		
		
        // get additional non contenido parameters
        $str_additional_params = '';
        $arr_additional_params = array();
        $arr_param_pairs = split( "&", $str_args );
        
        $arr_ignored_params = array ( 'idcat', 'idart', 'lang', 'client', 'idcatart' );
        
        foreach ( $arr_param_pairs as $str_pair ) {
            $bol_found_bad = false;
            $arr_param = split ( "=", $str_pair );
            
            foreach ( $arr_ignored_params as $str_key ) {
                if ( $str_key == strtolower(trim($arr_param[0])) ) {
                    $bol_found_bad = true;
                    break;
                }
                
            }
            if ( $bol_found_bad == false ) {
                $arr_additional_params[] = $arr_param[0] . '=' . $arr_param[1];
            }
          
        }
        if ( count ( $arr_additional_params ) > 0 ) {
            $str_additional_params = '?' . join ( "&", $arr_additional_params );
        }
        
		// set language? 
		$str_lang = ($cfg["mod_rewrite"]['use_language'] == 1 ) ? ModRewrite::get_language_name($lang) . "/" : '';
	
		// define rootpath ...
		$str_new_url = $cfg['mod_rewrite']['rootdir'] . $str_lang;
		
        // handle idcatart
        if (isset($idcatart) && $idcatart > 0 && ( !isset($idcat) || $idcat == 0 ) && ( !isset($idart) || $idart == 0 )) {
            $db = new DB_Contenido;
			
			$sql = "SELECT idcat, idart
					FROM " . $cfg["tab"]["cat_art"] . " 
					WHERE idcatart = '$idcatart'";
    	    $db->query($sql);
			$db->next_record();
			
			$idcat = $db->f('idcat');
            $idart = $db->f('idart');
        }
        
		// check if article id is given and set article url
		if (isset($idart) && $idart > 0) {
			$str_article = ModRewrite::get_art_websafename ( $idart, $lang ) . ".html";
		}
		
		// check if only article id is given, cat id have to rebuild
		if (isset($idart) && $idart > 0 && ( !isset($idcat) || $idcat == 0 ) ) {
			$db = new DB_Contenido;
			
			$sql = "SELECT idcat
					FROM " . $cfg["tab"]["cat_art"] . " 
					WHERE idart = '$idart'";
    	    $db->query($sql);
			$db->next_record();
			
			$idcat = $db->f('idcat');
		}
		
		// ok build dir list, if idcat found ...
		if (isset($idcat) && $idcat > 0) {
			$str_categories = ModRewrite::build_recursiv_path ( $idcat, $lang );
			
			// check start directory settings
			if ( $cfg['mod_rewrite']['startfromroot'] == 0 ) {
				// splitt string in array
				$arr_categories = split( "/", $str_categories);
				
				// remove first category
				$str_first_cat = array_shift ( $arr_categories );
				
				// implode array with categories to new string 
				$str_categories = join ( "/",  $arr_categories );
			}
		}
		
		
		return $str_new_url . $str_categories . $str_article . $str_additional_params;
		
	}	// end functionhier funktionierts: http://contenido.polycoder.com/