الفرق بين المراجعتين لصفحة: «تصنيف:مقالات مختارة»
المظهر
أنشأ الصفحة ب'=== <u>For 40 years, Sean Ferrer has worked in all aspects of motion picture development, production, post-production and marketing. After taking a short sabbatical to create a series of charities dedicated to continuing his mother's humanitarian legacy, Sean directed and produced a one-man feature</u> === <u>For 40 years, Sean Ferrer has worked in all aspects of motion picture development, production, post-production and marketing. After taking a short sabbatical...' |
لا ملخص تعديل |
||
سطر ١: | سطر ١: | ||
=== | local p = {} | ||
function p.randomArticleFromCategory( frame ) | |||
local categoryName = frame.args[1] or "مقالات مختارة" | |||
local limit = tonumber(frame.args[2]) or 50 | |||
local pages = mw.site.stats.pagesInCategory(categoryName, "pages") | |||
if pages == 0 then | |||
return "لا توجد مقالات في التصنيف." | |||
end | |||
local titles = {} | |||
local category = mw.title.new("تصنيف:" .. categoryName) | |||
for _, title in ipairs(category:getContent()) do | |||
table.insert(titles, title) | |||
end | |||
if #titles == 0 then | |||
return "لم يتم العثور على مقالات." | |||
end | |||
math.randomseed(os.time()) | |||
local selected = titles[math.random(#titles)] | |||
return string.format("'''[[%s]]'''", selected.fullText) | |||
end | |||
return p | |||
[[تصنيف:الكيمياء]] | [[تصنيف:الكيمياء]] |
المراجعة الحالية بتاريخ ٠٩:٤٢، ١٢ يوليو ٢٠٢٥
local p = {}
function p.randomArticleFromCategory( frame )
local categoryName = frame.args[1] or "مقالات مختارة" local limit = tonumber(frame.args[2]) or 50
local pages = mw.site.stats.pagesInCategory(categoryName, "pages")
if pages == 0 then return "لا توجد مقالات في التصنيف." end
local titles = {} local category = mw.title.new("تصنيف:" .. categoryName) for _, title in ipairs(category:getContent()) do table.insert(titles, title) end
if #titles == 0 then return "لم يتم العثور على مقالات." end
math.randomseed(os.time()) local selected = titles[math.random(#titles)] return string.format("%s", selected.fullText)
end
return p