Manuel İnstallation for SMF 2.0 Beta 4
Sources/ManageSettings.php
Pesquisar
);
if ($return_config)
return $config_vars;
Adicionar antes
'',
// Action SEF URLS?
array('check', 'enableActionurls'),
array('check', 'enableSubActionurls'),
array('check', 'enableCurls'),
array('check', 'enablePageurls'),
array('check', 'enableUseQuestion'),
array('check', 'enableNoIndex'),
array('check', 'enableNoFile'),
Sources/QueryString.php
Pesquisar
global $board, $topic, $boardurl, $scripturl, $modSettings, $smcFunc;
Trocar por
global $board, $topic, $boardurl, $scripturl, $modSettings, $smcFunc, $disable_sef;
Pesquisar
// Makes it easier to refer to things this way.
$scripturl = $boardurl . '/index.php';
Adicionar antes
if(!empty($modSettings['enableUseQuestion']) && empty($disable_sef))
$scripturl = str_replace('/index.php', '/?', $scripturl);
elseif(!empty($modSettings['enableNoIndex']) && empty($disable_sef))
$scripturl = str_replace('/index.php', '/index', $scripturl);
// This will make all urls use a double /, but it is needed for detection by the script.
elseif(!empty($modSettings['enableNoFile']) && empty($disable_sef))
$scripturl = str_replace('/index.php', '//', $scripturl);
Pesquisar
function ob_sessrewrite($buffer)
{
Adicionar antes
global $disable_sef;
Pesquisar
// If $scripturl is set to nothing, or the SID is not defined (SSI?) just quit.
Adicionar antes
// Clean URL to start with.
$sef_urls = array();
// Check the Settings, with a backup.
if(!empty($modSettings['enableActionurls']) && empty($disable_sef))
$sef_urls[] = 'action';
if(!empty($modSettings['enableSubActionurls']))
$sef_urls[] = 'sa';
if(!empty($modSettings['enableCurls']) && empty($disable_sef))
$sef_urls[] = 'c';
if(!empty($modSettings['enablePageurls']) && empty($disable_sef))
$sef_urls[] = 'page';
// After all that, Rip it up and drop it in a single line.
$sef_urls = implode('|', $sef_urls) . '|';
Pesquisar
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?(?:' . SID . ';)((?:
Trocar por
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?(?:' . SID . ';)((?:' . $sef_urls . '
Pesquisar
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?((?:
Trocar por
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?((?:' . $sef_urls . '
Pesquisar
if (empty($_COOKIE) && SID != '' && empty($context['browser']['possibly_robot']) && @version_compare(PHP_VERSION, '4.3.0') != -1)
Trocar por
if (empty($_COOKIE) && SID != '' && empty($context['browser']['possibly_robot']) && @version_compare(PHP_VERSION, '4.3.0') != -1 && (empty($modSettings['enableNoFile']) || !empty($disable_sef)))
Pesquisar
if (isset($_GET['debug']))
Trocar por
if (isset($_GET['debug']) && !empty($disable_sef))
Pesquisar
// Return the changed buffer.
return $buffer;
Adicionar antes
// If we are using SEF urls, we want a clean debug.
if (isset($_GET['debug']) && empty($disable_sef))
$buffer = str_replace($scripturl, substr($scripturl, 0, -1) . 'debug', $buffer);
// Maybe we want to clean slashes?
elseif(!empty($modSettings['enableNoFile']) && empty($disable_sef))
$buffer = str_replace($scripturl, substr($scripturl, 0, -2), $buffer);
Sources/Subs.php
Pesquisar
// Put the session ID in.
Adicionar Depois
// Clean URL to start with.
$sef_urls = array();
// Check the Settings..
if(!empty($modSettings['enableActionurls']))
$sef_urls[] = 'action';
if(!empty($modSettings['enableSubActionurls']))
$sef_urls[] = 'sa';
if(!empty($modSettings['enableCurls']))
$sef_urls[] = 'c';
if(!empty($modSettings['enablePageurls']))
$sef_urls[] = 'page';
// After all that, Rip it up and drop it in a single line.
$sef_urls = implode('|', $sef_urls) . '|';
Pesquisar
$setLocation = preg_replace('/^' . preg_quote($scripturl, '/') . '\?(?:' . SID . ';)((?:board|topic)=[^#]+?)(#[^"]*?)?$/e', "\$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html\$2?' . SID", $setLocation);
else
$setLocation = preg_replace('/^' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?$/e', "\$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html\$2'", $setLocation);
Trocar por
$setLocation = preg_replace('/"' . preg_quote($scripturl, '/') . '\?(?:' . SID . ';)((?:' . $sef_urls . 'board|topic)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html?' . SID . '\$2\"'", $setLocation);
else
$setLocation = preg_replace('/"' . preg_quote($scripturl, '/') . '\?((?:' . $sef_urls . 'board|topic)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html\$2\"'", $setLocation);
Pesquisar
// We send a Refresh header only in special cases because Location looks better. (and is quicker...)
Trocar por
if(!empty($modSettings['enableUseQuestion']) && empty($disable_sef))
$setLocation = str_replace('??', '?', $setLocation);
Themes/default/Post.template.php
Pesquisar
new_url = new_url.substr(0, new_url.indexOf("rand=") + 5);
Trocar por
new_url = new_url.substr(0, new_url.indexOf("rand") + 5);
.htaccess
Pesquisar
?>
Adicionar depois
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [QSA]
</IfModule>
Themes/default/languages/Modifications.english.php
Pesquisar
?>
Adicionar depois
$txt['enableActionurls'] = 'Enable Action SEF URLS';
$txt['enableSubActionurls'] = 'Enable Sub Action SEF URLS';
$txt['enableCurls'] = 'Enable Category SEF URLS (For Single Category Mod)';
$txt['enablePageurls'] = 'Enable Page SEF URLS (For Tinyportal Pages)';
$txt['enableUseQuestion'] = 'Use a question Mark (?) Instead of index.php';
$txt['enableNoIndex'] = 'Use index instead of index.php <span class="smalltext">(Doesn\'t work on all servers, use "$disable_sef = true;" in your Settings.php if enabling this breaks your site)</span>';
$txt['enableNoFile'] = 'Use Nothing instead of index.php <span class="smalltext">(Doesn\'t work on all servers, use "$disable_sef = true;" in your Settings.php if enabling this breaks your site)</span>';
A TRADUCAO EM PT Candidosa2 Vai fazer..e colocar aqui