.php & .html çevirici kod

Tüm soru(n)lar ve tartışmalar; kullanım ile ilgili soru(n)lar.

.php & .html çevirici kod

İleti BaRaN 07.05.2007, 18:33

Arkadaşlar benim elimdeki modu önceleri kullanabiliyordum yalnız şimdi tekrar kurduğumda sayfalara ulaşamıyor yanlış url'ye yönlendiriyor.Şuna bi göz atarsanız sevinirim

Kod: Tümünü seç
-----------------------------------
----[ OPEN ]-----------------------
-----------------------------------

includes/page_header.php

-----------------------------------
----[ FIND ]-----------------------
-----------------------------------

//
// Parse and show the overall header.
//
$template->set_filenames(array(
'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
);

-----------------------------------
----[ AFTER, ADD ]-----------------
-----------------------------------

#======================================================================= |
#==== Start: == Dynamic Rewrite ======================================== |
#==== v1.0.0 =========================================================== |
#====
ob_start();
function dynamic_rewrite(&$to_change)
{
global $phpbb_root_path, $phpEx, $board_config, $userdata;
$file_listing = $phpbb_root_path;
$files = @opendir($file_listing);
while ($file = @readdir($files))
{
if (@strstr($file, $phpEx))
{
if (@strstr($to_change, 'href="'. $file) || @strstr($to_change, 'href="./'. $file) || @strstr($to_change, 'href="/'. $file) || @strstr($to_change, "href='". $file) || @strstr($to_change, "href='./". $file) || @strstr($to_change, "href='/". $file))
{
#==== Drop session ids for guests properly, since other mods dont always do it.
if ($userdata['user_id'] == ANONYMOUS)
$sessions_out = "";
else
$sessions_out = "-sid-". $userdata['session_id'] ."";

$in = array(
"'(?<!/)href=\"". $file ."'",
"'(?<!/)". str_replace('.php', '.html', $file) ."\?'",
"'(?<!/)". str_replace('.php', '.html', $file) ."-([^ \?&=\#\"<]*?)=([^ \?&=\#\"<]*?)'",
"'(?<!/)". str_replace('.php', '.html', $file) ."-([^ \?&=\#\"<]*?)-([^ \?&=\#\"<]*?)\&amp;([^ \?&=\#\"<]*?)=([^ \?&=\#\"<]*?)'",
"'(?<!/)". str_replace('.php', '.html', $file) ."-([^ \?&=\#\"<]*?)-([^ \?&=\#\"<]*?)\&([^ \?&=\#\"<]*?)=([^ \?&=\#\"<]*?)'",
"'(?<!/)". str_replace('.php', '.html', $file) ."-([^ \?&=\#\"<]*?)-([^ \?&=\#\"<]*?)-([^ \?&=\#\"<]*?)-([^ \?&=\#\"<]*?)\&amp;([^ \?&=\#\"<]*?)=([^ \?&=\#\"<]*?)'",
"'(?<!/)". str_replace('.php', '.html', $file) ."-([^ \?&=\#\"<]*?)-([^ \?&=\#\"<]*?)-([^ \?&=\#\"<]*?)-([^ \?&=\#\"<]*?)\&([^ \?&=\#\"<]*?)=([^ \?&=\#\"<]*?)'",
"'amp;'",

"'(?<!/)href=\"index.html(.*)'", "'(?<!/)href=\"/index.html(.*)'", "'(?<!/)href=\"\./index.html(.*)'", "'(?<!/)href=\'index.html(.*)'", "'(?<!/)href=\'/index.html(.*)'", "'(?<!/)href=\'\./index.html(.*)'",
"'(?<!/)href=\"viewforum.html(.*)'", "'(?<!/)href=\"/viewforum.html(.*)'", "'(?<!/)href=\"\./viewforum.html(.*)'", "'(?<!/)href=\'viewforum.html(.*)'", "'(?<!/)href=\'/viewforum.html(.*)'", "'(?<!/)href=\'\./viewforum.html(.*)'",
"'(?<!/)href=\"viewtopic.html(.*)'", "'(?<!/)href=\"/viewtopic.html(.*)'", "'(?<!/)href=\"\./viewtopic.html(.*)'", "'(?<!/)href=\'viewtopic.html(.*)'", "'(?<!/)href=\'/viewtopic.html(.*)'", "'(?<!/)href=\'\./viewtopic.html(.*)'",
"'(?<!/)href=\"groupcp.html(.*)'", "'(?<!/)href=\"/groupcp.html(.*)'", "'(?<!/)href=\"\./groupcp.html(.*)'", "'(?<!/)href=\'groupcp.html(.*)'", "'(?<!/)href=\'/groupcp.html(.*)'", "'(?<!/)href=\'\./groupcp.html(.*)'",
"'(?<!/)href=\"privmsg.html(.*)'", "'(?<!/)href=\"/privmsg.html(.*)'", "'(?<!/)href=\"\./privmsg.html(.*)'", "'(?<!/)href=\'privmsg.html(.*)'", "'(?<!/)href=\'/privmsg.html(.*)'", "'(?<!/)href=\'\./privmsg.html(.*)'",
"'(?<!/)href=\"profile.html(.*)'", "'(?<!/)href=\"/profile.html(.*)'", "'(?<!/)href=\"\./profile.html(.*)'", "'(?<!/)href=\'profile.html(.*)'", "'(?<!/)href=\'/profile.html(.*)'", "'(?<!/)href=\'\./profile.html(.*)'",
"'(?<!/)href=\"login.html(.*)'", "'(?<!/)href=\"/login.html(.*)'", "'(?<!/)href=\"\./login.html(.*)'", "'(?<!/)href=\'login.html(.*)'", "'(?<!/)href=\'/login.html(.*)'", "'(?<!/)href=\'\./login.html(.*)'",
"'(?<!/)href=\"viewonline.html(.*)'", "'(?<!/)href=\"/viewonline.html(.*)'", "'(?<!/)href=\"\./viewonline.html(.*)'", "'(?<!/)href=\'viewonline.html(.*)'", "'(?<!/)href=\'/viewonline.html(.*)'", "'(?<!/)href=\'\./viewonline.html(.*)'",
"'(?<!/)href=\"faq.html(.*)'", "'(?<!/)href=\"/faq.html(.*)'", "'(?<!/)href=\"\./faq.html(.*)'", "'(?<!/)href=\'faq.html(.*)'", "'(?<!/)href=\'/faq.html(.*)'", "'(?<!/)href=\'\./faq.html(.*)'",
"'(?<!/)href=\"login_security.html(.*)'", "'(?<!/)href=\"/login_security.html(.*)'", "'(?<!/)href=\"\./login_security.html(.*)'", "'(?<!/)href=\'login_security.html(.*)'", "'(?<!/)href=\'/login_security.html(.*)'", "'(?<!/)href=\'\./login_security.html(.*)'",
"'(?<!/)href=\"memberlist.html(.*)'", "'(?<!/)href=\"/memberlist.html(.*)'", "'(?<!/)href=\"\./memberlist.html(.*)'", "'(?<!/)href=\'memberlist.html(.*)'", "'(?<!/)href=\'/memberlist.html(.*)'", "'(?<!/)href=\'\./memberlist.html(.*)'",

"'-sid-". $userdata['session_id'] ."'");

$out = array(
"href=\"". str_replace('.php', '.html', $file) ."",
"". str_replace('.php', '.html', $file) ."-",
"". str_replace('.php', '.html', $file) ."-\\1-\\2",
"". str_replace('.php', '.html', $file) ."-\\1-\\2-\\3-\\4",
"". str_replace('.php', '.html', $file) ."-\\1-\\2-\\3-\\4",
"". str_replace('.php', '.html', $file) ."-\\1-\\2-\\3-\\4-\\5-\\6",
"". str_replace('.php', '.html', $file) ."-\\1-\\2-\\3-\\4-\\5-\\6",
"",

"href=\"main.html\\1", "href=\"/main.html\\1", "href=\"./main.html\\1", "href='main.html\\1", "href='/main.html\\1", "href='./main.html\\1",
"href=\"forums.html\\1", "href=\"/forums.html\\1", "href=\"./forums.html\\1", "href='forums.html\\1", "href='/forums.html\\1", "href='./forums.html\\1",
"href=\"topics.html\\1", "href=\"/topics.html\\1", "href=\"./topics.html\\1", "href='topics.html\\1", "href='/topics.html\\1", "href='./topics.html\\1",
"href=\"groups.html\\1", "href=\"/groups.html\\1", "href=\"./groups.html\\1", "href='groups.html\\1", "href='/groups.html\\1", "href='./groups.html\\1",
"href=\"messages.html\\1", "href=\"/messages.html\\1", "href=\"./messages.html\\1", "href='messages.html\\1", "href='/messages.html\\1", "href='./messages.html\\1",
"href=\"profiles.html\\1", "href=\"/profiles.html\\1", "href=\"./profiles.html\\1", "href='profiles.html\\1", "href='/profiles.html\\1", "href='./profiles.html\\1",
"href=\"sessions.html\\1", "href=\"/sessions.html\\1", "href=\"./sessions.html\\1", "href='sessions.html\\1", "href='/sessions.html\\1", "href='./sessions.html\\1",
"href=\"online.html\\1", "href=\"/online.html\\1", "href=\"./online.html\\1", "href='online.html\\1", "href='/online.html\\1", "href='./online.html\\1",
"href=\"questions.html\\1", "href=\"/questions.html\\1", "href=\"./questions.html\\1", "href='questions.html\\1", "href='/questions.html\\1", "href='./questions.html\\1",
"href=\"security.html\\1", "href=\"/security.html\\1", "href=\"./security.html\\1", "href='security.html\\1", "href='/security.html\\1", "href='./security.html\\1",
"href=\"members.html\\1", "href=\"/members.html\\1", "href=\"./members.html\\1", "href='members.html\\1", "href='/members.html\\1", "href='./members.html\\1",

"". $sessions_out ."");

$to_change = preg_replace($in, $out, $to_change);
}
}
}
return $to_change;
}
@closedir($file_listing);
#====
#==== Author: aUsTiN [austin@phpbb-amod.com] [http://phpbb-tweaks.com] = |
#==== End: ==== Dynamic Rewrite ======================================== |
#======================================================================= |

-----------------------------------
----[ CLOSE & SAVE ]---------------
-----------------------------------

-----------------------------------
----[ OPEN ]-----------------------
-----------------------------------

includes/page_tail.php

-----------------------------------
----[ FIND ]-----------------------
-----------------------------------

//
// Close our DB connection.
//
$db->sql_close();

-----------------------------------
----[ AFTER, ADD ]-----------------
-----------------------------------

#======================================================================= |
#==== Start: == Dynamic Rewrite ======================================== |
#==== v1.0.0 =========================================================== |
#====
$page = ob_get_contents();
ob_end_clean();
echo dynamic_rewrite($page);
#====
#==== Author: aUsTiN [austin@phpbb-amod.com] [http://phpbb-tweaks.com] = |
#==== End: ==== Dynamic Rewrite ======================================== |
#======================================================================= |

-----------------------------------
----[ CLOSE & SAVE ]---------------
-----------------------------------

-----------------------------------
----[ OPEN ]-----------------------
-----------------------------------

.htaccess

-----------------------------------
----[ ADD BEFORE ALL CODES ]-------
-----------------------------------

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^main.html(.*) index.html$1 [NC]
RewriteRule ^forums.html(.*) viewforum.html$1 [NC]
RewriteRule ^topics.html(.*) viewtopic.html$1 [NC]
RewriteRule ^groups.html(.*) groupcp.html$1 [NC]
RewriteRule ^messages.html(.*) privmsg.html$1 [NC]
RewriteRule ^profiles.html(.*) profile.html$1 [NC]
RewriteRule ^sessions.html(.*) login.html$1 [NC]
RewriteRule ^online.html(.*) viewonline.html$1 [NC]
RewriteRule ^questions.html(.*) faq.html$1 [NC]
RewriteRule ^security.html(.*) login_security.html$1 [NC]
RewriteRule ^members.html(.*) memberlist.html$1 [NC]

RewriteRule ^(.*).html-(.*)-(.*)-(.*)-(.*)-(.*)-(.*) /$1.php?$2=$3&$4=$5&$6=$7 [NC]
RewriteRule ^(.*).html-(.*)-(.*)-(.*)-(.*) /$1.php?$2=$3&$4=$5 [NC]
RewriteRule ^(.*).html-(.*)-(.*) /$1.php?$2=$3 [NC]
RewriteRule ^(.*).html-(.*) /$1.php?$2 [NC]
RewriteRule ^(.*).html /$1.php [L]

-----------------------------------
----[ CLOSE & SAVE ]---------------
-----------------------------------
Kullanıcı avatarı
BaRaN
Üye
Üye
 
İleti: 16
Kayıt: 23.10.2005, 10:16
Konum: İstanbul

Re: .php & .html çevirici kod

İleti WILT 08.05.2007, 17:15

Forumda bir çok kere yazıldı.

viewtopic.php?f=73&t=559
Galatasaray Basketbol Portalı
"Ne gülüyorsun, bu anlattığım senin hikayen!"
Kullanıcı avatarı
WILT
Üye
Üye
 
İleti: 284
Kayıt: 03.02.2007, 10:27
Konum: İstanbul


Soru(n)lar & Tartışmalar



Kimler çevrimiçi

Bu forumu görüntüleyenler: Kayıtlı kullanıcı yok ve 0 misafir

cron