Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

Rekomendowane odpowiedzi

Opublikowano

No próbowałem już wszystkiego, od unicod'u po wartości hex i binarne.....

Jest to niezgodność na poziomie kodowania. Trzeba by było pogrzebać w plikach. Problem w tym, że z tego co pamiętam są kodowane ioncube.

Ty masz kodowanie ISO-2 a dla minervy header jest UTF-8 i stąd całe zamieszanie.

Ale... jeśli dysponujesz kilkoma stówami około (250zł) to zakup CSEO i masz problem z głowy. Ja długo używałem Minervy, ale to była tragedia, raz że dość mocno spowalniało działanie serwera, dwa: błąd błędy błędem poganiał , trzy: do tej pory nie udało mi się w całości odinstalować Minervy (pozostały w bazie tabele)

Ewentualnie, jeśli pliki nie są kodowane możesz użyć funkcji php: iconv lub iconv_set_encoding

46279b204b.png

Rozwiążemy dla Ciebie każde zadanie z matematyki: http://matma4u.pl

Opublikowano (edytowane)

przejrzałem plik icelabz_core/furl.php i moim zdaniem tam jest skopane zamienianie literek niektórych: ą ś ł ż ź ć Ą Ś Ł Ż Ź Ć

prawidłowo działają: ę ó ń

w tym literka ć zamieniana jest na ae , a literka Ć na AE (czyli ae w linku)

chyba funkcja function remove_accents uznaje te brakujące literki (ą ś ł ż ź ć Ą Ś Ł Ż Ź Ć) za jakieś znaki specjalne typu ' "" () i je pomija

oryginalne znaki są zapisane w postaci ASCII w tym pliku ale autor chyba źle albo ze swojej niewiedzy dal zle im zamienniki

jedziemy niżej i

			$double_chars ['in'] = array (
			chr ( 140 ), 
			chr ( 156 ), 
			chr ( 198 ), 
			chr ( 208 ), 
			chr ( 222 ), 
			chr ( 223 ), 
			chr ( 230 ), 
			chr ( 240 ), 
			chr ( 254 ) );
		$double_chars ['out'] = array (
			'OE', 
			'oe', 
			'AE', 
			'DH', 
			'TH', 
			'ss', 
			'ae', 
			'dh', 
			'th' );

140 to jest literka Ś jest zamieniana na OE

156 ś jest zamieniana na oe

198 Ć jest zamieniana na AE

230 ć jest zamieniana na ae

to potwierdza ze autor nie ma pojęcia o polskich znakach :thumbsup:

po zamianie AE/ae na C/c działa zamiana ć na c w linkach

po zamianie OE/oe na S/s nie działa zamiana ś na s w linkach ani ś na oe nie wiem dla czemu, literka jest pomijana

próbowałem dopisać w tym kodzie

			// Assume ISO-8859-1 if not UTF-8
		$chars ['in'] = chr ( 128 ) . chr ( 131 ) . chr ( 138 ) . chr ( 142 ) . chr ( 154 ) . chr ( 158 ) . chr ( 159 ) . chr ( 162 ) . chr ( 165 ) . chr ( 181 ) . chr ( 192 ) . chr ( 193 ) . chr ( 194 ) . chr ( 195 ) . chr ( 196 ) . chr ( 197 ) . chr ( 199 ) . chr ( 200 ) . chr ( 201 ) . chr ( 202 ) . chr ( 203 ) . chr ( 204 ) . chr ( 205 ) . chr ( 206 ) . chr ( 207 ) . chr ( 209 ) . chr ( 210 ) . chr ( 211 ) . chr ( 212 ) . chr ( 213 ) . chr ( 214 ) . chr ( 216 ) . chr ( 217 ) . chr ( 218 ) . chr ( 219 ) . chr ( 220 ) . chr ( 221 ) . chr ( 224 ) . chr ( 225 ) . chr ( 226 ) . chr ( 227 ) . chr ( 228 ) . chr ( 229 ) . chr ( 231 ) . chr ( 232 ) . chr ( 233 ) . chr ( 234 ) . chr ( 235 ) . chr ( 236 ) . chr ( 237 ) . chr ( 238 ) . chr ( 239 ) . chr ( 241 ) . chr ( 242 ) . chr ( 243 ) . chr ( 244 ) . chr ( 245 ) . chr ( 246 ) . chr ( 248 ) . chr ( 249 ) . chr ( 250 ) . chr ( 251 ) . chr ( 252 ) . chr ( 253 ) . chr ( 255 );

		$chars ['out'] = "EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy";

		$string = strtr ( $string, $chars ['in'], $chars ['out'] );

w ten sposób np literka ą = 185

// Assume ISO-8859-1 if not UTF-8

