phpbb link conversion
#1
Hi,

i have a request (which may already have been filled)..

i have imported by phpbb into mybb however any links either within the forum or external to the forum still point to posts and threads using the phpbb url viewtopic, viewforum, viewthread etc obviously these will not be found because the urls have now become showthread, showpost etc etc.

I would like a php file in the root to interprate these requests and translate them into mybb urls and redirect.

I know that smf have these routing files available so it must be achievable (though not for me as i know nothing ).

cheers,
#2
Untested, but should work.

viewforum.php:
<?php
define("IN_MYBB", 1);
require_once "./global.php";
$fid = '1';
if(isset($mybb->input['f']))
{
	$fid = intval($mybb->input['f']);
}
header("Location: ".$mybb->settings['bburl']."/forumdisplay.php?fid=".$fid);

viewtopic.php:
<?php
define("IN_MYBB", 1);
require_once "./global.php";
$tid = '1';
if(isset($mybb->input['t']))
{
	$tid = intval($mybb->input['t']);
}
header("Location: ".$mybb->settings['bburl']."/showthread.php?tid=".$tid);
[Need Smilies? Get Me Smileys!
#3
thanks christian.. so create those two files and put them ion the root of the forum, yea ?

will this cover a direct post link as well ?

cheers
#4
Correct, create the files and upload it to your server. What the code does is, all links going to viewforum.php?f=1. will forward to forumdisplay.php?fid=1 and viewtopic.php?t=1 forwards to showthread.php?tid=1.

Also, I forgot the HTTP status code, add the following before the other header's in the previous codes.
header('HTTP/1.1 301 Moved Permanently');
[Need Smilies? Get Me Smileys!
#5
great, i'll try that and get back to you ..

cheers
#6
hiya, just got round to this christian..

i get an error when i put in the original board url..

Quote:Direct initialization of this file is not allowed.

Please make sure IN_MYBB is defined.

any thoughts..

cheers
#7
add the following to the top of the original index.php file:

define("IN_MYBB", 1);

make sure it goes inside the <?php

?> tags.

#8
above:
require_once "./global.php";
add:
define('IN_MYBB', 1);
Smile
#9
thanks guys...all sorted Smile
#10
Hmm...I could use this too...thanks.


Forum Jump:


Users browsing this thread: 2 Guest(s)