Add zero_pad_left macro

Pad left with four zeros.
This commit is contained in:
Roan Horning 2022-07-31 21:33:54 -04:00
parent 536f7cce03
commit 858bf058ff
Signed by: rho_n
GPG Key ID: 234AEF20B72D5769
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,4 @@
<!--% PROCESS 'shared-utils.tpl.html' %-->
<article>
<p>
<h2 class="title">Correspondents</h2><p>For more information on how to become a Correspondent see our <a href="contribute.php">contribute</a></center> page. To add a logo here, either email one to admin at hpr or setup your email on <a href="https://en.gravatar.com/">Gravatar</a>. To protect your browsing privacy we gather the images every hour and serve them directly from HPR.<p />
@ -19,7 +20,7 @@
<td><strong><!--% host.host %--></strong><br />
Host ID: <a href="correspondents/<!--% host.hostid %-->.html"><!--% host.hostid %--></a></td>
Host ID: <a href="correspondents/<!--% zero_pad_left(host.hostid) %-->/index.html"><!--% host.hostid %--></a></td>
<td><!--% host.license %--></td>
<td><!--% host.date %--></td>
</tr>

View File

@ -0,0 +1,4 @@
<!--% MACRO zero_pad_left(word) BLOCK %-->
<!--% USE String(word) %-->
<!--% String.format("%04s") %-->
<!--% END %-->