Ugrás a tartalomhoz

Modul:CitWeb

A Wikipédiából, a szabad enciklopédiából
A lap korábbi változatát látod, amilyen JulesWinnfield-hu (vitalap | szerkesztései) 2015. december 19., 15:47-kor történt szerkesztése után volt. Ez a változat jelentősen eltérhet az aktuális változattól.

CitWeb[mi ez?] • [dokumentáció: mutat, szerkeszt] • [tesztek: létrehozás]

--Version 2014_05_23
local ds =require("Modul:Dátumszűrés")
local hopp =require("Modul:CheckISBN")
local args = {} 
local lang = mw.getContentLanguage() 

local function isArabic(v)
	return tonumber(v)
end

	local lans={}  
	lans["an"] = "van"
    lans["ar"] = "van"
    lans["aze"] = "van"
    lans["be"] = "van"
    lans["bg"] = "van"
    lans["bn"] = "van"
    lans["bs"] = "van" 
    lans["ca"] = "van" 
    lans["chm"] = "van"
    lans["cy"] = "van"
    lans["cs"] = "van"
    lans["da"] = "van"
    lans["de"] = "van"
    lans["ee"] = "van"
    lans["el"] = "van"
    lans["en"] = "van"
    lans["eo"] = "van"
    lans["es"] = "van"
    lans["et"] = "van"
    lans["eu"] = "van"
    lans["fa"] = "van"
    lans["fi"] = "van"
    lans["fo"] = "van"
    lans["fr"] = "van"
    lans["fy"] = "van"
    lans["ga"] = "van"
    lans["gd"] = "van"
    lans["gl"] = "van"
    lans["grc"] = "van"
    lans["gu"] = "van"
    lans["he"] = "van"
    lans["hi"] = "van"
    lans["hr"] = "van"
    lans["ht"] = "van"
    lans["hu"] = "van"
    lans["hy"] = "van"
    lans["hz"] = "van"
    lans["id"] = "van"
    lans["is"] = "van"
    lans["it"] = "van"
    lans["ja"] = "van"
    lans["jp"] = "van"
    lans["ka"] = "van"
    lans["kk"] = "van" 
    lans["km"] = "van"
    lans["kn"] = "van"
    lans["ko"] = "van"
    lans["ku"] = "van"
    lans["ky"] = "van"
    lans["lat"] = "van"
    lans["lb"] = "van"
    lans["lo"] = "van"
    lans["lit"] = "van"
    lans["lv"] = "van"
    lans["mk"] = "van"
    lans["mn"] = "van"
    lans["mo"] = "van"
    lans["ms"] = "van"
    lans["mt"] = "van"
    lans["my"] = "van"
    lans["ne"] = "van"
    lans["nl"] = "van"
    lans["nn"] = "van"
    lans["no"] = "van"
    lans["oc"] = "van"
    lans["pa"] = "van"
    lans["pl"] = "van"
    lans["pt"] = "van"
    lans["rm"] = "van"
    lans["ro"] = "van"
    lans["ru"] = "van"
    lans["rue"] = "van"
    lans["sa"] = "van"
    lans["sah"] = "van"
    lans["scn"] = "van"
    lans["se"] = "van"
    lans["sh"] = "van"
    lans["sk"] = "van"
    lans["slo"] = "van"
    lans["sm"] = "van"
    lans["sq"] = "van"
    lans["sr"] = "van"
    lans["sv"] = "van" 
    lans["tam"] = "van"
    lans["te"] = "van"
    lans["tet"] = "van"
    lans["tg"] = "van"
    lans["th"] = "van"
    lans["tk"] = "van"
    lans["tag"] = "van"
    lans["to"] = "van"
    lans["tr"] = "van"
    lans["tat"] = "van"
    lans["ty"] = "van"
    lans["uk"] = "van"
    lans["ur"] = "van"
    lans["uz"] = "van"
    lans["vi"] = "van"
    lans["yi"] = "van"
    lans["zh"] = "van"



hibavan = false


local ou ='' -- hibakeresésre szolgáló globális változó, mely tartalmazza az an
			--alízishez szolgáló üzeneteket, az alábbi function pop() gyűjtögeti a tartalmát

function pop(...)  -- idézőjeles rész és bővítmények az ou számára
    local list = {...};
    for _, var in pairs(list) do
         ou = ou..var..'\n ' 
    end
end

local function is_set( var ) -- lekérdezi, hogy a változónak adtunk-e értéket. 
                                --Ha a változó értéke nil, vagy üres string, akkor false értéket ad, kben true
                                -- azaz a var sem nil, sem üres
    return not (var == nil or var == '');
end
 
-- First set variable or nil if none : keresi az első olyan változót, amelynek van értéke egy listában 
-- visszaadott értéke a változó értéke, vagy nil, ha egyetlen változó sincs a vararg listában, amelynek értéke lenne
local function first_set(...)
    local list = {...};
    for _, var in pairs(list) do
        if is_set( var ) then
            return var;
        end
    end
end


