phpBB Italia chiude!
phpBB Italia ringrazia tutti gli utenti che hanno dato fiducia al nostro progetto per ben 9 anni, e che, grazie al grande lavoro fatto da tutto lo Staff (rigorosamente a titolo gratuito), hanno portato il portale a diventare il principale punto di riferimento italiano alla piattaforma phpBB.

Purtroppo, causa motivi personali, non ho più modo di gestirlo e portarlo avanti. Il forum viene ora posto in uno stato di sola lettura, nonché un archivio storico per permettere a chiunque di fruire di tutte le discussioni trattate.

Il nuovo portale di assistenza per l'Italia di phpBB diventa phpBB-Store.it, cui ringrazio per aver deciso di portare avanti questo grande progetto.

Grazie ancora,
Carlo - Amministratore di phpBB Italia

Problema installazione zero duplicate v0.6.8

Supporto relativo alle altre MODs SEO, quali No Duplicate, Zero Duplicate, Optimal Titles, SEO Stats MOD, Dynamic Meta Tags, e così via.
crocierista
Utente
Utente
Messaggi: 214
Iscritto il: 06/03/2011, 19:33
Sesso: Maschio
Versione: 3.0.11
Server: UNIX/Linux
PHP: 5.2.17
Database: MySQL(i) 5.0.82sp1-log
Contatta:

Problema installazione zero duplicate v0.6.8

Messaggio da crocierista » 13/01/2013, 7:11

Buon giorno
Vorrei installare la mod in oggetto ma una volta caricati i file editati il forum mi va in blocco.
Il problema è il seguente si ingrandiscono le scritte i bottoni ecc... e inoltre mi da cosici di errori all'inizio della pagina
allego screen
Immagine

Premetto che ho fatto il passaggio da capo 4 volte ma niente escludo errore di edit file sono stato maniacale l'ultima volta che ho provato

Come posso ovviare il problema?
Ho installato le seguenti mod
Seo_Url 0.7.0
Gym sitemap 2.0.4
Php Newslwtter
Share on Mod 2.1.0
Mobiquo Tapatalk

Angolo
Leader Traduttori
Leader Traduttori
Messaggi: 7237
Iscritto il: 11/03/2011, 17:37
Sesso: Maschio
Versione: 3.0.12
Server: UNIX/Linux
PHP: 5.6.18
Database: MySQL 5.6.33-log
Contatta:

Re: Problema installazione zero duplicate v0.6.8

Messaggio da Angolo » 13/01/2013, 18:48

Dal messaggio di errore, si evince chiaramente che l'errore è nel file function.php.

Ti vengono indicate anche le righe....

Ricontrolla tutto in riferimento a quel file, con molta precisione.

crocierista
Utente
Utente
Messaggi: 214
Iscritto il: 06/03/2011, 19:33
Sesso: Maschio
Versione: 3.0.11
Server: UNIX/Linux
PHP: 5.2.17
Database: MySQL(i) 5.0.82sp1-log
Contatta:

Re: Problema installazione zero duplicate v0.6.8

Messaggio da crocierista » 14/01/2013, 11:22

Grazie Angolo per la risposta.
Però non capisco per l'installazione della zero duplicate non mi richiede intervento sul fuction.php.....
Quindi non riesco a capire dove sta lo l'errore??
Puoi aiutarmi?

Ti allego il resto del messaggio di errore riscontrato

Immagine

Angolo
Leader Traduttori
Leader Traduttori
Messaggi: 7237
Iscritto il: 11/03/2011, 17:37
Sesso: Maschio
Versione: 3.0.12
Server: UNIX/Linux
PHP: 5.6.18
Database: MySQL 5.6.33-log
Contatta:

Re: Problema installazione zero duplicate v0.6.8

Messaggio da Angolo » 14/01/2013, 12:43

Adesso è un altro file...

Ti conviene trasferire il tutto in locale, e utilizzare in locale i file della SEO premod. Quindi, sempre in locale, riapplichi le modiche delle altre MOD sui file della SEO premod. Se fatto tutto correttamente, il problema sussiste, forse usi qualche MOD incompatibile con la SEO.

