From b898ffccaed27e48d060cc2f6184ada587ec555a Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 7 Jan 2022 17:39:57 +0200 Subject: [PATCH] update --- README.md | 2 +- helper.php | 44 ++++++++++++++++++++++++------------------ mod_dailyscripture.xml | 2 +- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 2283e3d..735c767 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Display the daily scripture from [https://github.com/trueChristian/daily-scriptu + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Dailyscripture](https://www.vdm.io/) + *First Build*: 22nd October, 2015 -+ *Last Build*: 6th January, 2022 ++ *Last Build*: 7th January, 2022 + *Version*: 1.0.1 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html diff --git a/helper.php b/helper.php index 6565b41..7544329 100644 --- a/helper.php +++ b/helper.php @@ -42,7 +42,7 @@ class ModDailyScriptureHelper /** * Scripture * - * @var mix + * @var mixed * @since 1.0 */ protected $scripture = null; @@ -74,30 +74,34 @@ class ModDailyScriptureHelper /** * Constructor. * - * @param Registry $params the module settings + * @param Registry|null $params the module settings * * @since 1.0 */ public function __construct(Registry $params = null) { - // set the global params - $this->params = $params; - // get the version - $this->type = $params->get('type', 1); - // implementation type = 1 = gitHub - if ($this->type == 1) + // we must have the params or we cant continue + if ($params) { + // set the global params + $this->params = $params; // get the version - $version = $params->get('version', 'kjv'); - // the link to the scripture for the day - $path = "https://raw.githubusercontent.com/trueChristian/daily-scripture/master/scripture/$version/README.json"; - // get the scripture object - $this->scripture = $this->getFileContents($path); - } - // implementation type = 2 = Telegram - elseif ($this->type == 2) - { - $this->setTelegram(); + $this->type = $params->get('type', 1); + // implementation type = 1 = gitHub + if ($this->type == 1) + { + // get the version + $version = $params->get('version', 'kjv'); + // the link to the scripture for the day + $path = "https://raw.githubusercontent.com/trueChristian/daily-scripture/master/scripture/$version/README.json"; + // get the scripture object + $this->scripture = $this->getFileContents($path); + } + // implementation type = 2 = Telegram + elseif ($this->type == 2) + { + $this->setTelegram(); + } } } @@ -126,7 +130,7 @@ class ModDailyScriptureHelper /** * get the Telegram script * - * @return string data-color values + * @return void * * @since 1.0 */ @@ -161,6 +165,8 @@ class ModDailyScriptureHelper /** * get today's time stamp based on user * + * @param string $getDate the string to get the time stamp for + * * @return int the timestamp * * @since 1.0 diff --git a/mod_dailyscripture.xml b/mod_dailyscripture.xml index f36f7af..10d6c59 100644 --- a/mod_dailyscripture.xml +++ b/mod_dailyscripture.xml @@ -1,7 +1,7 @@ MOD_DAILYSCRIPTURE - 6th January, 2022 + 7th January, 2022 Llewellyn van der Merwe joomla@vdm.io https://www.vdm.io/