function error ( about ) -- ő állítja át a hibavant true-ra és kiadja a kimenetén
 						-- a megfelelően megjelenítendő hibaüzenetet
    -- Enclose errorMsg with <span>
    -- Precondition:
    --     about  -- string
    hibavan = true  
    local r = about
    if type( about ) == "string" then
        if #about == 0 then
            r = "Error in Lua"
        end
    else
        r = tostring( about )
    end
    return "<span class=\'error\'>" .. r .. "</span>, "
end -- error()

function trim(str)  -- a str bevezető és záró szóközeinek levágását célozza
    if str.args then
        str = str.args[1]  
    end
    if str == nil then
        return nil
    else
        return (str:gsub("^%s*(.-)%s*$", "%1")) -- extra brackets are necessary because gsub returns multiple values
    end
end

function tabledump(tbl, recursive)
    if type(tbl) ~= 'table' then
        return '<not a table!>'
    end
    local s = '{ '
    for k,v in pairs(tbl) do
        if type(k) ~= 'number' then 
            k = '"'..k..'"' 
        end
        if type(v) == 'table' then
            if recursive then
                v = table.dump(v, true)
            else
                v = 'table'
            end
        elseif type(v) == 'boolean' then -- no boolean -> string autoconversion in Lua
            if v then
                v = 'true'
            else
                v = 'false'
            end
        end
        s = s .. '['..k..'] = ' .. v .. ','
    end
    return s .. '} '
end


function isISSN( str)
	local v,chsum
	str = string.gsub  (str, '–' , '-') -- nagykötőjelből kicsi lesz
	str = string.gsub  (str, '—' , '-') -- hetvenkvirtesből kicsi lesz
	i,j = string.find  (str, '-')
	if i==j and i==5 then -- rendben, az ötödik helyen van a kötőjel
		v = string.sub (str,1,4)..string.sub (str,6,8)
		chd =  string.sub (str,-1,-1); 
		else return false
	end
	if chd == 'X' or isArabic(chd) then
			if chd == 'X' then chnum = 10 else chnum = string.byte(chd,1) - string.byte('0',1) end 
		else
		return false
	end 
	if isArabic(v) then 
		    chsum = 0
			for j = 8,2,-1 do   
			    local elsbyte = string.byte(v,(9 - j))
				chsum = chsum + (elsbyte - string.byte('0',1)) * j
				end -- j ciklus
			else return false -- nem számjegyek
	end -- if
	local chnumdo = 11 - (chsum % 11)    
	if chnumdo == chnum then return true
	                 else return false 
	end
end -- isISSN


 
--CitWeb
--[[
    {{citweb |url= |szerző= |szerző2= |szerző3= |cím= |alcím=  |közreműködők= 
    {{citweb |url= |aut=    |aut2=    |aut3=    |tit= |subtit= |ass=   --Alternatív paraméterekkel 
    |weblap= |nyelvkód= |hely= |kiadó= |dátum= vagy év= |oldal= |elér= 
    |work=   |lan=      |loc=  |red=   |date= vagy ann= |pag=   |accd= 	
    |formátum= |méret= |archívurl= |archívdátum= |doi= |egyéb= |idézet= }}
	|form=     |siz=        |aurl=      |archd=       |doi= |misc=  |quote= }}  
--]]    	

-- a sablon paramétereit, vagy annak alternatíváját hozza be és adja át egy változónak
-- A "form=" alakú paramétereket nem üresként, hanem nilként adja át, 
			--így úgy veszi, mintha a sablonban nem is szerepelne a paraméter (ez így egységes)
			-- assign segítségével megadhatjuk a default értéket

function getArg(arg,alternativarg, assign ) -- itt eredetileg a frame nem paraméter
    -- Retrieve template argument
    -- Precondition:
    --     arg     -- string or number; argument identifier
    --     assign  -- any, optional; default value
    -- Uses:
    --     mw.getCurrentFrame()
    
        --local r = mw.getCurrentFrame().args[ arg ]  állt itt eredetileg
       -- a kurrens frame argumentumai közül az arg kulccsal megadott
    
    local r,r1,r2 = nil
    -- a frame nil értéket ad, ha nem szerepel a paraméter, ''-et ad, ha szerepel, de nincs benne karakter
    if args[ arg ] ~=nil and  args[ arg ] ~='' then r1 = args[ arg ]  end
    -- r1 nil marad, ha a paramétert nem adták meg, vagy üresen adták meg
    if args[ alternativarg ]~= nil and  args[ alternativarg ] ~=''  then  r2 = args[ alternativarg ] end
    -- r2 nil marad, ha az alternatív paramétert  nem adták meg, vagy üresen adták meg
    
    if r1  then r =  r1  else 
    					if r2 then r = r2 end
    end					
        if type( r ) ~= "string" then
        if type( assign ) == nil then
            r = "{{{<" .. arg .. ">}}}"  --ha r nem string tipus, azaz és assign nil érték
        else
            r = assign -- ha r nem string tipus, és assign nem nil
        end
    end
    return r  -- ha r string tipus, vagy nil
end

