http://proplan.55bet-pro.com/wiki/index.php?action=history&feed=atom&title=M%C3%B3dulo%3AHigh-use Módulo:High-use - Histórico de revisão-55BET Pro 2026-03-14T12:04:34Z Histórico de revisões para esta página neste wiki MediaWiki 1.42.7 http://proplan.55bet-pro.com/wiki/index.php?title=M%C3%B3dulo:High-use&diff=161&oldid=prev Módulo:High-use - Histórico de revisão-55BET Pro 2024-06-27T11:11:59Z <p>uma edição</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <tr class="diff-title" lang="pt-BR"> <td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Edição anterior</td> <td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Edição das 08h11min de 27 de junho de 2024</td> </tr><tr><td colspan="2" class="diff-notice" lang="pt-BR"><div class="mw-diff-empty">(Sem diferença)</div> </td></tr></table> Henryzord http://proplan.55bet-pro.com/wiki/index.php?title=M%C3%B3dulo:High-use&diff=160&oldid=prev Módulo:High-use - Histórico de revisão-55BET Pro 2024-04-25T12:38:03Z <p>per edit request on talk page - highlight transclusions on tool target page</p> <p><b>Página nova</b></p><div>local p = {}<br /> <br /> -- _fetch looks at the &quot;demo&quot; argument.<br /> local _fetch = require(&#039;Module:Transclusion_count&#039;).fetch<br /> local yesno = require(&#039;Module:Yesno&#039;)<br /> <br /> function p.num(frame, count)<br /> if count == nil then<br /> if yesno(frame.args[&#039;fetch&#039;]) == false then<br /> if (frame.args[1] or &#039;&#039;) ~= &#039;&#039; then count = tonumber(frame.args[1]) end<br /> else<br /> count = _fetch(frame)<br /> end<br /> end<br /> <br /> -- Build output string<br /> local return_value = &quot;&quot;<br /> if count == nil then<br /> if frame.args[1] == &quot;risk&quot; then<br /> return &quot;a very large number of&quot;<br /> else<br /> return &quot;many&quot;<br /> end<br /> else<br /> -- Use 2 significant figures for smaller numbers and 3 for larger ones<br /> local sigfig = 2<br /> if count &gt;= 100000 then<br /> sigfig = 3<br /> end<br /> <br /> -- Prepare to round to appropriate number of sigfigs<br /> local f = math.floor(math.log10(count)) - sigfig + 1<br /> <br /> -- Round and insert &quot;approximately&quot; or &quot;+&quot; when appropriate<br /> if (frame.args[2] == &quot;yes&quot;) or (mw.ustring.sub(frame.args[1],-1) == &quot;+&quot;) then<br /> -- Round down<br /> return_value = string.format(&quot;%s+&quot;, mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) ) * (10^(f))) )<br /> else<br /> -- Round to nearest<br /> return_value = string.format(&quot;approximately&amp;#x20;%s&quot;, mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) + 0.5) * (10^(f))) )<br /> end<br /> <br /> -- Insert percentage of pages if that is likely to be &gt;= 1% and when |no-percent= not set to yes<br /> if count and count &gt; 250000 and not yesno (frame:getParent().args[&#039;no-percent&#039;]) then<br /> local percent = math.floor( ( (count/frame:callParserFunction(&#039;NUMBEROFPAGES&#039;, &#039;R&#039;) ) * 100) + 0.5)<br /> if percent &gt;= 1 then<br /> return_value = string.format(&quot;%s&amp;#x20;pages, or roughly %s%% of all&quot;, return_value, percent)<br /> end<br /> end <br /> end<br /> <br /> return return_value<br /> end<br /> <br /> -- Actions if there is a large (greater than or equal to 100,000) transclusion count<br /> function p.risk(frame)<br /> if frame.args[1] == &quot;risk&quot; then<br /> return &quot;risk&quot;<br /> else<br /> local count = _fetch(frame)<br /> if count and count &gt;= 100000 then<br /> return &quot;risk&quot;<br /> end<br /> end<br /> return &quot;&quot;<br /> end<br /> <br /> function p.text(frame, count)<br /> -- Only show the information about how this template gets updated if someone<br /> -- is actually editing the page and maybe trying to update the count.<br /> local bot_text = (frame:preprocess(&quot;{{REVISIONID}}&quot;) == &quot;&quot;) and &quot;\n\n----\n&#039;&#039;&#039;Preview message&#039;&#039;&#039;: Transclusion count updated automatically ([[Template:High-use/doc#Technical details|see documentation]]).&quot; or &#039;&#039;<br /> <br /> if count == nil then<br /> if yesno(frame.args[&#039;fetch&#039;]) == false then<br /> if (frame.args[1] or &#039;&#039;) ~= &#039;&#039; then count = tonumber(frame.args[1]) end<br /> else<br /> count = _fetch(frame)<br /> end<br /> end<br /> local title = mw.title.getCurrentTitle()<br /> if title.subpageText == &quot;doc&quot; or title.subpageText == &quot;sandbox&quot; then<br /> title = title.basePageTitle<br /> end<br /> <br /> local systemMessages = frame.args[&#039;system&#039;]<br /> if frame.args[&#039;system&#039;] == &#039;&#039; then<br /> systemMessages = nil<br /> end<br /> <br /> -- This retrieves the project URL automatically to simplify localiation.<br /> local templateCount = (&#039;on [http://linkcount.toolforge.org/?project=%s&amp;page=%s#transclusions %s pages]&#039;):format(<br /> mw.title.getCurrentTitle():fullUrl():gsub(&#039;//(.-)/.*&#039;, &#039;%1&#039;),<br /> mw.uri.encode(title.fullText), p.num(frame, count))<br /> local used_on_text = &quot;&#039;&#039;&#039;This &quot; .. (mw.title.getCurrentTitle().namespace == 828 and &quot;Lua module&quot; or &quot;template&quot;) .. &#039; is used &#039;;<br /> if systemMessages then<br /> used_on_text = used_on_text .. systemMessages ..<br /> ((count and count &gt; 2000) and (&quot;&#039;&#039;&#039;, and &quot; .. templateCount) or (&quot;&#039;&#039;&#039;&quot;))<br /> else<br /> used_on_text = used_on_text .. templateCount .. &quot;&#039;&#039;&#039;&quot;<br /> end<br /> <br /> <br /> local sandbox_text = (&quot;%s&#039;s [[%s/sandbox|/sandbox]] or [[%s/testcases|/testcases]] subpages, or in your own [[%s]]. &quot;):format(<br /> (mw.title.getCurrentTitle().namespace == 828 and &quot;module&quot; or &quot;template&quot;),<br /> title.fullText, title.fullText,<br /> mw.title.getCurrentTitle().namespace == 828 and &quot;Module:Sandbox|module sandbox&quot; or &quot;Wikipedia:User pages#SUB|user subpage&quot;<br /> )<br /> <br /> local infoArg = frame.args[&quot;info&quot;] ~= &quot;&quot; and frame.args[&quot;info&quot;]<br /> if (systemMessages or frame.args[1] == &quot;risk&quot; or (count and count &gt;= 100000) ) then<br /> local info = systemMessages and &#039;.&lt;br/&gt;Changes to it can cause immediate changes to the Wikipedia user interface.&#039; or &#039;.&#039;<br /> if infoArg then<br /> info = info .. &quot;&lt;br /&gt;&quot; .. infoArg<br /> end<br /> sandbox_text = info .. &#039;&lt;br /&gt; To avoid major disruption&#039; ..<br /> (count and count &gt;= 100000 and &#039; and server load&#039; or &#039;&#039;) ..<br /> &#039;, any changes should be tested in the &#039; .. sandbox_text ..<br /> &#039;The tested changes can be added to this page in a single edit. &#039;<br /> else<br /> sandbox_text = (infoArg and (&#039;.&lt;br /&gt;&#039; .. infoArg .. &#039; C&#039;) or &#039; and c&#039;) ..<br /> &#039;hanges may be widely noticed. Test changes in the &#039; .. sandbox_text<br /> end<br /> <br /> <br /> local discussion_text = systemMessages and &#039;Please discuss changes &#039; or &#039;Consider discussing changes &#039;<br /> if frame.args[&quot;2&quot;] and frame.args[&quot;2&quot;] ~= &quot;&quot; and frame.args[&quot;2&quot;] ~= &quot;yes&quot; then<br /> discussion_text = string.format(&quot;%sat [[%s]]&quot;, discussion_text, frame.args[&quot;2&quot;])<br /> else<br /> discussion_text = string.format(&quot;%son the [[%s|talk page]]&quot;, discussion_text, title.talkPageTitle.fullText )<br /> end<br /> <br /> return used_on_text .. sandbox_text .. discussion_text .. &quot; before implementing them.&quot; .. bot_text<br /> end<br /> <br /> function p.main(frame)<br /> local count = nil<br /> if yesno(frame.args[&#039;fetch&#039;]) == false then<br /> if (frame.args[1] or &#039;&#039;) ~= &#039;&#039; then count = tonumber(frame.args[1]) end<br /> else<br /> count = _fetch(frame)<br /> end<br /> local image = &quot;[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]&quot;<br /> local type_param = &quot;style&quot;<br /> local epilogue = &#039;&#039;<br /> if frame.args[&#039;system&#039;] and frame.args[&#039;system&#039;] ~= &#039;&#039; then<br /> image = &quot;[[File:Ambox important.svg|40px|alt=Warning|link=]]&quot;<br /> type_param = &quot;content&quot;<br /> local nocat = frame:getParent().args[&#039;nocat&#039;] or frame.args[&#039;nocat&#039;]<br /> local categorise = (nocat == &#039;&#039; or not yesno(nocat))<br /> if categorise and not mw.title.getCurrentTitle().isRedirect then<br /> epilogue = frame:preprocess(&#039;{{Sandbox other||{{#switch:{{#invoke:Effective protection level|{{#switch:{{NAMESPACE}}|File=upload|#default=edit}}|{{FULLPAGENAME}}}}|sysop|templateeditor|interfaceadmin=|#default=[[Category:Pages used in system messages needing protection]]}}}}&#039;)<br /> end<br /> elseif (frame.args[1] == &quot;risk&quot; or (count and count &gt;= 100000)) then<br /> image = &quot;[[File:Ambox warning orange.svg|40px|alt=Warning|link=]]&quot;<br /> type_param = &quot;content&quot;<br /> end<br /> <br /> if frame.args[&quot;form&quot;] == &quot;editnotice&quot; then<br /> return frame:expandTemplate{<br /> title = &#039;editnotice&#039;,<br /> args = {<br /> [&quot;image&quot;] = image,<br /> [&quot;text&quot;] = p.text(frame, count),<br /> [&quot;expiry&quot;] = (frame.args[&quot;expiry&quot;] or &quot;&quot;)<br /> }<br /> } .. epilogue<br /> else<br /> return require(&#039;Module:Message box&#039;).main(&#039;ombox&#039;, {<br /> type = type_param,<br /> image = image,<br /> text = p.text(frame, count),<br /> expiry = (frame.args[&quot;expiry&quot;] or &quot;&quot;)<br /> }) .. epilogue<br /> end<br /> end<br /> <br /> return p</div> infobox>Paine Ellsworth