issue: code cleanup breaking up row attributes
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 30 Dec 2019 08:30:29 +0000 (09:30 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 30 Dec 2019 08:31:02 +0000 (09:31 +0100)
Identical results using separate, more maintainable statements.

issue/index.php

index 8a3d9078627a0a9f998dd654f28855362d89574f..6b34216a785fee7c085ca780f12fb8eee71346b8 100644 (file)
@@ -69,19 +69,29 @@ if ($id == 'feed') {
 ob_start();
 print '<ul>';
 while ($row = $query->fetch()) {
-       printf('<li%s><div><a href="%s">%s <small class="date">%s</small>%s</a>',
+       printf('<li%s><div><a href="%s">',
                $row->closed ? ' class="disabled"' : '',
-               "/$Page/{$row->id}/{$row->link}",
-               sprintf($row->closed ? '<s>%s</s>' : '%s',
-                       htmlspecialchars($row->subject)),
-               showdate(array_slice(preg_split('/\D/', $row->updated), 0, 3)),
-               implode(' ', [
-                       $row->imagecount ? sprintf('<span class=right><i class="right icon images" title="afbeeldingen">*</i></span>') : '',
-                       $row->replycount ? sprintf('<span class=right><i class="icon replies" title="reacties">+</i>%d</span>', $row->replycount) : '',
-                       isset($row->assign) ? '<em class="right">'.$row->assign.'</em>' : '',
-               ])
+               "/$Page/{$row->id}/{$row->link}"
        );
-       print "</div></li>\n";
+       printf($row->closed ? '<s>%s</s>' : '%s', htmlspecialchars($row->subject));
+       {
+               printf(' <small class="date">%s</small>',
+                       showdate(array_slice(preg_split('/\D/', $row->updated), 0, 3))
+               );
+       }
+       if ($row->imagecount) {
+               print ' <span class="right icon images" title="afbeeldingen">*</span>';
+       }
+       if ($row->replycount) {
+               printf(' <span class=right>%s %d</span>',
+                       '<span class="icon replies" title="reacties">+</span>',
+                       $row->replycount
+               );
+       }
+       if (isset($row->assign)) {
+               print ' <em class="right">'.$row->assign.'</em>';
+       }
+       print "</a></div></li>\n";
 }
 print "</ul>\n";
 $Place['issuelist'] = ob_get_clean();