local url,szerzo, szerzo2, szerzo3, szerzo4, szerzo5, szerzo6, szerzo7, szerzo8, szerzo9 =nil
local cim, alcim,datum , outdatum, nyelv, lan, english= nil
local ass,weblap,red,loc, ev, ho,nap, oldal,form,size,formsiz,aurl,archd,doi,accd,misc,quote=nil 
local szerzo_csaladneve, szerzo2_csaladneve, szerzo3_csaladneve, szerzo4_csaladneve= nil
local  szerzo5_csaladneve, szerzo6_csaladneve, szerzo7_csaladneve, szerzo8_csaladneve, szerzo9_csaladneve= nil 
local szerzo_keresztneve, szerzo2_keresztneve, szerzo3_keresztneve, szerzo4_keresztneve= nil
local  szerzo5_keresztneve, szerzo6_keresztneve, szerzo7_keresztneve, szerzo8_keresztneve, szerzo9_keresztneve= nil 
local szerzolink,szerzolink2,szerzolink3,szerzolink4,szerzolink5,szerzolink6,szerzolink7,szerzolink8,szerzolink9= nil 
local month, year, origyear

function angol_parameterek()
	cim= getArg("title") 
	datum= getArg("date") 
	accd=  getArg('accessdate') 
	aurl=getArg('archiveurl')
	if aurl then 
	    aurl = string.gsub(aurl, '%s','%%20')
		aurl = string.gsub(aurl, '\"','%%22')
		aurl = string.gsub(aurl, "\'",'%%27')
		aurl = string.gsub(aurl, "<",'%%3c')
		aurl = string.gsub(aurl, ">",'%%3e')
		aurl = string.gsub(aurl, "%[",'%%5b')
		aurl = string.gsub(aurl, "%]",'%%5d')
		aurl = string.gsub(aurl, "{",'%%7b')
		aurl = string.gsub(aurl, "|",'%%7c')
		aurl = string.gsub(aurl, "}",'%%7d')
	end

	archd=getArg('archivedate')
	weblap = getArg("website","work")
	red = getArg('publisher')
	szerzo_csaladneve= getArg("last","author")
	if not  szerzo_csaladneve   then szerzo_csaladneve  = getArg("last1","author1") end
	if not  szerzo_csaladneve   then szerzo_csaladneve  = getArg("authors") end
	szerzo2_csaladneve= getArg("last2","author2")
	szerzo3_csaladneve= getArg("last3","author3")
	szerzo4_csaladneve= getArg("last4","author4")
	szerzo5_csaladneve= getArg("last5","author5")
	szerzo6_csaladneve= getArg("last6","author6")
	szerzo7_csaladneve= getArg("last7","author7")
	szerzo8_csaladneve= getArg("last8","author8")
	szerzo9_csaladneve= getArg("last9","author9")

    szerzo_keresztneve= getArg("first")
    if not szerzo_keresztneve then szerzo_keresztneve= getArg("first1") end
	szerzo2_keresztneve= getArg("first2")
	szerzo3_keresztneve= getArg("first3")
	szerzo4_keresztneve= getArg("first4")
	szerzo5_keresztneve= getArg("first5")
	szerzo6_keresztneve= getArg("first6")
	szerzo7_keresztneve= getArg("first7")
	szerzo8_keresztneve= getArg("first8")
	szerzo9_keresztneve= getArg("first9")
	
	
	         local c=''
    if szerzo_csaladneve then c=c..  szerzo_csaladneve 
                if szerzo_keresztneve then c=c..', '.. szerzo_keresztneve end
        szerzo=c;
        end
        c=''   
        if szerzo2_csaladneve then c=c..  szerzo2_csaladneve 
                if szerzo2_keresztneve then c=c..', '.. szerzo2_keresztneve end
            szerzo2=c;
        end
		c=''   
        if szerzo3_csaladneve then c=c..  szerzo3_csaladneve 
                if szerzo3_keresztneve then c=c..', '.. szerzo3_keresztneve end
            szerzo3=c;
        end
		c=''   
        if szerzo4_csaladneve then c=c..  szerzo4_csaladneve 
                if szerzo4_keresztneve then c=c..', '.. szerzo4_keresztneve end
            szerzo4=c;
        end
		c=''   
        if szerzo5_csaladneve then c=c..  szerzo5_csaladneve 
                if szerzo5_keresztneve then c=c..', '.. szerzo5_keresztneve end
            szerzo5=c;
        end
		c=''   
        if szerzo6_csaladneve then c=c..  szerzo6_csaladneve 
                if szerzo6_keresztneve then c=c..', '.. szerzo6_keresztneve end
            szerzo6=c;
        end
		c=''   
        if szerzo7_csaladneve then c=c..  szerzo7_csaladneve 
                if szerzo7_keresztneve then c=c..', '.. szerzo7_keresztneve end
           szerzo7=c; 
        end
		c=''   
        if szerzo8_csaladneve then c=c..  szerzo8_csaladneve 
                if szerzo8_keresztneve then c=c..', '.. szerzo8_keresztneve end
        szerzo8=c    
        end
		c=''   
        if szerzo9_csaladneve then c=c..  szerzo9_csaladneve 
                if szerzo9_keresztneve then c=c..', '.. szerzo9_keresztneve end
            szerzo9= c  
        end


	
	szerzolink= getArg("authorlink")
	if not szerzolink then  szerzolink= getArg("authorlink1") end
	if not szerzolink then  szerzolink= getArg("author-link1") end
	if not szerzolink  then  szerzolink= getArg("author1-link") end
	if not szerzolink  then  szerzolink= getArg("author1link") end
	
	if szerzolink then szerzo = '[['..szerzolink..']]' end
	szerzolink2= getArg("authorlink2") 
	if not szerzolink2  then  szerzolink2= getArg("author2-link") end
	if szerzolink2 then szerzo2 = '[['..szerzolink2..']]' end	
	szerzolink3= getArg("authorlink3") 
	if not szerzolink3  then  szerzolink3= getArg("author3-link") end
	if szerzolink3 then szerzo3 = '[['..szerzolink3..']]' end	
	szerzolink4= getArg("authorlink4") 
	if not szerzolink4  then  szerzolink4= getArg("author4-link") end
	if szerzolink4 then szerzo4 = '[['..szerzolink4..']]' end	
	szerzolink5= getArg("authorlink5") 
	if not szerzolink5  then  szerzolink5= getArg("author5-link") end
	if szerzolink5 then szerzo5 = '[['..szerzolink5..']]' end	
	szerzolink6= getArg("authorlink6") 
	if not szerzolink6  then  szerzolink6= getArg("author6-link") end
	if szerzolink6 then szerzo6 = '[['..szerzolink6..']]' end		 
	szerzolink7= getArg("authorlink7") 
	if not szerzolink7  then  szerzolink7= getArg("author7-link") end
	if szerzolink7 then szerzo7 = '[['..szerzolink7..']]' end	
	szerzolink8= getArg("authorlink8") 
	if not szerzolink8  then  szerzolink8= getArg("author8-link") end
	if szerzolink8 then szerzo8 = '[['..szerzolink8..']]' end		 
	szerzolink9= getArg("authorlink9") 
	if not szerzolink9  then  szerzolink9= getArg("author9-link") end
	if szerzolink9 then szerzo9 = '[['..szerzolink9..']]' end		 
	datum = getArg"date" or getArg"year"
	origyear = getArg"origyear"

	ass = getArg('others')
	lan = getArg('language')
	cim = getArg('title')
	forditas_cime = getArg('trans_title')
	loc = getArg('place','location')
	red = getArg('publisher')
	publication_date= getArg('publication-date')
	if publication_date then 
		if select(2,ds.datumszuro(publication_date))== select(2,ds.datumszuro(datum)) then publication_date = nil 
		else datum = publication_date
		end
	end -- csak akkor tekintjük létezőnek, ha különbözik a dátumtól		
	publication_place = getArg('publication-place')

		szerkeszto_csaladneve = getArg('editor-last','editor1-last')	
		if  not szerkeszto_csaladneve then szerkeszto_csaladneve = getArg ('editor', 'editors') end
		szerkeszto_keresztneve = getArg('editor-first', 'editor1-first')
		szerkeszto2_csaladneve = getArg('editor2-last')
		szerkeszto2_keresztneve = getArg('editor2-first')
		szerkeszto3_csaladneve = getArg('editor3-last')
		szerkeszto3_keresztneve = getArg('editor3-first')
		szerkeszto4_csaladneve = getArg('editor4-last')
		szerkeszto4_keresztneve = getArg('editor4-first')

 	    local c=''
    	if szerkeszto_csaladneve then c=c..  szerkeszto_csaladneve 
                if szerkeszto_keresztneve then c=c..', '.. szerkeszto_keresztneve end
        szerkeszto=c;
        end
        c=''   
        if szerkeszto2_csaladneve then c=c..  szerkeszto2_csaladneve 
                if szerkeszto2_keresztneve then c=c..', '.. szerkeszto2_keresztneve end
            szerkeszto2=c;
        end
		c=''   
        if szerkeszto3_csaladneve then c=c..  szerkeszto3_csaladneve 
                if szerkeszto3_keresztneve then c=c..', '.. szerkeszto3_keresztneve end
            szerkeszto3=c;
        end
		c=''   
        if szerkeszto4_csaladneve then c=c..  szerkeszto4_csaladneve 
                if szerkeszto4_keresztneve then c=c..', '.. szerkeszto4_keresztneve end
            szerkeszto4=c;
        end
    local c=''
  	if szerkeszto then c = szerkeszto end
  	if szerkeszto2 then 
  					if c == '' then c = szerkeszto2 else c = c..' &#8211; '..szerkeszto2 end
  	           end
    if szerkeszto3 then 
  					if c == '' then c = szerkeszto3 else c = c..' &#8211; '..szerkeszto3 end
  	           end
    if szerkeszto4 then 
  					if c == '' then c = szerkeszto4 else c = c..' &#8211; '..szerkeszto4 end
  	           end
    if c == '' then szerkeszto = nil else szerkeszto ="szerk.: ".. c end 	
	
	oldal = getArg('page','pages')
	nopp = getArg('nopp') 
    at = getArg('at')
    if oldal then at= nil end 
    deadurl= getArg(' deadurl') 
    template_doc_demo= getArg('template doc demo') 
    if template_doc_demo ~= nil and template_doc_demo == "true" then template_doc_demo=true else template_doc_demo=false end
    _format= getArg('format')
    if _format then _format= '( '.._format..') ' end
    isbn= getArg('isbn')   
    issn= getArg('issn')   
    
    --Quote	
    
    quote= getArg('quote')
     doi= getArg('doi')   
	 tipus= getArg('type')  
	 sorozat = getArg('series','version')
	 if not sorozat then  sorozat = getArg('agency') else
	 sorozat = "Sorozat: "..sorozat..' '	
	 	end 
	 
	 
    id= getArg('id')   
     if not id then  
	     arxiv= getArg('arxiv')  
	     _asin= getArg('asin')   
	     _asin_tld= getArg('asin-tld')  
	     						
	     bibcode= getArg('bibcode')   
	     doi_brokendate= getArg('doi_brokendate')  
	     jfm= getArg('jfm')   
	     jstor= getArg('jstor')  
	     lccn= getArg('lccn')   
	     mr= getArg('mr')   
	     oclc= getArg('oclc')  
	     ol= getArg('ol')   
	     osti= getArg('osti') 
	     pmc= getArg('pmc')   
	     embargo= getArg('embargo')   
	     pmid= getArg('pmid')   
	     rfc= getArg('rfc')   
	     ssrn= getArg('ssrn') 
	     zbl= getArg('zbl')   
	 end 
	 
	 --Laysummary

     layurl= getArg('layurl') 
         laysource= getArg('laysource')   
         laydate= getArg('laydate')   

