(* Web page for each mushroom species *) maintainMpages := ( Print["Creating web page for each mushroom species ..."]; xsizem1 = 800; (* Max width of pop-up thumbnail *) ysizem1 = 600; (* Max height of pop-up thumbnail *) height = 680; font =15; margin =3; Do[ name0 = data[[1]]; datasql = data[[3]]; id = selectid[name0]; kingdom = idcomponents["kingdom", id]; phylum = idcomponents["phylum", id]; class = idcomponents["class", id]; order = idcomponents["order", id]; family = idcomponents["family", id]; name = idcomponents["name", id]; namehtml = idcomponents["name_html", id]; syns = idcomponents["synonyms", id]; rnames = translatename[name, "ru"]; nameru = ""; If[rnames =!= {}, nameru = rnames[[1]]]; nPrint[name, " -> ", rnames]; line = kingdom <> " > " <> phylum <> " > " <> class <> " > " <> order <> " > " <> family<> " > " <> namehtml; name0a = name; If[rnames =!= {}, name0a = If[Length[rnames] < 6, name0a <> " (" <> StringJoin[Riffle[rnames, ", "]] <> ")", name0a <> " (" <> StringJoin[Riffle[Take[rnames, 5], ", "]] <> ", ...)" ], If[syns =!= {}, name0a = If[Length[syns] < 4, name0a <> " (" <> StringJoin[Riffle[syns, ", "]] <> ")", name0a <> " (" <> StringJoin[Riffle[Take[syns, 3], ", "]] <> ", ...)" ]; ]; ]; allnames = Join[{name0}, If[Length[rnames] < 8, rnames, Take[rnames, 7]], If[Length[syns] < 4, syns, Take[syns, 3]]]; name0a=name; namew = StringReplace[name, " " -> "%20"]; namea = StringReplace[name, " " -> "_"]; wikitext = wikitext1ru[name]; wikiurl = "http://ru.wikipedia.org/wiki/" <> namea; If[wikitext === {}, wikitxt = "", wikitext = wikitextru[name]; If[wikitext === {}, wikitxt = "", wikitxt = "" <> wikitext[[1]] <> ""; ]; ]; text = { "
" <> StringJoin[Riffle[syns, ", "]] <> "
", ""], (* wikitxt3 = ""; If[wikitxt =!= "", wikitxt2 = ""; If[Length[wikitext] > 1, wikitxt2 = wikitext[[2]]; wikitxt2 = "[+]" <> wikitxt <> wikitxt2 <> "
", ""], *) (* pts = {}; SetDirectory[ToFileName[{dir00, "temp", "qatar_plants-2014", "webpages"}]]; availdates = FileNames[]; availdates = Select[availdates, (FileType[#] === Directory)&]; ResetDirectory[]; *) Table[ {year, roll, pic, capt, xsize, ysize, date, pop} = dat; link = "../asergeev/pictures/archives/compress/" <> year <> "/" <> roll <> "/" <> pic <> ".htm"; linkjpg = "../asergeev/pictures/archives/" <> year <> "/" <> roll <> "/jpeg/" <> pic <> ".jpg"; filejpg = ToFileName[{dir00, "pictures", "archives", year, roll, "jpeg"}, pic <> "b.jpg"]; If[FileType[filejpg] === File, linkjpg = "../asergeev/pictures/archives/" <> year <> "/" <> roll <> "/jpeg/" <> pic <> "b.jpg"]; slink = "../asergeev/pictures/archives/compress/" <> year <> "/" <> roll <> "/" <> pic <> ".htm"; (* ! *) captdate = capt; (* Link to all pictures including duplicates it the same day *) datematch = "(\\w+\\s+\\w+[,]?\\s+\\w+)$"; datest = StringCases[capt, RegularExpression[datematch]]; If[datest === {}, Print["Error: datematch not found: ", {year, roll, pic, capt}]; Goto[endcaptdate]; ]; datest = datest[[1]]; datecapt = DateList[datest]; If[Head[datecapt] =!= List, Print["Error: Head[datecapt] =!= List: ", {year, roll, pic, capt}]; captdate = capt; Goto[endcaptdate]; ]; {date1, date2, date3} = ToString /@ Take[datecapt, 3]; If[StringLength[date2] == 1, date2 = "0" <> date2]; If[StringLength[date3] == 1, date3 = "0" <> date3]; datecapt = date1 <> "-" <> date2 <> "-" <> date3; (* If[!MemberQ[availdates, datecapt], (* Print["Warning: !MemberQ[availdates, datecapt]: ", {year, roll, pic, datecapt}]; *) nodates = Append[nodates, datecapt]; captdate = capt; Goto[endcaptdate]; ]; datest1 = " datecapt <> "/index-160x120.htm\" TARGET=\"_blank\" " <> "TITLE=\"All pictures (including duplicates) taken on " <> datest <> "\">" <> datest <> ""; captdate = StringReplace[capt, datest ~~ EndOfString -> datest1]; Label[endcaptdate]; *) capt1 = " link <> "\" TARGET=\"_blank\" TITLE=\"Photo " <> roll <> "-" <> pic <> "\">" <> captdate; (* (* GPS data *) plname = placename[roll, pic]; If[Head[plname] === List, {plname, plname1} = plname]; russia = "\:0420\:043e\:0441\:0441\:0438\:044f"; If[Head[plname] === String, inrussia = StringMatchQ[plname, RegularExpression["^" <> russia <> ".*"]]; If[!inrussia, plname = StringReplace[plname, RegularExpression["^" <> russia <> "[, ]*"] -> ""]; plname = "linkmap <> "\" ONMOUSEOVER=\"showtrail('" <> linkg <> "',600,400);\" ONMOUSEOUT=\"hidetrail();\">" <> " | " <> plname2 <> " |