crocierista
Utente
Utente
Messaggi: 214
Iscritto il: 06/03/2011, 19:33
Sesso: Maschio
Versione: 3.0.11
Server: UNIX/Linux
PHP: 5.2.17
Database: MySQL(i) 5.0.82sp1-log
Contatta:

Re: Problema installazione zero duplicate v0.6.8

Messaggio da crocierista » 14/01/2013, 12:56

Angolo ha scritto:Adesso è un altro file...

Ti conviene trasferire il tutto in locale, e utilizzare in locale i file della SEO premod. Quindi, sempre in locale, riapplichi le modiche delle altre MOD sui file della SEO premod. Se fatto tutto correttamente, il problema sussiste, forse usi qualche MOD incompatibile con la SEO.
No Angolo e lo stesso messaggio lo diviso in 2 per allegarlo
Non so proprio da dove partire ma se installo no duplicate al posto dello zero?
Mi sono riguardato tutti i file e tutto è fatto correttamente :oops:
Uso la Nesletter mod
Mobiquo Tapatalk
Gym
Seo Url
solo queste sono installate
Stavo pensando ma prima di installare la zero devo settare Gymsitemap? no perche nel pannello della gym io gia leggo zero duplicate attivare si o no ?

Avatar utente
Tiger
phpBB Expert
phpBB Expert
Messaggi: 1998
Iscritto il: 24/05/2011, 12:37
Sesso: Maschio
Versione: 3.0.12
Server: UNIX/Linux
PHP: 5.3.28
Database: MySQL(i) 5.5.35-cll
Località: Roma
Contatta:

Re: Problema installazione zero duplicate v0.6.8

Messaggio da Tiger » 14/01/2013, 13:04

Strano,il problema se non sbaglio ti e' sorto subito dopo aver integrato la zero duplicate,quindi,si suppone che la seo sia stata installata correttamente,riguardo a quell'errore di debug,a volte potrebbe essere anche uno spazio di troppo lasciato tra una riga ed un'altra ricontrolla per bene i passaggi per la zero duplicate.

crocierista
Utente
Utente
Messaggi: 214
Iscritto il: 06/03/2011, 19:33
Sesso: Maschio
Versione: 3.0.11
Server: UNIX/Linux
PHP: 5.2.17
Database: MySQL(i) 5.0.82sp1-log
Contatta:

Re: Problema installazione zero duplicate v0.6.8

Messaggio da crocierista » 14/01/2013, 13:12

Tiger ha scritto:Strano,il problema se non sbaglio ti e' sorto subito dopo aver integrato la zero duplicate,quindi,si suppone che la seo sia stata installata correttamente,riguardo a quell'errore di debug,a volte potrebbe essere anche uno spazio di troppo lasciato tra una riga ed un'altra ricontrolla per bene i passaggi per la zero duplicate.
si ho installato la seo url e la gym e il forum non da nessun problema ma come carico i file della zero mi da quel messaggio???

Avatar utente
Tiger
phpBB Expert
phpBB Expert
Messaggi: 1998
Iscritto il: 24/05/2011, 12:37
Sesso: Maschio
Versione: 3.0.12
Server: UNIX/Linux
PHP: 5.3.28
Database: MySQL(i) 5.5.35-cll
Località: Roma
Contatta:

Re: Problema installazione zero duplicate v0.6.8

Messaggio da Tiger » 14/01/2013, 13:20

Ricontrolla bene le modifiche in questo file,controllando anche la spaziatura:
phpbb_seo/includes/setup_phpbb_seo.php

crocierista
Utente
Utente
Messaggi: 214
Iscritto il: 06/03/2011, 19:33
Sesso: Maschio
Versione: 3.0.11
Server: UNIX/Linux
PHP: 5.2.17
Database: MySQL(i) 5.0.82sp1-log
Contatta:

Re: Problema installazione zero duplicate v0.6.8

Messaggio da crocierista » 14/01/2013, 13:22

