You can edit almost every page by Creating an account and confirming your email.

Module:Books and Writers

From EverybodyWiki Bios & Wiki

Usage

There is currently 1 template that invokes this module, {{Books and Writers}}.

IMPORTANT: The Wayback date "20130704043115" is tested and known to work with all cases. Later dates may result in missing pages.



local p = {}
 
function p.externallink(frame)
  
  local pframe = frame:getParent()
  local args = pframe.args
 
  local tname = "Books and Writers" -- name of calling template. Change if template is renamed.
 
  local id      = nil -- author ID
  local name    = nil -- display name (default: article title)
  local url     = nil
  local tagline = "at ''Books and Writers''"
--  local urlhead = "https://web.archive.org/web/20130704043115/http://www.kirjasto.sci.fi/"
--  local urlhead = "https://greencardamom.github.io/BooksAndWriters/"
  local urlhead = "http://authorscalendar.info/"
--  local deadurl = "http://www.kirjasto.sci.fi/"
  local mainindex = "http://authorscalendar.info/indeksi.htm" 

  id = trimArg(args[1]) or trimArg(args.id)
  if not id then
    error("Error in Template:" .. tname .. " - id missing - please see documentation for [[Template:" .. tname .. "]]")
  end 

  name = trimArg(args[2]) or trimArg(args.name)
  if not name then
    name = mw.title.getCurrentTitle().text:gsub('%s+%([^%(]-%)$', '') -- Current page name without the final parentheses
  end 

  url = "Petri Liukkonen. [" .. urlhead .. id .. ".htm \"" .. name .. "\"]. [" .. mainindex .. " ''Books and Writers'']"

  return url
 
end

function trimArg(arg)

  if arg == "" or arg == nil then
    return nil
  else
    return mw.text.trim(arg)
  end

end
 
return p