| |
|
| :: |
| Author |
Message |
myfa1z
Joined: 17 Aug 2007 Posts: 27
|
Posted: Fri Aug 17, 2007 12:49 pm Post subject: Help Error Simple Mod rewrite |
|
|
Hi everyone
I'm newbie in this forum, and i just install simple mo rewrite, but when i go to my forum appear this message
Fatal error: Cannot redeclare class phpbb_seo in /home/www/blabla.com/phpbb_seo/phpbb_seo_class.php on line 16
Can you help me with this problem ?, i'm using char-set "UTF-8". |
|
|
| Back to top |
|
 |
|
 |
HB phpBB SEO Team

Joined: 16 Oct 2006 Posts: 794
|
Posted: Fri Aug 17, 2007 1:07 pm Post subject: Re: Help Error Simple Mod rewrite |
|
|
That class is included by common.php. Are you explicitly including it again? Double check the mod instructions (or use EasyMOD).
| Code: | #
#-----[ OPEN ]------------------------------------------
#
common.php
##
#-----[ FIND ]------------------------------------------
#
if (file_exists('install') || file_exists('contrib'))
{
message_die(GENERAL_MESSAGE, 'Please_remove_install_contrib');
}
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
include($phpbb_root_path . 'phpbb_seo/phpbb_seo_class.'.$phpEx);
$phpbb_seo = new phpbb_seo();
// www.phpBB-SEO.com SEO TOOLKIT END |
|
_________________ Dan Kehn |
|
| Back to top |
|
 |
myfa1z
Joined: 17 Aug 2007 Posts: 27
|
Posted: Fri Aug 17, 2007 1:34 pm Post subject: Re: Help Error Simple Mod rewrite |
|
|
Thanks for Quick Respon but i still have an error message, and now the message is:
Parse error: parse error, unexpected $ in /home/www/blabla.com/common.php on line 239
thanks for the answer |
|
|
| Back to top |
|
 |
HB phpBB SEO Team

Joined: 16 Oct 2006 Posts: 794
|
Posted: Fri Aug 17, 2007 3:36 pm Post subject: Re: Help Error Simple Mod rewrite |
|
|
Sounds like a typo. I enjoy a good riddle, but I think it would be dramatically easier to diagnose this problem if you posted the code around line 239 (or all of common.php, if you prefer).
| Quote: | | Parse error: parse error, unexpected $ in /home/www/blabla.com/common.php on line 239 |
|
_________________ Dan Kehn |
|
| Back to top |
|
 |
