From 4cf2d738361ff098272ed2fcf89b510e6cf6819f Mon Sep 17 00:00:00 2001 From: cynic Date: Tue, 29 Aug 2023 16:11:47 -0500 Subject: create data/instances.php to demonstrate out-of-code configuration, and use it to dynamically generate the instance list (#8) see title. the workflow here (i.e. a file data/*.php, which only has a data structure and is used to generate content elsewhere) could also be used for easier per-instance customization. [you can see what this looks like live here](https://4get.silly.computer/about) Co-authored-by: cynic Reviewed-on: https://git.lolcat.ca/lolcat/4get/pulls/8 Co-authored-by: cynic Co-committed-by: cynic --- about.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'about.php') diff --git a/about.php b/about.php index 2b3d316..77c9ab1 100644 --- a/about.php +++ b/about.php @@ -18,6 +18,19 @@ echo '' . ''; +include "data/instances.php"; +$compiledinstancelist = ""; +foreach ($instancelist as $instance) +{ + $compiledinstancelist .= " ".$instance["name"].""; + $compiledinstancelist .= " ".$instance["address"]["displayname"].""; + foreach ($instance["altaddresses"] as $alt) + { + $compiledinstancelist .= "(".$alt["displayname"].")"; + } + $compiledinstancelist .= ""; +} + $left = '< Go back @@ -87,14 +100,7 @@ $left = Name Address - - lolcat\'s instance (master) - 4get.ca(tor) - - - zzls\'s instance - 4get.zzls.xyz(tor) - + '.$compiledinstancelist.'

How can I trust you?

-- cgit v1.2.3