Tiger ha scritto:Ricontrolla bene le modifiche in questo file,controllando anche la spaziatura:
phpbb_seo/includes/setup_phpbb_seo.php
Ok mo' lo edito da capo...

crocierista
Utente
Utente
Messaggi: 214
Iscritto il: 06/03/2011, 19:33
Sesso: Maschio
Versione: 3.0.11
Server: UNIX/Linux
PHP: 5.2.17
Database: MySQL(i) 5.0.82sp1-log
Contatta:

Re: Problema installazione zero duplicate v0.6.8

Messaggio da crocierista » 14/01/2013, 18:55

Ho riguardato il file e credo che tutto sia corretto allego il mio setup_phpbb_seo

Cerca

Codice: Seleziona tutto

function init_phpbb_seo() {
		global $phpEx, $config, $phpbb_root_path;  
Inserisci dopo

Codice: Seleziona tutto

// --> Zero Dupe
		$this->seo_opt['zero_dupe'] = array( 'on' => false, // Activate or not the redirections : true / false
			'strict' => false, // strict compare, == VS strpos() : true / false
			'post_redir' => 'guest', // Redirect post urls if not valid ? : guest / all / post / off
		);
		$this->cache_config['dynamic_options']['zero_dupe'] = $this->seo_opt['zero_dupe']; // Do not change
		$this->seo_opt['zero_dupe']['do_redir'] = false; // do not change
		$this->seo_opt['zero_dupe']['go_redir'] = true; // do not change
		$this->seo_opt['zero_dupe']['do_redir_post'] = false; // do not change
		$this->seo_opt['zero_dupe']['start'] = 0; // do not change
		$this->seo_opt['zero_dupe']['redir_def'] = array(); // do not change
		// <-- Zero Dupe  
Cerca

Codice: Seleziona tutto

// Let's make sure that settings are consistent
		$this->check_config();
	}
	// Here start the add-on methods  
Aggiungi dopo

Codice: Seleziona tutto

