This commit is contained in:
Llewellyn van der Merwe 2022-01-07 17:39:57 +02:00
parent 7eede35961
commit b898ffccae
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C
3 changed files with 27 additions and 21 deletions

View File

@ -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

View File

@ -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

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="4" client="site" method="upgrade">
<name>MOD_DAILYSCRIPTURE</name>
<creationDate>6th January, 2022</creationDate>
<creationDate>7th January, 2022</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://www.vdm.io/</authorUrl>