--Display options

     author_mask= getArg('author-mask')  
	 author_name_separator= getArg('author-name-separator')  
     author_separator= getArg('author-separator')   
     display_authors= getArg('display-authors')   
     display_editors = getArg('display-editors')   
     lastauthoramp= getArg('lastauthoramp')  
     postscript= getArg('postscript')   
     separator= getArg('separator')   
end


local function isEnglish()
    cim= getArg("title") ; pop('cim',cim)  
    year = getArg('year') 
    accd=  getArg('accessdate') 
    aurl=getArg('archiveurl') 
    archd=getArg('archivedate')
    weblap = getArg("website") 
    red = getArg('publisher')  
    datum = getArg('date') 
    ass = getArg('others') 
    lan = getArg('language') 
    cim = getArg('title') 
    loc = getArg('place','location') 
    red = getArg('publisher') 
    oldal = getArg('page','pages') 
    szerzo_csaladneve= getArg("last","author")
    if not  szerzo_csaladneve   then szerzo_csaladneve  = getArg("last1","author1") end
            if not  szerzo_csaladneve   then szerzo_csaladneve  = getArg("authors") end
    szerzolink= getArg("authorlink")
            if not szerzolink then  szerzolink= getArg("authorlink1") end
            if not szerzolink then  szerzolink= getArg("author-link1") end
            if not szerzolink  then  szerzolink= getArg("author1-link") end
    year = getArg('year')
    origyear = getArg('origyear')
    ass = getArg('others')
    forditas_cime = getArg('trans_title')
    loc = getArg('place','location'); --pop('loc',loc) 
    publication_date= getArg('publication-date')
    szerkeszto_csaladneve = getArg('editor-last','editor1-last')    
                    if  not szerkeszto_csaladneve then szerkeszto_csaladneve = getArg ('editor', 'editors') end
    oldal = getArg('page','pages')
            nopp = getArg('nopp')
    at = getArg('at')
            if oldal then at= nil end -- ha page, vagy pages definiált, akkor ő legyen nil
    deadurl= getArg(' deadurl') 
    template_doc_demo= getArg('template doc demo') 
    _format= getArg('format')
    isbn= getArg('isbn')
    issn= getArg('issn')
    tipus= getArg('type')  
    sorozat = getArg('series','version')
    if not sorozat then  sorozat = getArg('agency') end
    x= cim or year  or accd or  aurl or archd or weblap  or  red  or  ass  or lan  or loc  or  red  or  oldal  or szerzo_csaladneve or szerzolink or year  or  origyear  or  ass or  forditas_cime or  red  or  publication_date or szerkeszto_csaladneve  or oldal  or nopp or  
    at  or  deadurl or  template_doc_demo or _format or isbn or  issn or  tipus or sorozat 
    local talalat =''
    if x == nil then  talalat='nem' else talalat= 'igen' end 
    if x == nil then return false else return true end
