| |
|
| :: |
| Author |
Message |
Ľubor PR0

Joined: 13 Feb 2007 Posts: 52 Location: Slovakia,Bratislava
|
Posted: Mon Mar 12, 2007 6:34 pm Post subject: Re: [advanced] viewforum ? |
|
|
Zero duplicate announce error
| Code: | #
#-----[ OPEN ]------------------------------------------
#
viewforum.php
#
#-----[ FIND ]------------------------------------------
#
if ( !($forum_row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'Forum_not_exist');
}
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$phpbb_seo->seo_url['forum'][$forum_id] = $phpbb_seo->format_url($forum_row['forum_name'], $phpbb_seo->seo_static['forum']);
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ AFTER, ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$uri = $phpbb_seo->seo_req_uri();
$phpbb_seo->seo_start( $start, $board_config['topics_per_page'] );
$phpbb_seo->page_url = $phpbb_seo->seo_url['forum'][$forum_id] . $phpbb_seo->seo_delim['forum'] . $forum_id . $phpbb_seo->start . $phpbb_seo->seo_ext['forum'];
$phpbb_seo->seo_cond(!$userdata['session_logged_in'] && (strpos($uri, "sid=" ) !== FALSE ));
$topicday_redir = empty($_POST['topicdays']) && empty($_GET['topicdays']);
if ($_GET['topicdays'] == 0 || $_POST['topicdays'] == 0 ) {
$topicday_redir = TRUE;
}
if ( $phpbb_seo->do_redir || ( ($mark_read == '') && $topicday_redir && ( strpos($uri, $phpbb_seo->page_url) === FALSE ) ) ) {
$phpbb_seo->seo_redirect( $phpbb_seo->seo_path['phpbb_url'] . $phpbb_seo->page_url );
}
// www.phpBB-SEO.com SEO TOOLKIT END |
I have phpBB SEO Advanced mod Rewrite 0.2.2 and zero duplicate is phpBB SEO Zero dupilcate - phpBB SEO Advanced mod Rewrite version 0.2.2 |
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
Ľubor PR0

Joined: 13 Feb 2007 Posts: 52 Location: Slovakia,Bratislava
|
Posted: Fri Mar 16, 2007 4:49 pm Post subject: Re: [advanced] viewforum ? |
|
|
| dcz wrote: | Well, I know the install, what is the error ?
And have you modified all files ?
The code changes are not this many in viewforum.php, please double check.
++ |
I have modified all files |
|
|
| Back to top |
|
 |
Ľubor PR0

Joined: 13 Feb 2007 Posts: 52 Location: Slovakia,Bratislava
|
Posted: Fri Mar 16, 2007 6:13 pm Post subject: Re: [advanced] viewforum ? |
|
|
| Code: | | Fatal error: Call to undefined method: phpbb_seo->seo_start() in /data/web/pc-war.sk/web/viewforum.php on line 103 |
I have phpBB SEO Advanced mod Rewrite 0.2.2 |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
Ľubor PR0