// --> Zero Duplicate
	/**
	* Custom HTTP 301 redirections.
	* To kill duplicates
	*/
	function seo_redirect($url, $header = '301 Moved Permanently', $code = 301, $replace = true) {
		global $db;
		if (!$this->seo_opt['zero_dupe']['on'] || @headers_sent()) {
			return false;
		}
		garbage_collection();
		$url = str_replace('&', '&', $url);
		// Behave as redirect() for checks to provide with the same level of protection
		// Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2
		if (strpos(urldecode($url), "\n") !== false || strpos(urldecode($url), "\r") !== false || strpos($url, ';') !== false) {
			trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
		}
		// Now, also check the protocol and for a valid url the last time...
		$allowed_protocols = array('http', 'https'/*, 'ftp', 'ftps'*/);
		$url_parts = parse_url($url);
		if ($url_parts === false || empty($url_parts['scheme']) || !in_array($url_parts['scheme'], $allowed_protocols)) {
			trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
		}
		$http = 'HTTP/1.1 ';
		header($http . $header, $replace, $code);
		header('Location: ' . $url);
		exit_handler();
	}
	/**
	* Set the do_redir_post option right
	*/
	function set_do_redir_post() {
		global $user;
		switch ($this->seo_opt['zero_dupe']['post_redir']) {
			case 'guest':
				if ( empty($user->data['is_registered']) ) {
					$this->seo_opt['zero_dupe']['do_redir_post'] = true;
				}
				break;
			case 'all':
				$this->seo_opt['zero_dupe']['do_redir_post'] = true;
				break;
			case 'off': // Do not redirect
				$this->seo_opt['zero_dupe']['do_redir'] = false;
				$this->seo_opt['zero_dupe']['go_redir'] = false;
				$this->seo_opt['zero_dupe']['do_redir_post'] = false;
				break;
			default:
				$this->seo_opt['zero_dupe']['do_redir_post'] = false;
				break;
		}
		return $this->seo_opt['zero_dupe']['do_redir_post'];
	}
	/**
	* Redirects if the uri sent does not match (fully) the
	* attended url
	*/
	function seo_chk_dupe($url = '', $uri = '', $path = '') {
		global $auth, $user, $_SID, $phpbb_root_path, $config;
		if (empty($this->seo_opt['req_file']) || (!$this->seo_opt['rewrite_usermsg'] && $this->seo_opt['req_file'] == 'search') ) {
			return false;
		}
		if (!empty($_REQUEST['explain']) && (boolean) ($auth->acl_get('a_') && defined('DEBUG_EXTRA'))) {
			if ($_REQUEST['explain'] == 1) {
				return true;
			}
		}
		$path = empty($path) ? $phpbb_root_path : $path;
		$uri = !empty($uri) ? $uri : $this->seo_path['uri'];
		$reg = !empty($user->data['is_registered']) ? true : false;
		$url = empty($url) ? $this->expected_url($path) : str_replace('&', '&', append_sid($url, false, true, 0));
		$url = $this->drop_sid($url);
		// Only add sid if user is registered and needs it to keep session
		if (!empty($_GET['sid']) && !empty($_SID) && ($reg || !$this->seo_opt['rem_sid']) ) {
			if ($_GET['sid'] == $user->session_id) {
				$url .=  (utf8_strpos( $url, '?' ) !== false ? '&' : '?') . 'sid=' . $user->session_id;
			}
		}
		$url = str_replace( '%26', '&', urldecode($url));
		if ($this->seo_opt['zero_dupe']['do_redir']) {
			$this->seo_redirect($url);
		} else {
			$url_check = $url;
			// we remove url hash for comparison, but keep it for redirect
			if (strpos($url, '#') !== false) {
				list($url_check, $hash) = explode('#', $url, 2);
			}
			if ($this->seo_opt['zero_dupe']['strict']) {
				return $this->seo_opt['zero_dupe']['go_redir'] && ( ($uri != $url_check) ? $this->seo_redirect($url) : false );
			} else {
				return $this->seo_opt['zero_dupe']['go_redir'] && ( (utf8_strpos( $uri, $url_check ) === false) ? $this->seo_redirect($url) : false );
			}
		}
	}
	/**
	* expected_url($path = '')
	* build expected url
	*/
	function expected_url($path = '') {
		global $phpbb_root_path, $phpEx;
		$path = empty($path) ? $phpbb_root_path : $path;
		$params = array();
		foreach ($this->seo_opt['zero_dupe']['redir_def'] as $get => $def) {
			if ((isset($_GET[$get]) && $def['keep']) || !empty($def['force'])) {
				$params[$get] = $def['val'];
				if (!empty($def['hash'])) {
					$params['#'] = $def['hash'];
				}
			}
		}
		$this->page_url = append_sid($path . $this->seo_opt['req_file'] . ".$phpEx", $params, false, 0);
		return $this->page_url;
	}
	/**
	* set_cond($bool, $type = 'bool_redir', $or = true)
	* Helps out grabbing boolean vars
	*/
	function set_cond($bool, $type = 'do_redir', $or = true) {
		if ( $or ) {
			$this->seo_opt['zero_dupe'][$type] = (boolean) ($bool || $this->seo_opt['zero_dupe'][$type]);
		} else {
			$this->seo_opt['zero_dupe'][$type] = (boolean) ($bool && $this->seo_opt['zero_dupe'][$type]);
		}
		return;
	}
	/**
	* check start var consistency
	* Returns our best guess for $start, eg the first valid page
	*/
	function seo_chk_start($start = 0, $limit = 0) {
		if ($limit > 0) {
			$start = is_int($start/$limit) ? $start : intval($start/$limit)*$limit;
		}
		if ( $start >= 1 ) {
			$this->start = $this->seo_delim['start'] . (int) $start;
			return (int) $start;
		}
		$this->start = '';
		return 0;
	}
	/**
	* get_canonical
	* Returns the canonical url if ever built
	* Beware with ssl :
	* 	Since we want zero duplicate, the canonical element will only use https when ssl is forced
	* 	(eg set as THE server protocol in config) and will use http in other cases.
	*/
	function get_canonical() {
		return $this->sslify($this->seo_path['canonical'], $this->ssl['forced'], true);
	}
	// <-- Zero Duplicate  