$chars ['in'] = chr ( 128 ) . chr ( 131 ) . chr ( 138 ) . chr ( 142 ) . chr ( 154 ) . chr ( 158 ) . chr ( 159 ) . chr ( 162 ) . chr ( 165 ) . chr ( 181 ) . chr ( 185 ) . chr ( 192 ) . chr ( 193 ) . chr ( 194 ) . chr ( 195 ) . chr ( 196 ) . chr ( 197 ) . chr ( 199 ) . chr ( 200 ) . chr ( 201 ) . chr ( 202 ) . chr ( 203 ) . chr ( 204 ) . chr ( 205 ) . chr ( 206 ) . chr ( 207 ) . chr ( 209 ) . chr ( 210 ) . chr ( 211 ) . chr ( 212 ) . chr ( 213 ) . chr ( 214 ) . chr ( 216 ) . chr ( 217 ) . chr ( 218 ) . chr ( 219 ) . chr ( 220 ) . chr ( 221 ) . chr ( 224 ) . chr ( 225 ) . chr ( 226 ) . chr ( 227 ) . chr ( 228 ) . chr ( 229 ) . chr ( 231 ) . chr ( 232 ) . chr ( 233 ) . chr ( 234 ) . chr ( 235 ) . chr ( 236 ) . chr ( 237 ) . chr ( 238 ) . chr ( 239 ) . chr ( 241 ) . chr ( 242 ) . chr ( 243 ) . chr ( 244 ) . chr ( 245 ) . chr ( 246 ) . chr ( 248 ) . chr ( 249 ) . chr ( 250 ) . chr ( 251 ) . chr ( 252 ) . chr ( 253 ) . chr ( 255 );

$chars ['out'] = "EfSZszYcYuaAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy";

$string = strtr ( $string, $chars ['in'], $chars ['out'] );

brakujące literki i żadnego efektu, chyba ale patrząc na to to powinno to działać

Edytowane przez andriu-m
  • 4 tygodnie później...
Opublikowano

poprawione ;]

icelabz_core/furl.php

			$double_chars ['in'] = array (
			chr ( 140 ), 
			chr ( 156 ), 
			chr ( 198 ), 
			chr ( 208 ), 
			chr ( 222 ), 
			chr ( 223 ), 
			chr ( 230 ), 
			chr ( 240 ), 
			chr ( 254 ) );
		$double_chars ['out'] = array (
			'OE', 
			'oe', 
			'AE', 
			'DH', 
			'TH', 
			'ss', 
			'ae', 
			'dh', 
			'th' );

zamienic na

			$double_chars ['in'] = array (
			chr ( 140 ), 
			chr ( 156 ),
			chr ( 161 ),
			chr ( 163 ),
			chr ( 166 ),
			chr ( 172 ),
			chr ( 175 ),
			chr ( 177 ),
			chr ( 179 ),
			chr ( 182 ),
			chr ( 188 ),
			chr ( 191 ), 
			chr ( 198 ), 
			chr ( 208 ), 
			chr ( 222 ), 
			chr ( 223 ), 
			chr ( 230 ), 
			chr ( 240 ), 
			chr ( 254 ) );
		$double_chars ['out'] = array (
			'OE', 
			'oe', 
			'A',
			'L',
			'S',
			'Z',
			'Z',
			'a',
			'l',
			's',
			'z',
			'z',
			'C', 
			'DH', 
			'TH', 
			'ss', 
			'c', 
			'dh', 
			'th' );

powodem złego zamieniania literek polskich był brak ich wpisanych w tablice: odpowiednio: Ą = 161 , Ć = 198 , Ę = 202 , Ł = 163 , Ń = 209 , Ś = 166 , Ź = 172 itp.. wiecej na http://pl.wikipedia.org/wiki/Spos%C3%B3b_kodowania_polskich_znak%C3%B3w

Opublikowano

tutorial tutaj nie jest potrzebny, wystarczy podmienić jeden plik icelabz_core/furl.php

niżej zamieszczam cały plik z poprawka, zapisać jako furl.php i podmienić z oryginalnym w katalogu icelabz_core

<?php

if (! class_exists ( 'icl_functions' )) {
include ROOT_PATH . 'icelabz_core/function.php';
}

