diff --git a/shields/shieldgen.php b/shields/shieldgen.php index 36d1b1c1..d620e41a 100644 --- a/shields/shieldgen.php +++ b/shields/shieldgen.php @@ -400,6 +400,25 @@ function generate($r, $force_reload = false) break; + case 'usanes': + $matches = []; + $routeNum = str_replace('NE', "", $row['route']); + if ($routeNum[0] == 'L') { + $svg_path = "{$dir}/template_usanes_link.svg"; + $svg = file_get_contents($svg_path); + $routeNum = str_replace('L', "", $routeNum); + preg_match('/(?[0-9]+)(?[A-Za-z]+)/', $routeNum, $matches); + } + else { //S + $svg_path = "{$dir}/template_usanes_spur.svg"; + $svg = file_get_contents($svg_path); + $routeNum = str_replace('S', "", $routeNum); + preg_match('/(?[0-9]+)(?[A-Za-z]+)/', $routeNum, $matches); + } + $svg = str_replace("***NUMBER***", $matches['number'], $svg); + $svg = str_replace("***LETTER***", $matches['letter'], $svg); + break; + //the following cases are meant to fall through to the default //TODO: fix this diff --git a/shields/template_usanes_link.svg b/shields/template_usanes_link.svg new file mode 100644 index 00000000..bab008de --- /dev/null +++ b/shields/template_usanes_link.svg @@ -0,0 +1,27 @@ + + + + + + + image/svg+xml + + + + + + + + + + + ***NUMBER*** + ***LETTER*** + + + + + + + + diff --git a/shields/template_usanes_spur.svg b/shields/template_usanes_spur.svg new file mode 100644 index 00000000..46d1fdcf --- /dev/null +++ b/shields/template_usanes_spur.svg @@ -0,0 +1,27 @@ + + + + + + + image/svg+xml + + + + + + + + + + + ***NUMBER*** + ***LETTER*** + + + + + + + +