Mercurial > hg > batmud > maputils
changeset 2620:164aa519640d
Use 'author' instead of 'creator' or 'coder'.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 16 Feb 2024 23:50:59 +0200 |
parents | 7758acc2fc41 |
children | 9ef91b0032f3 |
files | src/liblocfile.c src/liblocfile.h src/mkloc.c www/common.inc.php www/faq.xml www/info.php www/latest.php www/loc.php www/simple.php www/ss.php |
diffstat | 10 files changed, 112 insertions(+), 112 deletions(-) [+] |
line wrap: on
line diff
--- a/src/liblocfile.c Fri Feb 16 23:06:27 2024 +0200 +++ b/src/liblocfile.c Fri Feb 16 23:50:59 2024 +0200 @@ -59,10 +59,10 @@ switch (flags) { - case CREATOR_ORIG : pfx = "@"; desc = "original"; break; - case CREATOR_RECODER : pfx = "!"; desc = "recoder"; break; - case CREATOR_MAINTAINER : pfx = "%"; desc = "maintainer"; break; - case CREATOR_EXPANDER : pfx = "&"; desc = "expander"; break; + case AUTHOR_ORIG : pfx = "@"; desc = "original"; break; + case AUTHOR_RECODER : pfx = "!"; desc = "recoder"; break; + case AUTHOR_MAINTAINER : pfx = "%"; desc = "maintainer"; break; + case AUTHOR_EXPANDER : pfx = "&"; desc = "expander"; break; default : pfx = "" ; desc = "undefined"; break; } @@ -78,10 +78,10 @@ int n = 0; switch (src[nsrc].name[0]) { - case '@': n++; flags |= CREATOR_ORIG; break; - case '!': n++; flags |= CREATOR_RECODER; break; - case '%': n++; flags |= CREATOR_MAINTAINER; break; - case '&': n++; flags |= CREATOR_EXPANDER; break; + case '@': n++; flags |= AUTHOR_ORIG; break; + case '!': n++; flags |= AUTHOR_RECODER; break; + case '%': n++; flags |= AUTHOR_MAINTAINER; break; + case '&': n++; flags |= AUTHOR_EXPANDER; break; } dst[*ndst].name = th_strdup(&(src[nsrc].name[n])); dst[*ndst].flags = flags; @@ -154,8 +154,8 @@ for (int i = 0; i < res->nnames; i++) res->names[i].name = th_strdup(src->names[i].name); - for (int i = 0; i < res->ncreators; i++) - res->creators[i].name = th_strdup(src->creators[i].name); + for (int i = 0; i < res->nauthors; i++) + res->authors[i].name = th_strdup(src->authors[i].name); return res; } @@ -175,7 +175,7 @@ bool locAddNew(MapLocations *l, int xc, int yc, int dir, int flags, - LocName *names, LocName *creators, LocDateStruct *added, bool valid, + LocName *names, LocName *authors, LocDateStruct *added, bool valid, const char *uri, const char *freeform, LocFileInfo *file) { LocMarker *tmp; @@ -194,7 +194,7 @@ for (i = 0; i < LOC_MAX_NAMES; i++) { locAddAreaName(tmp->names, &tmp->nnames, names, i); - locAddAreaCreator(tmp->creators, &tmp->ncreators, creators, i); + locAddAreaCreator(tmp->authors, &tmp->nauthors, authors, i); } if (added != NULL) @@ -254,7 +254,7 @@ for (int i = 0; i < LOC_MAX_NAMES; i++) { th_free_r(&marker->names[i].name); - th_free_r(&marker->creators[i].name); + th_free_r(&marker->authors[i].name); } th_free_r(&marker->uri); @@ -592,7 +592,7 @@ break; case 5: // Creators - locParseMultiField(ctx, ",;", ',', "creator names", marker->creators); + locParseMultiField(ctx, ",;", ',', "author names", marker->authors); break; case 6: // Date @@ -661,7 +661,7 @@ { // Add new location to our list locAddNew(l, marker->xc, marker->yc, marker->align, marker->flags, - marker->names, marker->creators, &marker->added, + marker->names, marker->authors, &marker->added, marker->valid, marker->uri, tmpStr, ctx->file); locPMSet(ctx, PM_IDLE, -1); }
--- a/src/liblocfile.h Fri Feb 16 23:06:27 2024 +0200 +++ b/src/liblocfile.h Fri Feb 16 23:50:59 2024 +0200 @@ -80,10 +80,10 @@ /* Creator roles */ -#define CREATOR_ORIG (0x00001) // '@' Original area creator -#define CREATOR_RECODER (0x00002) // '!' Converter or recoder of area -#define CREATOR_MAINTAINER (0x00004) // '%' Maintainer -#define CREATOR_EXPANDER (0x00008) // '&' Expander, adding new things +#define AUTHOR_ORIG (0x00001) // '@' Original area author +#define AUTHOR_RECODER (0x00002) // '!' Converter or recoder of area +#define AUTHOR_MAINTAINER (0x00004) // '%' Maintainer +#define AUTHOR_EXPANDER (0x00008) // '&' Expander, adding new things /* Area name flags @@ -133,8 +133,8 @@ LocDateStruct added; // Date / time information bool valid; - int nnames, ncreators; - LocName names[LOC_MAX_NAMES], creators[LOC_MAX_NAMES]; + int nnames, nauthors; + LocName names[LOC_MAX_NAMES], authors[LOC_MAX_NAMES]; char *uri, *freeform; @@ -165,7 +165,7 @@ void locCopyLocations(MapLocations *dst, const MapLocations *src); bool locAddNew(MapLocations *l, int xc, int yc, int dir, int flags, - LocName *names, LocName *creators, LocDateStruct *added, bool valid, + LocName *names, LocName *authors, LocDateStruct *added, bool valid, const char *uri, const char *freeform, LocFileInfo *file); bool locParseLocStream(FILE *fp, LocFileInfo *file, MapLocations *l, const int offX, const int offY);
--- a/src/mkloc.c Fri Feb 16 23:06:27 2024 +0200 +++ b/src/mkloc.c Fri Feb 16 23:50:59 2024 +0200 @@ -30,7 +30,7 @@ WARN_NONE = 0x0000, WARN_MARKER_INVALID = 0x0001, WARN_MARKER_MISSING = 0x0002, - WARN_CREATORS = 0x0004, + WARN_AUTHORS = 0x0004, WARN_TIMESTAMPS = 0x0008, WARN_ALL = 0xffff }; @@ -91,7 +91,7 @@ { 18,'t', "type-prefix", "Prepend labels with type prefix", OPT_NONE }, { 19,'X', "markers", "Location markers ('" LOC_MARKERS "')", OPT_ARGREQ }, { 22,'W', "warnings", "Output warnings about: " - "none, all, timestamps, creators", OPT_ARGREQ }, + "none, all, timestamps, authors", OPT_ARGREQ }, { 23, 0, "warn-loc", "Output warnings to loc file instead of stderr", OPT_NONE }, }; @@ -269,7 +269,7 @@ optWarnings |= WARN_TIMESTAMPS; break; case 'c': - optWarnings |= WARN_CREATORS; + optWarnings |= WARN_AUTHORS; break; default: THERR("Invalid argument to -W: '%s'\n", optArg); @@ -739,8 +739,8 @@ if ((optWarnings & WARN_TIMESTAMPS) && !loc->valid) printLocWarning(&first, outFile, loc, "No timestamp"); - if ((optWarnings & WARN_CREATORS) && loc->ncreators == 0) - printLocWarning(&first, outFile, loc, "No creators listed"); + if ((optWarnings & WARN_AUTHORS) && loc->nauthors == 0) + printLocWarning(&first, outFile, loc, "No authors listed"); } } @@ -783,13 +783,13 @@ } fprintf(outFile, ";"); - if (loc->ncreators > 0) + if (loc->nauthors > 0) { - printLocNameEsc(outFile, &loc->creators[0]); - for (int n = 1; n < loc->ncreators; n++) + printLocNameEsc(outFile, &loc->authors[0]); + for (int n = 1; n < loc->nauthors; n++) { fprintf(outFile, ","); - printLocNameEsc(outFile, &loc->creators[n]); + printLocNameEsc(outFile, &loc->authors[n]); } } @@ -1007,37 +1007,37 @@ } // Creator names or societies - if (loc->ncreators > 0) + if (loc->nauthors > 0) { if (loc->flags & LOCF_M_PCITY) { fprintf(outFile, "Societies: "); - for (int n = 0; n < loc->ncreators; n++) + for (int n = 0; n < loc->nauthors; n++) { - fps(loc->creators[n].name, outFile); - if (n < loc->ncreators - 1) + fps(loc->authors[n].name, outFile); + if (n < loc->nauthors - 1) fprintf(outFile, ", "); } } else { fprintf(outFile, "Creators: "); - for (int n = 0; n < loc->ncreators; n++) + for (int n = 0; n < loc->nauthors; n++) { char *info = "", *sinfo = ""; - switch (loc->creators[n].flags) + switch (loc->authors[n].flags) { - case CREATOR_ORIG: info = " (O)"; sinfo = "Original coder"; break; - case CREATOR_RECODER: info = " (R)"; sinfo = "Re-coder"; break; - case CREATOR_MAINTAINER: info = " (M)"; sinfo = "Maintainer"; break; - case CREATOR_EXPANDER: info = " (E)"; sinfo = "Expander"; break; + case AUTHOR_ORIG: info = " (O)"; sinfo = "Original coder"; break; + case AUTHOR_RECODER: info = " (R)"; sinfo = "Re-coder"; break; + case AUTHOR_MAINTAINER: info = " (M)"; sinfo = "Maintainer"; break; + case AUTHOR_EXPANDER: info = " (E)"; sinfo = "Expander"; break; } //fpr(outFile, "<a target=\"_blank\" href=\"http://www.bat.org/char/%s\">%s%s</a>", fpr(outFile, "<a target=\"_blank\" href=\"https://tnsp.org/maps/loc.php?a=%s\" title=\"%s\">%s%s</a>", - loc->creators[n].name, sinfo, - loc->creators[n].name, info); + loc->authors[n].name, sinfo, + loc->authors[n].name, info); - if (n < loc->ncreators - 1) + if (n < loc->nauthors - 1) fprintf(outFile, ", "); } } @@ -1163,30 +1163,30 @@ } // Creators or secret societies - if (loc->ncreators > 0) + if (loc->nauthors > 0) { if (loc->flags & LOCF_M_PCITY) { fprintf(outFile, "<societies>"); - for (int n = 0; n < loc->ncreators; n++) + for (int n = 0; n < loc->nauthors; n++) { fprintf(outFile, "<name>"); - fputse(loc->creators[n].name, outFile); + fputse(loc->authors[n].name, outFile); fprintf(outFile, "</name>"); } fprintf(outFile, "</societies>"); } else { - fprintf(outFile, "<creators>"); - for (int n = 0; n < loc->ncreators; n++) + fprintf(outFile, "<authors>"); + for (int n = 0; n < loc->nauthors; n++) { - fprintf(outFile, "<creator role=\"%s\">", - locGetAreaCreatorRole(loc->creators[n].flags, true)); - fputse(loc->creators[n].name, outFile); - fprintf(outFile, "</creator>"); + fprintf(outFile, "<author role=\"%s\">", + locGetAreaCreatorRole(loc->authors[n].flags, true)); + fputse(loc->authors[n].name, outFile); + fprintf(outFile, "</author>"); } - fprintf(outFile, "</creators>"); + fprintf(outFile, "</authors>"); } }
--- a/www/common.inc.php Fri Feb 16 23:06:27 2024 +0200 +++ b/www/common.inc.php Fri Feb 16 23:50:59 2024 +0200 @@ -36,10 +36,10 @@ // Creator roles -define("CREATOR_ORIG" , 0x000001); // '@' Original area creator -define("CREATOR_RECODER" , 0x000002); // '!' Converter or recoder of area -define("CREATOR_MAINTAINER" , 0x000004); // '%' Maintainer -define("CREATOR_EXPANDER" , 0x000008); // '&' Expander, adding new things +define("AUTHOR_ORIG" , 0x000001); // '@' Original area creator +define("AUTHOR_RECODER" , 0x000002); // '!' Converter or recoder of area +define("AUTHOR_MAINTAINER" , 0x000004); // '%' Maintainer +define("AUTHOR_EXPANDER" , 0x000008); // '&' Expander, adding new things // Area name flags @@ -273,10 +273,10 @@ switch (substr($name, 0, 1)) { - case "@": $npos++; $nflags = CREATOR_ORIG; break; - case "!": $npos++; $nflags = CREATOR_RECODER; break; - case "%": $npos++; $nflags = CREATOR_MAINTAINER; break; - case "&": $npos++; $nflags = CREATOR_EXPANDER; break; + case "@": $npos++; $nflags = AUTHOR_ORIG; break; + case "!": $npos++; $nflags = AUTHOR_RECODER; break; + case "%": $npos++; $nflags = AUTHOR_MAINTAINER; break; + case "&": $npos++; $nflags = AUTHOR_EXPANDER; break; } $list[] = [ @@ -381,11 +381,11 @@ mpGetGlobalCoords($filename, $record[1], $record[2], $glx, $gly); - // Split coder names + // Split author names if (strlen($record[5]) > 0) - mpAddLocNames($coders, preg_split("/\s*,\s*/", $record[5])); + mpAddLocNames($authors, preg_split("/\s*,\s*/", $record[5])); else - $coders = []; + $authors = []; // Get timestamp $stamp = $record[6]; @@ -424,7 +424,7 @@ "globalx" => $glx, "globaly" => $gly, "flags" => $flags, - "coders" => $coders, + "authors" => $authors, "added" => $added, "added_accuracy" => $added_accuracy, "url" => strlen($record[7]) ? $record[7] : NULL,
--- a/www/faq.xml Fri Feb 16 23:06:27 2024 +0200 +++ b/www/faq.xml Fri Feb 16 23:50:59 2024 +0200 @@ -91,7 +91,7 @@ <li><b>Malacoda</b> - Loaned her ship for re-mapping of Lucentium and Laenor.</li> <li><b>Moonlord</b>'s website - Lots of area coder information.</li> <li><b>Nuane</b> - More area coder information.</li> - <li>The wizard plaque - Bits and piece of information about coders current and past.</li> + <li>The wizard plaque - Bits and piece of information about authors current and past.</li> <li><b>Dryad</b>'s archived <a oldhref="http://www.maroon.com/bat/logs/1996_conversion.asp" href="http://web.archive.org/web/20090105184802/https://www.maroon.com/bat/logs/1996_conversion.asp"
--- a/www/info.php Fri Feb 16 23:06:27 2024 +0200 +++ b/www/info.php Fri Feb 16 23:50:59 2024 +0200 @@ -57,7 +57,7 @@ */ foreach ($locTable as $location) { - foreach ($location["coders"] as $wiz) + foreach ($location["authors"] as $wiz) { $name = $wiz["name"]; if (!isset($wizTable[$name]))
--- a/www/latest.php Fri Feb 16 23:06:27 2024 +0200 +++ b/www/latest.php Fri Feb 16 23:50:59 2024 +0200 @@ -81,12 +81,12 @@ echo "<table class=\"locTable\">\n". " <tr>\n". - " <th>Date</th>\n". - " <th>Location name</th>\n". - " <th>Continent</th>\n". + " <th class=\"locdate\">Date</th>\n". + " <th class=\"locname\">Location name</th>\n". + " <th class=\"loccont\">Continent</th>\n". ($showAll ? " <th>Type</th>\n" : ""). - " <th>Coder(s)</th>\n". - " <th>Information</th>\n". + " <th class=\"locauthor\">Author(s)</th>\n". + " <th class=\"locinfo\">Information</th>\n". " </tr>\n"; foreach ($sortedLocs as $ik => $iv) @@ -101,7 +101,7 @@ ($showAll ? " <td>".mpGetLocationTypeStr($iv["flags"])."</td>\n" : ""). " <td>".implode(", ", array_map( (($iv["flags"] & LOCF_M_MASK) == LOCF_M_PCITY) ? $locGetNameStr : $locGetNameLink, - $iv["coders"]))."</td>\n". + $iv["authors"]))."</td>\n". " <td>".(isset($iv["freeform"]) ? chentities($iv["freeform"]) : "")."</td>\n". " </tr>\n"; }
--- a/www/loc.php Fri Feb 16 23:06:27 2024 +0200 +++ b/www/loc.php Fri Feb 16 23:50:59 2024 +0200 @@ -16,7 +16,7 @@ ]; -function printTitleLink($afilter, $filter, $coders, $desc, $qname, $qclass) +function printTitleLink($afilter, $filter, $authors, $desc, $qname, $qclass) { global $setName; @@ -24,7 +24,7 @@ if ($afilter) $s = "f=".$filter; - if (!$coders) + if (!$authors) { if ($s !== "") $s .= "&"; $s .= "s"; @@ -102,8 +102,8 @@ { if (preg_match("#^([a-z]{1,15})#i", $tmpName, $matches)) { - $coderName = $matches[1]; - $coderName = strtoupper(substr($coderName, 0, 1)).strtolower(substr($coderName, 1)); + $authorName = $matches[1]; + $authorName = strtoupper(substr($authorName, 0, 1)).strtolower(substr($authorName, 1)); $wizTable = apcu_fetch("wizTable"); if (empty($wizTable)) @@ -114,7 +114,7 @@ } else { - $coderName = "???"; + $authorName = "???"; mpError("Invalid wizard name."); } } @@ -156,11 +156,11 @@ if (isset($data["name"])) { $idx = strtolower($data["name"][0]); - if (isset($coderName)) + if (isset($authorName)) { - foreach ($data["coders"] as $coder) + foreach ($data["authors"] as $author) { - if ($coderName == $coder["name"]) + if ($authorName == $author["name"]) $alphaTable[$idx][] = $data; } } @@ -193,7 +193,7 @@ " onload=\"mapOnLoad()\""); echo - "<h1>".$mtitle."BatMUD".(isset($coderName) ? " by ".chentities($coderName) : "")."</h1>\n". + "<h1>".$mtitle."BatMUD".(isset($authorName) ? " by ".chentities($authorName) : "")."</h1>\n". "<form action=\"?\" method=\"get\">\n". "<div class=\"controls\">\n"; @@ -227,24 +227,24 @@ // -// Wizard/coder/creator information box +// Wizard/author/creator information box // -if (isset($coderName)) +if (isset($authorName)) { - if (isset($wizTable[$coderName]) && count($wizTable[$coderName]) > 1) + if (isset($wizTable[$authorName]) && count($wizTable[$authorName]) > 1) { // Profile picture - //$imageURL = $wizImageURL.(qcheck($wizTable[$coderName], "imageURL", $imageName) ? $imageName : "unknown.png"); + //$imageURL = $wizImageURL.(qcheck($wizTable[$authorName], "imageURL", $imageName) ? $imageName : "unknown.png"); $imageURL = $wizImageURL."unknown.png"; echo "<div class=\"wizInfoBox\">\n". - " <div class=\"wizImage\"><img src=\"".$imageURL."\" alt=\"".$coderName."\" /></div>\n". + " <div class=\"wizImage\"><img src=\"".$imageURL."\" alt=\"".$authorName."\" /></div>\n". " <div class=\"wizInfo\">\n". - " <h2>".$coderName."</h2>\n"; + " <h2>".$authorName."</h2>\n"; // Description block - if (qcheck($wizTable[$coderName], "desc", $str)) + if (qcheck($wizTable[$authorName], "desc", $str)) { // Handle special tags $str = preg_replace("/\~([A-Z][a-z]+)\~/i", "<a href=\"?a=\${1}\">\${1}</a>", $str); @@ -256,12 +256,12 @@ } // Links, etc. - echo " [<a href=\"".mpFingerURL($coderName)."\">Finger</a>]\n"; + echo " [<a href=\"".mpFingerURL($authorName)."\">Finger</a>]\n"; - if (qcheck($wizTable[$coderName], "homeURL", $s)) + if (qcheck($wizTable[$authorName], "homeURL", $s)) { if ($s == "bat") - $s = "https://wiz.bat.org/~".strtolower($coderName)."/"; + $s = "https://wiz.bat.org/~".strtolower($authorName)."/"; echo " [<a href=\"".$s."\">Homepage</a>]<br />\n"; } @@ -379,18 +379,18 @@ } // Coder / society names - if (count($iv["coders"]) > 0 && $showCoders) + if (count($iv["authors"]) > 0 && $showCoders) { $fs = []; - foreach ($iv["coders"] as $name) + foreach ($iv["authors"] as $name) { - // Tags/flags of this coder in relation to the area + // Tags/flags of this author in relation to the area switch ($name["flags"]) { - case CREATOR_ORIG: $qs = "title=\"Original creator\" class=\"wizorig\""; break; - case CREATOR_RECODER: $qs = "title=\"Converter, recoder\" class=\"wizrecoder\""; break; - case CREATOR_MAINTAINER: $qs = "title=\"Maintainer\" class=\"wizmaintainer\""; break; - case CREATOR_EXPANDER: $qs = "title=\"Implemented new content, expansion(s)\" class=\"wizexpander\""; break; + case AUTHOR_ORIG: $qs = "title=\"Original creator\" class=\"wizorig\""; break; + case AUTHOR_RECODER: $qs = "title=\"Converter, recoder\" class=\"wizrecoder\""; break; + case AUTHOR_MAINTAINER: $qs = "title=\"Maintainer\" class=\"wizmaintainer\""; break; + case AUTHOR_EXPANDER: $qs = "title=\"Implemented new content, expansion(s)\" class=\"wizexpander\""; break; default: $qs = ""; } @@ -403,7 +403,7 @@ echo "<div class=\"locCoders\">".implode(", ", $fs)."</div>"; } - if (/* isset($coderName) && */ $iv["added"] > 0) + if (/* isset($authorName) && */ $iv["added"] > 0) { echo "<div class=\"locAdded\">".mpLocFormatTime($iv)."</div>"; }
--- a/www/simple.php Fri Feb 16 23:06:27 2024 +0200 +++ b/www/simple.php Fri Feb 16 23:50:59 2024 +0200 @@ -90,28 +90,28 @@ echo " <td class=\"desc\">".$desc."</td>\n"; // Coder / society names - $coders = ""; - if (count($iv["coders"]) > 0) + $authors = ""; + if (count($iv["authors"]) > 0) { $fs = []; - foreach ($iv["coders"] as $name) + foreach ($iv["authors"] as $name) { - // Tags/flags of this coder in relation to the area + // Tags/flags of this author in relation to the area switch ($name["flags"]) { - case CREATOR_ORIG: $qs = "title=\"Original creator\" class=\"wizorig\""; break; - case CREATOR_RECODER: $qs = "title=\"Converter, recoder\" class=\"wizrecoder\""; break; - case CREATOR_MAINTAINER: $qs = "title=\"Maintainer\" class=\"wizmaintainer\""; break; - case CREATOR_EXPANDER: $qs = "title=\"Implemented new content, expansion(s)\" class=\"wizexpander\""; break; + case AUTHOR_ORIG: $qs = "title=\"Original creator\" class=\"wizorig\""; break; + case AUTHOR_RECODER: $qs = "title=\"Converter, recoder\" class=\"wizrecoder\""; break; + case AUTHOR_MAINTAINER: $qs = "title=\"Maintainer\" class=\"wizmaintainer\""; break; + case AUTHOR_EXPANDER: $qs = "title=\"Implemented new content, expansion(s)\" class=\"wizexpander\""; break; default: $qs = ""; } $fs[] = $name["name"]; } - $coders = implode(", ", $fs); + $authors = implode(", ", $fs); } echo - " <td class=\"coders\">".$coders."</td>\n". + " <td class=\"authors\">".$authors."</td>\n". " </tr>\n"; }
--- a/www/ss.php Fri Feb 16 23:06:27 2024 +0200 +++ b/www/ss.php Fri Feb 16 23:50:59 2024 +0200 @@ -26,7 +26,7 @@ { // Make the list array foreach ($locTable as $key => $value) - foreach ($value["coders"] as $name) + foreach ($value["authors"] as $name) $sortTable[$name["name"]] = $value; foreach ($locPTable as $key => $value)