Skip to content

Commit

Permalink
pkg_jcomments_4.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
exstreme committed Dec 6, 2021
1 parent 509233e commit 5665659
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 46 deletions.
Binary file modified build/packages/com_jcomments.zip
Binary file not shown.
99 changes: 57 additions & 42 deletions build/pkg_jcomments.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion build/pkg_jcomments.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<author>JComments team</author>
<creationDate>December 2021</creationDate>
<packagename>jcomments</packagename>
<version>4.0.5</version>
<version>4.0.6</version>
<url>https://github.com/exstreme/Jcomments-4</url>
<packager>JComments team</packager>
<packagerurl>https://github.com/exstreme/Jcomments-4</packagerurl>
Expand Down
2 changes: 1 addition & 1 deletion jcomments.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<authorUrl>https://github.com/exstreme/Jcomments-4</authorUrl>
<copyright>Copyright 2006-2021 JoomlaTune.ru All rights reserved!</copyright>
<license>https://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
<version>4.0.5</version>
<version>4.0.6</version>
<description>JComments lets your users comment on content items.</description>

<install>
Expand Down
Binary file added pkg_jcomments_4.0.6.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions update-jcomments.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<description>JComments lets your users comment on content items</description>
<element>com_jcomments</element>
<type>component</type>
<version>4.0.5</version>
<version>4.0.6</version>
<infourl title="JComments">https://github.com/exstreme/Jcomments-4</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/exstreme/Jcomments-4/raw/master/pkg_jcomments_4.0.5.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/exstreme/Jcomments-4/raw/master/pkg_jcomments_4.0.6.zip</downloadurl>
</downloads>
<tags>
<tag>Stable</tag>
Expand Down

0 comments on commit 5665659

Please sign in to comment.