wangsisi 发表于 2010-12-24 16:01:46

MediaWiki扩展:Inputbox帮助文档

inputbox是MediaWiki的一个扩展插件,用以增加在wiki页面中“创建文章”的功能,以解决用户不知道如何在mediawiki中创建新文章的问题。

本功能扩展还可以在页面中增加创建新评论和全文搜索输入框。
inputbox插件运行于MediaWiki 1.5以上版本,作者Erik Möller。
语法格式
Inputbox的语法如下:(在wiki页面上编辑保存如下文本即可生效)
<inputbox>
type=表格类型
parameter1=参数1
parameter2=参数2
</inputbox>
其中表格类型是必有的强制参数,其他参数可选。
表格类型
类型 例子
type=search



生成一个宽度为50个字符宽的搜索框。

type=create



允许创建一个新页面,点击后直接创建页面。

type=comment



添加更多的段落到一个已经存在的页面,或者创建一个页面,给一个已经存在的页面添加简述。


参数说明
Parameters
Parameter
Scope Example
bgcolor=
All types

设定表格的背景色彩(HTML颜色值)。不要使用引号。 <inputbox>
type=search
bgcolor=#eeeeff
</inputbox>



width=
All types

设定inputbox的宽度(以半角字符计),老的浏览器需要这个参数(参见上文)。 <inputbox>
type=create
width=24
</inputbox>



default=
All types

inputbox中的预设文本 <inputbox>
type=comment
default=User talk:Eloquence
</inputbox>



preload=
comment, create

在创建新页面时,本参数指定的页面内容将被作为预设文本,以作为基础内容供用户进一步编辑。可在inputbox中输入一个不存在地文章标题,并点击创建按钮测试本参数的效果。 <inputbox>
type=create
preload=Log
</inputbox>



你可以输入在上面的输入框里面输入一个不存在的页面名称然后点击“创建新页面”或者“发布评论”来测试这的确是有效的。
editintro=
comment, create

注:本参数未天下维客试验未见效果。本参数可以指定额外的提示文本,它将在创建新页面的提交按钮之前显示。可输入一个不存在的页面标题,然後点击创建按钮测试效果。
<inputbox>
type=comment
editintro=MediaWiki:Missingcommenttext
</inputbox>



buttonlabel=
All types

这个参数指定主要按钮的显示文本。 <inputbox>
type=comment
buttonlabel=新增评论
</inputbox>



hidden=
create, comment

This specifies that there is no inputbox.
It is used with parameter "default", now not being a default, but the fixed value of the name of the page. <inputbox>
type=comment
editintro=Extension:Inputbox/editintro comment
preload=Extension:Inputbox/preload
hidden=yes
default=Extension talk:Inputbox
buttonlabel=在talk页面添加评论
</inputbox>



searchbuttonlabel=
search

这个标签将用来进行全文搜索。 <inputbox>
type=search
searchbuttonlabel=Dig deeper
</inputbox>



break=
All types

Whether or not to insert a line break between the input box and the button(s). Defaults to using the line break unless set to no. <inputbox>
type=create
width=24
break=no
</inputbox>



namespaces=
search

带有名称空间复选框的全文搜索。
带有 "Namespace**" 是被默认的。 <inputbox>
type=search
namespaces=Main**,Help
</inputbox>



当试图“创建”一篇已经存在的文章时,只会进入现存文章的编辑页面。这种情况下,editintro和preload参数被忽略。同样,当试图为一篇新文章添加注释(comment )而该文章却已经存在时,editintro参数将被忽略。

局限

    * 变量、参数、模板(template)目前不能被inputbox作为输入内容,否则无法获得预期转换效果。


安装

    * 下载inputbox文件(见Inputbox源代码v1.19页面或inputbox.php),上传到extensions目录中。
    * 版本说明:Inputbox 1.19版本适合mediawiki 1.5或者mediawiki 1.8;1.20版本适合mediawiki 1.6。后续版本请自行验证。
    * 在LocalSettings.php文件的尾部增加下面一行:

require_once("extensions/inputbox.php");
注意:应该在php的结束符之前书写,因此实际效果应与此类似:

require_once("extensions/inputbox.php");
?>



页: [1]
查看完整版本: MediaWiki扩展:Inputbox帮助文档

美国主机评测网站