(* Web page for each plant species *) maintainPlantpages := ( Print["Creating web page for each plant species ..."]; xsizem1 = 800; (* Max width of pop-up thumbnail *) ysizem1 = 600; (* Max height of pop-up thumbnail *) height = 680; font =15; margin =3; nodates = {}; Do[ name = plantname[plant]; nts = notes[plant]; family = plantfamily[plant]; name0 = name0a = shortenname[name]; syns = plantsynonyms[plant]; names = plantnames[plant]; cnames = Complement[names, {name0}, syns, SameTest -> ((ToLowerCase[#1] === ToLowerCase[#2]) &)]; If[cnames =!= {}, name0a = If[Length[cnames] < 6, name0a <> " (" <> StringJoin[Riffle[cnames, ", "]] <> ")", name0a <> " (" <> StringJoin[Riffle[Take[cnames, 5], ", "]] <> ", ...)" ], If[syns =!= {}, name0a = If[Length[syns] < 4, name0a <> " (" <> StringJoin[Riffle[syns, ", "]] <> ")", name0a <> " (" <> StringJoin[Riffle[Take[syns, 3], ", "]] <> ", ...)" ]; ]; ]; allnames = Join[{name0}, If[Length[cnames] < 8, cnames, Take[cnames, 7]], If[Length[syns] < 4, syns, Take[syns, 3]]]; wikitext = plantwiki[plant]; If[wikitext === "", wikitxt = "", wikitext = StringCases[wikitext, "
" ~~ Shortest[x__] ~~ "
" -> x]; wikitext = StringTrim /@ wikitext; wikitext = Select[wikitext, !StringMatchQ[#, ""]&]; If[Length[wikitext] == 0, Print["Internal error: first paragraph of Wiki article not found: ", name, " -> ", wikitext], wikitxt = "" <> wikitext[[1]] <> ""; ]; ]; plantdescr = plantDescription[plant]; If[Head[plantdescr] === String, plantparagraph = "" <> addsymb0[plantdescr] <> "
", Print["Warning: maintain-plantpages.m: no plant description: ", plantdescr]; plantparagraph = ""; ]; plantsumm = plantSummary[plant]; If[Head[plantsumm] === String, plantparagraph2 = "" <> addsymb0[plantsumm] <> "
", Print["Warning: maintain-plantsumms.m: no plant summary: ", plantsumm]; plantparagraph2 = ""; ]; namer = StringReplace[name0, redirects]; name1 = StringReplace[namer, " " -> "%20"]; name1a = StringReplace[name1, " " -> "_"]; planta = StringReplace[plant, " " -> "_"]; plantal = ToLowerCase[planta]; wikiurl = "http://en.wikipedia.org/wiki/" <> name1a; datasql = plantdatasql[plant]; excls = exclusions[plant]; text = { "" <> StringJoin[Riffle[syns, ", "]] <> "
", ""], If[cnames =!= {}, cnames = StringJoin[Riffle[cnames, ", "]]; cnames = ToUpperCase[StringTake[cnames, 1]] <> StringDrop[cnames, 1]; "" <> cnames <> "
", ""], If[nts =!= {}, nts = StringJoin[Riffle[nts, "" <> nts <> "
", ""], wikitxt3 = ""; If[wikitxt =!= "", wikitxt2 = ""; If[Length[wikitext] > 1, wikitxt2 = Drop[wikitext, 1]; wikitxt2 = StringJoin[("" <> #)&/@ wikitxt2]; wikitxt2 = "[+]
" <> wikitxt <> wikitxt2 <> "
", ""], plantparagraph, 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; If[MemberQ[excls, {roll, pic}], "", 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"; (* 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}]; captdate = 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 <> "\"> linkmap <>
"\" ONMOUSEOVER=\"showtrail('" <>
linkg <> "',400,266);\" ONMOUSEOUT=\"hidetrail();\">![]() | " <> plname2 <> " |
QNHG (Qatar Natural History Group) and associated people, for a possibility to participate in their field excursions and to learn about local nature.