我開心得太早了.
原來所找到的script乃 UltraBoard 1.62 轉至
phpBB 1.2.0的. 如下:
[php]<?php
if($submit) {
include('extention.inc');
include('functions.'.$phpEx);
include('config.'.$phpEx);
require('auth.'.$phpEx);
if ($delete == "on"){
$sql = "delete from topics where forum_id = $forum";
if (!mysql_query($sql, $db))
echo "cannot clean up topics";
$sql = "delete from posts where forum_id = $forum";
if (!mysql_query($sql, $db))
echo "cannot clean up topics";
echo "DB cleared<BR>";
}
while ($post < $postend) {
if (!$fp = fopen ("$dir/$post.post","r")) {
echo "$post.post not exist<BR>";
} else {
$count = 0;
while (!feof ($fp)) {
$oldrecord = explode("|^|",fgets($fp, 4096));
if ($count == 0)
{
$sql = "INSERT INTO topics (topic_title, topic_poster, forum_id, topic_time, topic_notify,unregistered_name) VALUES (".
"'".addslashes(str_replace("|APO|","''",str_replace("|EQU|","",str_replace ("+", " ", $oldrecord[0]))))."',".
"'-1', ".
"'$forum', ".
"'".date("Y-m-d H:i",$oldrecord[5])."',".
"'0',".
"'".str_replace("+"," ",$oldrecord[1])."')";
if(!$result = mysql_query($sql, $db)) {
echo "Couldn't enter topic in database.<BR>";
echo "$sql<BR>";
break;
}
$topic_id = mysql_insert_id();
}
if (!($count == 1)){
if (strlen($oldrecord[7]) > 0) {
$sql = "INSERT INTO posts (topic_id, forum_id, poster_id, post_text, post_time, poster_ip,unregistered_name) VALUES ('$topic_id', '$forum', '-1', '".str_replace ("+", " ", addslashes(str_replace("|APO|","''",str_replace("|EQU|","",str_replace("\\
","",$oldrecord[7])))))."', '".date("Y-m-d H:i",$oldrecord[5])."', '".$oldrecord[6]."','".str_replace("+"," ",$oldrecord[1])."')";
if(!$result = mysql_query($sql, $db)) {
echo "Couldn't enter post in database.<BR>";
echo "$sql<BR>";
}
}
}
$count++;
}
echo "#".$post." added<BR>";
}
$post++;
}
echo ($post-1)." topics added";
} else {
echo $submit;
?>
<form>
Forum ID : <input type = "TEXT" name = forum><BR>
Directory : <input type = "TEXT" name = dir><BR>
Start : <input type = "TEXT" name = post><BR>
End : <input type = "TEXT" name = postend><BR>
Clear DB? : <input type = "checkbox" name = delete><BR>
<input type = submit NAME="submit">
</form>
<?php
}
?>[/php]
經初步研究:
1)phpBB 1.2 祇會用以下table儲存留言資料:
- phpbb_topics
- phpbb_posts
而phpBB 2.0.6則用:
- phpbb_topics
- phpbb_posts
-
phpbb_posts_text <--新增的
2)以上table的structure也不同,可以說是兩碼子事.
我會
嘗試把它改成 2.0.6可用,但已經遇到以下問題:
1) 舊phpbb_topics的"topic_notify"/"unregistered_name",現在該放那裡?
2) 舊phpbb_posts的"unregistered_name",現在該放那裡?
3) 新增的phpbb_posts_text的"bbcode_uid",我該放甚麼進去呢?
相信改完後,我會對2.0.6更了解...
請問有沒有大大可以幫忙修改一下呢?
