Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
diddipoeler committed Nov 1, 2023
1 parent 56254f1 commit a8d5ae4
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 62 deletions.
34 changes: 17 additions & 17 deletions admin/helpers/sportsmanagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,27 @@
}

// Get the base version
$baseVersion = substr(JVERSION, 0, 3);
//$baseVersion = substr(JVERSION, 0, 3);

if (version_compare($baseVersion, '4.0', 'ge'))
{
// Joomla! 4.0 code here
defined('JSM_JVERSION') or define('JSM_JVERSION', 4);
}
//if (version_compare($baseVersion, '4.0', 'ge'))
//{
// // Joomla! 4.0 code here
// defined('JSM_JVERSION') or define('JSM_JVERSION', 4);
//}


if (version_compare($baseVersion, '3.0', 'ge'))
{
// Joomla! 3.0 code here
defined('JSM_JVERSION') or define('JSM_JVERSION', 3);
}
//if (version_compare($baseVersion, '3.0', 'ge'))
//{
// // Joomla! 3.0 code here
// defined('JSM_JVERSION') or define('JSM_JVERSION', 3);
//}


if (version_compare($baseVersion, '2.5', 'ge'))
{
// Joomla! 2.5 code here
defined('JSM_JVERSION') or define('JSM_JVERSION', 2);
}
//if (version_compare($baseVersion, '2.5', 'ge'))
//{
// // Joomla! 2.5 code here
// defined('JSM_JVERSION') or define('JSM_JVERSION', 2);
//}

/**
* sportsmanagementHelper
Expand Down Expand Up @@ -575,7 +575,7 @@ public static function getDBConnection($request = false, $value = false)
{
// Zuerst noch überprüfen, ob der user
// überhaupt den zugriff auf die datenbank hat.
if (version_compare(JSM_JVERSION, '4', 'eq'))
if (version_compare(JVERSION, '4.0.0', 'ge'))
{
self::$_jsm_db = JDatabaseDriver::getInstance($options);
}
Expand Down
18 changes: 9 additions & 9 deletions admin/sportsmanagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
JLoader::import('components.com_sportsmanagement.helpers.csvhelper', JPATH_ADMINISTRATOR);

/** Get the base version */
$baseVersion = substr(JVERSION, 0, 3);
//$baseVersion = substr(JVERSION, 0, 3);

if (version_compare($baseVersion, '4.0', 'ge'))
if (version_compare(JVERSION, '4.0.0', 'ge'))
{
/** Joomla! 4.0 code here */
defined('JSM_JVERSION') or define('JSM_JVERSION', 4);
//defined('JSM_JVERSION') or define('JSM_JVERSION', 4);
JLoader::import('components.com_sportsmanagement.libraries.github.github', JPATH_ADMINISTRATOR);
JLoader::import('components.com_sportsmanagement.libraries.github.object', JPATH_ADMINISTRATOR);
JLoader::import('components.com_sportsmanagement.libraries.github.http', JPATH_ADMINISTRATOR);
Expand All @@ -63,23 +63,23 @@
JLoader::import('components.com_sportsmanagement.libraries.github.package.activity.starring', JPATH_ADMINISTRATOR);
}

if (version_compare($baseVersion, '3.0', 'ge'))
elseif (version_compare(JVERSION, '3.0.0', 'ge'))
{
/** Joomla! 3.0 code here */
defined('JSM_JVERSION') or define('JSM_JVERSION', 3);
//defined('JSM_JVERSION') or define('JSM_JVERSION', 3);
JLoader::import('libraries.joomla.github.github', JPATH_ADMINISTRATOR);
}

if (version_compare($baseVersion, '2.5', 'ge'))
elseif (version_compare(JVERSION, '2.5.0', 'ge'))
{
/** Joomla! 2.5 code here */
defined('JSM_JVERSION') or define('JSM_JVERSION', 2);
//defined('JSM_JVERSION') or define('JSM_JVERSION', 2);
}
elseif (version_compare($baseVersion, '1.7.0', 'ge'))
elseif (version_compare(JVERSION, '1.7.0', 'ge'))
{
/** Joomla! 1.7 code here */
}
elseif (version_compare($baseVersion, '1.6', 'ge'))
elseif (version_compare(JVERSION, '1.6.0', 'ge'))
{
/** Joomla! 1.6 code here */
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,27 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Component\ComponentHelper;

// Get the base version
$baseVersion = substr(JVERSION, 0, 3);
//// Get the base version
//$baseVersion = substr(JVERSION, 0, 3);

//if (version_compare($baseVersion, '4.0', 'ge'))
//{
// // Joomla! 4.0 code here
// defined('JSM_JVERSION') or define('JSM_JVERSION', 4);
//}

//if (version_compare($baseVersion, '3.0', 'ge'))
//{
// // Joomla! 3.0 code here
// defined('JSM_JVERSION') or define('JSM_JVERSION', 3);
//}

//if (version_compare($baseVersion, '2.5', 'ge'))
//{
// // Joomla! 2.5 code here
// defined('JSM_JVERSION') or define('JSM_JVERSION', 2);
//}

if (version_compare($baseVersion, '4.0', 'ge'))
{
// Joomla! 4.0 code here
defined('JSM_JVERSION') or define('JSM_JVERSION', 4);
}

if (version_compare($baseVersion, '3.0', 'ge'))
{
// Joomla! 3.0 code here
defined('JSM_JVERSION') or define('JSM_JVERSION', 3);
}

if (version_compare($baseVersion, '2.5', 'ge'))
{
// Joomla! 2.5 code here
defined('JSM_JVERSION') or define('JSM_JVERSION', 2);
}

if (!defined('DS'))
{
Expand Down
34 changes: 17 additions & 17 deletions site/sportsmanagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,28 @@
JLoader::import('components.com_sportsmanagement.libraries.sportsmanagement.table', JPATH_ADMINISTRATOR);
JLoader::import('components.com_sportsmanagement.libraries.sportsmanagement.formbehavior2', JPATH_ADMINISTRATOR);

/** Get the base version */
$baseVersion = substr(JVERSION, 0, 3);
///** Get the base version */
//$baseVersion = substr(JVERSION, 0, 3);

if (version_compare($baseVersion, '4.0', 'ge'))
{
/** Joomla! 4.0 code here */
defined('JSM_JVERSION') or define('JSM_JVERSION', 4);
}
//if (version_compare($baseVersion, '4.0', 'ge'))
//{
// /** Joomla! 4.0 code here */
// defined('JSM_JVERSION') or define('JSM_JVERSION', 4);
//}


if (version_compare($baseVersion, '3.0', 'ge'))
{
/** Joomla! 3.0 code here */
defined('JSM_JVERSION') or define('JSM_JVERSION', 3);
}
//if (version_compare($baseVersion, '3.0', 'ge'))
//{
// /** Joomla! 3.0 code here */
// defined('JSM_JVERSION') or define('JSM_JVERSION', 3);
//}


if (version_compare($baseVersion, '2.5', 'ge'))
{
/** Joomla! 2.5 code here */
defined('JSM_JVERSION') or define('JSM_JVERSION', 2);
}
//if (version_compare($baseVersion, '2.5', 'ge'))
//{
// /** Joomla! 2.5 code here */
// defined('JSM_JVERSION') or define('JSM_JVERSION', 2);
//}

//if (!defined('DS'))
//{
Expand Down

0 comments on commit a8d5ae4

Please sign in to comment.