美国虚拟主机Hostease

Mediawiki中文技术论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5504|回复: 0

MediaWiki扩展:动态文章列表

[复制链接]
发表于 2010-12-27 15:03:18 | 显示全部楼层 |阅读模式
美国主机侦探
序言

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) - [create time]
When "type" is set to update or discussion ,
The output record format would be Page Title (last editor) - [update time]

The underlaying wiki codes are:

  1. <DynamicArticleList>
  2.   title=Newly Posted Articles
  3.   type=new
  4.   count=512412412412
  5. </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:
  1. <DynamicArticleList>
  2.   title=Most Popular Articles
  3.   type=hot
  4.   count=5
  5. </DynamicArticleList>
复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

美国主机评测网站

Archiver|手机版|小黑屋|Mediawiki中文技术论坛

GMT+8, 2024-4-19 20:43 , Processed in 0.047002 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2024, Tencent Cloud.

快速回复 返回顶部 返回列表