diff --git a/build/packages/com_jcomments.zip b/build/packages/com_jcomments.zip index d3abe00b..a059c284 100644 Binary files a/build/packages/com_jcomments.zip and b/build/packages/com_jcomments.zip differ diff --git a/build/pkg_jcomments.php b/build/pkg_jcomments.php index 80dbc46b..96409028 100644 --- a/build/pkg_jcomments.php +++ b/build/pkg_jcomments.php @@ -64,6 +64,63 @@ public function preflight($action, $installer) return true; } + /** + * Called only with install + * + * @param string $action Which action is happening (install|uninstall|discover_install|update) + * @param InstallerAdapter $installer The class calling this method + * + * @return boolean True on success + * + * @throws Exception + * @since 4.0.0 + */ + public function install($action, $installer) + { + // Load default custom bbcodes + $query = $db->getQuery(true) + ->select('COUNT(id)') + ->from($db->quoteName('#__jcomments_custom_bbcodes')); + + $db->setQuery($query); + $count = $db->loadResult(); + + if ($count == 0) + { + $this->executeSQL(JPATH_ROOT . '/administrator/components/com_jcomments/install/sql/mysql/default.custom_bbcodes.sql'); + $this->fixUsergroupsCustomBBCodes(); + } + + // Load default smilies + $query = $db->getQuery(true) + ->select('COUNT(id)') + ->from($db->quoteName('#__jcomments_smilies')); + + $db->setQuery($query); + $count = $db->loadResult(); + + if ($count == 0) + { + $this->executeSQL(JPATH_ROOT . '/administrator/components/com_jcomments/install/sql/mysql/default.smilies.sql'); + } + + // Load default access rules + $this->executeSQL(JPATH_ROOT . '/administrator/components/com_jcomments/install/sql/mysql/default.access.sql'); + + // Copy JomSocial rule + $source = JPATH_ROOT . '/administrator/components/com_jcomments/install/xml/jomsocial_rule.xml'; + $destination = JPATH_SITE . '/components/com_jcomments/jomsocial_rule.xml'; + + if (!is_file($destination)) + { + File::copy($source, $destination); + } + + // Enable plugins + $this->enablePlugins(1); + + $this->setComponentParams(); + } /** * Called after any type of action @@ -101,49 +158,7 @@ public function postflight($action, $installer) $data->action = $action; $data->xml = $componentXML; - // Load default custom bbcodes - $query = $db->getQuery(true) - ->select('COUNT(id)') - ->from($db->quoteName('#__jcomments_custom_bbcodes')); - - $db->setQuery($query); - $count = $db->loadResult(); - - if ($count == 0) - { - $this->executeSQL(JPATH_ROOT . '/administrator/components/com_jcomments/install/sql/mysql/default.custom_bbcodes.sql'); - $this->fixUsergroupsCustomBBCodes(); - } - - // Load default smilies - $query = $db->getQuery(true) - ->select('COUNT(id)') - ->from($db->quoteName('#__jcomments_smilies')); - - $db->setQuery($query); - $count = $db->loadResult(); - - if ($count == 0) - { - $this->executeSQL(JPATH_ROOT . '/administrator/components/com_jcomments/install/sql/mysql/default.smilies.sql'); - } - - // Load default access rules - $this->executeSQL(JPATH_ROOT . '/administrator/components/com_jcomments/install/sql/mysql/default.access.sql'); - - // Copy JomSocial rule - $source = JPATH_ROOT . '/administrator/components/com_jcomments/install/xml/jomsocial_rule.xml'; - $destination = JPATH_SITE . '/components/com_jcomments/jomsocial_rule.xml'; - - if (!is_file($destination)) - { - File::copy($source, $destination); - } - - // Enable plugins - $this->enablePlugins(1); - $this->setComponentParams(); $this->cleanCache('com_jcomments'); $this->displayResults($data); diff --git a/build/pkg_jcomments.xml b/build/pkg_jcomments.xml index b344b4cb..4a1d5286 100644 --- a/build/pkg_jcomments.xml +++ b/build/pkg_jcomments.xml @@ -4,7 +4,7 @@ JComments team December 2021 jcomments - 4.0.5 + 4.0.6 https://github.com/exstreme/Jcomments-4 JComments team https://github.com/exstreme/Jcomments-4 diff --git a/jcomments.xml b/jcomments.xml index 3c9ab8c6..f6ed4efe 100644 --- a/jcomments.xml +++ b/jcomments.xml @@ -7,7 +7,7 @@ https://github.com/exstreme/Jcomments-4 Copyright 2006-2021 JoomlaTune.ru All rights reserved! https://www.gnu.org/copyleft/gpl.html GNU/GPL - 4.0.5 + 4.0.6 JComments lets your users comment on content items. diff --git a/pkg_jcomments_4.0.6.zip b/pkg_jcomments_4.0.6.zip new file mode 100644 index 00000000..76276b9e Binary files /dev/null and b/pkg_jcomments_4.0.6.zip differ diff --git a/update-jcomments.xml b/update-jcomments.xml index e8001163..b0cf020d 100644 --- a/update-jcomments.xml +++ b/update-jcomments.xml @@ -5,10 +5,10 @@ JComments lets your users comment on content items com_jcomments component - 4.0.5 + 4.0.6 https://github.com/exstreme/Jcomments-4 - https://github.com/exstreme/Jcomments-4/raw/master/pkg_jcomments_4.0.5.zip + https://github.com/exstreme/Jcomments-4/raw/master/pkg_jcomments_4.0.6.zip Stable