myfa1z
Joined: 17 Aug 2007 Posts: 27
|
Posted: Fri Aug 17, 2007 4:19 pm Post subject: Re: Help Error Simple Mod rewrite |
|
|
may be like this:
| Quote: |
while ( $row = $db->sql_fetchrow($result) )
{
$board_config[$row['config_name']] = $row['config_value'];
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
include($phpbb_root_path . 'phpbb_seo/phpbb_seo_class.'.$phpEx);
$phpbb_seo = new phpbb_seo();
// www.phpBB-SEO.com SEO TOOLKIT END
if (file_exists('install') || file_exists('contrib')) <<<<< line 239
{
message_die(GENERAL_MESSAGE, 'Please_remove_install_contrib');
}
//
// Show 'Board is disabled' message if needed.
//
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") )
|
Can you help me with this code please ? |
|
|
| Back to top |
|
 |
myfa1z
Joined: 17 Aug 2007 Posts: 27
|
Posted: Fri Aug 17, 2007 4:21 pm Post subject: Re: Help Error Simple Mod rewrite |
|
|
sory but this is the complete code of common.php
| Code: |
<?php
/***************************************************************************
* common.php
* -------------------
* begin : Saturday, Feb 23, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: common.php,v 1.74.2.25 2006/05/26 17:46:59 grahamje Exp $
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
//
error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
set_magic_quotes_runtime(0); // Disable magic_quotes_runtime
// The following code (unsetting globals)
// Thanks to Matt Kavanagh and Stefan Esser for providing feedback as well as patch files
// PHP5 with register_long_arrays off?
if (@phpversion() >= '5.0.0' && (!@ini_get('register_long_arrays') || @ini_get('register_long_arrays') == '0' || strtolower(@ini_get('register_long_arrays')) == 'off'))
{
$HTTP_POST_VARS = $_POST;
$HTTP_GET_VARS = $_GET;
$HTTP_SERVER_VARS = $_SERVER;
$HTTP_COOKIE_VARS = $_COOKIE;
$HTTP_ENV_VARS = $_ENV;
$HTTP_POST_FILES = $_FILES;
// _SESSION is the only superglobal which is conditionally set
if (isset($_SESSION))
{
$HTTP_SESSION_VARS = $_SESSION;
}
}
// Protect against GLOBALS tricks
if (isset($HTTP_POST_VARS['GLOBALS']) || isset($HTTP_POST_FILES['GLOBALS']) || isset($HTTP_GET_VARS['GLOBALS']) || isset($HTTP_COOKIE_VARS['GLOBALS']))
{
die("Hacking attempt");
}
// Protect against HTTP_SESSION_VARS tricks
if (isset($HTTP_SESSION_VARS) && !is_array($HTTP_SESSION_VARS))
{
die("Hacking attempt");
}
if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
{
// PHP4+ path
$not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path');
// Not only will array_merge give a warning if a parameter
// is not an array, it will actually fail. So we check if
// HTTP_SESSION_VARS has been initialised.
if (!isset($HTTP_SESSION_VARS) || !is_array($HTTP_SESSION_VARS))
{
$HTTP_SESSION_VARS = array();
}
// Merge all into one extremely huge array; unset
// this later
$input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES);
unset($input['input']);
unset($input['not_unset']);
while (list($var,) = @each($input))
{
if (in_array($var, $not_unset))
{
die('Hacking attempt!');
}
unset($$var);
}
unset($input);
}
//
// addslashes to vars if magic_quotes_gpc is off
// this is a security precaution to prevent someone
// trying to break out of a SQL statement.
//
if( !get_magic_quotes_gpc() )
{
if( is_array($HTTP_GET_VARS) )
{
while( list($k, $v) = each($HTTP_GET_VARS) )
{
if( is_array($HTTP_GET_VARS[$k]) )
{
while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) )
{
$HTTP_GET_VARS[$k][$k2] = addslashes($v2);
}
@reset($HTTP_GET_VARS[$k]);
}
else
{
$HTTP_GET_VARS[$k] = addslashes($v);
}
}
@reset($HTTP_GET_VARS);
}
if( is_array($HTTP_POST_VARS) )
{
while( list($k, $v) = each($HTTP_POST_VARS) )
{
if( is_array($HTTP_POST_VARS[$k]) )
{
while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) )
{
$HTTP_POST_VARS[$k][$k2] = addslashes($v2);
}
@reset($HTTP_POST_VARS[$k]);
}
else
{
$HTTP_POST_VARS[$k] = addslashes($v);
}
}
@reset($HTTP_POST_VARS);
}
if( is_array($HTTP_COOKIE_VARS) )
{
while( list($k, $v) = each($HTTP_COOKIE_VARS) )
{
if( is_array($HTTP_COOKIE_VARS[$k]) )
{
while( list($k2, $v2) = each($HTTP_COOKIE_VARS[$k]) )
{
$HTTP_COOKIE_VARS[$k][$k2] = addslashes($v2);
}
@reset($HTTP_COOKIE_VARS[$k]);
}
else
{
$HTTP_COOKIE_VARS[$k] = addslashes($v);
}
}
@reset($HTTP_COOKIE_VARS);
}
}
//
// Define some basic configuration arrays this also prevents
// malicious rewriting of language and otherarray values via
// URI params
//
$board_config = array();
$userdata = array();
$theme = array();
$images = array();
$lang = array();
$nav_links = array();
$dss_seeded = false;
$gen_simple_header = FALSE;
include($phpbb_root_path . 'config.'.$phpEx);
if( !defined("PHPBB_INSTALLED") )
{
header('Location: ' . $phpbb_root_path . 'install/install.' . $phpEx);
exit;
}
include($phpbb_root_path . 'includes/constants.'.$phpEx);
include($phpbb_root_path . 'includes/template.'.$phpEx);
include($phpbb_root_path . 'includes/sessions.'.$phpEx);
include($phpbb_root_path . 'includes/auth.'.$phpEx);
include($phpbb_root_path . 'includes/functions.'.$phpEx);
include($phpbb_root_path . 'includes/db.'.$phpEx);
// We do not need this any longer, unset for safety purposes
unset($dbpasswd);
//
// Obtain and encode users IP
//
// I'm removing HTTP_X_FORWARDED_FOR ... this may well cause other problems such as
// private range IP's appearing instead of the guilty routable IP, tough, don't
// even bother complaining ... go scream and shout at the idiots out there who feel
// "clever" is doing harm rather than good ... karma is a great thing ... :)
//
$client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') );
$user_ip = encode_ip($client_ip);
//
// Setup forum wide options, if this fails
// then we output a CRITICAL_ERROR since
// basic forum information is not available
//
$sql = "SELECT *
FROM " . CONFIG_TABLE;
if( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$board_config[$row['config_name']] = $row['config_value'];
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
include($phpbb_root_path . 'phpbb_seo/phpbb_seo_class.'.$phpEx);
$phpbb_seo = new phpbb_seo();
// www.phpBB-SEO.com SEO TOOLKIT END
if (file_exists('install') || file_exists('contrib'))
{
message_die(GENERAL_MESSAGE, 'Please_remove_install_contrib');
}
//
// Show 'Board is disabled' message if needed.
//
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") )
{
message_die(GENERAL_MESSAGE, 'Board_disable', 'Information');
}
?>
|
Thanks again for helping me |
|
|
| Back to top |
|
 |
HB phpBB SEO Team

Joined: 16 Oct 2006 Posts: 794
|
Posted: Fri Aug 17, 2007 4:52 pm Post subject: Re: Help Error Simple Mod rewrite |
|
|
Looks like you fumbled fingered the end of the file. Here's what mine looks like:
| Code: | //
// Setup forum wide options, if this fails
// then we output a CRITICAL_ERROR since
// basic forum information is not available
//
$sql = "SELECT *
FROM " . CONFIG_TABLE;
if( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$board_config[$row['config_name']] = $row['config_value'];
}
if (file_exists('install') || file_exists('contrib'))
{
message_die(GENERAL_MESSAGE, 'Please_remove_install_contrib');
}
//
// Show 'Board is disabled' message if needed.
//
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") )
{
message_die(GENERAL_MESSAGE, 'Board_disable', 'Information');
}
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
include($phpbb_root_path . 'phpbb_seo/phpbb_seo_class.'.$phpEx);
$phpbb_seo = new phpbb_seo();
// www.phpBB-SEO.com SEO TOOLKIT END
?> |
You should consider EasyMOD. It does all the changes for you and the install is (nearly) idiot proof. |
_________________ Dan Kehn |
|
| Back to top |
|
 |
myfa1z
Joined: 17 Aug 2007 Posts: 27
|
Posted: Fri Aug 17, 2007 5:30 pm Post subject: Re: Help Error Simple Mod rewrite |
|
|
| Thanks hb, my forum is back again, and url of my forum is change now, thanks again. |
|
|
| Back to top |
|
 |
myfa1z
Joined: 17 Aug 2007 Posts: 27
|
Posted: Fri Aug 17, 2007 5:37 pm Post subject: Re: Help Error Simple Mod rewrite |
|
|
Sory but i'm asking again but this is my url now
http://lowongankerja.freehostia.com/post2.html#2
my title is "halo", but this is not include in my url, can we change this "post" to title in url ?.
thanks for the answer |
|
|
| Back to top |
|
 |
HB phpBB SEO Team

Joined: 16 Oct 2006 Posts: 794
|
Posted: Sat Aug 18, 2007 12:13 am Post subject: Re: Help Error Simple Mod rewrite |
|
|
The postNNN.html link doesn't matter since your robots.txt blocks access to it as described in this forum's install instructions:
| SeO wrote: | The robots.txt :
The robots.txt file must be uploaded in your domain's root folder.
You must obviously change phpbb/ with your real phpBB installation folder (or with nothing if it's installed in the root).
| Code: | User-agent: *
Disallow: /phpbb/viewtopic.php
Disallow: /phpbb/viewforum.php
Disallow: /phpbb/index.php?
Disallow: /phpbb/posting.php
Disallow: /phpbb/groupcp.php
Disallow: /phpbb/search.php
Disallow: /phpbb/login.php
Disallow: /phpbb/privmsg.php
Disallow: /phpbb/post |
This is the minimum required for bots to only consider the rewritten URLs.
The index.php? is absolutely normal and does not disallow index.php
After this you can add :
| Code: |
Disallow: /phpbb/member
Disallow: /phpbb/profile.php
Disallow: /phpbb/memberlist.php
Disallow: /phpbb/faq.php |
If you don't want to put too much weight on those, by the way attractive to spammers. Will save some "useless" bot visits as well.
You may need to implement additional disallows if you changed URL standard for example. |
NB: I know that dcz writes long instructions, but trust me, reading them will save you time and frustration because in the end, you'll end up reading them anyway. |
_________________ Dan Kehn |
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

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