Some chars not replaced

15 years 6 months ago #4231 by klp29
Hi!

Thanks for a great component!

I have a problem, though.

In my REPLACE CHARS, I have:

Ã¥=>aa,
æ=>ae,
ø=>oe

But the URL www.crazynight.dk/13-hvad-bør-i-få-bekræftet.html is only partly translated, as it ends up as www.crazynight.dk/13-hvad-boer-i-faa-bekræftet.html where "æ" in "bekræftet" is not translated to "ae" as it should.

Any idea why / how to fix this?

:] Have a smiley day

Kenneth Lund

Using SefAdvanced at:
www.bryllup.dk - online weddingplanning
www.kennethlund.dk - personal blog
www.soundpeople.dk - social network for producers

Please Log in or Create an account to join the conversation.

15 years 6 months ago #4232 by klp29
It's very strange, because in another URL on the same site, "æ" in "planlægning" IS replaced by" ae":

www.crazynight.dk/jreviews/Polterabend-a...rabend_c111_m89.html

:] Have a smiley day

Kenneth Lund

Using SefAdvanced at:
www.bryllup.dk - online weddingplanning
www.kennethlund.dk - personal blog
www.soundpeople.dk - social network for producers

Please Log in or Create an account to join the conversation.

15 years 6 months ago #4233 by klp29
Also, in my Custom Component Strings, I have:

customcomp=>cc,
mtree=>forhandleroversigt,
fireboard=>bryllupsforum,
jreviews=>anbefalinger

But still, jrevies shows up unchanged in URLs like:

www.crazynight.dk/jreviews/Polterabend-a...rabend_c111_m89.html

Which really should be www.crazynight.dk/anbefalinger/Polterabe...rabend_c111_m89.html

:] Have a smiley day

Kenneth Lund

Using SefAdvanced at:
www.bryllup.dk - online weddingplanning
www.kennethlund.dk - personal blog
www.soundpeople.dk - social network for producers

Please Log in or Create an account to join the conversation.

15 years 6 months ago - 15 years 6 months ago #4234 by Saka
It is all to jReviews and its SEF extension and whether or not it uses SEF Advances replace functions. So please talk to jReviews author about that.

About the replace jreviews=>anbefalinger it should work if the component has sef_ext.php and not using router.php (check that sef_ext.php exists). Also try removing new lines and test with:
mtree=>forhandleroversigt,fireboard=>bryllupsforum,jreviews=>anbefalinger

Emir Sakic
www.sakic.net

Please Log in or Create an account to join the conversation.

15 years 6 months ago #4235 by klp29
Yes, this is the sef_ext.php script that we use - we have never had problems like this before i jReviews:
<?php
/**
 * jReviews - Reviews Extension
 * Copyright (C) 2006-2008 Alejandro Schmeichler
 * This is not free software, do not distribute it.
 * For licencing information visit http://www.reviewsforjoomla.com
 * or contact sales@reviewsforjoomla.com
**/

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

if (!defined('DS')) define('DS', DIRECTORY_SEPARATOR);

class sef_jreviews {
	
	var $__Menu;
		
	function &getInstance() {

		static $instance = array();

		if (!isset($instance[0]) || !$instance[0]) {
			$instance[0] =& new sef_jreviews();
			require( dirname(__FILE__) . DS . 'jreviews' . DS . 'framework.php');

			App::import('Model','Menu','jreviews');

			$instance[0]->__Menu = &RegisterClass::getInstance('MenuModel');
		}
		
		return $instance[0];
	}

	function create($string) {

		$_this =& sef_jreviews::getInstance();
		
		$url = '';
		$hasMenuId = preg_match('/Itemid=([0-9]{1,})/',$string,$menu_id);
		$isMenuLink = strpos($string,'url=menu');
		
		$sefstring = '';
				
		// Process internal "url" parameter
		$temp = explode('&url=', $string);

		if(isset($temp[1])) {
			$url = urldecode($temp[1]);
		}
		
		if (eregi('&url=',$string) && !$isMenuLink) 
		{
			$query_string = explode('/',$url);
			// Properly urlencodes the jReviews parameters contained within the url parameter
			foreach($query_string AS $key=>$param) {
				$query_string[$key] = urlencodeParam($param);
			}
			$url = implode('/',$query_string);
					
			$sefstring .= $url;
		
		} elseif(isset($menu_id[1]) && ($isMenuLink || $hasMenuId)) {

			$sefstring .= $isMenuLink ? str_replace('menu',$_this->__Menu->getMenuName($menu_id[1]),$url) : $_this->__Menu->getMenuName($menu_id[1]);
		
		} else {
			
			$sefstring = $string;
		
		}
	
		return rtrim($sefstring,'/').'/';
	}

	function revert ($url_array, $pos) {

		$_PARAM_CHAR = ':';
		$url = array();
		$_this =& sef_jreviews::getInstance();

		global $QUERY_STRING;
		
		// First check if this is a menu link by looking for the menu name to get an Itemid
		if(isset($url_array[$pos+2]) && $menu_id = $_this->__Menu->getMenuId($url_array[$pos+2])) {
			
			$_GET['Itemid'] = $_REQUEST['Itemid'] = $menu_id;
			$QUERY_STRING = "option=com_jreviews&Itemid=$menu_id";

			for($i=$pos+2;$i<count($url_array);$i++) {
				if($url_array[$i] != '' && false!==strpos($url_array[$i],$_PARAM_CHAR)) {
					$parts = explode($_PARAM_CHAR,$url_array[$i]);
					if(isset($parts[1]) && $parts[1]!='') {
						$url[] = $url_array[$i];
						$_GET[$parts[0]] = $_REQUEST[$parts[0]] = $parts[1];
					}
				}
			}

			$QUERY_STRING .= '&url=menu/' . implode('/',$url);

		} else {

			// Not a menu link, so we use the url named param
			for($i=$pos+2;$i<count($url_array);$i++) {
				if($url_array[$i] != '') {
					$url[] = $url_array[$i];
				}
			}

			$url = implode('/',$url);
	
			if(preg_match('/_m([0-9]+)/',$url,$matches)) {
				$menu_id = $_GET['Itemid'] = $_REQUEST['Itemid'] = $matches[1];
			} else {				
				$menu_id = $_GET['Itemid'] = $_REQUEST['Itemid'] = '';
			}			
			
			$_GET['url'] = $_REQUEST['url'] = $url;
			$_GET['option'] = $_REQUEST['option'] = 'com_jreviews';

			$QUERY_STRING = "option=com_jreviews&Itemid=$menu_id&url=$url";
					
		}
//			return $QUERY_STRING;		
	}

}

:] Have a smiley day

Kenneth Lund

Using SefAdvanced at:
www.bryllup.dk - online weddingplanning
www.kennethlund.dk - personal blog
www.soundpeople.dk - social network for producers

Please Log in or Create an account to join the conversation.

15 years 6 months ago - 15 years 6 months ago #4236 by Saka
As I already said: talk to Alejandro! I can't debug every SEF extension for each component and can't build extension for each new component either. It is author's responsibility.

To find out what's wrong I would have to install it and test it, can't say what's wrong from the top of my head. And it takes time, I don't even have a copy of jReviews. Then fixing it only for you would still leave the issue in author's distribution and other users would still have the same problem. It is by far best for the author to fix it and include in his distribution.

Emir Sakic
www.sakic.net

Please Log in or Create an account to join the conversation.

About us

We provide high quality Joomla components created by a co-founder and original core developer of Joomla. For over a decade, our products have been used by more than 20.000 webmasters around the world.

Stay in touch