end -- isEnglish

	

local function _nilez()
szerzo,szerzo2 ,szerzo3,szerzo4,szerzo5 = nil
szerzo6,szerzo7,szerzo8,szerzo9, cim,alcim  = nil
ass, weblap,lan  ,loc,red , ev ,datum  , accd ,form,size,aurl,archd ,misc  = nil
end


local function magyar_e()
	url= getArg("url"); 
	szerzo= getArg("szerző","aut")
	szerzo2= getArg("szerző2","aut2") 
	szerzo3= getArg("szerző3","aut3")
	szerzo4= getArg("szerző4","aut4")
	szerzo5= getArg("szerző5","aut5")
	szerzo6= getArg("szerző6","aut6")
	szerzo7= getArg("szerző7","aut7")
	szerzo8= getArg("szerző8","aut8")
	szerzo9= getArg("szerző9","aut9")
	cim= getArg("cím","tit")    
	alcim= getArg("alcím","subtit")
	ass = getArg('ass','közreműködők')
	weblap = getArg("weblap","work")
	lan = getArg('lan','nyelvkód')
	loc = getArg('loc','hely')
	red = getArg('red','kiadó')
	ev= getArg("év","ann") 
	if ev then ev = string.gsub(ev,"[%[%]]",'')end
	datum = getArg("dátum","date")
	if datum then datum = string.gsub(datum,"[%[%]]",'')end
	oldal= getArg("oldal","pag")
	accd=  getArg('elér','accd') 
	if accd then accd = string.gsub(accd,"[%[%]]",'')end
	form=getArg('form','formátum')
	size=getArg('siz','méret')
	aurl=getArg('aurl','archívurl')
	archd=getArg('archd','archívdátum')
	if archd then archd = string.gsub(archd,"[%[%]]",'')end
	doi=getArg('doi') 
	misc=getArg("egyéb","misc")
	quote=getArg('quote',"idézet")
	local x = nil
	x= szerzo or szerzo2  or szerzo3 or szerzo4 or szerzo5 or 
	szerzo6 or szerzo7 or szerzo8 or szerzo9 or  cim or alcim  
	or ass  or lan   or loc or red  or  ev  or  accd  or form or size or aurl or archd  or misc  
	local talalat =''
	if x == nil then  talalat='nem' else talalat= 'igen' end 
	if x == nil then return false else return true end
