Kategorien
Bearbeiten von „FreewarWiki:Bot/Skripts/npclist2wikibilder.pl“
Zur Navigation springen
Zur Suche springen
Die Bearbeitung kann rückgängig gemacht werden. Bitte prüfe den Vergleich unten, um sicherzustellen, dass du dies tun möchtest, und veröffentliche dann unten deine Änderungen, um die Bearbeitung rückgängig zu machen.
Aktuelle Version | Dein Text | ||
Zeile 1: | Zeile 1: | ||
<pre> | <pre> | ||
#!/usr/bin/perl | #!/usr/bin/perl | ||
Zeile 12: | Zeile 11: | ||
# - introduced support for multiple languages | # - introduced support for multiple languages | ||
# - grouped items by npc picture | # - grouped items by npc picture | ||
# set the layout style for the table: | |||
$TABLEWIDTH = "50%"; | |||
# set language code for output: 0=en, 1=de | # set language code for output: 0=en, 1=de | ||
Zeile 19: | Zeile 22: | ||
@STR_PICTURE = ("Picture", "Bild"); | @STR_PICTURE = ("Picture", "Bild"); | ||
@STR_NPC = ("NPC(s)", "NPC(s)"); | @STR_NPC = ("NPC(s)", "NPC(s)"); | ||
@ | @STR_PAINTER = ("painted by", "Maler"); | ||
@STR_HINT = ("<div style='background-color:orange; padding: 1px; border: 4px dashed black;'>\n" | @STR_HINT = ("<div style='width: $TABLEWIDTH; background-color:orange; padding: 1px; border: 4px dashed black;'>\n" | ||
. "{| border='0' cellspacing='8' cellpadding='0' " | . "{| border='0' cellspacing='8' cellpadding='0' " | ||
. "style='background-color: #f9f9f9; border: 1px solid #e9e9e9; font-size: 95%; margin-top: 2px; margin-bottom: 2px; clear: both;'\n" | . "style='background-color: #f9f9f9; border: 1px solid #e9e9e9; font-size: 95%; margin-top: 2px; margin-bottom: 2px; clear: both;'\n" | ||
Zeile 27: | Zeile 30: | ||
. "'''You should not change data here, because your modifications will be oberwritten by the next update.'''<br/>\n" | . "'''You should not change data here, because your modifications will be oberwritten by the next update.'''<br/>\n" | ||
. "Instead change the data on the NPC article!<br/><br/>\n" | . "Instead change the data on the NPC article!<br/><br/>\n" | ||
. "(Use the template parameter \"ImageAuthor\" for the | . "(Use the template parameter \"ImageAuthor\" for the painter of the pic. The image author is then shown " | ||
. "in the article also.)\n" | . "in the article also.)\n" | ||
. "|}\n" | . "|}\n" | ||
. "</div>\n" | . "</div>\n" | ||
, | , | ||
"<div style='background-color: orange; padding: 1px; border: 4px dashed black;'>\n" | "<div style='width: $TABLEWIDTH; background-color: orange; padding: 1px; border: 4px dashed black;'>\n" | ||
. "{| {{Bausteindesign3}}\n" | . "{| {{Bausteindesign3}}\n" | ||
. " | '''Hinweis:'''\n" | . " | '''Hinweis:'''\n" | ||
. "Diese Tabelle wird von Zeit zu Zeit automatisch aus den Daten auf den einzelnen NPC-Seiten erstellt.<br/>\n" | . "Diese Tabelle wird von Zeit zu Zeit automatisch aus den Daten auf den einzelnen NPC-Seiten erstellt.<br/>\n" | ||
. "'''Die Daten hier sollten nicht direkt ge | . "'''Die Daten hier sollten nicht direkt geändert werden, weil solche Änderungen bei einer Neuerstellung " | ||
. "verloren gehen.'''<br/>Stattdessen bitte die Daten auf den Seiten des jeweiligen NPC korrigieren!<br/><br/>\n" | . "verloren gehen.'''<br/>Stattdessen bitte die Daten auf den Seiten des jeweiligen NPC korrigieren!<br/><br/>\n" | ||
. "(F | . "(Für den Autor gibt es ein Vorlagenfeld \"BildAutor\", das dann auch im NPC-Artikel angezeigt wird.)\n" | ||
. "|}\n" | . "|}\n" | ||
. "</div>\n"); | . "</div>\n"); | ||
Zeile 50: | Zeile 53: | ||
print $STR_HINT[$LANGUAGE_CODE]; | print $STR_HINT[$LANGUAGE_CODE]; | ||
print "{| | print "{| {{Prettytable}}} style='width: $TABLEWIDTH'\n"; | ||
print "|-\n"; | print "|-\n"; | ||
print "!" . $STR_PICTURE[$LANGUAGE_CODE] . "||" . $STR_NPC[$LANGUAGE_CODE] . "||" . $ | print "!" . $STR_PICTURE[$LANGUAGE_CODE] . "||" . $STR_NPC[$LANGUAGE_CODE] . "||" . $STR_PAINTER[$LANGUAGE_CODE] . "\n"; | ||
while(<>) { | while(<>) { |