Advanced mod Rewrite 0.2.2 - problém
- R-stick
- V.I.P.
- Příspěvky: 907
- Registrován: pát 13. led 2006 1:00:00
- Bydliště: Vysoké Studnice
- Kontaktovat uživatele:
Re: Advanced mod Rewrite 0.2.2 - problém
Co jsem se koukal, tak kódování máš už v pořádku, ovšem mod ti nepřepisuje korektně v některých tématech. To už si ale budeš muset doladit v té části pro přepisování. Resp zapátrat v databázi, co tam máš za znaky. Něco ti totiž chodí správně a něco ne. - a co máš v databázi tě pomůže nasměrovat.
http://www.rstick.com -bubenické paličky
http://www.sferabubeniku.info - bubenické diskusní fórum.
NEPOSKYTUJI podporu přes soukromé zprávy a mail. => ptejte se na fóru.
http://www.sferabubeniku.info - bubenické diskusní fórum.
NEPOSKYTUJI podporu přes soukromé zprávy a mail. => ptejte se na fóru.
Re: Advanced mod Rewrite 0.2.2 - problém
Tak jsem to upravil, diakritika taky už funguje, ale u tohoto modu jen na půl.
Nezobrazuje se : ě , ř , č , ú , ů
Tyto nemam vyzkoušené : ď , ť ,
Tyto se zobrazují doře : í , á , ž , š , ý , é ,
Nezobrazuje se : ě , ř , č , ú , ů
Tyto nemam vyzkoušené : ď , ť ,
Tyto se zobrazují doře : í , á , ž , š , ý , é ,
Re: Advanced mod Rewrite 0.2.2 - problém
Aha nevšiml jsem si R-stickova příspěvku, odeslal jsem svůj a jel jsem na chalupu. Zkusím ten mod nejak poladit, ačkoli nevím jak
PS : Chtěl bych se zeptat, jaký je rozdíl mezi tímto free SEO a placeným, jaké výhody přináší placený oproti free a kolik stojí . Díky
PS : Chtěl bych se zeptat, jaký je rozdíl mezi tímto free SEO a placeným, jaké výhody přináší placený oproti free a kolik stojí . Díky
Re: Advanced mod Rewrite 0.2.2 - problém
Takže ted už funguje vše správně, udělal jsem postup který je na http://www.phpbbcz.com/navody.php?sid=8 ... 2d415255f4
Re: Advanced mod Rewrite 0.2.2 - problém
A k čemu tento mod slouží?
-
- Příspěvky: 9436
- Registrován: pon 24. črc 2006 0:00:00
- Bydliště: 48°43'N, 19°08'E
- Kontaktovat uživatele:
Re: Advanced mod Rewrite 0.2.2 - problém
Tento MOD prepisuje linky. Napríklad link tejto témy je:
po použití tohto MODu by vyzeral takto:
Kód: Vybrat vše
http://www.phpbb.cz/posting.php?mode=reply&f=5&t=10531
Kód: Vybrat vše
http://www.phpbb.cz/Advanced_mod_Rewrite_0.2.2.html
WhiteWolfSix (WW6)
Nežiadajte ma o pomoc prostredníctvom icq a SS (SZ)
Nežiadajte ma o pomoc prostredníctvom icq a SS (SZ)
Re: Advanced mod Rewrite 0.2.2 - problém
Ahoj, mam problem s kodovanim u Advanced mod Rewrite 0.2.4 . Vysla nova verze a podle toho vaseho navodu to nejde upravit, protoze je to jine.
$encoding = "iso-8859-1"; jsem zkousel menit na CP1250 a nepohlo to.
http://test.jirikajinek.cz/ tady je ukázka.
Nebo pokud někdo máte verzi 0.2.2 tak sem s ní .
Kód: Vybrat vše
<?php
/**
*
* @package Advanced phpBB SEO mod Rewrite
* @version $Id: phpbb_seo_class.php, 0.2.4 2007/02/07 13:48:48 dcz Exp $
* @copyright (c) 2006 dcz - www.phpbb-seo.com
* @license http://www.opensource.org/licenses/rpl.php RPL Public License
*
*/
/**
* phpBB_SEO Class
* www.phpBB-SEO.com
* @package Advanced phpBB SEO mod Rewrite
*/
class phpbb_seo {
var $modrtype = 0;
var $seo_url = array();
var $seo_delim = array();
var $seo_ext = array();
var $seo_static = array();
var $seo_path = array();
var $seo_url_filter = array();
var $seo_stats = array();
var $get_var = array();
var $path = "";
var $start = "";
var $filename = "";
var $file = "";
var $url_in = "";
var $url = "";
var $page_url = "";
var $seo_opt = array();
var $encoding = "iso-8859-1";
/**
* constuctor
*/
function phpbb_seo() {
global $phpEx, $board_config;
// config
$this->encoding = "iso-8859-1";
$this->modrtype = 3; // 3 = Advanced
$this->start = '';
// --> DOMAIN SETTING <-- //
// NOTE : If you add already declared a PHPBB_URL constant in common.php,
// you should get rid of it and let this part do it instead.
// You can hard-code the data to save process.
$server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';
$server_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name']));
$server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) : '';
// $this->seo_path['phpbb_script'] should be = '' if phpbb is installed in the domain's root
// 'phpbb/' in case it's installed in the phpbb/ folder.
$this->seo_path['phpbb_script'] = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path']));
$this->seo_path['phpbb_script'] = ($this->seo_path['phpbb_script'] == '') ? '' : $this->seo_path['phpbb_script'] . '/';
// Domain URL
$this->seo_path['root_url'] = $server_protocol . $server_name . $server_port . '/';
$this->seo_path['phpbb_url'] = $this->seo_path['root_url'] . $this->seo_path['phpbb_script'];
// Populate the $seo_path['PathToUrl'] array for multifolder setups handling.
// Pattern is $this->seo_path['PathToUrl']['phpbb/'] = "http://www.example.com/phpbb/";
$this->seo_path['PathToUrl'][$this->seo_path['phpbb_script']] = $this->seo_path['phpbb_url'];
// URL Settings
$this->seo_url = array( 'cat' => array(),
'forum' => array(),
'topic' => array(),
'user' => array(),
);
$this->seo_delim = array('cat' => '-c',
'forum' => '-f',
'topic' => '-t',
'user' => '-u',
// Rss
'rss_forum' => '-rf',
// Google
'google_forum' => '-gf'
);
$this->seo_ext = array('cat' => '.html',
'forum' => '.html',
'topic' => '.html',
'user' => '.html',
'gz_ext' => '',
);
$this->seo_static = array('cat' => 'cat',
'forum' => 'forum',
'topic' => 'topic',
'post' => 'post',
'user' => 'member',
'start' => '-',
'gz_ext' => '.gz',
'index' => ''
);
if ($board_config['default_lang'] === 'french') {
$this->seo_static['user'] = 'membre';
}
// URL Filters
$this->phpbb_filter = array('postdays' => 0, 'topicdays' => 0, 'postorder' => 'asc', 'highlight' => '');
// Stop files
$this->seo_stop_files = array("posting", "privmsg", "faq", "groupcp", "memberlist", "login", "search");
// Stop vars
$this->seo_stop_vars = array("view=", "mark=");
return;
}
// --> URL rewriting functions <--
/**
* Prepare Titles for URL injection
*/
function format_url( $url, $type = 'topic' ) {
$url = preg_replace("`\[.*\]`U","",$url);
$url = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$url);
$url = htmlentities($url, ENT_COMPAT, $this->encoding);
$url = preg_replace( "`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i","\\1", $url );
$url = preg_replace( array("`[^a-z0-9]`i","`[-]+`") , "-", $url);
$url = ( $url == "" ) ? $type : strtolower(trim($url, '-'));
return $url;
}
/**
* Rewrite URLs.
* Allow adding of many more cases than just the
* regular phpBB URL rewritting without slowing up the process.
*/
function url_rewrite($url, $non_html_amp = FALSE) {
global $phpEx;
$this->url = $this->url_in = $url;
if ( strpos($this->url, ".$phpEx") === FALSE || defined('IN_ADMIN') || defined('IN_LOGIN') ) {
return $url;
}
// Grabb params
$this->url = str_replace('&', '&', $this->url);
$parsed_url = @parse_url($this->url);
parse_str($parsed_url['query'], $this->get_vars);
$this->file = basename($parsed_url['path']);
$this->path = trim(trim(dirname($parsed_url['path']), "."), "/");
$this->path = (!empty($this->path)) ? ( isset( $this->seo_path['PathToUrl'][$this->path . '/'] ) ? $this->seo_path['PathToUrl'][$this->path . '/'] : $this->path . '/' ) : '';
$this->filename = trim(str_replace(".$phpEx", "", $this->file));
if ( in_array($this->filename, $this->seo_stop_files) ) {
return $url;
}
// Reset $url
$this->url = $this->file;
if ( @method_exists($this, $this->filename) ) {
$this->{$this->filename}();
// Assamble URL
$this->url .= $this->query_string($this->get_vars);
//$this->url = (!$non_html_amp) ? str_replace('&', '&', $this->url) : $this->url;
return $this->path . $this->url . ((!empty($parsed_url['fragment'])) ? "#" . $parsed_url['fragment'] : '');
} else {
return $url;
}
}
/**
* Set the $start var proper
* @access private
*/
function seo_pagination() {
$this->start = intval($this->get_vars['start']);
$this->start = ( $this->start > 0 ) ? $this->seo_static['start'] . $this->get_vars['start'] : '';
unset($this->get_vars['start']);
}
/**
* URL rewritting for viewtopic.php
* @access private
*/
function viewtopic() {
$this->filter_url($this->seo_stop_vars);
if ( !empty($this->get_vars[POST_TOPIC_URL]) && !empty($this->seo_url['topic'][$this->get_vars[POST_TOPIC_URL]]) ) {
// Filter default params
$this->filter_get_var($this->phpbb_filter);
$this->seo_pagination();
$this->url = $this->seo_url['topic'][$this->get_vars[POST_TOPIC_URL]] . $this->seo_delim['topic'] . $this->get_vars[POST_TOPIC_URL] . $this->start . $this->seo_ext['topic'];
unset($this->get_vars[POST_TOPIC_URL]);
} elseif ( !empty($this->get_vars[POST_POST_URL]) ) {
$this->url = $this->seo_static['post'] . $this->get_vars[POST_POST_URL] . $this->seo_ext['topic'];
unset($this->get_vars[POST_POST_URL]);
}
return;
}
/**
* URL rewritting for viewforum.php
* @access private
*/
function viewforum() {
$this->filter_url($this->seo_stop_vars);
if ( !empty($this->get_vars[POST_FORUM_URL]) && !empty($this->seo_url['forum'][$this->get_vars[POST_FORUM_URL]]) ) {
// Filter default params
$this->filter_get_var($this->phpbb_filter);
$this->seo_pagination();
$this->url = $this->seo_url['forum'][$this->get_vars[POST_FORUM_URL]] . $this->seo_delim['forum'] . $this->get_vars[POST_FORUM_URL] . $this->start . $this->seo_ext['forum'];
unset($this->get_vars[POST_FORUM_URL]);
}
return;
}
/**
* URL rewritting for profile.php
* @access private
*/
function profile() {
if ( !empty($this->get_vars[POST_USERS_URL]) && $this->get_vars['mode'] === 'viewprofile') {
$this->url = $this->seo_static['user'] . $this->get_vars[POST_USERS_URL] . $this->seo_ext['user'];
unset($this->get_vars[POST_USERS_URL]);
unset($this->get_vars['mode']);
}
return;
}
/**
* URL rewritting for index.php
* @access private
*/
function index() {
if ( !empty($this->get_vars[POST_CAT_URL]) && !empty($this->seo_url['cat'][$this->get_vars[POST_CAT_URL]]) ) {
$this->url = $this->seo_url['cat'][$this->get_vars[POST_CAT_URL]] . $this->seo_delim['cat'] . $this->get_vars[POST_CAT_URL] . $this->seo_ext['cat'];
unset($this->get_vars[POST_CAT_URL]);
} else {
$this->url = $this->seo_path['phpbb_url'] . $this->seo_static['index'];
}
return;
}
// --> Extra rewriting
// <-- Extra rewriting
/**
* Will break if a $filter pattern is foundin $url.
* Example $filter = array("view=", "mark=");
* @access private
*/
function filter_url($filter = array()) {
foreach ($filter as $patern ) {
if ( strpos($this->url_in, $patern) !== FALSE ) {
unset($this->get_vars);
$this->url = $this->url_in;
break;
}
}
return;
}
/**
* Will unset all default var stored in $filter array.
* Example $filter = array('postdays' => 0, 'topicdays' => 0, 'postorder' => 'asc');
* @access private
*/
function filter_get_var($filter = array()) {
if ( !empty($this->get_vars) ) {
foreach ($this->get_vars as $paramkey => $paramval) {
if ( array_key_exists($paramkey, $filter) ) {
if ( $filter[$paramkey] == $this->get_vars[$paramkey] ) {
unset($this->get_vars[$paramkey]);
}
}
}
}
return;
}
/**
* Will return the remaining GET vars to take care of
* @access private
*/
function query_string() {
if(empty($this->get_vars)) {
return '';
}
$params = array();
foreach($this->get_vars as $key => $value) {
$params[] = $key . '=' . $value;
}
return '?' . implode('&', $params);
}
// --> Add on Functions <--
// --> Gen stats
/**
* Returns usable microtime
* Borrowed from php.net
* Required for the phpBB SEO Google sitemaps module
*/
function microtime_float() {
return array_sum(explode(' ',microtime()));
}
}
?>
http://test.jirikajinek.cz/ tady je ukázka.
Nebo pokud někdo máte verzi 0.2.2 tak sem s ní .
Re: Advanced mod Rewrite 0.2.2 - problém
Mám stejný problém, mám verzi 0.4.4... co s tím??
Zkusil jsem upraviti takto, ale nefunguje to:
Zkusil jsem upraviti takto, ale nefunguje to:
Kód: Vybrat vše
static $find = array('ž', 'š', 'č', 'ř', 'ď', 'ť', 'ň', 'ě', '&', '/', '#', '+');
static $replace = array('z', 's', 'c', 'r', 'd', 't', 'n', 'e', '%26', '%2F', '%23', '%2b');
return rawurlencode(str_replace( $find, $replace, utf8_normalize_nfc(htmlspecialchars_decode(str_replace('&', '%26', rawurldecode($url))))));
}