allwiki首页  
天下维客 你可以修改的网络知识库
首页最近更改优秀条目专题展示电脑科技词典软件学习网络知识电脑安全明星时尚天下百科
 

MediaWiki扩展:Inputbox帮助文档

天下维客,你可以修改的网络知识库

(重定向自Inputbox)
Jump to: navigation, search
MediaWiki扩展简明教程 Inputbox帮助文档 使用Spam黑名单 内容折叠隐藏 动态文章列表 指定图片链接
代码高亮处理 预置初始编辑文本 页面访问限制 所见即所得编辑器 QQ在线信息
交流:扩展使用 投票与评分 内容随机展示 wikitex 改进设想 ...更多
加入google地图和51地图标注功能 Ajax五颗星评分插件

inputboxMediaWiki的一个扩展插件,用以增加在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>

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



上文中从MediaWiki:名字空间中取得的文本仅供演示,你可以修改那些内容,或者直接指定editintropreload参数。 不幸的是,preload不能为Special:Upload摘要页面正常工作。

局限

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

安装

require_once("extensions/inputbox.php");


注意:应该在php的结束符之前书写,因此实际效果应与此类似:

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

参见

MediaWiki扩展简明教程 Inputbox帮助文档 使用Spam黑名单 内容折叠隐藏 动态文章列表 指定图片链接
代码高亮处理 预置初始编辑文本 页面访问限制 所见即所得编辑器 QQ在线信息
交流:扩展使用 投票与评分 内容随机展示 wikitex 改进设想 ...更多
加入google地图和51地图标注功能 Ajax五颗星评分插件
Personal tools
工具
金银币拍卖 金币拍卖预展  金银币网店 熊猫金银币 生肖金银币