This is an old revision of this page, as edited by GreenC(talk | contribs) at 01:54, 7 October 2015(replace "<space>" with "+"). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.Revision as of 01:54, 7 October 2015 by GreenC(talk | contribs)(replace "<space>" with "+")
This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected.
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing.
localp={}functionp.author(frame)localpframe=frame:getParent()localargs=pframe.argslocaltname="Gutenberg author"-- name of calling template. Change if template is renamed.localid=nil-- author name, or author number. The later will go direct to the author page, the former to a search results page.localname=nil-- display name on Wikipedia (default: article title)localurl=nillocaltagline="at [[Project Gutenberg]]"localurlheadname="http://www.gutenberg.org/author/"-- SSL problems with certain browsers. See [[Template_talk:Gutenberg_author#https_problem]]localurlheadnumb="http://www.gutenberg.org/ebooks/author/"localurlhead=nilid=trimArg(args[1])ortrimArg(args.id)ifnotidthenerror("Parameter id is missing. See [[Template:"..tname.."]] documentation")elseiftonumber(id)then-- it's a numberurlhead=urlheadnumbelseurlhead=urlheadnameendendname=trimArg(args[2])ortrimArg(args.name)ifnotnamethenname=mw.title.getCurrentTitle().text:gsub('%s+%([^%(]-%)$','')-- Current page name without the final parenthesesendlocalstitle=mw.ustring.gsub(name," ","+")-- replace "<space>" with "+"url="["..urlhead..id.." Works by "..name.."] "..taglinereturnurlendfunctiontrimArg(arg)ifarg==""orarg==nilthenreturnnilelsereturnmw.text.trim(arg)endendreturnp