end --magyar_e


local function _citweb(frame)

	
  _nilez() --
  local igen_magyar,hiba_jelzes = nil
  
  if magyar_e() then igen_magyar = true  else igen_magyar = false end
  if not igen_magyar then  angol_parameterek() end 

   hiba_jelzes=''

-- a szerzőket előre lépteti, társszerzőből szerzőt csinál stb.

   	local c=''
  	if szerzo then c = szerzo end
  	if szerzo2 then 
  					if c == '' then c = szerzo2 else c = c..' &#8211; '..szerzo2 end
  	           end
    if szerzo3 then 
  					if c == '' then c = szerzo3 else c = c..' &#8211; '..szerzo3 end
  	           end
    if szerzo4 then 
  					if c == '' then c = szerzo4 else c = c..' &#8211; '..szerzo4 end
  	           end
    if szerzo5 then 
  					if c == '' then c = szerzo5 else c = c..' &#8211; '..szerzo5 end
  	           end
    if szerzo6 then 
  					if c == '' then c = szerzo6 else c = c..' &#8211; '..szerzo6 end
  	           end
    if szerzo7 then 
  					if c == '' then c = szerzo7 else c = c..' &#8211; '..szerzo7 end
  	           end
    if szerzo8 then 
  					if c == '' then c = szerzo8 else c = c..' &#8211; '..szerzo8 end
  	           end
    if szerzo9 then 
  					if c == '' then c = szerzo9 else c = c..' &#8211; '..szerzo9 end
  	           end
    if c == '' then szerzo = nil else szerzo = c..': 'end 

  --cím és alcím
  
  
  local terminator
  if cim  
     then cim = trim(lang:ucfirst(cim))
     else hiba_jelzes = hiba_jelzes.. error("nincs elsődleges cím")
      end
  if alcim   then 
              	alcim=lang:ucfirst(alcim)  
              	if cim   then 
              	         if string.sub(cim,-1,-1) ~= ":" then
               								    cim= cim..": "..alcim 
           				 else cim= cim.." "..alcim
           				 end
           		end		 --	
  end 
  if cim then terminator = string.sub(cim,-1,-1) 
	if (terminator ~= '?' and terminator ~= '!'and terminator ~= ',' and terminator ~= '.' and terminator ~= '\166' ) 
	    then      cim= cim.."."  end   
	
	-- SZÜKSÉGES CSERÉK:
	--newline 	[ 	     ] 	     |    Ezek kellenek, mert az URL ráhúzásakor bezavarnak
	--space    &#91; 	&#93; 	&#124;
	if forditas_cime then cim = cim..' ['.. forditas_cime..'] ' end
	cim = string.gsub(cim,'\n',' ')
	cim = string.gsub(cim,'%[','&#91;')  
	cim = string.gsub(cim,'%]','&#93;')
	cim = string.gsub(cim,'%|','&#124;')
  end   
  
    
  -- asszisztencia

  	if ass then ass = lang:ucfirst(ass)..' ' end
  		
  		
  		url= getArg("url"); pop("url", url)
	if url then 
	    url = string.gsub(url, '%s','%%20')
		url = string.gsub(url, '\"','%%22')
		url = string.gsub(url, "\'",'%%27')
		url = string.gsub(url, "<",'%%3c')
		url = string.gsub(url, ">",'%%3e')
		url = string.gsub(url, "%[",'%%5b')
		url = string.gsub(url, "%]",'%%5d')
		url = string.gsub(url, "{",'%%7b')
		url = string.gsub(url, "|",'%%7c')
		url = string.gsub(url, "}",'%%7d')
	end

  	
  	-- weblap

  	if weblap then  --pop("weblap", weblap)
		else --pop("weblap", "nincs eddig")
			if not red then  
					if url then
							local maradek, i, j
							i, j = string.find (url,"//")
							if j then maradek = string.sub(url,j+1,-1) 
							end
							if maradek then       
								i, j = string.find (maradek,"/") 
								if j then 
								weblap = string.sub(maradek, 1, j - 1)
							else 
								weblap = maradek -- elmarad az URL első / jele is
								end
							end -- maradek
					end --if url	
			end --if not red
	end -- if weblap
  