Il Mio setup_phpbb_seo

Codice: Seleziona tutto

  <?php
/**
*
* @package Ultimate SEO URL phpBB SEO
* @version $Id: setup_phpbb_seo.php 327 2011-09-07 07:24:49Z dcz $
* @copyright (c) 2006 - 2010 www.phpbb-seo.com
* @license http://www.opensource.org/licenses/rpl1.5.txt Reciprocal Public License 1.5
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB')) {
	exit;
}
/**
* setup_phpbb_seo Class
* www.phpBB-SEO.com
* @package Ultimate SEO URL phpBB SEO
*/
class setup_phpbb_seo {
	/**
	* Do the init
	*/
	function init_phpbb_seo() {
		global $phpEx, $config, $phpbb_root_path;
          // --> Zero Dupe
		$this->seo_opt['zero_dupe'] = array( 'on' => false, // Activate or not the redirections : true / false
			'strict' => false, // strict compare, == VS strpos() : true / false
			'post_redir' => 'guest', // Redirect post urls if not valid ? : guest / all / post / off
		);
		$this->cache_config['dynamic_options']['zero_dupe'] = $this->seo_opt['zero_dupe']; // Do not change
		$this->seo_opt['zero_dupe']['do_redir'] = false; // do not change
		$this->seo_opt['zero_dupe']['go_redir'] = true; // do not change
		$this->seo_opt['zero_dupe']['do_redir_post'] = false; // do not change
		$this->seo_opt['zero_dupe']['start'] = 0; // do not change
		$this->seo_opt['zero_dupe']['redir_def'] = array(); // do not change
		// <-- Zero Dupe
		// Let's load config and forum urls, mods adding options in the cache file must do it before
		if ($this->check_cache()) {
			foreach($this->cache_config['dynamic_options'] as $optionname => $optionvalue ) {
				if (@is_array($this->cache_config['settings'][$optionname])) {
					$this->seo_opt[$optionname] = array_merge($this->seo_opt[$optionname], $this->cache_config['settings'][$optionname]);
				} elseif ( @isset($this->cache_config['settings'][$optionvalue]) ) {
					$this->seo_opt[$optionvalue] = $this->cache_config['settings'][$optionvalue];
				}
			}
			$this->modrtype = @isset($this->seo_opt['modrtype']) ? $this->seo_opt['modrtype'] : $this->modrtype;
			if ( $this->modrtype > 1 ) { // Load cached URLs
				$this->seo_url['forum'] =& $this->cache_config['forum'];
			}
		}
		// ====> here starts the add-on and custom set up <====

		// ===> Custom url replacements <===
		// Here you can set up custom replacements to be used in title injection.
		// Example : array( 'find' => 'replace')
		//	$this->url_replace = array(
		//		// Purely cosmetic replace
		//		'$' => 'dollar', '€' => 'euro',
		//		'\'s' => 's', // it's => its / mary's => marys ...
		//		// Language specific replace (German example)
		//		'ß' => 'ss',
		//		'Ä' => 'Ae', 'ä' => 'ae',
		//		'Ö' => 'Oe', 'ö' => 'oe',
		//		'Ü' => 'Ue', 'ü' => 'ue',
		//	);

		// ===> Custom values Delimiters, Static parts and Suffixes <===
		// ==> Delimiters <==
		// Can be overridden, requires .htaccess update <=
		// Example :
		//	$this->seo_delim['forum'] = '-mydelim'; // instead of the default "-f"

		// ==> Static parts <==
		// Can be overridden, requires .htaccess update.
		// Example :
		//	$this->seo_static['post'] = 'message'; // instead of the default "post"
		// !! phpBB files must be treated a bit differently !!
		// Example :
		//	$this->seo_static['file'][ATTACHMENT_CATEGORY_QUICKTIME] = 'quicktime'; // instead of the default "qt"
		//	$this->seo_static['file_index'] = 'my_files_virtual_dir'; // instead of the default "resources"

		// ==> Suffixes <==
		// Can be overridden, requires .htaccess update <=
		// Example :
		// 	$this->seo_ext['topic'] = '/'; // instead of the default ".html"

		// ==> Forum redirect <==
		// In case you are using forum id removing and need to edit some forum urls
		// that where already indexed, you can keep track of them ritgh here
		// NOTE :
		// 	This will only allow the zero duplicate to perform the appropriate redirection
		// 	You need the mod for this to work :
		// 		http://www.phpbb-seo.com/en/zero-duplicate/phpbb-seo-zero-duplicate-t1220.html (en)
		// 		http://www.phpbb-seo.com/fr/zero-duplicate/zero-duplicate-phpbb-seo-t1502.html (fr)
		//
		// Example :
		//
		// $this->forum_redirect = array(
		// 	// 'old-url-without-id-nor-suffix' => forum_id,
		// 	'old-forum-url' => 23,
		// 	'another-one' => 32,
		// 	'anoter-version-of-the-same' => 32,
		// );
		//

		// ==> Special for lazy French, others may delete this part
		if ( strpos($config['default_lang'], 'fr') !== false ) {
			$this->seo_static['user'] = 'membre';
			$this->seo_static['group'] = 'groupe';
			$this->seo_static['global_announce'] = 'annonces';
			$this->seo_static['leaders'] = 'equipe';
			$this->seo_static['atopic'] = 'sujets-actifs';
			$this->seo_static['utopic'] = 'sans-reponses';
			$this->seo_static['npost'] = 'nouveaux-messages';
			$this->seo_static['urpost'] = 'non-lu';
			$this->seo_static['file_index'] = 'ressources';
		}
		// <== Special for lazy French, others may delete this part

		// Let's make sure that settings are consistent
		$this->check_config();
	}
	// Here start the add-on methods
     // --> Zero Duplicate
	/**
	* Custom HTTP 301 redirections.
	* To kill duplicates
	*/
	function seo_redirect($url, $header = '301 Moved Permanently', $code = 301, $replace = true) {
		global $db;
		if (!$this->seo_opt['zero_dupe']['on'] || @headers_sent()) {
			return false;
		}
		garbage_collection();
		$url = str_replace('&', '&', $url);
		// Behave as redirect() for checks to provide with the same level of protection
		// Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2
		if (strpos(urldecode($url), "\n") !== false || strpos(urldecode($url), "\r") !== false || strpos($url, ';') !== false) {
			trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
		}
		// Now, also check the protocol and for a valid url the last time...
		$allowed_protocols = array('http', 'https'/*, 'ftp', 'ftps'*/);
		$url_parts = parse_url($url);
		if ($url_parts === false || empty($url_parts['scheme']) || !in_array($url_parts['scheme'], $allowed_protocols)) {
			trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
		}
		$http = 'HTTP/1.1 ';
		header($http . $header, $replace, $code);
		header('Location: ' . $url);
		exit_handler();
	}
	/**
	* Set the do_redir_post option right
	*/
	function set_do_redir_post() {
		global $user;
		switch ($this->seo_opt['zero_dupe']['post_redir']) {
			case 'guest':
				if ( empty($user->data['is_registered']) ) {
					$this->seo_opt['zero_dupe']['do_redir_post'] = true;
				}
				break;
			case 'all':
				$this->seo_opt['zero_dupe']['do_redir_post'] = true;
				break;
			case 'off': // Do not redirect
				$this->seo_opt['zero_dupe']['do_redir'] = false;
				$this->seo_opt['zero_dupe']['go_redir'] = false;
				$this->seo_opt['zero_dupe']['do_redir_post'] = false;
				break;
			default:
				$this->seo_opt['zero_dupe']['do_redir_post'] = false;
				break;
		}
		return $this->seo_opt['zero_dupe']['do_redir_post'];
	}
	/**
	* Redirects if the uri sent does not match (fully) the
	* attended url
	*/
	function seo_chk_dupe($url = '', $uri = '', $path = '') {
		global $auth, $user, $_SID, $phpbb_root_path, $config;
		if (empty($this->seo_opt['req_file']) || (!$this->seo_opt['rewrite_usermsg'] && $this->seo_opt['req_file'] == 'search') ) {
			return false;
		}
		if (!empty($_REQUEST['explain']) && (boolean) ($auth->acl_get('a_') && defined('DEBUG_EXTRA'))) {
			if ($_REQUEST['explain'] == 1) {
				return true;
			}
		}
		$path = empty($path) ? $phpbb_root_path : $path;
		$uri = !empty($uri) ? $uri : $this->seo_path['uri'];
		$reg = !empty($user->data['is_registered']) ? true : false;
		$url = empty($url) ? $this->expected_url($path) : str_replace('&', '&', append_sid($url, false, true, 0));
		$url = $this->drop_sid($url);
		// Only add sid if user is registered and needs it to keep session
		if (!empty($_GET['sid']) && !empty($_SID) && ($reg || !$this->seo_opt['rem_sid']) ) {
			if ($_GET['sid'] == $user->session_id) {
				$url .=  (utf8_strpos( $url, '?' ) !== false ? '&' : '?') . 'sid=' . $user->session_id;
			}
		}
		$url = str_replace( '%26', '&', urldecode($url));
		if ($this->seo_opt['zero_dupe']['do_redir']) {
			$this->seo_redirect($url);
		} else {
			$url_check = $url;
			// we remove url hash for comparison, but keep it for redirect
			if (strpos($url, '#') !== false) {
				list($url_check, $hash) = explode('#', $url, 2);
			}
			if ($this->seo_opt['zero_dupe']['strict']) {
				return $this->seo_opt['zero_dupe']['go_redir'] && ( ($uri != $url_check) ? $this->seo_redirect($url) : false );
			} else {
				return $this->seo_opt['zero_dupe']['go_redir'] && ( (utf8_strpos( $uri, $url_check ) === false) ? $this->seo_redirect($url) : false );
			}
		}
	}
	/**
	* expected_url($path = '')
	* build expected url
	*/
	function expected_url($path = '') {
		global $phpbb_root_path, $phpEx;
		$path = empty($path) ? $phpbb_root_path : $path;
		$params = array();
		foreach ($this->seo_opt['zero_dupe']['redir_def'] as $get => $def) {
			if ((isset($_GET[$get]) && $def['keep']) || !empty($def['force'])) {
				$params[$get] = $def['val'];
				if (!empty($def['hash'])) {
					$params['#'] = $def['hash'];
				}
			}
		}
		$this->page_url = append_sid($path . $this->seo_opt['req_file'] . ".$phpEx", $params, false, 0);
		return $this->page_url;
	}
	/**
	* set_cond($bool, $type = 'bool_redir', $or = true)
	* Helps out grabbing boolean vars
	*/
	function set_cond($bool, $type = 'do_redir', $or = true) {
		if ( $or ) {
			$this->seo_opt['zero_dupe'][$type] = (boolean) ($bool || $this->seo_opt['zero_dupe'][$type]);
		} else {
			$this->seo_opt['zero_dupe'][$type] = (boolean) ($bool && $this->seo_opt['zero_dupe'][$type]);
		}
		return;
	}
	/**
	* check start var consistency
	* Returns our best guess for $start, eg the first valid page
	*/
	function seo_chk_start($start = 0, $limit = 0) {
		if ($limit > 0) {
			$start = is_int($start/$limit) ? $start : intval($start/$limit)*$limit;
		}
		if ( $start >= 1 ) {
			$this->start = $this->seo_delim['start'] . (int) $start;
			return (int) $start;
		}
		$this->start = '';
		return 0;
	}
	/**
	* get_canonical
	* Returns the canonical url if ever built
	* Beware with ssl :
	* 	Since we want zero duplicate, the canonical element will only use https when ssl is forced
	* 	(eg set as THE server protocol in config) and will use http in other cases.
	*/
	function get_canonical() {
		return $this->sslify($this->seo_path['canonical'], $this->ssl['forced'], true);
	}
	// <-- Zero Duplicate
}
?>

Rispondi

Torna a “Altre MODs SEO”

Chi c’è in linea

Visitano il forum: Nessuno e 15 ospiti