- 主题:帮帮忙哪,首页导读最后一个warning
Warning: domxml_open_file(): XML declaration allowed only at the start of the document in /usr/local/www/htdocs/mainpage.php on line 283
好几天没搞定。
--
FROM 59.66.125.*
下面的第四行就是warning里的283行:
function gen_recommend_boards_html()
{
# load xml doc
$boardrank_file = BBS_HOME . "/xml/rcmdbrd.xml";
$doc = domxml_open_file($boardrank_file);
if (!$doc)
return;
$root = $doc->document_element();
$boards = $root->child_nodes();
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="helpert">
<tr>
<td class="helpert_left"></td>
<td class="helpert_middle">推荐版面</td>
<td class="helpert_right"></td>
<td> </td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="helper">
<tr>
<td width="100%" class="MainContentText">
<ul style="margin: 5px 0px 0px 15px; padding: 0px;">
<?php
$brdarr = array();
# shift through the array
while($board = array_shift($boards))
{
if ($board->node_type() == XML_TEXT_NODE)
continue;
$ename = find_content($board, "EnglishName");
$brdnum = bbs_getboard($ename, $brdarr);
if ($brdnum == 0)
continue;
$brd_encode = urlencode($brdarr["NAME"]);
?>
<li class="default"><a href="bbsdoc.php?board=<?php echo $brd_encode; ?>"><?php echo htmlspecialchars($brdarr["DESC"]); ?></a></li>
<?php
}
?>
</ul></td></tr>
</table>
<br>
<?php
}
【 在 r0 (阿圆) 的大作中提到: 】
: Warning: domxml_open_file(): XML declaration allowed only at the start of the document in /usr/local/www/htdocs/mainpage.php on line 283
: 好几天没搞定。
--
FROM 59.66.124.*
来自dev.kcn.cn
3.3.3 手工生成 rcmdbrd.xml
编辑,$(BBSHOME)/xml/rcmdbrd.xml,按照以下格式,感谢 windinsn 提供
<?xml version="1.0" encoding="GBK"?>
<RecommendBoards>
<Board><EnglishName>这里写版面的英文名</EnglishName></Board>
<Board><EnglishName>...</EnglishName></Board>
...
<Board><EnglishName>...</EnglishName></Board>
</RecommendBoards>
【 在 r0 (阿圆) 的大作中提到: 】
: 下面的第四行就是warning里的283行:
: function gen_recommend_boards_html()
: {
: ...................
--
FROM 218.26.243.*
添加了呀: 没添加时是 三个warning
我的 rcmdbrd.xml:
<?xml version="1.0" encoding="GBK"?>
<RecommendBoards>
<Board><EnglishName>StoneStory</EnglishName></Board>
<Board><EnglishName>StonePoems</EnglishName></Board>
<Board><EnglishName>EEA</EnglishName></Board>
</RecommendBoards>
有问题?
我的站:bbs.cathaystone.net
【 在 sxdxsimple (雾里龙虾) 的大作中提到: 】
: 来自dev.kcn.cn
: 3.3.3 手工生成 rcmdbrd.xml
: 编辑,$(BBSHOME)/xml/rcmdbrd.xml,按照以下格式,感谢 windinsn 提供
: ...................
--
FROM 59.66.124.*
检查版面英文名,检查版面读取权限
【 在 r0 (阿圆) 的大作中提到: 】
: 添加了呀: 没添加时是 三个warning
: 我的 rcmdbrd.xml:
: <?xml version="1.0" encoding="GBK"?>
: ...................
--
FROM 218.26.243.*
hexdump -Cv rcmdbrd.xml|head
贴结果
【 在 r0 (阿圆) 的大作中提到: 】
: 添加了呀: 没添加时是 三个warning
: 我的 rcmdbrd.xml:
: <?xml version="1.0" encoding="GBK"?>
: <RecommendBoards>
: <Board><EnglishName>StoneStory</EnglishName></Board>
: <Board><EnglishName>StonePoems</EnglishName></Board>
: <Board><EnglishName>EEA</EnglishName></Board>
: </RecommendBoards>
: 有问题?
: 我的站:bbs.cathaystone.net
--
FROM 128.12.150.*
00000000 20 20 20 20 3c 3f 78 6d 6c 20 76 65 72 73 69 6f | <?xml versio|
00000010 6e 3d 22 31 2e 30 22 20 65 6e 63 6f 64 69 6e 67 |n="1.0" encoding|
00000020 3d 22 47 42 4b 22 3f 3e 0a 20 20 20 20 3c 52 65 |="GBK"?>. <Re|
00000030 63 6f 6d 6d 65 6e 64 42 6f 61 72 64 73 3e 0a 20 |commendBoards>. |
00000040 20 20 20 3c 42 6f 61 72 64 3e 3c 45 6e 67 6c 69 | <Board><Engli|
00000050 73 68 4e 61 6d 65 3e 53 74 6f 6e 65 53 74 6f 72 |shName>StoneStor|
00000060 79 3c 2f 45 6e 67 6c 69 73 68 4e 61 6d 65 3e 3c |y</EnglishName><|
00000070 2f 42 6f 61 72 64 3e 0a 20 20 20 20 3c 42 6f 61 |/Board>. <Boa|
00000080 72 64 3e 3c 45 6e 67 6c 69 73 68 4e 61 6d 65 3e |rd><EnglishName>|
00000090 53 74 6f 6e 65 50 6f 65 6d 73 3c 2f 45 6e 67 6c |StonePoems</Engl|
【 在 atppp (Big Mouse) 的大作中提到: 】
: hexdump -Cv rcmdbrd.xml|head
: 贴结果
--
FROM 59.66.124.*
最前面多了四个空格。而且出错信息也很明白的说了
XML declaration allowed only at the start of the document...
【 在 r0 (阿圆) 的大作中提到: 】
: 00000000 20 20 20 20 3c 3f 78 6d 6c 20 76 65 72 73 69 6f | <?xml versio|
: 00000010 6e 3d 22 31 2e 30 22 20 65 6e 63 6f 64 69 6e 67 |n="1.0" encoding|
: 00000020 3d 22 47 42 4b 22 3f 3e 0a 20 20 20 20 3c 52 65 |="GBK"?>. <Re|
: ...................
--
FROM 128.12.150.*
晕,这个我记住了,老大就是牛
【 在 atppp (Big Mouse) 的大作中提到: 】
: 最前面多了四个空格。而且出错信息也很明白的说了
: XML declaration allowed only at the start of the document...
--
修改:sxdxsimple FROM 218.26.243.*
FROM 218.26.243.*
谢谢acore指教
没有 warning了,但那个写着:
“如果您看到了左边的菜单,那么您的 KBS 系统 Web 界面已经初步安装成功。
请参阅《首页导读安装说明》(代码包 doc/INSTALL.mainpage) 配置安装首页导读。”
的页面为什么还在呢?要手工消除么?还是我还没配置齐全?
【 在 atppp (Big Mouse) 的大作中提到: 】
: 最前面多了四个空格。而且出错信息也很明白的说了
: XML declaration allowed only at the start of the document...
--
FROM 59.66.125.*