wangsisi 发表于 2010-12-27 15:03:18

MediaWiki扩展:动态文章列表

序言

DynamicArticleList 是 Mediawiki 1.5 扩展。它旨在为所有已提交的文章提供附加的排序功能。现在已实现了四种类型的动态文章列表:

   1. 新提交的文章
   2. 最近更新的文章
   3. 最新讨论
   4. 最流行的文章

用户在动态文章列表的帮助下可以轻松找到最近或最流行的主题。

This extension is written with the help from Dynamic Page List.

前提条件

    * 需要安装 PHP 5 或更高版本。
    * 动态文章列表对"recentchanges(最新更改)"表极为依赖,但是 Mediawiki 引擎 1.5.0 会定期根据"recentchanges"表刷新旧条目。建议禁用自动删除功能。- 打开"includes"文件夹中的 Article.php 文件,找到函数"editUpdates"并注释掉开始部分的行 "$dbw->query( $sql )"。


安装

    * 从下面提供的链接下载源代码。
          o DynamicArticleList.php
          o CategoryTravelerBase.php
          o CategoryNode.php
          o CategoryUtil.php
    * 复制出 pdf 中的内容,并创建相应的 php 源文件。
          o What do you mean by pdf out? Is this a piece of freeware I haven't heard of before? (To convert the files I had to use Gmail and send the pdf's to myself. I then viewed them in html and saved them. I had five minutes of formatting issues afterwards; but the extension worked perfectly.):ChrisG 03:07, 6 January 2006 (UTC)
          o I believe the author intended for one to open the pdf's in your pdf reader of choice (Acrobat, XPdf, etc.) and select all the text, use the clipboard to copy it, and paste it into a new php file. Your method worked too, of course. (*; Jcobbers 14:46, 8 February 2006 (UTC)
    * 将 DynamicArticleList.php 复制到 "extensions" 文件夹。
    * 将 CategoryTravelerBase.php , CategoryNode.php , CategoryUtil.php 复制到 "includes" 文件夹。
    * 在 "LocalSettings.php" 中添加行 require_once( "extensions/DynamicArticleList.php" ); 。


Usage

Tag and its Parameters

Tag Name DynamicArticleList
Parameters title (optional) Title of the output article list
type (optional) Type of dynamic article list (new/update/discussion/hot)
count (optional) Output count of articles
categoryRoot (optional) Name of category where (including its children) all articles reside


Note:

    * If "categoryRoot" is set, Dynamic Article List will only retrieve articles in this category and its children. If not, all articles will be candidates.
    * The value of parameter "type" could be one of the following (default is new ):
          o new => Newly Posted Articles
          o update => Recently Updated Articles
          o discussion => Recent Discussions
          o hot => Most Popular Articles
    * The default value of "count" is 5 .


Samples

A sample snapshot of Dynamic Article List is shown below.

<a href="/index.php?title=Special:Upload&wpDestFile=Sample_Dynamic_Article_List_1.png" class="new" title="Image:Sample Dynamic Article List 1.png">Image:Sample Dynamic Article List 1.png</a>

When "type" is set to new ,
The output record format would be Page Title (author) -
When "type" is set to update or discussion ,
The output record format would be Page Title (last editor) -

The underlaying wiki codes are:

<DynamicArticleList>
title=Newly Posted Articles
type=new
count=512412412412
</DynamicArticleList>



Another sample snapshot of Dynamic Article List is shown below.

<a href="/index.php?title=Special:Upload&wpDestFile=Sample_Dynamic_Article_List_2.png" class="new" title="Image:Sample Dynamic Article List 2.png">Image:Sample Dynamic Article List 2.png</a>

When "type" is set to hot ,
The output record format would be Page Title - (accessed times)

The underlaying wiki codes are:
<DynamicArticleList>
title=Most Popular Articles
type=hot
count=5
</DynamicArticleList>


页: [1]
查看完整版本: MediaWiki扩展:动态文章列表

美国主机评测网站