Joined: 13 Feb 2007 Posts: 52 Location: Slovakia,Bratislava
|
Posted: Sat Mar 17, 2007 10:46 pm Post subject: Re: [advanced] viewforum ? |
|
|
| Code: | <?php
/**
*
* @package Advanced phpBB SEO mod Rewrite
* @version $Id: phpbb_seo_class.php, 0.2.2 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_paths = 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 = "";
/**
* constuctor
*/
function phpbb_seo() {
global $phpEx, $board_config;
// config
$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'];
// URL Settings
$this->seo_url = array( 'cat' => array(),
'forum' => array(),
'topic' => array(),
'user' => 'member'
);
$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_url['user'] = $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);
$find = array('"','&','<','>','\r\n','\n',);
$url = str_replace ($find, '-', $url);
$url = str_replace ('ß', 'ss', $url);
$url = str_replace (array('ö','Ö'), 'oe', $url);
$url = str_replace (array('ä','Ä'), 'ae', $url);
$url = str_replace (array('ü','Ü'), 'ue', $url);
$find = array('a', 'A', 'á', 'Á', 'ä', 'Ä');
$url = str_replace ($find, 'a', $url);
$find = array('b', 'B');
$url = str_replace ($find, 'b', $url);
$find = array('c', 'C', 'č', 'Č');
$url = str_replace ($find, 'c', $url);
$find = array('d', 'D', 'ď', 'Ď');
$url = str_replace ($find, 'd', $url);
$find = array('e', 'E', 'é', 'É', 'ě', 'Ě', 'ë', 'Ë');
$url = str_replace ($find, 'e', $url);
$find = array('f', 'F');
$url = str_replace ($find, 'f', $url);
$find = array('g', 'G');
$url = str_replace ($find, 'g', $url);
$find = array('h', 'H');
$url = str_replace ($find, 'h', $url);
$find = array('i', 'I', 'í', 'Í');
$url = str_replace ($find, 'i', $url);
$find = array('j', 'J');
$url = str_replace ($find, 'j', $url);
$find = array('k', 'K');
$url = str_replace ($find, 'k', $url);
$find = array('l', 'L', 'ĺ', 'Ĺ', 'ľ', 'Ľ');
$url = str_replace ($find, 'l', $url);
$find = array('m', 'M');
$url = str_replace ($find, 'm', $url);
$find = array('n', 'N', 'ň', 'Ň');
$url = str_replace ($find, 'n', $url);
$find = array('o', 'O', 'ó', 'Ó', 'ô', 'Ô', 'ö', 'Ö');
$url = str_replace ($find, 'o', $url);
$find = array('p', 'P');
$url = str_replace ($find, 'p', $url);
$find = array('q', 'Q');
$url = str_replace ($find, 'q', $url);
$find = array('r', 'R', 'ŕ', 'Ŕ', 'ř', 'Ř');
$url = str_replace ($find, 'r', $url);
$find = array('s', 'S', 'š', 'Š');
$url = str_replace ($find, 's', $url);
$find = array('t', 'T', 'ť', 'Ť');
$url = str_replace ($find, 't', $url);
$find = array('u', 'U', 'ú', 'Ú', 'ů', 'Ů', 'ü', 'Ü');
$url = str_replace ($find, 'u', $url);
$find = array('v', 'V');
$url = str_replace ($find, 'v', $url);
$find = array('w', 'W');
$url = str_replace ($find, 'w', $url);
$find = array('x', 'X');
$url = str_replace ($find, 'x', $url);
$find = array('y', 'Y', 'ý', 'Ý');
$url = str_replace ($find, 'y', $url);
$find = array('z', 'Z', 'ž', 'Ž');
$url = str_replace ($find, 'z', $url);
$url = strtr($url,$find,$replace);
$url = strtolower($url);
$url = ereg_replace("[^a-zA-Z0-9]", "-", $url);
$url = preg_replace("`([\-])+`", "\\1", $url);
$url = trim($url, '-');
$url = ( $url == "" ) ? $type : $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)) ? $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()));
}
}
?>
|
 |
|
|
| Back to top |
|
 |
Ľubor PR0

Joined: 13 Feb 2007 Posts: 52 Location: Slovakia,Bratislava
|
Posted: Sun Mar 18, 2007 11:52 am Post subject: Re: [advanced] viewforum ? |
|
|
Already is all good
My forum |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Mon Mar 19, 2007 10:02 pm Post subject: Re: [advanced] viewforum ? |
|
|
So you modified the title filtering, for Windows-1250 it seems.
I lately worked a bit on advanced filtering and came up with this one that should work for windows-1250 as well as any installed char-set, in theory
| Code: | /**
* Prepare Titles for URL injection
*/
function format_url( $url, $type = 'topic' ) {
$url = preg_replace("(\[.*\])U","",$url);
$url = htmlentities($url, ENT_NOQUOTES, 'windows-1250');
$url = preg_replace('`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron);`i','$1',$url);
$url = preg_replace('`&[a-z]+;`i','',$url);
$url = preg_replace('`[\W]`', '-', $url);
$url = preg_replace('`[-]+`', '-', $url);
$url = trim($url, '-');
return ( $url == "" ) ? $type : strtolower($url);
}
|
With this one you should only have to bother about the special replacement where one letter gets replaced with two :
| Code: | $url = str_replace('ß', 'ss', $url);
$url = str_replace(array('ö','Ö'), 'oe', $url);
$url = str_replace(array('ä','Ä'), 'ae', $url);
$url = str_replace(array('ü','Ü'), 'ue', $url); |
To put before the htmlentities() call in case it's necessary.
This trick could be used with other char-set, just a matter to tell it to htmlentities().
++ |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
Ľubor PR0

Joined: 13 Feb 2007 Posts: 52 Location: Slovakia,Bratislava
|
Posted: Tue Mar 20, 2007 3:17 pm Post subject: Re: [advanced] viewforum ? |
|
|
all is already good,has failed anything another  |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
|
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|