صفحهٔ اصلی: تفاوت میان نسخهها
جزبدون خلاصۀ ویرایش |
جزبدون خلاصۀ ویرایش |
||
خط ۱۲: | خط ۱۲: | ||
خارج اصول | خارج اصول | ||
</categorytree> | </categorytree> | ||
----- | |||
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 |
نسخهٔ ۲۷ ژانویهٔ ۲۰۲۵، ساعت ۲۳:۰۵
دسته بندی ویکی ضحی
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 = '
' output = output .. ''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('', count, title:fullUrl(), title.text, persianDate)
endoutput = output .. '
ردیف | عنوان | تاریخ ایجاد |
---|---|---|
%d | <a href="%s">%s</a> | %s |
'
return output
end
return p