5
0
Fork 0

first commit

This commit is contained in:
Llewellyn van der Merwe 2023-04-09 23:19:33 +02:00
commit 53ba8c4ee2
Signed by: Llewellyn
GPG Key ID: A9201372263741E7
14 changed files with 1215 additions and 0 deletions

53
README.md Normal file
View File

@ -0,0 +1,53 @@
# Dailylight (1.1.2)
Display the daily scripture from [https://github.com/trueChristian/daily-scripture](https://github.com/trueChristian/daily-scripture).
# Build Details
+ *Company*: [Vast Development Method](https://www.vdm.io/)
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Dailylight](https://www.vdm.io/)
+ *First Build*: 22nd October, 2015
+ *Last Build*: 9th April, 2023
+ *Version*: 1.1.2
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
> This **module** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
## Contributors
This project exists thanks to all the people who contribute to the [Joomla Component Builder Project](https://github.com/vdm-io/Joomla-Component-Builder).
[![Contributors](https://opencollective.com/Joomla-Component-Builder/contributors.svg?width=890&button=false)](https://github.com/vdm-io/Joomla-Component-Builder/graphs/contributors)
### Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/Joomla-Component-Builder#backer)]
[![Our Backers on opencollective](https://opencollective.com/Joomla-Component-Builder/backers.svg?width=890)](https://opencollective.com/Joomla-Component-Builder#backers)
### Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/Joomla-Component-Builder#sponsor)]
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/0/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/0/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/1/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/1/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/2/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/2/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/3/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/3/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/4/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/4/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/5/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/5/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/6/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/6/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/7/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/7/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/8/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/8/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/9/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/9/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/10/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/10/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/11/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/11/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/12/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/12/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/13/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/13/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/14/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/14/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/15/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/15/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/16/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/16/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/17/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/17/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/18/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/18/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/19/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/19/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/20/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/20/website)

1
fields/index.html Normal file
View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

554
helper.php Normal file
View File

@ -0,0 +1,554 @@
<?php
/*-------------------------------------------------------------------------------------------------------------| www.vdm.io |------/
____ ____ __ __ __
/\ _`\ /\ _`\ __ /\ \__ __/\ \ /\ \__
\ \,\L\_\ __ _ __ ___ ___ ___ ___ \ \ \/\ \/\_\ ____\ \ ,_\ _ __ /\_\ \ \____ __ __\ \ ,_\ ___ _ __
\/_\__ \ /'__`\/\`'__\/' __` __`\ / __`\ /' _ `\ \ \ \ \ \/\ \ /',__\\ \ \/ /\`'__\/\ \ \ '__`\/\ \/\ \\ \ \/ / __`\/\`'__\
/\ \L\ \/\ __/\ \ \/ /\ \/\ \/\ \/\ \L\ \/\ \/\ \ \ \ \_\ \ \ \/\__, `\\ \ \_\ \ \/ \ \ \ \ \L\ \ \ \_\ \\ \ \_/\ \L\ \ \ \/
\ `\____\ \____\\ \_\ \ \_\ \_\ \_\ \____/\ \_\ \_\ \ \____/\ \_\/\____/ \ \__\\ \_\ \ \_\ \_,__/\ \____/ \ \__\ \____/\ \_\
\/_____/\/____/ \/_/ \/_/\/_/\/_/\/___/ \/_/\/_/ \/___/ \/_/\/___/ \/__/ \/_/ \/_/\/___/ \/___/ \/__/\/___/ \/_/
/------------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage helper.php
@author Llewellyn van der Merwe <https://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
A sermon distributor that links to Dropbox.
/----------------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\Registry\Registry;
class ModDailyLightHelper
{
/**
* Params
*
* @var Registry
* @since 1.0
*/
protected Registry $params;
/**
* Daily Light
*
* @var mixed
* @since 1.0
*/
protected $daily = null;
/**
* Telegram Scripture
*
* @var array
* @since 1.1
*/
protected array $telegram = [];
/**
* Telegram Comments
*
* @var array
* @since 1.1
*/
protected array $comments = [];
/**
* Type
*
* @var int
* @since 1.0
*/
protected int $type;
/**
* Time of Day
*
* @var int
* @since 1.0
*/
protected int $time;
/**
* The Telegram Post evening ID
*
* @var int
* @since 1.1
*/
protected int $evening = 0;
/**
* The Telegram Post morning ID
*
* @var int
* @since 1.1
*/
protected int $morning = 0;
/**
* Constructor.
*
* @param Registry|null $params the module settings
*
* @since 1.0
*/
public function __construct(Registry $params = null)
{
// we must have the params or we cant continue
if ($params)
{
// set the global params
$this->params = $params;
// get the type
$this->type = $params->get('type', 1);
// implementation type = 1 = gitHub
if ($this->type == 1)
{
// the link to the scripture for the day
$path = $params->get('url_json', "https://raw.githubusercontent.com/trueChristian/daily-light/master/README.json");
// get the daily light object
$this->daily = $this->getFileContents($path);
}
}
}
/**
* get the Telegram Post Evening ID
*
* @param string $time The time of daily light
*
* @return int
* @since 1.1
*/
protected function getId($time): int
{
if ($this->$time == 0)
{
// the link to the daily light morning/evening
$path = $this->params->get("url_{$time}_telegram_id", "https://raw.githubusercontent.com/trueChristian/daily-light/master/{$time}.tg.id");
// get the scripture object
$id = trim($this->getFileContents($path, false));
// make sure we have a number here
if (is_numeric($id))
{
$this->$time = (int) $id;
}
}
return $this->$time;
}
/**
* Waco method to get an scripture value
*
* @param mixed $name Name of the value to retrieve.
*
* @return mixed The request value
* @since 1.0
*/
public function __get($key)
{
if ($this->type == 1 && $this->checkDaily($key))
{
return $this->daily->{$key};
}
elseif ($this->type == 2 && ($key === 'telegram.evening' || $key === 'telegram.morning'))
{
if ($key === 'telegram.evening')
{
return $this->getTelegram('evening');
}
elseif ($key === 'telegram.morning')
{
return $this->getTelegram('morning');
}
}
elseif ($key === 'comments.evening' || $key === 'comments.morning')
{
if ($key === 'comments.evening')
{
return $this->getComments('evening');
}
elseif ($key === 'comments.morning')
{
return $this->getComments('morning');
}
}
return null;
}
/**
* get the Telegram script
*
* @param string $time The time of daily light
*
* @return string|null
* @since 1.1
*/
protected function getTelegram(string $time): ?string
{
if (empty($this->telegram[$time]))
{
$this->setTelegram($time);
}
return (isset($this->telegram[$time]) &&
$this->checkString($this->telegram[$time])) ? $this->telegram[$time] : null;
}
/**
* set the Telegram script
*
* @param string $time The time of daily light
*
* @return void
* @since 1.0
*/
protected function setTelegram($time)
{
// validate the ID
if (($id = $this->getId($time)) > 0)
{
// get the color
$color = $this->getColor();
// get the dark theme
$dark = $this->getDarkTheme();
// get the width
$width = $this->params->get('width', 100);
// get the userpic
$userpic = $this->getUserPic();
// set the daily light
$this->telegram[$time] = "<script async src=\"https://telegram.org/js/telegram-widget.js?22\" data-telegram-post=\"daily_light/$id\" data-width=\"$width%\"${color}${userpic}${dark}></script>";
}
}
/**
* get the Telegram Comment script
*
* @param string $time The time of daily light
*
* @return string|null
* @since 1.1
*/
protected function getComments($time): ?string
{
if (empty($this->comments[$time]))
{
$this->setComments($time);
}
return (isset($this->comments[$time]) &&
$this->checkString($this->comments[$time])) ? $this->comments[$time] : null;
}
/**
* set the Telegram script
*
* @param string $time The time of daily light
*
* @return void
* @since 1.1
*/
protected function setComments($time)
{
// should we add comments
if ($this->params->get('show_comments', 0) == 1 && ($id = $this->getId($time)) > 0)
{
// get the color
$color = $this->getColor();
// get the dark theme
$dark = $this->getDarkTheme();
// get comment limit
$limit = $this->params->get('comments_limit', 5);
// get comment Height
$height = $this->getCommentHeight();
// get color ful switch
$colorful = $this->getCommentColorful();
// set the script
$this->comments[$time] = "<script async src=\"https://telegram.org/js/telegram-widget.js?22\" data-telegram-discussion=\"daily_light/$id\" data-comments-limit=\"$limit\"${colorful}${height}${color}${dark}></script>";
}
}
/**
* get the color
*
* @return string The telegram script
* @since 1.0
*/
protected function getColor()
{
// get the color
$color = $this->params->get('color', 1);
// convert to color
switch($color)
{
case 2:
// Cyan
$color = '13B4C6';
$dark_color = '39C4E8';
break;
case 3:
// Green
$color = '29B127';
$dark_color = '72E350';
break;
case 4:
// Yellow
$color = 'CA9C0E';
$dark_color = 'F0B138';
break;
case 5:
// Red
$color = 'E22F38';
$dark_color = 'F95C54';
break;
case 6:
// White
$color = '343638';
$dark_color = 'FFFFFF';
break;
case 7:
// custom color
$color = strtoupper(trim($this->params->get('custom_color', 'F646A4'), '#'));
$dark_color = null;
break;
default:
// default
$color = null;
$dark_color = null;
break;
}
// load colors if set
if ($color)
{
$color = " data-color=\"$color\"";
// load dark color if set
if ($dark_color)
{
$color = "$color data-dark-color=\"$dark_color\"";
}
$this->color = $color;
}
}
/**
* get the dark theme state
*
* @return string data-dark value
* @since 1.0
*/
protected function getDarkTheme()
{
// get the theme
$theme = $this->params->get('theme', 1);
// only load if dark theme is set
if ($theme == 2)
{
$this->dark = " data-dark=\"1\"";
}
}
/**
* get the comment height
*
* @return string height value
* @since 1.1
*/
protected function getCommentHeight()
{
if (($height = $this->params->get('comments_height')) > 300)
{
return " data-height=\"$height\"";
}
return '';
}
/**
* get the comment color ful switch
*
* @return string height value
* @since 1.1
*/
protected function getCommentColorful()
{
if (($colorful = $this->params->get('comments_colorful', 0)) == 1)
{
return " data-colorful=\"1\"";
}
return '';
}
/**
* get the user pic state
*
* @return string data-userpic value
* @since 1.0
*/
protected function getUserPic()
{
// get the author_photo
$author_photo = $this->params->get('author_photo', 1);
// convert to userpic
switch($author_photo)
{
case 2:
// Always show
$userpic = 'true';
break;
case 3:
// Always hide
$userpic = 'false';
break;
default:
// Auto
$userpic = null;
break;
}
// load userpic if set
if ($userpic)
{
$userpic = " data-userpic=\"$userpic\"";
return $userpic;
}
return '';
}
/**
* get the file content
*
* @input string $path The path to get remotely
*
* @returns mixed on success
* @since 1.0
*/
protected function getFileContents($path, $json = true)
{
// use basic file get content for now
if (($content = @file_get_contents($path)) !== FALSE)
{
// return if found
if ($json)
{
if ($this->checkJson($content))
{
return json_decode($content);
}
}
elseif ($this->checkString($content))
{
return $content;
}
}
// use curl if available
elseif (function_exists('curl_version'))
{
// start curl
$ch = curl_init();
// set the options
$options = array();
$options[CURLOPT_URL] = $path;
$options[CURLOPT_USERAGENT] = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
$options[CURLOPT_RETURNTRANSFER] = TRUE;
$options[CURLOPT_SSL_VERIFYPEER] = FALSE;
// load the options
curl_setopt_array($ch, $options);
// get the content
$content = curl_exec($ch);
// close the connection
curl_close($ch);
// return if found
if ($json)
{
if ($this->checkJson($content))
{
return json_decode($content);
}
}
elseif ($this->checkString($content))
{
return $content;
}
}
return null;
}
/**
* Check if have an json string
*
* @input string The json string to check
*
* @returns bool true on success
* @since 1.0
*/
protected function checkJson($string)
{
if ($this->checkString($string))
{
json_decode($string);
return (json_last_error() === JSON_ERROR_NONE);
}
return false;
}
/**
* Check if have a string with a length
*
* @input string The string to check
*
* @returns bool true on success
* @since 1.0
*/
protected function checkString($string)
{
if (isset($string) && is_string($string) && strlen($string) > 0)
{
return true;
}
return false;
}
/**
* Check if we have an daily light object with value
*
* @input key The key being requested
*
* @returns bool true on success
* @since 1.0
*/
protected function checkDaily($key)
{
if (isset($this->daily) && is_object($this->daily) && isset($this->daily->{$key}))
{
return true;
}
return false;
}
}

1
index.html Normal file
View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,49 @@
MOD_DAILYLIGHT="Dailylight"
MOD_DAILYLIGHT_DESCRIPTION="A Joomla Module to Display the Daily Daily Light on the Daily Path."
MOD_DAILYLIGHT_XML_DESCRIPTION="<h1>Dailylight (v.1.1.2)</h1> <div style='clear: both;'></div><p>A Joomla Module to Display the Daily Daily Light on the Daily Path.</p><p>Created by <a href='https://www.vdm.io/' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 14th January, 2022</small></p>"
MOD_DAILYLIGHT_DAILY_LIGHT="Daily Light"
MOD_DAILYLIGHT_THERE_WAS_AN_ERROR_LOADING_THE_DAILY_LIGHT_PLEASE_TRY_AGAIN_LATTER="There was an error loading the Daily Light, please try again latter."
MOD_DAILYLIGHT_TIME_OF_DAY_LABEL="Time of Day"
MOD_DAILYLIGHT_TIME_OF_DAY_DESCRIPTION="What time of day would you like to display?"
MOD_DAILYLIGHT_MORNING="Morning"
MOD_DAILYLIGHT_EVENING="Evening"
MOD_DAILYLIGHT_BOTH="Both"
MOD_DAILYLIGHT_TYPE_LABEL="Implementation Type"
MOD_DAILYLIGHT_TYPE_DESCRIPTION="What kind of implementation would you like to use. Direct from gitHub the main source, or directly from Telegram its official channel"
MOD_DAILYLIGHT_DIRECT_FROM_GITHUB="Direct from gitHub"
MOD_DAILYLIGHT_DIRECT_FROM_TELEGRAM="Direct from Telegram"
MOD_DAILYLIGHT_SHOW_HEADER_LABEL="Show Header"
MOD_DAILYLIGHT_YES="Yes"
MOD_DAILYLIGHT_NO="No"
MOD_DAILYLIGHT_SHOW_NAME_HEADER_LABEL="Show Name Header"
MOD_DAILYLIGHT_SHOW_SECTION_HEADER_LABEL="Show Section Header"
MOD_DAILYLIGHT_SHOW_BODY_LABEL="Show Body"
MOD_DAILYLIGHT_SHOW_REFERENCES_LABEL="Show References"
MOD_DAILYLIGHT_SHOW_COMMENTS_LABEL="Show Comments"
MOD_DAILYLIGHT_SHOW_COMMENTS_DESCRIPTION="The option to load comment below the post"
MOD_DAILYLIGHT_COMMENTS_LIMIT_LABEL="Comments limit"
MOD_DAILYLIGHT_COMMENTS_COLORFUL_LABEL="Use different colors for names"
MOD_DAILYLIGHT_COMMENTS_HEIGHT_LABEL="Comments Height"
MOD_DAILYLIGHT_COMMENTS_HEIGHT_DESCRIPTION="Use 300 for auto height. Any higher value to set custom height, since 300 is the smallest height available."
MOD_DAILYLIGHT_LINK_LABEL="Show Link"
MOD_DAILYLIGHT_LINK_DESCRIPTION="Should we show the link to the daily scripture channel on Telegram."
MOD_DAILYLIGHT_SHOW_DATE_FOOTER_LABEL="Show Date Footer"
MOD_DAILYLIGHT_WIDTH_LABEL="Width"
MOD_DAILYLIGHT_AUTHOR_PHOTO_LABEL="Author Photo"
MOD_DAILYLIGHT_AUTO="Auto"
MOD_DAILYLIGHT_ALWAYS_SHOW="Always show"
MOD_DAILYLIGHT_ALWAYS_HIDE="Always hide"
MOD_DAILYLIGHT_COLOR_LABEL="Color"
MOD_DAILYLIGHT_DEFAULT="Default"
MOD_DAILYLIGHT_CYAN="Cyan"
MOD_DAILYLIGHT_GREEN="Green"
MOD_DAILYLIGHT_YELLOW="Yellow"
MOD_DAILYLIGHT_RED="Red"
MOD_DAILYLIGHT_WHITE="White"
MOD_DAILYLIGHT_CUSTOM="Custom"
MOD_DAILYLIGHT_CUSTOM_COLOR_LABEL="Custom Color"
MOD_DAILYLIGHT_THEME_LABEL="Theme"
MOD_DAILYLIGHT_LIGHT_THEME="Light Theme"
MOD_DAILYLIGHT_DARK_THEME="Dark Theme"
MOD_DAILYLIGHT_DAILY_LIGHT_NOTE_LABEL="Details"
MOD_DAILYLIGHT_DAILY_LIGHT_NOTE_DESCRIPTION="<h5>Relevant Links:</h5><ul><li><b>Daily Light</b>: <a href='https://github.com/trueChristian/daily-light' target='_blank'>https://github.com/trueChristian/daily-light</a>.</li><li><b>Telegram channel</b>: <a href='https://t.me/daily_light' target='_blank'>https://t.me/daily_light</a>.</li><li><b>Module repository</b>: <a href='https://git.vdm.dev/christian/mod_dailylight' target='_blank'>https://git.vdm.dev/christian/mod_dailylight</a>.</li></ul><h5>How it works</h5><p>We have a script that is designed to update a repository with daily messages called &quot;Daily Light.&quot; The script achieves this by first setting up various variables and configurations, then extracting the relevant information for the current day, and finally updating the files and pushing the changes to the repository.</p><p>In the first part, the script sets up the file paths, key identifiers, and date information. It establishes the script's directory, the Daily Light file location, and the morning and evening keys used to identify specific sections of the file. It also sets the current date based on the &quot;Africa/Windhoek&quot; timezone. After setting up the configurations, the script searches the Daily Light file for the current day's details using the 'grep' command, which matches the date with the corresponding line of text.</p><p>In the second part, the script formats and extracts the relevant information from the matched line of text. It splits the line into separate sections for the morning and evening messages, as well as the respective verses for each. Next, it creates two sets of formatted text—one in HTML and the other in Markdown. These formatted texts include the morning and evening messages, verses, and a link to a Telegram channel.</p><p>Finally, the script writes the formatted text to four separate files—morning.html, evening.html, morning.md, and evening.md. It then creates a README.md file with both the morning and evening messages and verses, along with a link to the Telegram channel. Lastly, the script commits the changes with a git commit command, using the current date as the commit message, and pushes the changes to the repository. This ensures that the repository stays updated with the latest Daily Light details for users to access.</p>"

View File

@ -0,0 +1,49 @@
MOD_DAILYLIGHT="Dailylight"
MOD_DAILYLIGHT_DESCRIPTION="A Joomla Module to Display the Daily Daily Light on the Daily Path."
MOD_DAILYLIGHT_XML_DESCRIPTION="<h1>Dailylight (v.1.1.2)</h1> <div style='clear: both;'></div><p>A Joomla Module to Display the Daily Daily Light on the Daily Path.</p><p>Created by <a href='https://www.vdm.io/' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 14th January, 2022</small></p>"
MOD_DAILYLIGHT_DAILY_LIGHT="Daily Light"
MOD_DAILYLIGHT_THERE_WAS_AN_ERROR_LOADING_THE_DAILY_LIGHT_PLEASE_TRY_AGAIN_LATTER="There was an error loading the Daily Light, please try again latter."
MOD_DAILYLIGHT_TIME_OF_DAY_LABEL="Time of Day"
MOD_DAILYLIGHT_TIME_OF_DAY_DESCRIPTION="What time of day would you like to display?"
MOD_DAILYLIGHT_MORNING="Morning"
MOD_DAILYLIGHT_EVENING="Evening"
MOD_DAILYLIGHT_BOTH="Both"
MOD_DAILYLIGHT_TYPE_LABEL="Implementation Type"
MOD_DAILYLIGHT_TYPE_DESCRIPTION="What kind of implementation would you like to use. Direct from gitHub the main source, or directly from Telegram its official channel"
MOD_DAILYLIGHT_DIRECT_FROM_GITHUB="Direct from gitHub"
MOD_DAILYLIGHT_DIRECT_FROM_TELEGRAM="Direct from Telegram"
MOD_DAILYLIGHT_SHOW_HEADER_LABEL="Show Header"
MOD_DAILYLIGHT_YES="Yes"
MOD_DAILYLIGHT_NO="No"
MOD_DAILYLIGHT_SHOW_NAME_HEADER_LABEL="Show Name Header"
MOD_DAILYLIGHT_SHOW_SECTION_HEADER_LABEL="Show Section Header"
MOD_DAILYLIGHT_SHOW_BODY_LABEL="Show Body"
MOD_DAILYLIGHT_SHOW_REFERENCES_LABEL="Show References"
MOD_DAILYLIGHT_SHOW_COMMENTS_LABEL="Show Comments"
MOD_DAILYLIGHT_SHOW_COMMENTS_DESCRIPTION="The option to load comment below the post"
MOD_DAILYLIGHT_COMMENTS_LIMIT_LABEL="Comments limit"
MOD_DAILYLIGHT_COMMENTS_COLORFUL_LABEL="Use different colors for names"
MOD_DAILYLIGHT_COMMENTS_HEIGHT_LABEL="Comments Height"
MOD_DAILYLIGHT_COMMENTS_HEIGHT_DESCRIPTION="Use 300 for auto height. Any higher value to set custom height, since 300 is the smallest height available."
MOD_DAILYLIGHT_LINK_LABEL="Show Link"
MOD_DAILYLIGHT_LINK_DESCRIPTION="Should we show the link to the daily scripture channel on Telegram."
MOD_DAILYLIGHT_SHOW_DATE_FOOTER_LABEL="Show Date Footer"
MOD_DAILYLIGHT_WIDTH_LABEL="Width"
MOD_DAILYLIGHT_AUTHOR_PHOTO_LABEL="Author Photo"
MOD_DAILYLIGHT_AUTO="Auto"
MOD_DAILYLIGHT_ALWAYS_SHOW="Always show"
MOD_DAILYLIGHT_ALWAYS_HIDE="Always hide"
MOD_DAILYLIGHT_COLOR_LABEL="Color"
MOD_DAILYLIGHT_DEFAULT="Default"
MOD_DAILYLIGHT_CYAN="Cyan"
MOD_DAILYLIGHT_GREEN="Green"
MOD_DAILYLIGHT_YELLOW="Yellow"
MOD_DAILYLIGHT_RED="Red"
MOD_DAILYLIGHT_WHITE="White"
MOD_DAILYLIGHT_CUSTOM="Custom"
MOD_DAILYLIGHT_CUSTOM_COLOR_LABEL="Custom Color"
MOD_DAILYLIGHT_THEME_LABEL="Theme"
MOD_DAILYLIGHT_LIGHT_THEME="Light Theme"
MOD_DAILYLIGHT_DARK_THEME="Dark Theme"
MOD_DAILYLIGHT_DAILY_LIGHT_NOTE_LABEL="Details"
MOD_DAILYLIGHT_DAILY_LIGHT_NOTE_DESCRIPTION="<h5>Relevant Links:</h5><ul><li><b>Daily Light</b>: <a href='https://github.com/trueChristian/daily-light' target='_blank'>https://github.com/trueChristian/daily-light</a>.</li><li><b>Telegram channel</b>: <a href='https://t.me/daily_light' target='_blank'>https://t.me/daily_light</a>.</li><li><b>Module repository</b>: <a href='https://git.vdm.dev/christian/mod_dailylight' target='_blank'>https://git.vdm.dev/christian/mod_dailylight</a>.</li></ul><h5>How it works</h5><p>We have a script that is designed to update a repository with daily messages called &quot;Daily Light.&quot; The script achieves this by first setting up various variables and configurations, then extracting the relevant information for the current day, and finally updating the files and pushing the changes to the repository.</p><p>In the first part, the script sets up the file paths, key identifiers, and date information. It establishes the script's directory, the Daily Light file location, and the morning and evening keys used to identify specific sections of the file. It also sets the current date based on the &quot;Africa/Windhoek&quot; timezone. After setting up the configurations, the script searches the Daily Light file for the current day's details using the 'grep' command, which matches the date with the corresponding line of text.</p><p>In the second part, the script formats and extracts the relevant information from the matched line of text. It splits the line into separate sections for the morning and evening messages, as well as the respective verses for each. Next, it creates two sets of formatted text—one in HTML and the other in Markdown. These formatted texts include the morning and evening messages, verses, and a link to a Telegram channel.</p><p>Finally, the script writes the formatted text to four separate files—morning.html, evening.html, morning.md, and evening.md. It then creates a README.md file with both the morning and evening messages and verses, along with a link to the Telegram channel. Lastly, the script commits the changes with a git commit command, using the current date as the commit message, and pushes the changes to the repository. This ensures that the repository stays updated with the latest Daily Light details for users to access.</p>"

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

1
language/index.html Normal file
View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

42
mod_dailylight.php Normal file
View File

@ -0,0 +1,42 @@
<?php
/*-------------------------------------------------------------------------------------------------------------| www.vdm.io |------/
____ ____ __ __ __
/\ _`\ /\ _`\ __ /\ \__ __/\ \ /\ \__
\ \,\L\_\ __ _ __ ___ ___ ___ ___ \ \ \/\ \/\_\ ____\ \ ,_\ _ __ /\_\ \ \____ __ __\ \ ,_\ ___ _ __
\/_\__ \ /'__`\/\`'__\/' __` __`\ / __`\ /' _ `\ \ \ \ \ \/\ \ /',__\\ \ \/ /\`'__\/\ \ \ '__`\/\ \/\ \\ \ \/ / __`\/\`'__\
/\ \L\ \/\ __/\ \ \/ /\ \/\ \/\ \/\ \L\ \/\ \/\ \ \ \ \_\ \ \ \/\__, `\\ \ \_\ \ \/ \ \ \ \ \L\ \ \ \_\ \\ \ \_/\ \L\ \ \ \/
\ `\____\ \____\\ \_\ \ \_\ \_\ \_\ \____/\ \_\ \_\ \ \____/\ \_\/\____/ \ \__\\ \_\ \ \_\ \_,__/\ \____/ \ \__\ \____/\ \_\
\/_____/\/____/ \/_/ \/_/\/_/\/_/\/___/ \/_/\/_/ \/___/ \/_/\/___/ \/__/ \/_/ \/_/\/___/ \/___/ \/__/\/___/ \/_/
/------------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage mod_dailylight.php
@author Llewellyn van der Merwe <https://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
A sermon distributor that links to Dropbox.
/----------------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// Include the helper functions only once
JLoader::register('ModDailyLightHelper', __DIR__ . '/helper.php');
// get the daily light
$today = new ModDailyLightHelper($params);
// set the time of day
$target = $params->get('time_of_day', 3);
$times = ($target == 3) ? ['morning', 'evening']:(($target == 1) ? ['morning']:['evening']);
// get the module class sfx (local)
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
// load the default Tmpl
require JModuleHelper::getLayoutPath('mod_dailylight', $params->get('layout', 'default'));

310
mod_dailylight.xml Normal file
View File

@ -0,0 +1,310 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="4" client="site" method="upgrade">
<name>MOD_DAILYLIGHT</name>
<creationDate>9th April, 2023</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://www.vdm.io/</authorUrl>
<copyright>Copyright (C) 2015. All Rights Reserved</copyright>
<license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license>
<version>1.1.2</version>
<description>MOD_DAILYLIGHT_XML_DESCRIPTION</description>
<!-- Scripts to run on installation -->
<scriptfile>script.php</scriptfile>
<!-- Language files -->
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.mod_dailylight.ini</language>
<language tag="en-GB">en-GB/en-GB.mod_dailylight.sys.ini</language>
</languages>
<!-- Model files -->
<files>
<filename module="mod_dailylight">mod_dailylight.php</filename>
<filename>README.md</filename>
<filename>helper.php</filename>
<filename>index.html</filename>
<folder>language</folder>
<folder>fields</folder>
<folder>rules</folder>
<folder>tmpl</folder>
</files>
<!-- Config parameter -->
<config>
<fields name="params">
<!-- default paths of basic fieldset points to the module -->
<fieldset name="basic" label="basic"
addrulepath="/modules/mod_dailylight/rules"
addfieldpath="/modules/mod_dailylight/fields"
>
<!-- Time_of_day Field. Type: List. (joomla) -->
<field
type="list"
name="time_of_day"
label="MOD_DAILYLIGHT_TIME_OF_DAY_LABEL"
description="MOD_DAILYLIGHT_TIME_OF_DAY_DESCRIPTION"
class="list_class"
multiple="false"
default="3">
<!-- Option Set. -->
<option value="1">
MOD_DAILYLIGHT_MORNING</option>
<option value="2">
MOD_DAILYLIGHT_EVENING</option>
<option value="3">
MOD_DAILYLIGHT_BOTH</option>
</field>
<!-- Type Field. Type: List. (joomla) -->
<field
type="list"
name="type"
label="MOD_DAILYLIGHT_TYPE_LABEL"
description="MOD_DAILYLIGHT_TYPE_DESCRIPTION"
class="list_class"
multiple="false"
default="1">
<!-- Option Set. -->
<option value="1">
MOD_DAILYLIGHT_DIRECT_FROM_GITHUB</option>
<option value="2">
MOD_DAILYLIGHT_DIRECT_FROM_TELEGRAM</option>
</field>
<!-- Show_header Field. Type: Radio. (joomla) -->
<field
type="radio"
name="show_header"
label="MOD_DAILYLIGHT_SHOW_HEADER_LABEL"
class="btn-group btn-group-yesno"
default="1"
showon="type:1">
<!-- Option Set. -->
<option value="1">
MOD_DAILYLIGHT_YES</option>
<option value="0">
MOD_DAILYLIGHT_NO</option>
</field>
<!-- Show_name_header Field. Type: Radio. (joomla) -->
<field
type="radio"
name="show_name_header"
label="MOD_DAILYLIGHT_SHOW_NAME_HEADER_LABEL"
class="btn-group btn-group-yesno"
default="1"
showon="type:1">
<!-- Option Set. -->
<option value="1">
MOD_DAILYLIGHT_YES</option>
<option value="0">
MOD_DAILYLIGHT_NO</option>
</field>
<!-- Show_section_header Field. Type: Radio. (joomla) -->
<field
type="radio"
name="show_section_header"
label="MOD_DAILYLIGHT_SHOW_SECTION_HEADER_LABEL"
class="btn-group btn-group-yesno"
default="1"
showon="type:1">
<!-- Option Set. -->
<option value="1">
MOD_DAILYLIGHT_YES</option>
<option value="0">
MOD_DAILYLIGHT_NO</option>
</field>
<!-- Show_body Field. Type: Radio. (joomla) -->
<field
type="radio"
name="show_body"
label="MOD_DAILYLIGHT_SHOW_BODY_LABEL"
class="btn-group btn-group-yesno"
default="1"
showon="type:1">
<!-- Option Set. -->
<option value="1">
MOD_DAILYLIGHT_YES</option>
<option value="0">
MOD_DAILYLIGHT_NO</option>
</field>
<!-- Show_references Field. Type: Radio. (joomla) -->
<field
type="radio"
name="show_references"
label="MOD_DAILYLIGHT_SHOW_REFERENCES_LABEL"
class="btn-group btn-group-yesno"
default="1"
showon="type:1">
<!-- Option Set. -->
<option value="1">
MOD_DAILYLIGHT_YES</option>
<option value="0">
MOD_DAILYLIGHT_NO</option>
</field>
<!-- Show_comments Field. Type: Radio. (joomla) -->
<field
type="radio"
name="show_comments"
label="MOD_DAILYLIGHT_SHOW_COMMENTS_LABEL"
description="MOD_DAILYLIGHT_SHOW_COMMENTS_DESCRIPTION"
class="btn-group btn-group-yesno"
default="0">
<!-- Option Set. -->
<option value="1">
MOD_DAILYLIGHT_YES</option>
<option value="0">
MOD_DAILYLIGHT_NO</option>
</field>
<!-- Comments_limit Field. Type: Number. (joomla) -->
<field
type="number"
name="comments_limit"
label="MOD_DAILYLIGHT_COMMENTS_LIMIT_LABEL"
class="text_area"
min="1"
max="20"
step="1"
showon="show_comments:1"
/>
<!-- Comments_colorful Field. Type: Radio. (joomla) -->
<field
type="radio"
name="comments_colorful"
label="MOD_DAILYLIGHT_COMMENTS_COLORFUL_LABEL"
class="btn-group btn-group-yesno"
default="0"
showon="show_comments:1">
<!-- Option Set. -->
<option value="1">
MOD_DAILYLIGHT_YES</option>
<option value="0">
MOD_DAILYLIGHT_NO</option>
</field>
<!-- Comments_height Field. Type: Number. (joomla) -->
<field
type="number"
name="comments_height"
label="MOD_DAILYLIGHT_COMMENTS_HEIGHT_LABEL"
description="MOD_DAILYLIGHT_COMMENTS_HEIGHT_DESCRIPTION"
class="text_area"
min="300"
max="2000"
step="10"
showon="show_comments:1"
/>
<!-- Link Field. Type: Radio. (joomla) -->
<field
type="radio"
name="link"
label="MOD_DAILYLIGHT_LINK_LABEL"
description="MOD_DAILYLIGHT_LINK_DESCRIPTION"
class="btn-group btn-group-yesno"
default="1"
showon="type:1">
<!-- Option Set. -->
<option value="1">
MOD_DAILYLIGHT_YES</option>
<option value="0">
MOD_DAILYLIGHT_NO</option>
</field>
<!-- Show_date_footer Field. Type: Radio. (joomla) -->
<field
type="radio"
name="show_date_footer"
label="MOD_DAILYLIGHT_SHOW_DATE_FOOTER_LABEL"
class="btn-group btn-group-yesno"
default="0"
showon="type:1">
<!-- Option Set. -->
<option value="1">
MOD_DAILYLIGHT_YES</option>
<option value="0">
MOD_DAILYLIGHT_NO</option>
</field>
<!-- Width Field. Type: Number. (joomla) -->
<field
type="number"
name="width"
label="MOD_DAILYLIGHT_WIDTH_LABEL"
class="text_area"
min="10"
max="100"
step="10"
showon="type:2"
/>
<!-- Author_photo Field. Type: List. (joomla) -->
<field
type="list"
name="author_photo"
label="MOD_DAILYLIGHT_AUTHOR_PHOTO_LABEL"
class="list_class"
multiple="false"
default="1"
showon="type:2">
<!-- Option Set. -->
<option value="1">
MOD_DAILYLIGHT_AUTO</option>
<option value="2">
MOD_DAILYLIGHT_ALWAYS_SHOW</option>
<option value="3">
MOD_DAILYLIGHT_ALWAYS_HIDE</option>
</field>
<!-- Color Field. Type: List. (joomla) -->
<field
type="list"
name="color"
label="MOD_DAILYLIGHT_COLOR_LABEL"
class="list_class"
multiple="false"
default="1"
showon="type:2[OR]show_comments:1">
<!-- Option Set. -->
<option value="1">
MOD_DAILYLIGHT_DEFAULT</option>
<option value="2">
MOD_DAILYLIGHT_CYAN</option>
<option value="3">
MOD_DAILYLIGHT_GREEN</option>
<option value="4">
MOD_DAILYLIGHT_YELLOW</option>
<option value="5">
MOD_DAILYLIGHT_RED</option>
<option value="6">
MOD_DAILYLIGHT_WHITE</option>
<option value="7">
MOD_DAILYLIGHT_CUSTOM</option>
</field>
<!-- Custom_color Field. Type: Color. (joomla) -->
<field
type="color"
name="custom_color"
default="1"
label="MOD_DAILYLIGHT_CUSTOM_COLOR_LABEL"
showon="type:2[AND]color:7[OR]show_comments:1[AND]color:7"
/>
<!-- Theme Field. Type: Radio. (joomla) -->
<field
type="radio"
name="theme"
label="MOD_DAILYLIGHT_THEME_LABEL"
class="btn-group btn-group-yesno"
default="1"
showon="type:2[OR]show_comments:1">
<!-- Option Set. -->
<option value="1">
MOD_DAILYLIGHT_LIGHT_THEME</option>
<option value="2">
MOD_DAILYLIGHT_DARK_THEME</option>
</field>
</fieldset>
<!-- default paths of info fieldset points to the module -->
<fieldset name="info" label="MOD_DAILYLIGHT_DAILY_LIGHT"
addrulepath="/modules/mod_dailylight/rules"
addfieldpath="/modules/mod_dailylight/fields"
>
<!-- Daily_light_note Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="daily_light_note" label="MOD_DAILYLIGHT_DAILY_LIGHT_NOTE_LABEL" description="MOD_DAILYLIGHT_DAILY_LIGHT_NOTE_DESCRIPTION" heading="h4" class="alert alert-success daily_light_note" />
</fieldset>
</fields>
</config>
</extension>

1
rules/index.html Normal file
View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

64
script.php Normal file
View File

@ -0,0 +1,64 @@
<?php
/*-------------------------------------------------------------------------------------------------------------| www.vdm.io |------/
____ ____ __ __ __
/\ _`\ /\ _`\ __ /\ \__ __/\ \ /\ \__
\ \,\L\_\ __ _ __ ___ ___ ___ ___ \ \ \/\ \/\_\ ____\ \ ,_\ _ __ /\_\ \ \____ __ __\ \ ,_\ ___ _ __
\/_\__ \ /'__`\/\`'__\/' __` __`\ / __`\ /' _ `\ \ \ \ \ \/\ \ /',__\\ \ \/ /\`'__\/\ \ \ '__`\/\ \/\ \\ \ \/ / __`\/\`'__\
/\ \L\ \/\ __/\ \ \/ /\ \/\ \/\ \/\ \L\ \/\ \/\ \ \ \ \_\ \ \ \/\__, `\\ \ \_\ \ \/ \ \ \ \ \L\ \ \ \_\ \\ \ \_/\ \L\ \ \ \/
\ `\____\ \____\\ \_\ \ \_\ \_\ \_\ \____/\ \_\ \_\ \ \____/\ \_\/\____/ \ \__\\ \_\ \ \_\ \_,__/\ \____/ \ \__\ \____/\ \_\
\/_____/\/____/ \/_/ \/_/\/_/\/_/\/___/ \/_/\/_/ \/___/ \/_/\/___/ \/__/ \/_/ \/_/\/___/ \/___/ \/__/\/___/ \/_/
/------------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage script.php
@author Llewellyn van der Merwe <https://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
A sermon distributor that links to Dropbox.
/----------------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* Dailylight script file.
*
* @package DailyLight
*/
class mod_DailyLightInstallerScript
{
/**
* Called before any type of action
*
* @param string $route Which action is happening (install|uninstall|discover_install|update)
* @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script
*
* @return boolean True on success
*/
public function preflight($route, $adapter)
{
// get application
$app = JFactory::getApplication();
// the default for both install and update
$jversion = new JVersion();
if (!$jversion->isCompatible('3.8.0'))
{
$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');
return false;
}
if ('install' === $route)
{
//
}
return true;
}
}

88
tmpl/default.php Normal file
View File

@ -0,0 +1,88 @@
<?php
/*-------------------------------------------------------------------------------------------------------------| www.vdm.io |------/
____ ____ __ __ __
/\ _`\ /\ _`\ __ /\ \__ __/\ \ /\ \__
\ \,\L\_\ __ _ __ ___ ___ ___ ___ \ \ \/\ \/\_\ ____\ \ ,_\ _ __ /\_\ \ \____ __ __\ \ ,_\ ___ _ __
\/_\__ \ /'__`\/\`'__\/' __` __`\ / __`\ /' _ `\ \ \ \ \ \/\ \ /',__\\ \ \/ /\`'__\/\ \ \ '__`\/\ \/\ \\ \ \/ / __`\/\`'__\
/\ \L\ \/\ __/\ \ \/ /\ \/\ \/\ \/\ \L\ \/\ \/\ \ \ \ \_\ \ \ \/\__, `\\ \ \_\ \ \/ \ \ \ \ \L\ \ \ \_\ \\ \ \_/\ \L\ \ \ \/
\ `\____\ \____\\ \_\ \ \_\ \_\ \_\ \____/\ \_\ \_\ \ \____/\ \_\/\____/ \ \__\\ \_\ \ \_\ \_,__/\ \____/ \ \__\ \____/\ \_\
\/_____/\/____/ \/_/ \/_/\/_/\/_/\/___/ \/_/\/_/ \/___/ \/_/\/___/ \/__/ \/_/ \/_/\/___/ \/___/ \/__/\/___/ \/_/
/------------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage default.php
@author Llewellyn van der Merwe <https://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
A sermon distributor that links to Dropbox.
/----------------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<?php if ($today->date_name): ?>
<div>
<?php if ($params->get('show_header', 1) == 1): ?>
<<?php echo $params->get('header', 'h2'); ?>><?php echo $today->date_name; ?></<?php echo $params->get('header', 'h2'); ?>>
<?php endif; ?>
<?php foreach ($times as $time): ?>
<?php if ($params->get('show_name_header', 1) == 1): ?>
<<?php echo $params->get('name_header', 'h3'); ?>><?php echo $today->{$time}->name; ?></<?php echo $params->get('name_header', 'h3'); ?>>
<?php endif; ?>
<?php if ($params->get('show_section_header', 1) == 1): ?>
<<?php echo $params->get('section_header', 'h5'); ?>><?php echo $today->{$time}->header; ?></<?php echo $params->get('section_header', 'h5'); ?>>
<?php endif; ?>
<?php if ($params->get('show_body', 1) == 1): ?>
<ul style="list-style-type: none;">
<?php foreach ($today->{$time}->body as $row): ?>
<li><?php echo $row; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if ($params->get('show_references', 1) == 1): ?>
<p><?php echo implode('; ', $today->{$time}->references); ?></p>
<?php endif; ?>
<?php if ($today->{'comments.' . $time}): ?>
<?php echo $today->{'comments.' . $time}; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php if ($params->get('link', 1) == 1): ?>
<a href="https://t.me/s/<?php echo $today->telegram; ?>" target="_blank">
<?php if ($params->get('show_date_footer', 0) == 1): ?>
<?php echo $today->date_name; ?>
<?php else: ?>
<?php echo JText::_('MOD_DAILYLIGHT_DAILY_LIGHT'); ?>
<?php endif; ?>
</a>
<?php else: ?>
<?php if ($params->get('show_date_footer', 0) == 1): ?>
<p><?php echo $today->date_name; ?></p>
<?php endif; ?>
<?php endif; ?>
</div>
<?php elseif ($params->get('type', 1) == 2 && ($today->{'telegram.morning'} || $today->{'telegram.evening'})): ?>
<div>
<?php $counter = 1; ?>
<?php foreach ($times as $time): ?>
<?php if ($today->{'telegram.' . $time}): ?>
<?php if ($counter == 2): ?>
<br /><br />
<?php endif; ?>
<?php echo $today->{'telegram.' . $time}; ?>
<?php if ($today->{'comments.' . $time}): ?>
<?php echo $today->{'comments.' . $time}; ?>
<?php endif; ?>
<?php $counter++; ?>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php else: ?>
<?php echo JText::_('MOD_DAILYLIGHT_THERE_WAS_AN_ERROR_LOADING_THE_DAILY_LIGHT_PLEASE_TRY_AGAIN_LATTER'); ?>
<?php endif; ?>

1
tmpl/index.html Normal file
View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>