-- nyelvkód

 local LetezoLansablon = false
  if lan then 
  			if  (lan ~= nil ) and  (cim==nil)  
             	then  hiba_jelzes = hiba_jelzes..' '..error("nyelv cím nélkül")..' ' else  
             			if lans[lan] ~= nil then 
             				     LetezoLansablon = frame:callParserFunction{ name = '#ifexist',args = { 'lan', lan }}
			                     if LetezoLansablon then nyelv =' '..frame:expandTemplate{ title = lan, args = {lan } } end
							else -- különben mi magunk kiírjuk , mert így beszédesebb
							      hiba_jelzes = hiba_jelzes..' '..error("ismeretlen nyelvkód")..' '
						end
             			--frame:expandTemplate{ title = 'template', args = { 'arg1', 'arg2', name = 'arg3' } }
			 end	
   end 

	-- loc, red
	local kiadas = loc
	if red then
		kiadas = (kiadas and kiadas .. ": " or "") .. red
	end

	if kiadas and nyelv then
		nyelv = nyelv .. "."
	elseif kiadas and weblap then
		weblap = weblap .. "."
	end

	-- form és size
	
	  c=''
	  if form then c =form  end
	  if size then 
	       if string.sub (size,-5,-1) == 'oldal' then size = string.sub (size,1,-6) end  	
	  	 if form then c = c..': '..size.." oldal " else c = size .." oldal "
	  	 	end
	  end  	
  if c ~= '' then formsiz = '('..c..')' end

	if datum then
	    elseif ev then datum = ev -- ha nincs dátum, akkor az év legyen a dátum
	end		

	if datum then -- ha van dátum (mostmár vagy a dátum, vagy ennek hiányában az év)
		local nyom =''
	    local nyom, dou= ds.datumszuro(datum)
		if dou 
			then outdatum =  '('..ds.honapnevesdate(dou)..') '
			else hiba_jelzes = hiba_jelzes..' '.. error("hibás dátum")
		end    	 	
	end
  
 -- oldal adatok
  	
  	if oldal then 
  	oldal = string.gsub (oldal, '-' , '–') -- kiskötőjelből nagy
  	oldal = string.gsub (oldal, '—' , '–') -- hetvenkvirtesből nagy
  	oldal = string.gsub (oldal, '%.,' , ',') -- pontot követő veszőből vesszőt
  	oldal = string.gsub (oldal, '%.' , '') -- pontból üreset
  	oldal = string.gsub (oldal, ',' , '.,') -- végül vesszőből ponot kovető vesszőt
  	oldal ="&#x20;"..oldal..". o. " 
  	if nopp ~= nil and nopp =='y' then oldal = string.sub (oldal,1, -6)..' ' -- levágjuk a ". o. " farkat az oldal végéről
  		else oldal = oldal end
  end
  
  -- Archiválva:
  
  if aurl then  -- encode aurl
	    aurl = string.gsub(aurl, '%s','%%20')
		aurl = string.gsub(aurl, '\"','%%22')
		aurl = string.gsub(aurl, "\'",'%%27')
		aurl = string.gsub(aurl, "<",'%%3c')
		aurl = string.gsub(aurl, ">",'%%3e')
		aurl = string.gsub(aurl, "%[",'%%5b')
		aurl = string.gsub(aurl, "%]",'%%5d')
		aurl = string.gsub(aurl, "{",'%%7b')
		aurl = string.gsub(aurl, "|",'%%7c')
		aurl = string.gsub(aurl, "}",'%%7d')
	end

  
	if archd then -- ha van dátum 
	    local outarchd, dou 
		dou= select(2, ds.datumszuro(archd))
		if dou 
			then outarchd = ds.honapnevesdate(dou)
				if aurl then 
					archd = "<span title=\""..outarchd.."\">["..aurl.." arch".."]</span>"
	  				else hiba_jelzes  = hiba_jelzes..' '..error("archívdátum van, de archívurl nélkül")
	  			end
			else hiba_jelzes  = hiba_jelzes..' '..error("hibás archívdátum")
		end  -- if dou  	 	
	end	-- if archd
	 
