📄 lbpost2bmb.php
字号:
<?
// LeoBoard -> Blue Magic 完美论坛帖子转换程序
// 制作于 17:32 2004-5-5
set_time_limit(0);
/*------------------------
以下内容请根据情况设置
------------------------*/
$ib_forum_dir = "C:/Apache/htdocs/cgi-bin/bbs/forum1/";
// IB(LB)的要转换板块的绝对路径,最后不要遗漏slash("/"),此目录必须存在(版块已经创建)
$boundary = "\t";
//版块内主题文件分隔字符,Leoboard默认为"\t",IkonBoard为"|";
/*------------------------
以下内容请勿修改
------------------------*/
$dh=opendir($ib_forum_dir);
$count=0;
while ($threadfile=readdir($dh)) {
if (eregi("\.thd\.cgi$",$threadfile)) {
$threaddata=file("$ib_forum_dir$threadfile");
$c=count($threaddata); $content.='-post-\n';
for ($i=0; $i<$c; $i++) {
list($membername, $topictitle, $postipaddresstemp,
$showemoticons, $showsignature, $postdate, $post, $posticon)
= explode($boundary,trim($threaddata[$i]));
if (!$posticon) $posticon='ran';
$postipaddresstemp='LB 旧帖';
$topictitle = str_replace("*#!&*","",$topictitle);
if ($showsignature=='yes') $showsignature='1';
else $showsignature='0';
$content.="$topictitle|$membername|$post|$postdate|$postipaddresstemp|$posticon|$showsignature|\n";
}
$count++;
}
}
writetofile("lb{$count}.bmb",$content);
print("<html><head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">
<title>文章资料转换程序:Ikon/Leo Board --> BMB</title>
</head>
<body>
<br><br>......
<br><br>
资料转换完毕,共转换了 $count 个主题
<br><br>
请您使用 EmEditor 等可以保存 without BOM UTF-8 文件的编辑器按照 <a href=http://www.bmforum.com/help/convert.htm>这里</a> 的介绍修改输出的文件 lb{$count}.bmb,然后用论坛导入程序导入
<br><br>
更多信息,请到 <a href='http://www.bmforum.com/' target=_blank>BMB 官方</a> 寻找
</body>
</html>");
exit;
//+------------------------------------------------------------------------------------------------------
//+-----------write------------
function writetofile($file_name,$data) {
$filenum=fopen($file_name,"w");
flock($filenum,2);
$file_data=fwrite($filenum,$data);
fclose($filenum);
return $file_data;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -