A
A-B
Guest
Hello
j'essaye d'appliquer le MOD pour mon forum est a premiere vu il y a truc qui cloche pouvez vous m'aider .
merci
Voici les modifs que j'ai fais.
le fichier htaccess
j'essaye d'appliquer le MOD pour mon forum est a premiere vu il y a truc qui cloche pouvez vous m'aider .
merci
Voici les modifs que j'ai fais.
includes/page_header.php
$template->set_filenames(array(
'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
);
#
ob_start();
function replace_mod_rewrite($s)
{
$urlin = array(
"'(?<!/)viewforum.php\?f=([0-9]*)&topicdays=([0-9]*)&start=([0-9]*)'",
"'(?<!/)viewforum.php\?f=([0-9]*)&mark=topics'",
"'(?<!/)viewforum.php\?f=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&view=previous'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&view=next'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&view=newest'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&start=([0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&highlight=([a-zA-Z0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)'",
"'(?<!/)viewtopic.php\?p=([0-9]*)'");
$urlout = array(
"viewforum\\1-\\2-\\3.html",
"mforum\\1.html",
"forum\\1.html",
"ptopic\\1.html",
"ntopic\\1.html",
"newtopic\\1.html",
"ftopic\\1-\\2-\\3-\\4.html",
"ftopic\\1-\\2-\\3-\\4-\\5.html",
"ftopic\\1-\\2.html",
"ftopic\\1.html",
"sutra\\1.html");
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
#
includes/page_tail.php
#
$db->sql_close();
#
$contents = ob_get_contents();
ob_end_clean();
echo replace_mod_rewrite($contents);
global $dbg_starttime;
#
#
$gzip_contents = ob_get_contents();
ob_end_clean();
#
$gzip_size = strlen($gzip_contents);
$gzip_crc = crc32($gzip_contents);
includes/sessions.php
#
$sql_ip = $user_id == ANONYMOUS ? " AND session_ip = '$user_ip'" : '';
#
$sql = "UPDATE " . SESSIONS_TABLE . "
SET session_ip = '$user_ip', session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login
WHERE session_id = '" . $session_id . "' $sql_ip
AND session_user_id = '$user_id'";
#
$SID = $user_id > 0 ? 'sid=' . $session_id : '';
$SID = $userdata['user_id'] > 0 ? (($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : '') : '';
#
elseif(empty($sessiondata))
{
// try to login guest
$sql = "SELECT u.*, s.*
FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
WHERE s.session_ip = '$user_ip'
AND s.session_user_id = " . ANONYMOUS . "
AND u.user_id = s.session_user_id
LIMIT 0, 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql);
}
$userdata = $db->sql_fetchrow($result);
if ( isset($userdata['user_id']) )
{
if ( $current_time - $userdata['session_time'] > 60 )
{
$sql = "UPDATE " . SESSIONS_TABLE . "
SET session_time = $current_time, session_start = $current_time, session_page = 0
WHERE session_id = '" . $userdata['session_id'] . "'";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
}
}
return $userdata;
}
}
//
// If we reach here then no (valid) session exists. So we'll create a new one,
le fichier htaccess
RewriteEngine On
RewriteRule ^forums.html index.php
RewriteRule ^mforum([0-9]*).html viewforum.php?f=$1&mark=topics
RewriteRule ^viewforum([0-9]*)-([0-9]*)-([0-9]*).html viewforum.php?f=$1&topicdays=$2&start=$3
RewriteRule ^forum([0-9]*).html viewforum.php?f=$1
RewriteRule ^ptopic([0-9]*).html viewtopic.php?t=$1&view=previous
RewriteRule ^ntopic([0-9]*).html viewtopic.php?t=$1&view=next
RewriteRule ^stopic([0-9]*)-([0-9]*).html viewtopic.php?t=$1&watch=topic&start=$2
RewriteRule ^utopic([0-9]*)-([0-9]*).html viewtopic.php?t=$1&unwatch=topic&start=$2
RewriteRule ^ftopic([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).html viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4
RewriteRule ^ftopic([0-9]*)-([0-9]*).html viewtopic.php?t=$1&start=$2
RewriteRule ^ftopic([0-9]*).html viewtopic.php?t=$1
RewriteRule ^ftopic([0-9]*).html viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5
RewriteRule ^setopic_([0-9]*)-([a-zA-Z0-9]*).html viewtopic.php?t=$1&highlight=$2
RewriteRule ^sutra([0-9]*).html viewtopic.php?p=$1
RewriteRule ^newtopic([0-9]*).html viewtopic.php?t=$1&view=newest