
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://zoophilia.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ASelf</id>
	<title>Module:Self - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://zoophilia.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ASelf"/>
	<link rel="alternate" type="text/html" href="https://zoophilia.wiki/index.php?title=Module:Self&amp;action=history"/>
	<updated>2026-06-22T02:33:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://zoophilia.wiki/index.php?title=Module:Self&amp;diff=134229&amp;oldid=prev</id>
		<title>SockyPaws: Import needed module from English Wikipedia</title>
		<link rel="alternate" type="text/html" href="https://zoophilia.wiki/index.php?title=Module:Self&amp;diff=134229&amp;oldid=prev"/>
		<updated>2026-03-21T11:08:10Z</updated>

		<summary type="html">&lt;p&gt;Import needed module from English Wikipedia&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.decide_migration(args)&lt;br /&gt;
  if args[&amp;#039;migration&amp;#039;] then&lt;br /&gt;
    return args[&amp;#039;migration&amp;#039;]&lt;br /&gt;
  end&lt;br /&gt;
  local licsense_migration_data = mw.loadJsonData(&amp;#039;Module:Self/license_migration_data.json&amp;#039;)&lt;br /&gt;
  for _, template_name in ipairs(args) do&lt;br /&gt;
    local migration_data = licsense_migration_data[string.lower(template_name)]&lt;br /&gt;
    if migration_data == &amp;#039;redundant&amp;#039; then&lt;br /&gt;
      return migration_data&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  return &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.setup_template_params(template_name, frame, args, migration)&lt;br /&gt;
  local title = mw.title.new(template_name, 10)&lt;br /&gt;
  if not title.exists then&lt;br /&gt;
    return {&lt;br /&gt;
      txt = &amp;#039;&amp;#039;,&lt;br /&gt;
      errors = (&amp;#039;&amp;lt;span class=&amp;quot;error scribunto-error&amp;quot;&amp;gt;The license &amp;quot;&amp;#039; .. template_name ..  &amp;#039;&amp;quot; does not exist.&amp;lt;/span&amp;gt;&amp;#039; ..&lt;br /&gt;
          &amp;#039;[[Category:Wikipedia dual licensed files with invalid licenses]]&amp;#039;)&lt;br /&gt;
    }&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  return {&lt;br /&gt;
    txt = (frame:expandTemplate({&lt;br /&gt;
      title = template_name,&lt;br /&gt;
      args = {&lt;br /&gt;
        dw = (args[&amp;#039;dw&amp;#039;] or &amp;#039;no&amp;#039;),&lt;br /&gt;
        date = (args[&amp;#039;date&amp;#039;]  or &amp;#039;&amp;#039;),&lt;br /&gt;
        migration = (migration)&lt;br /&gt;
      }&lt;br /&gt;
    })),&lt;br /&gt;
    errors = &amp;#039;&amp;#039;&lt;br /&gt;
  }&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.more_than_one(args)&lt;br /&gt;
  local c = 0&lt;br /&gt;
  for _, __ in ipairs(args) do&lt;br /&gt;
    c = c + 1&lt;br /&gt;
    if c == 2 then&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.start_line(args)&lt;br /&gt;
  local more_than_one = p.more_than_one(args)&lt;br /&gt;
  return mw.ustring.format(&lt;br /&gt;
    &amp;#039;\&amp;#039;\&amp;#039;\&amp;#039;\&amp;#039;\&amp;#039;%s, the copyright holder of this work,\&amp;#039;\&amp;#039;\&amp;#039; hereby publish%s it under the following license%s:\&amp;#039;\&amp;#039;&amp;#039;,&lt;br /&gt;
    args[&amp;#039;author&amp;#039;] or &amp;#039;I&amp;#039;,&lt;br /&gt;
    args[&amp;#039;author&amp;#039;] and &amp;#039;es&amp;#039; or &amp;#039;&amp;#039;,&lt;br /&gt;
    more_than_one and &amp;#039;s&amp;#039; or &amp;#039;&amp;#039;&lt;br /&gt;
  )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.categories(args)&lt;br /&gt;
  local currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
  local is_in_file_namespace = currentTitle.nsText == &amp;#039;File&amp;#039;&lt;br /&gt;
  if not is_in_file_namespace then&lt;br /&gt;
    return &amp;#039;&amp;#039;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  if args[&amp;#039;author&amp;#039;] then&lt;br /&gt;
    return mw.ustring.format(&amp;#039;[[Category:Files licensed by third parties|%s]]&amp;#039;, currentTitle.fullText)&lt;br /&gt;
  else&lt;br /&gt;
    return mw.ustring.format(&amp;#039;[[Category:Self-published works|%s]]&amp;#039;, currentTitle.fullText)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
  local args = frame:getParent().args&lt;br /&gt;
  local tstyles = frame:extensionTag(&lt;br /&gt;
    &amp;#039;templatestyles&amp;#039;,&lt;br /&gt;
    &amp;#039;&amp;#039;,&lt;br /&gt;
    {&lt;br /&gt;
      src = &amp;#039;Module:Self/styles.css&amp;#039;&lt;br /&gt;
    }&lt;br /&gt;
  )&lt;br /&gt;
  local fmt_string_tmpl = &amp;#039;&amp;lt;div class=&amp;quot;wp-tmpl-self-license-wrapper&amp;quot;&amp;gt;&amp;#039; ..&lt;br /&gt;
    &amp;#039;&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;%s&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;%s&amp;lt;/div&amp;gt;%s&amp;lt;/div&amp;gt;%s&amp;#039;&lt;br /&gt;
  local initial_text = p.start_line(args)&lt;br /&gt;
  local final_line = p.more_than_one(args) and &amp;#039;&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;#039; ..&lt;br /&gt;
      &amp;#039;&amp;lt;span style=&amp;quot;font-style: italic;&amp;quot;&amp;gt;You may select the license of your choice.&amp;lt;/span&amp;gt;&amp;#039; ..&lt;br /&gt;
      &amp;#039;&amp;lt;/div&amp;gt;&amp;#039; or &amp;#039;&amp;#039;&lt;br /&gt;
  local categories = p.categories(args)&lt;br /&gt;
  local templates = &amp;#039;&amp;#039;&lt;br /&gt;
  local errors = &amp;#039;&amp;#039;&lt;br /&gt;
  local migration = p.decide_migration(args)&lt;br /&gt;
  for _, template_name in ipairs(args) do&lt;br /&gt;
    tmpl_with_args = p.setup_template_params(template_name, frame, args, migration)&lt;br /&gt;
    templates = templates .. tmpl_with_args.txt&lt;br /&gt;
    errors = errors .. tmpl_with_args.errors&lt;br /&gt;
  end&lt;br /&gt;
  return tstyles .. mw.ustring.format(fmt_string_tmpl, initial_text, templates, final_line, categories) .. errors&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>SockyPaws</name></author>
	</entry>
</feed>