|
|
خط ۸: |
خط ۸: |
|
| |
|
| [[رده:اساتید|اساتید]] | | [[رده:اساتید|اساتید]] |
| | | ------ |
| <categorytree mode=pages hideroot=on> | | <categorytree mode=pages hideroot=on> |
| خارج اصول | | خارج اصول |
خط ۱۴: |
خط ۱۴: |
|
| |
|
| ----- | | ----- |
| local p = {}
| |
|
| |
| function p.showArticles(frame)
| |
| local category = frame.args[1] or "خارج اصول"
| |
| local limit = tonumber(frame.args[2]) or 10
| |
| local count = 0
| |
| local dpl = require("Module:DPL")
| |
| local results = dpl:new({ category = category, count = limit }):exec()
| |
|
| |
| local output = '<table border="1" style="width: 100%;">'
| |
| output = output .. '<tr><th>ردیف</th><th>عنوان</th><th>تاریخ ایجاد</th></tr>'
| |
|
| |
| for i, article in ipairs(results) do
| |
| count = count + 1
| |
| local title = mw.title.new(article.title)
| |
| local creationDate = mw.title.getCreationTimestamp(title)
| |
| local persianDate = mw.language.new("fa"):formatDate("Y-m-d", creationDate)
| |
| output = output .. string.format('<tr><td>%d</td><td><a href="%s">%s</a></td><td>%s</td></tr>', count, title:fullUrl(), title.text, persianDate)
| |
| end
| |
|
| |
| output = output .. '</table>'
| |
| return output
| |
| end
| |
|
| |
| return p
| |