diff options
author | Minteck <contact@minteck.org> | 2023-02-11 18:10:01 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-11 18:10:01 +0100 |
commit | 38a3b0ce3ce9dac3630c283589ed998f0b837de6 (patch) | |
tree | 1cfcd8eacb678e7f300556204768ba44ce5495d5 /includes | |
parent | 35d622ad561c7f693c396020820f3d8cfdb71a88 (diff) | |
download | pluralconnect-38a3b0ce3ce9dac3630c283589ed998f0b837de6.tar.gz pluralconnect-38a3b0ce3ce9dac3630c283589ed998f0b837de6.tar.bz2 pluralconnect-38a3b0ce3ce9dac3630c283589ed998f0b837de6.zip |
Updated includes/bitset.inc (automated)
Diffstat (limited to 'includes')
-rw-r--r-- | includes/bitset.inc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/includes/bitset.inc b/includes/bitset.inc index 8e3f5b2..131cb39 100644 --- a/includes/bitset.inc +++ b/includes/bitset.inc @@ -1,5 +1,21 @@ <?php function parseMetadata ($metadata) { + $metadata["little"] = 0; + + $age = -1; + + if (isset($metadata["birth"]["age"]) && $metadata["birth"]["age"] !== 0) { + $age = $metadata["birth"]["age"]; + } else if (isset($metadata["birth"]["year"]) && $metadata["birth"]["year"] > 1990) { + $age = (int)date('Y') - $metadata["birth"]["year"] + (strtotime(date('Y') . "-" . $metadata["birth"]["date"]) <= time() ? 0 : -1); + } + + if ($age > 0 && $age <= 10) { + $metadata["little"] = 2; + } else if ($age > 0 && $age <= 15) { + $metadata["little"] = 3; + } + return $metadata; }
\ No newline at end of file |