class icl_furl extends icl_functions {

/**---------------------------------
 * Stop word list
 * is an array full of stopword to be removed
 *--------------------------------*/

var $stopword_list = array ();
var $stopword_list_array = array ();

/**---------------------------------
 * SEO_folder must be defined to use this function
 *--------------------------------*/
function produce_htaccess() {

	$text = "
#Sometimes 'RewriteBase' is required on certain servers, 
# remove the # infront of RewriteBase if required		

<IfModule mod_rewrite.c>

RewriteEngine on
#RewriteBase " . SEO_folder . "
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^(admin|lofiversion|jscripts|style_avatars|style_captcha|style_emoticons|style_images|install|upgrade|uploads)/
RewriteRule !\.(js|ico|gif|jpg|png|css)$ " . SEO_folder . "mseo_furl.php [L,QSA]

</IfModule>";
	return $text;
}

function generate_meta_description($description) {
	/*$this->current_post = preg_replace('@(<.*?>)+@si','',$this->current_post);*/
	$description = substr ( $this->gentle_clean ( $description ), 0, 150 );
	return $description;
}

function generate_meta_keyword($text, $skipstopwords = 0) {
	/**---------------------------------
	 * @todo check if we have white space first
	 *--------------------------------*/

	$keywords = $this->gentle_clean ( $text );

	$_keywords = @explode ( ' ', $keywords );

	if (count ( $_keywords ) > 1 && is_array ( $_keywords )) {

		$keywords = @implode ( ',', array_splice ( $_keywords, 0, 50 ) );

		$keywords = $this->ipsclass->clean_comma ( $keywords );
		$keywords = str_replace ( ',', ', ', $keywords );
	}

	return $keywords;
}

function in_mseo_furl($file = 'mseo_furl.php') {
	/**---------------------------------
	 * START of URL parser
	 *--------------------------------*/

	$main_string = $this->my_getenv ( 'REQUEST_URI' );

	/**---------------------------------
	 * lets remove the current folder and only get the requested FURL
	 *--------------------------------*/

	$folder = str_replace ( '/' . $file, '', $this->my_getenv ( 'PHP_SELF' ) );

	/**---------------------------------
	 * finalise query_furl
	 *--------------------------------*/

	$query_furl = str_replace ( $folder . '/', '', $main_string );

	define ( 'SEO_folder', $folder . '/' );

	return array (
		$folder, 
		$query_furl );
}

/**---------------------------------
 * HEADER REDIRECTS
 *--------------------------------*/

function r301($url, $debug = "") {
	//print_R($this->ipsclass->member);
	if (! $this->ipsclass->input ['ipscheck']) {
		if (! $this->debug && ($url != $this->current_url)) {
			$url = ($url) ? $url : $this->INFO ['board_url'];
			$this->r301_header ();
			@header ( "Location: " . $url );

			exit ();
		} else {
			$this->current_url = str_replace ( '/' . SEO_folder . '/', '', $this->current_url );
			$this->print_debug ( '>>>>>R301>>' . $debug . ' @ ' . $this->current_url . ' for: ' . $url );
		}
	}
}

function r302($url, $check = 0, $debug = "") {
	if ($check == 1) {
		if (! $this->enabled_furl) {
			$this->r301 ( $url, $debug );
			return;
		}
	}
	//print_R($this->ipsclass->member);
	if (! $this->ipsclass->input ['ipscheck']) {
		if (! $this->debug && ($url != $this->current_url)) {
			$url = ($url) ? $url : $this->INFO ['board_url'];
			@header ( 'HTTP/1.1 302 Found' );

			@header ( "Location: " . $url );

			exit ();
		} else {
			$this->current_url = str_replace ( '/' . SEO_folder . '/', '', $this->current_url );
			$this->print_debug ( '>>>>>R302>>' . $debug . ' @ ' . $this->current_url . ' for: ' . $url );
		}
	}
}

function r301_header() {
	@header ( 'HTTP/1.1 301 Moved Permanently' );

	if ($this->ipsclass->vars ['msl_furl_cgi_301']) {
		$sapi_type = php_sapi_name ();
		if ($sapi_type == 'cgi' || $sapi_type == 'cgi-fcgi') {
			@header ( 'Status: 301 Moved Permanently' );
		}
	}
}

function r503($textr = 'Service unavailable') {
	@header ( "HTTP/1.1 503 " . $textr );
	if ($this->ipsclass->vars ['msl_furl_cgi_301']) {
		$sapi_type = php_sapi_name ();
		if ($sapi_type == 'cgi' || $sapi_type == 'cgi-fcgi') {
			@header ( 'Status: 503 ' . $textr );
		}
	}
	//		if ($this->ipsclass->vars ['msl_error_503_enabled'] == 1 && @file_exists ( ROOT_PATH . $this->ipsclass->vars ['msl_error_503'] )) {
//			include_once (ROOT_PATH . $this->ipsclass->vars ['msl_error_503']);
//			exit ();
//		}


}
/**
 * Forbidden
 */
function r403() {
	@header ( "HTTP/1.1 403 Forbidden" );
	if ($this->ipsclass->vars ['msl_furl_cgi_301']) {
		$sapi_type = php_sapi_name ();
		if ($sapi_type == 'cgi' || $sapi_type == 'cgi-fcgi') {
			@header ( 'Status: 403 Forbidden' );
		}
	}

}
/**
 * internal server error
 */
function r500() {
	@header ( "HTTP/1.1 500 Internal server error" );
	if ($this->ipsclass->vars ['msl_furl_cgi_301']) {
		$sapi_type = php_sapi_name ();
		if ($sapi_type == 'cgi' || $sapi_type == 'cgi-fcgi') {
			@header ( 'Status: 500 Internal server error' );
		}
	}

	if ($this->ipsclass->vars ['msl_error_505_enabled'] == 1 && @file_exists ( ROOT_PATH . $this->ipsclass->vars ['msl_error_505'] )) {
		include_once (ROOT_PATH . $this->ipsclass->vars ['msl_error_505']);
		exit ();
	}

}
/**
 * r404 function
 * not found
 * @since Sun Aug 19 10:39:53 BST 2007 10:39:53
 */
function r404() {
	@header ( 'HTTP/1.1 404 Not Found' );
	if ($this->ipsclass->vars ['msl_furl_cgi_301']) {
		$sapi_type = php_sapi_name ();
		if ($sapi_type == 'cgi' || $sapi_type == 'cgi-fcgi') {
			@header ( 'Status: 404 Not Found' );
		}
	}

}

/**
 * Generally cleans a string
 */
function general_clean($ntitle) {

	$ntitle = trim ( $ntitle );
	$ntitle = urldecode ( $ntitle );
	$ntitle = strip_tags ( $ntitle );
	return $ntitle;
}

function clean_title($title) {

	$title = $this->general_clean ( $title );
	return $title;
}

function clean_url($title, $skip_spacer = null, $skip_stopword = 0) {
	unset ( $ntitle );

	$ntitle = $this->general_clean ( $title );
	$ntitle = strip_tags ( $ntitle );
	$ntitle = html_entity_decode ( $ntitle );

	$ntitle = $this->str_char_replacement ( $ntitle );
	$ntitle = strtolower ( $ntitle );

	/**---------------------------------
	 * is stop word enabled?
	 * this removes a, the, we, etc... from word list
	 *--------------------------------*/
	if ($this->ipsclass->vars ['msl_stop_word_enable'] && $skip_stopword == 0) {

		/**
		 * Have we already created an array of all the stop words?
		 */
		if (count ( $this->stopword_list_array ) == 0) {
			$this->stopword_list_array = explode ( "\n", $this->ipsclass->txt_windowstounix ( $this->ipsclass->vars ['msl_stop_word_list'] ) );
			$this->stopword_list = implode ( '|', $this->stopword_list_array );
			$this->print_debug ( 'word list', $this->stopword_list );
		}
		$ntitle = preg_replace ( '#\b(' . $this->stopword_list . ')\b#s', '', $ntitle );
	}

	$ntitle = preg_replace ( '/\^|"|\'/', '', $ntitle );
	$ntitle = preg_replace ( '/&.*?;/', '', $ntitle );
	$ntitle = preg_replace ( "/[^a-zA-Z0-9]/", ',', $ntitle ); //cheating a little bit 


	$spacer = ($this->furl_seperator) ? $this->furl_seperator : $skip_spacer;

	$ntitle = $this->ipsclass->clean_comma ( $ntitle );
	$ntitle = $this->ipsclass->trim_trailing_comma ( $ntitle );
	$ntitle = $this->ipsclass->trim_leading_comma ( $ntitle );
	$ntitle = str_replace ( ',', $spacer, $ntitle );

	return $ntitle;
}

/**---------------------------------
 * This function turns arrays($keys=>$content)
 * into:
 * '<meta name="$key" content="$content" />'
 *--------------------------------*/
function meta_builder($data) {
	foreach ( $data as $key => $content ) {
		if ($content != '') {
			$content = str_replace ( '"', '\'', $content );
			$meta .= '<meta name="' . $key . '" content="' . trim ( $content ) . '" />' . "\n";
		}
	}
	return "\n\n" . $meta;
}

/**---------------------------------
 * This version turns array ($key=>$content)
 * into
 * <link rel="$key" href="$content" />
 *--------------------------------*/

function link_builder($data) {
	if (! empty ( $data )) {
		foreach ( $data as $key => $content ) {
			$content = str_replace ( '"', '\'', $content );

			$link .= '<link rel="' . $key . '" href="' . trim ( $content ) . '" />' . "\n";
		}
		return "\n\n" . $link;
	}
}

function remove_accents($string) {

	if (! preg_match ( '/[\x80-\xff]/', $string ))
		return $string;

	if ($this->_accents_seems_utf8 ( $string )) {
		$chars = array ( // Decompositions for Latin-1 Supplement
			chr ( 195 ) . chr ( 128 ) => 'A', 
			chr ( 195 ) . chr ( 129 ) => 'A', 
			chr ( 195 ) . chr ( 130 ) => 'A', 
			chr ( 195 ) . chr ( 131 ) => 'A', 
			chr ( 195 ) . chr ( 132 ) => 'A', 
			chr ( 195 ) . chr ( 133 ) => 'A', 
			chr ( 195 ) . chr ( 135 ) => 'C', 
			chr ( 195 ) . chr ( 136 ) => 'E', 
			chr ( 195 ) . chr ( 137 ) => 'E', 
			chr ( 195 ) . chr ( 138 ) => 'E', 
			chr ( 195 ) . chr ( 139 ) => 'E', 
			chr ( 195 ) . chr ( 140 ) => 'I', 
			chr ( 195 ) . chr ( 141 ) => 'I', 
			chr ( 195 ) . chr ( 142 ) => 'I', 
			chr ( 195 ) . chr ( 143 ) => 'I', 
			chr ( 195 ) . chr ( 145 ) => 'N', 
			chr ( 195 ) . chr ( 146 ) => 'O', 
			chr ( 195 ) . chr ( 147 ) => 'O', 
			chr ( 195 ) . chr ( 148 ) => 'O', 
			chr ( 195 ) . chr ( 149 ) => 'O', 
			chr ( 195 ) . chr ( 150 ) => 'O', 
			chr ( 195 ) . chr ( 153 ) => 'U', 
			chr ( 195 ) . chr ( 154 ) => 'U', 
			chr ( 195 ) . chr ( 155 ) => 'U', 
			chr ( 195 ) . chr ( 156 ) => 'U', 
			chr ( 195 ) . chr ( 157 ) => 'Y', 
			chr ( 195 ) . chr ( 159 ) => 's', 
			chr ( 195 ) . chr ( 160 ) => 'a', 
			chr ( 195 ) . chr ( 161 ) => 'a', 
			chr ( 195 ) . chr ( 162 ) => 'a', 
			chr ( 195 ) . chr ( 163 ) => 'a', 
			chr ( 195 ) . chr ( 164 ) => 'a', 
			chr ( 195 ) . chr ( 165 ) => 'a', 
			chr ( 195 ) . chr ( 167 ) => 'c', 
			chr ( 195 ) . chr ( 168 ) => 'e', 
			chr ( 195 ) . chr ( 169 ) => 'e', 
			chr ( 195 ) . chr ( 170 ) => 'e', 
			chr ( 195 ) . chr ( 171 ) => 'e', 
			chr ( 195 ) . chr ( 172 ) => 'i', 
			chr ( 195 ) . chr ( 173 ) => 'i', 
			chr ( 195 ) . chr ( 174 ) => 'i', 
			chr ( 195 ) . chr ( 175 ) => 'i', 
			chr ( 195 ) . chr ( 177 ) => 'n', 
			chr ( 195 ) . chr ( 178 ) => 'o', 
			chr ( 195 ) . chr ( 179 ) => 'o', 
			chr ( 195 ) . chr ( 180 ) => 'o', 
			chr ( 195 ) . chr ( 181 ) => 'o', 
			chr ( 195 ) . chr ( 182 ) => 'o', 
			chr ( 195 ) . chr ( 182 ) => 'o', 
			chr ( 195 ) . chr ( 185 ) => 'u', 
			chr ( 195 ) . chr ( 186 ) => 'u', 
			chr ( 195 ) . chr ( 187 ) => 'u', 
			chr ( 195 ) . chr ( 188 ) => 'u', 
			chr ( 195 ) . chr ( 189 ) => 'y', 
			chr ( 195 ) . chr ( 191 ) => 'y',  // Decompositions for Latin Extended-A
			chr ( 196 ) . chr ( 128 ) => 'A', 
			chr ( 196 ) . chr ( 129 ) => 'a', 
			chr ( 196 ) . chr ( 130 ) => 'A', 
			chr ( 196 ) . chr ( 131 ) => 'a', 
			chr ( 196 ) . chr ( 132 ) => 'A', 
			chr ( 196 ) . chr ( 133 ) => 'a', 
			chr ( 196 ) . chr ( 134 ) => 'C', 
			chr ( 196 ) . chr ( 135 ) => 'c', 
			chr ( 196 ) . chr ( 136 ) => 'C', 
			chr ( 196 ) . chr ( 137 ) => 'c', 
			chr ( 196 ) . chr ( 138 ) => 'C', 
			chr ( 196 ) . chr ( 139 ) => 'c', 
			chr ( 196 ) . chr ( 140 ) => 'C', 
			chr ( 196 ) . chr ( 141 ) => 'c', 
			chr ( 196 ) . chr ( 142 ) => 'D', 
			chr ( 196 ) . chr ( 143 ) => 'd', 
			chr ( 196 ) . chr ( 144 ) => 'D', 
			chr ( 196 ) . chr ( 145 ) => 'd', 
			chr ( 196 ) . chr ( 146 ) => 'E', 
			chr ( 196 ) . chr ( 147 ) => 'e', 
			chr ( 196 ) . chr ( 148 ) => 'E', 
			chr ( 196 ) . chr ( 149 ) => 'e', 
			chr ( 196 ) . chr ( 150 ) => 'E', 
			chr ( 196 ) . chr ( 151 ) => 'e', 
			chr ( 196 ) . chr ( 152 ) => 'E', 
			chr ( 196 ) . chr ( 153 ) => 'e', 
			chr ( 196 ) . chr ( 154 ) => 'E', 
			chr ( 196 ) . chr ( 155 ) => 'e', 
			chr ( 196 ) . chr ( 156 ) => 'G', 
			chr ( 196 ) . chr ( 157 ) => 'g', 
			chr ( 196 ) . chr ( 158 ) => 'G', 
			chr ( 196 ) . chr ( 159 ) => 'g', 
			chr ( 196 ) . chr ( 160 ) => 'G', 
			chr ( 196 ) . chr ( 161 ) => 'g', 
			chr ( 196 ) . chr ( 162 ) => 'G', 
			chr ( 196 ) . chr ( 163 ) => 'g', 
			chr ( 196 ) . chr ( 164 ) => 'H', 
			chr ( 196 ) . chr ( 165 ) => 'h', 
			chr ( 196 ) . chr ( 166 ) => 'H', 
			chr ( 196 ) . chr ( 167 ) => 'h', 
			chr ( 196 ) . chr ( 168 ) => 'I', 
			chr ( 196 ) . chr ( 169 ) => 'i', 
			chr ( 196 ) . chr ( 170 ) => 'I', 
			chr ( 196 ) . chr ( 171 ) => 'i', 
			chr ( 196 ) . chr ( 172 ) => 'I', 
			chr ( 196 ) . chr ( 173 ) => 'i', 
			chr ( 196 ) . chr ( 174 ) => 'I', 
			chr ( 196 ) . chr ( 175 ) => 'i', 
			chr ( 196 ) . chr ( 176 ) => 'I', 
			chr ( 196 ) . chr ( 177 ) => 'i', 
			chr ( 196 ) . chr ( 178 ) => 'IJ', 
			chr ( 196 ) . chr ( 179 ) => 'ij', 
			chr ( 196 ) . chr ( 180 ) => 'J', 
			chr ( 196 ) . chr ( 181 ) => 'j', 
			chr ( 196 ) . chr ( 182 ) => 'K', 
			chr ( 196 ) . chr ( 183 ) => 'k', 
			chr ( 196 ) . chr ( 184 ) => 'k', 
			chr ( 196 ) . chr ( 185 ) => 'L', 
			chr ( 196 ) . chr ( 186 ) => 'l', 
			chr ( 196 ) . chr ( 187 ) => 'L', 
			chr ( 196 ) . chr ( 188 ) => 'l', 
			chr ( 196 ) . chr ( 189 ) => 'L', 
			chr ( 196 ) . chr ( 190 ) => 'l', 
			chr ( 196 ) . chr ( 191 ) => 'L', 
			chr ( 197 ) . chr ( 128 ) => 'l', 
			chr ( 197 ) . chr ( 129 ) => 'L', 
			chr ( 197 ) . chr ( 130 ) => 'l', 
			chr ( 197 ) . chr ( 131 ) => 'N', 
			chr ( 197 ) . chr ( 132 ) => 'n', 
			chr ( 197 ) . chr ( 133 ) => 'N', 
			chr ( 197 ) . chr ( 134 ) => 'n', 
			chr ( 197 ) . chr ( 135 ) => 'N', 
			chr ( 197 ) . chr ( 136 ) => 'n', 
			chr ( 197 ) . chr ( 137 ) => 'N', 
			chr ( 197 ) . chr ( 138 ) => 'n', 
			chr ( 197 ) . chr ( 139 ) => 'N', 
			chr ( 197 ) . chr ( 140 ) => 'O', 
			chr ( 197 ) . chr ( 141 ) => 'o', 
			chr ( 197 ) . chr ( 142 ) => 'O', 
			chr ( 197 ) . chr ( 143 ) => 'o', 
			chr ( 197 ) . chr ( 144 ) => 'O', 
			chr ( 197 ) . chr ( 145 ) => 'o', 
			chr ( 197 ) . chr ( 146 ) => 'OE', 
			chr ( 197 ) . chr ( 147 ) => 'oe', 
			chr ( 197 ) . chr ( 148 ) => 'R', 
			chr ( 197 ) . chr ( 149 ) => 'r', 
			chr ( 197 ) . chr ( 150 ) => 'R', 
			chr ( 197 ) . chr ( 151 ) => 'r', 
			chr ( 197 ) . chr ( 152 ) => 'R', 
			chr ( 197 ) . chr ( 153 ) => 'r', 
			chr ( 197 ) . chr ( 154 ) => 'S', 
			chr ( 197 ) . chr ( 155 ) => 's', 
			chr ( 197 ) . chr ( 156 ) => 'S', 
			chr ( 197 ) . chr ( 157 ) => 's', 
			chr ( 197 ) . chr ( 158 ) => 'S', 
			chr ( 197 ) . chr ( 159 ) => 's', 
			chr ( 197 ) . chr ( 160 ) => 'S', 
			chr ( 197 ) . chr ( 161 ) => 's', 
			chr ( 197 ) . chr ( 162 ) => 'T', 
			chr ( 197 ) . chr ( 163 ) => 't', 
			chr ( 197 ) . chr ( 164 ) => 'T', 
			chr ( 197 ) . chr ( 165 ) => 't', 
			chr ( 197 ) . chr ( 166 ) => 'T', 
			chr ( 197 ) . chr ( 167 ) => 't', 
			chr ( 197 ) . chr ( 168 ) => 'U', 
			chr ( 197 ) . chr ( 169 ) => 'u', 
			chr ( 197 ) . chr ( 170 ) => 'U', 
			chr ( 197 ) . chr ( 171 ) => 'u', 
			chr ( 197 ) . chr ( 172 ) => 'U', 
			chr ( 197 ) . chr ( 173 ) => 'u', 
			chr ( 197 ) . chr ( 174 ) => 'U', 
			chr ( 197 ) . chr ( 175 ) => 'u', 
			chr ( 197 ) . chr ( 176 ) => 'U', 
			chr ( 197 ) . chr ( 177 ) => 'u', 
			chr ( 197 ) . chr ( 178 ) => 'U', 
			chr ( 197 ) . chr ( 179 ) => 'u', 
			chr ( 197 ) . chr ( 180 ) => 'W', 
			chr ( 197 ) . chr ( 181 ) => 'w', 
			chr ( 197 ) . chr ( 182 ) => 'Y', 
			chr ( 197 ) . chr ( 183 ) => 'y', 
			chr ( 197 ) . chr ( 184 ) => 'Y', 
			chr ( 197 ) . chr ( 185 ) => 'Z', 
			chr ( 197 ) . chr ( 186 ) => 'z', 
			chr ( 197 ) . chr ( 187 ) => 'Z', 
			chr ( 197 ) . chr ( 188 ) => 'z', 
			chr ( 197 ) . chr ( 189 ) => 'Z', 
			chr ( 197 ) . chr ( 190 ) => 'z', 
			chr ( 197 ) . chr ( 191 ) => 's',  // Euro Sign
			chr ( 226 ) . chr ( 130 ) . chr ( 172 ) => 'E' );

		$string = strtr ( $string, $chars );
	} else {
		// Assume ISO-8859-1 if not UTF-8
		$chars ['in'] = chr ( 128 ) . chr ( 131 ) . chr ( 138 ) . chr ( 142 ) . chr ( 154 ) . chr ( 158 ) . chr ( 159 ) . chr ( 162 ) . chr ( 165 ) . chr ( 181 ) . chr ( 192 ) . chr ( 193 ) . chr ( 194 ) . chr ( 195 ) . chr ( 196 ) . chr ( 197 ) . chr ( 199 ) . chr ( 200 ) . chr ( 201 ) . chr ( 202 ) . chr ( 203 ) . chr ( 204 ) . chr ( 205 ) . chr ( 206 ) . chr ( 207 ) . chr ( 209 ) . chr ( 210 ) . chr ( 211 ) . chr ( 212 ) . chr ( 213 ) . chr ( 214 ) . chr ( 216 ) . chr ( 217 ) . chr ( 218 ) . chr ( 219 ) . chr ( 220 ) . chr ( 221 ) . chr ( 224 ) . chr ( 225 ) . chr ( 226 ) . chr ( 227 ) . chr ( 228 ) . chr ( 229 ) . chr ( 231 ) . chr ( 232 ) . chr ( 233 ) . chr ( 234 ) . chr ( 235 ) . chr ( 236 ) . chr ( 237 ) . chr ( 238 ) . chr ( 239 ) . chr ( 241 ) . chr ( 242 ) . chr ( 243 ) . chr ( 244 ) . chr ( 245 ) . chr ( 246 ) . chr ( 248 ) . chr ( 249 ) . chr ( 250 ) . chr ( 251 ) . chr ( 252 ) . chr ( 253 ) . chr ( 255 );

		$chars ['out'] = "EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy";

		$string = strtr ( $string, $chars ['in'], $chars ['out'] );
		$double_chars ['in'] = array (
			chr ( 140 ), 
			chr ( 156 ),
			chr ( 161 ),
			chr ( 163 ),
			chr ( 166 ),
			chr ( 172 ),
			chr ( 175 ),
			chr ( 177 ),
			chr ( 179 ),
			chr ( 182 ),
			chr ( 188 ),
			chr ( 191 ), 
			chr ( 198 ), 
			chr ( 208 ), 
			chr ( 222 ), 
			chr ( 223 ), 
			chr ( 230 ), 
			chr ( 240 ), 
			chr ( 254 ) );
		$double_chars ['out'] = array (
			'OE', 
			'oe', 
			'A',
			'L',
			'S',
			'Z',
			'Z',
			'a',
			'l',
			's',
			'z',
			'z',
			'C', 
			'DH', 
			'TH', 
			'ss', 
			'c', 
			'dh', 
			'th' );
		$string = str_replace ( $double_chars ['in'], $double_chars ['out'], $string );
	}

	return $string;
}
/**
 * Here we break the url using parse_url
 * @return array from parse_url()
 */

function break_url($url, $get = '', $seo_extra = '') {
	if (! $url || $url == 'http://' || $url == 'http://#') {
		return;

	}
	$exploded_url = @parse_url ( $url );

	//fixes doodoo
	$exploded_url ['query'] = str_replace ( '&', '&', $exploded_url ['query'] );
	parse_str ( $exploded_url ['query'], $exploded_url ['exploded_query'] );
	if ($get) {
		$exploded_url ['exploded_query'] = array_merge ( $exploded_url ['exploded_query'], $get );
	}
	if ($exploded_url ['exploded_query'] ['act']) {
		$exploded_url ['_low_act'] = strtolower ( $exploded_url ['exploded_query'] ['act'] );
	}

	if ($exploded_url ['exploded_query'] ['showuser']) {
		$exploded_url ['_low_act'] = 'profile';
	}

	if ($exploded_url ['exploded_query'] ['showforum']) {
		$exploded_url ['_low_act'] = 'sf';
	}

	if ($exploded_url ['exploded_query'] ['showtopic']) {
		$exploded_url ['_low_act'] = 'st';
	}
	if ($exploded_url ['exploded_query'] ['autocom'] == 'blog') {
		$exploded_url ['_low_act'] = 'autocom';

	}
	if ($exploded_url ['exploded_query'] ['autocom'] == 'gallery') {
		$exploded_url ['_low_act'] = 'autocom';

	}

	if ($exploded_url ['exploded_query'] ['login'] || $exploded_url ['exploded_query'] ['Login']) {
		$exploded_url ['_low_act'] = 'login';
	}

	if ($seo_extra) {
		$exploded_url = array_merge ( $exploded_url, $seo_extra );
	}

	return $exploded_url;

}

function _accents_seems_utf8($str) { // by bmorel at ssi dot fr
	for($i = 0; $i < strlen ( $str ); $i ++) {
		if (ord ( $str [$i] ) < 0x80)
			continue; // 0bbbbbbb
		elseif ((ord ( $str [$i] ) & 0xE0) == 0xC0)
			$n = 1; // 110bbbbb
		elseif ((ord ( $str [$i] ) & 0xF0) == 0xE0)
			$n = 2; // 1110bbbb
		elseif ((ord ( $str [$i] ) & 0xF8) == 0xF0)
			$n = 3; // 11110bbb
		elseif ((ord ( $str [$i] ) & 0xFC) == 0xF8)
			$n = 4; // 111110bb
		elseif ((ord ( $str [$i] ) & 0xFE) == 0xFC)
			$n = 5; // 1111110b
		else
			return false; // Does not match any model
		for($j = 0; $j < $n; $j ++) { // n bytes matching 10bbbbbb follow ?
			if ((++ $i == strlen ( $str )) || ((ord ( $str [$i] ) & 0xC0) != 0x80))
				return false;
		}
	}
	return true;
}
function gentle_clean($data, $skip = "") {
	if ($skip == 1) {
		$data = html_entity_decode ( $data );
	} else {
		$data = htmlentities ( $data );
	}

	$data = $this->ipsclass->txt_UNhtmlspecialchars ( $data );
	$data = $this->ipsclass->clean_evil_tags ( $data );

	$data = str_replace ( "<br />", ' ', $data );
	$data = str_replace ( "<li>", ' ', $data );
	$data = strip_tags ( $data );
	$data = $this->ipsclass->txt_windowstounix ( $data );
	$data = str_replace ( "\n", ' ', $data );

	$data = trim ( $data );
	return $data;
}

function str_char_replacement($text) {
	if ($this->ipsclass->vars ['msl_char_enable_replacement']) {

		if (! is_array ( $left ) && ! is_array ( $right )) {

			include (ROOT_PATH . 'modules/MSL/nchar_list.php');

		}

		$text = $this->remove_accents ( $text );
		//		$text = iconv('utf-8','us-ascii//TRANSLIT',$text);
		$text = str_replace ( $left, $right, $text );

	}

	return $text;
}

/**---------------------------------
 * this function returns a string that is used to replace
 * the searched string with.
 * This is the generated url 
 *--------------------------------*/

function return_replacement_url($url_info, $formatted, $extra = '') {

	/**---------------------------------
	 * HASH fix
	 *--------------------------------*/
	if (! empty ( $url_info ['hash'] )) {
		$hash = '#' . $url_info ['hash'];
	} else {
		$hash = '';
	}

	//no quote = check_redirect function
	if (! $url_info ['quote']) {
		$url = $this->ipsclass->vars ['board_url'] . '/' . $formatted . $extra;
	} else {
		$url = 'href=' . $url_info ['quote'] . $url_info ['scheme'] . ':)/' . $url_info ['host'] . SEO_folder . $formatted . $extra . $hash . $url_info ['quote'];
	}

	$url = str_replace ( '&', '&', $url );
	return $url;
}

function do_seo_settings($file = 'seo_settings.php', $query_furl, $folder = '') {

	if (! file_exists ( $file )) {

		return false;
	}

	include ($file);
	/**---------------------------------
	 * sort the list of rules from seo_settings.php
	 *--------------------------------*/

	uksort ( $list_of_rules, array (
		$this, 
		'sortr_longer' ) );

	/**---------------------------------
	 * perform a foreach to restructure the rules for easy passing
	 */
	//--------------------------------


	foreach ( $list_of_rules as $key => $value ) {
		$all_rules [$list_of_rules [$key] [2]] = $list_of_rules [$key] [0];
	}
	unset ( $list_of_rules );
	//---------------------------------------
	// lets add more rules...
	// from line 423 in include.php
	//---------------------------------------


	$all_rules ['act=idx'] = SEO_forum_name;
	if (defined ( 'IPB_MAKE_UPORTAL_HOMEPAGE' )) {
		$all_rules ['act=uportal'] = SEO_portal_name;
	} else {
		$all_rules ['act=home'] = SEO_portal_name;
	}

	/**---------------------------------
	 * foreach the rules to see if we find a match
	 *--------------------------------*/

	$tail_of_url = array ();
	$poped = 0; //if poped stop the presses
	foreach ( $all_rules as $key_rule => $rule ) {

		if (! $poped) {

			if (preg_match ( '@^' . $rule . '@si', $query_furl, $matches )) {

				eval ( "\$new_query =  \"{$key_rule}\";" );
				//				echo '<!--'.$key_rule.'-->';
				$poped = 1;
			}
		}

	}

	/**---------------------------------
	 * unset data
	 *--------------------------------*/
	unset ( $all_rules );
	unset ( $file );
	return array (
		$poped, 
		$new_query );
}

/**
 * Here we get only the query furl from the given url
 * maybe later we could use it for non-htaccess websites
 */
function get_query_furl($url) {

	return preg_replace ( '@.*?' . SEO_folder . '@si', '', $url );
}

}
?>

  • Manager
Opublikowano

Problem ROZWIĄZANY. Jeśli są jakiekolwiek wątpliwości, pytania proszę o założenie nowego tematu.

Wszelkie uzasadnione reklamacje/pretensje/sugestie/rady przyjmuje ekipa forum.

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • 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ę.