Skip to content

Commit

Permalink
Imporved vdm notice, and github issues, releases, and more
Browse files Browse the repository at this point in the history
  • Loading branch information
Llewellynvdm committed Aug 24, 2017
1 parent ef3ffee commit 5a99913
Show file tree
Hide file tree
Showing 147 changed files with 788 additions and 399 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The best way to see all your options is to install this component on you Joomla
+ *Author*: [Llewellyn van der Merwe](mailto:[email protected])
+ *Name*: [Sermon Distributor](https://www.vdm.io/)
+ *First Build*: 22nd October, 2015
+ *Last Build*: 21st August, 2017
+ *Last Build*: 24th August, 2017
+ *Version*: 1.4.1
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Expand All @@ -36,19 +36,19 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **63324**
+ *File count*: **441**
+ *Line count*: **63481**
+ *File count*: **443**
+ *Folder count*: **90**

**116 Hours** or **15 Eight Hour Days** (the actual time the author spent)
**117 Hours** or **15 Eight Hour Days** (the actual time the author spent)

> (with the following break down:
> **debugging @44hours** = codingtime / 4;
> **planning @25hours** = codingtime / 7;
> **mapping @18hours** = codingtime / 10;
> **office @29hours** = codingtime / 6;)
> **office @30hours** = codingtime / 6;)
**293 Hours** or **37 Eight Hour Days**
**294 Hours** or **37 Eight Hour Days**
(a total of the realistic time frame for this project)

> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
Expand Down
12 changes: 6 additions & 6 deletions admin/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The best way to see all your options is to install this component on you Joomla
+ *Author*: [Llewellyn van der Merwe](mailto:[email protected])
+ *Name*: [Sermon Distributor](https://www.vdm.io/)
+ *First Build*: 22nd October, 2015
+ *Last Build*: 21st August, 2017
+ *Last Build*: 24th August, 2017
+ *Version*: 1.4.1
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Expand All @@ -36,19 +36,19 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)

+ *Line count*: **63324**
+ *File count*: **441**
+ *Line count*: **63481**
+ *File count*: **443**
+ *Folder count*: **90**

**116 Hours** or **15 Eight Hour Days** (the actual time the author spent)
**117 Hours** or **15 Eight Hour Days** (the actual time the author spent)

> (with the following break down:
> **debugging @44hours** = codingtime / 4;
> **planning @25hours** = codingtime / 7;
> **mapping @18hours** = codingtime / 10;
> **office @29hours** = codingtime / 6;)
> **office @30hours** = codingtime / 6;)

**293 Hours** or **37 Eight Hour Days**
**294 Hours** or **37 Eight Hour Days**
(a total of the realistic time frame for this project)

> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
Expand Down
2 changes: 1 addition & 1 deletion admin/assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.4.1
@build 21st August, 2017
@build 24th August, 2017
@created 22nd October, 2015
@package Sermon Distributor
@subpackage admin.css
Expand Down
2 changes: 1 addition & 1 deletion admin/assets/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.4.1
@build 21st August, 2017
@build 24th August, 2017
@created 22nd October, 2015
@package Sermon Distributor
@subpackage dashboard.css
Expand Down
4 changes: 2 additions & 2 deletions admin/assets/css/sermon.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 89 of this MVC
@build 16th February, 2017
@version @update number 90 of this MVC
@build 24th August, 2017
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermon.css
Expand Down
4 changes: 2 additions & 2 deletions admin/assets/css/sermons.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 89 of this MVC
@build 16th February, 2017
@version @update number 90 of this MVC
@build 24th August, 2017
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermons.css
Expand Down
2 changes: 1 addition & 1 deletion admin/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.4.1
@build 21st August, 2017
@build 24th August, 2017
@created 22nd October, 2015
@package Sermon Distributor
@subpackage controller.php
Expand Down
2 changes: 1 addition & 1 deletion admin/controllers/ajax.json.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.4.1
@build 21st August, 2017
@build 24th August, 2017
@created 22nd October, 2015
@package Sermon Distributor
@subpackage ajax.json.php
Expand Down
2 changes: 1 addition & 1 deletion admin/controllers/help.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.4.1
@build 21st August, 2017
@build 24th August, 2017
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help.php
Expand Down
2 changes: 1 addition & 1 deletion admin/controllers/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.4.1
@build 21st August, 2017
@build 24th August, 2017
@created 22nd October, 2015
@package Sermon Distributor
@subpackage import.php
Expand Down
4 changes: 2 additions & 2 deletions admin/controllers/sermon.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 89 of this MVC
@build 16th February, 2017
@version @update number 90 of this MVC
@build 24th August, 2017
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermon.php
Expand Down
2 changes: 1 addition & 1 deletion admin/controllers/sermondistributor.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.4.1
@build 21st August, 2017
@build 24th August, 2017
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermondistributor.php
Expand Down
4 changes: 2 additions & 2 deletions admin/controllers/sermons.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 89 of this MVC
@build 16th February, 2017
@version @update number 90 of this MVC
@build 24th August, 2017
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermons.php
Expand Down
2 changes: 1 addition & 1 deletion admin/helpers/headercheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.4.1
@build 21st August, 2017
@build 24th August, 2017
@created 22nd October, 2015
@package Sermon Distributor
@subpackage headercheck.php
Expand Down
2 changes: 1 addition & 1 deletion admin/helpers/html/batch_.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.4.1
@build 21st August, 2017
@build 24th August, 2017
@created 22nd October, 2015
@package Sermon Distributor
@subpackage batch_.php
Expand Down
116 changes: 73 additions & 43 deletions admin/helpers/sermondistributor.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.4.1
@build 21st August, 2017
@build 24th August, 2017
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermondistributor.php
Expand Down Expand Up @@ -69,6 +69,11 @@ function theQueue(id, target, type) {
}
}