-- elérés
    if not accd then accd = getArg('accessdate') end
	if accd then -- ha van elérés
	    	local outaccd, dou
		dou= select(2, ds.datumszuro(accd))
		if dou 
			then outaccd = ds.honapnevesdate(dou)
			accd = "(Hozzáférés: " .. outaccd .. ")"
			else hiba_jelzes =hiba_jelzes..' '.. error("hibás elérés")
		end  -- if dou  	 	
	end	-- if accd

	if issn then 
	  	 	 	if isISSN (issn) then issn = "<span title=\""..issn.."\"><font color=blue>ISSN</font></span>"
	  	  	
	        	    	      else hiba_jelzes  = hiba_jelzes..' '..error("hibás ISSN: ")..issn 
	     		end    
	  		else issn = '' -- ha nem létezik, legyen üres
	  end	-- issn 
	 
	  isbn= getArg("isbn"); pop("isbn=",isbn)
   if isbn then isbn = " ISBN "..isbn..' ' end
 

  
    if doi then 
    	local doicontrol
    	doicontrol = string.sub(doi,1,2)
    	if doicontrol ~= "10" then hiba_jelzes = hiba_jelzes..' '..error("doi kötelezően 10-zel kezdődik!") else
    		doi = "<span title=\""..doi.."\">[".."http://dx.doi.org/"..doi.." doi".."]</span>" 
    	end
  	end
-- misc lekezelése

    if misc then misc = misc .. '.' end
    
    
-- URL lekezelése
if url then -- encode url
	    url = string.gsub(url, '%s','%%20')
		url = string.gsub(url, '\"','%%22')
		url = string.gsub(url, "\'",'%%27')
		url = string.gsub(url, "<",'%%3c')
		url = string.gsub(url, ">",'%%3e')
		url = string.gsub(url, "%[",'%%5b')
		url = string.gsub(url, "%]",'%%5d')
		url = string.gsub(url, "{",'%%7b')
		url = string.gsub(url, "|",'%%7c')
		url = string.gsub(url, "}",'%%7d')
	end

   	
   	if url then 
   		if cim then cim = "[" .. url .. " " .. cim .. "]" 
	   		 if deadurl then 
	   		 	if deadurl~='no' then 
	   		 		if aurl then cim = "[" .. aurl .. " " .. cim .. "]" end
	   		 	end  
	   		 end  -- nem nil a deadurl		
	   	end  -- nem nil a cím
	end	 -- nem nil az url

--idézet

  if quote then  quote ="\'".."\'"..' „'..  quote..'\”'.."\'".."\'" end

-- output összeállítása
	s=''
	if igen_magyar then 
		if szerzo then s = s.. szerzo..'  ';end      
		if cim  then s = s..cim ..'  ';end      
	    if ass  then s = s..ass..'  ';end      
		if weblap  then s = s..weblap..'  ';end   
		if nyelv then s = s..nyelv..'  ';end      
		if kiadas then s = s..kiadas..'  ';end    
		if outdatum  then s = s..outdatum..'  ';end 
		if oldal  then s = s..oldal..'  ';end      
		if accd then s = s..accd..'  ' ;end      
		if formsiz then s = s..formsiz..'  ' ;end 
		if archd then s = s..archd..'  ' ;end     
		if doi then  s = s..doi..'  ' ;end      
		if misc  then s = s..misc..'  ';end     
		if quote then s = s..quote..'  ';end    
		if isbn then s = s..isbn..'  ' ;end     
	     --if ou then s = s..ou..'  '  end 
		if hibavan then s = s ..' '..hiba_jelzes..' '.. "[[Kategória:Hibás paraméterezésű CitWeb-et tartalmazó lapok]]" end
		
	else -- magyar kimenet
        if szerzo then s = s.. szerzo..'  '  end
		if cim  then s = s..cim ..'  ' end
		if _format then s = s.._format..'  ' end
	    if nyelv then s = s..nyelv..'  '  end
	    if tipus then s = s..' ('..tipus..') '..'  ' end
	    if ass  then s = s..ass..'  '  end 
		if weblap  then s = s..weblap..'  '  end 
		if kiadas then s = s..kiadas..'  ' end 
		if outdatum  then s = s..outdatum..'  ' end 
		if origyear then s = s..' ('..origyear..') '..'  ' end 
		if oldal  then s = s..oldal..'  ' end 
		if at  then s = s..at..'  '  end 
		if sorozat then s = s..sorozat..'  ' end
		if accd then s = s..accd..'  '  end 
		if formsiz then s = s..formsiz..'  '  end
		if archd then s = s..archd..'  '  end
		if doi then  s = s..doi..'  ' ; end
		if isbn then s = s..isbn..'  '  end
		if issn then s = s..issn..'  '  end
		
		if template_doc_demo then else 
        if hopp.argumentumok then s=s..tabledump(hopp.argumentumok, false)..'  ' end
        --if ou then s = s..ou..'  '  end 
		if hibavan then s = s ..' '..hiba_jelzes..' '.."[[Kategória:Hibás paraméterezésű CitWeb-et tartalmazó lapok]]" end 
    	end -- template_doc_demo
    end -- igen_magyar
	return trim(s)
end --citweb

function run(frame)
  	local pframe = frame:getParent()
    args = pframe.args -- azok a paraméterek, amelyek a sablont kisérik a  
                  	--sablon hivása oldalon
    config = frame.args -- az #invoke utasításban átadott paraméterek 
 return _citweb(frame)
end

local q = {
    run = run, -- az egyetlen átadadndó funkció a táblából
}

return q