/**
* The global params
**/
protected static $params = false;

/**
* The external source links auto
**/
Expand All @@ -89,21 +94,6 @@ function theQueue(id, target, type) {
**/
protected static $select_externalsource_manual;

/**
* The user notice info File Name
**/
protected static $usernotice = false;

/**
* The update error info File Name
**/
protected static $updateerror = false;

/**
* The update last File path
**/
protected static $updatelast = false;

/**
* The update errors
**/
Expand Down Expand Up @@ -339,7 +329,7 @@ protected static function getNextUpdateValues()
// get actual update values
$updates = self::getExternalListingUpdateKeys();
// get last update
$updatePath = self::getFilePath('update', 'last', 'vDm', '.txt', JPATH_COMPONENT_ADMINISTRATOR);
$updatePath = self::getFilePath('path', 'updatelast', 'txt', 'vDm', JPATH_COMPONENT_ADMINISTRATOR);
if (($lastUpdate = @file_get_contents($updatePath)) !== FALSE && self::checkArray($updates))
{
// now check what is next
Expand All @@ -364,6 +354,71 @@ protected static function getNextUpdateValues()
}
return false;
}

/**
* Get the file path or url
*
* @param string $type The (url/path) type to return
* @param string $target The Params Target name (if set)
* @param string $fileType The kind of filename to generate (if not set no file name is generated)
* @param string $key The key to adjust the filename (if not set ignored)
* @param string $default The default path if not set in Params (fallback path)
* @param bool $createIfNotSet The switch to create the folder if not found
*
* @return string On success the path or url is returned based on the type requested
*
*/
public static function getFilePath($type = 'path', $target = 'filepath', $fileType = null, $key = '', $default = JPATH_SITE . '/images/', $createIfNotSet = true)
{
// get the global settings
if (!self::checkObject(self::$params))
{
self::$params = JComponentHelper::getParams('com_sermondistributor');
}
$filePath = self::$params->get($target, $default);
// check the file path (revert to default only of not a hidden file path)
if ('hiddenfilepath' !== $target && strpos($filePath, JPATH_SITE) === false)
{
$filePath = JPATH_SITE . '/images/';
}
jimport('joomla.filesystem.folder');
// create the folder if it does not exist
if ($createIfNotSet && !JFolder::exists($filePath))
{
JFolder::create($filePath);
}
// setup the file name
$fileName = '';
if (self::checkString($fileType))
{
// Get basic key
$basickey = 'Th!s_iS_n0t_sAfe_buT_b3tter_then_n0thiug';
if (method_exists(get_called_class(), "getCryptKey"))
{
$basickey = self::getCryptKey('basic', $basickey);
}
// check the key
if (self::checkString($key))
{
$key = 'vDm';
}
// set the name
$fileName = trim(md5($type.$target.$basickey.$key) . '.' . trim($fileType, '.'));
}
// return the url
if ($type === 'url')
{
if (strpos($filePath, JPATH_SITE) !== false)
{
$filePath = trim( str_replace( JPATH_SITE, '', $filePath), '/');
return JURI::root() . $filePath . '/' . $fileName;
}
// since the path is behind the root folder of the site, return only the root url (may be used to build the link)
return JURI::root();
}
// sanitize the path
return '/' . trim( $filePath, '/' ) . '/' . $fileName;
}

protected static function saveFile($data,$path_filename)
{
Expand Down Expand Up @@ -624,31 +679,6 @@ public static function checkExternalSourceLocalListing($type, $get = 'links')
}
return false;
}

public static function getFilePath($type, $name = 'listing', $key = 'vDm', $fileType = '.json', $PATH = JPATH_COMPONENT_SITE)
{
if (!isset(self::${$type.$name}[$key]) || !self::checkString(self::${$type.$name}[$key]))
{
// Get local key
$localkey = self::getLocalKey();
// check the key
$keyMD5 = '';
if ('vDm' != $key)
{
$keyMD5 = $key;
}
// set the name
$fileName = md5($type.$name.$localkey.$keyMD5);
// set file path
self::${$type.$name}[$key] = $PATH.'/helpers/'.$fileName.$fileType;
}
if (isset(self::${$type.$name}[$key]) && self::checkString(self::${$type.$name}[$key]))
{
// return the path
return self::${$type.$name}[$key];
}
return '';
}

/**
* get the localkey
Expand Down Expand Up @@ -774,7 +804,7 @@ public static function getUpdateError($id, $fileKey = null)
// get update error from file
if ($fileKey)
{
$file_path = self::getFilePath('update', 'error', $fileKey, '.txt', JPATH_COMPONENT_ADMINISTRATOR);
$file_path = self::getFilePath('path', 'updateerror', 'txt', $fileKey, JPATH_COMPONENT_ADMINISTRATOR);
// check if it is set
if (($text = @file_get_contents($file_path)) !== FALSE)
{
Expand Down
Loading

0 comments on commit 5a99913

Please sign in to comment.