AAAAenqueueMessage(JText::sprintf('COM_CSVI_PHP_VERSION_ERROR', phpversion()), 'error'); return false; } // Check if the Joomla version is correct $version = new JVersion(); if (version_compare($version->getShortVersion(), '2.5', '<') == '-1') { $app = JFactory::getApplication(); $app->enqueueMessage(JText::sprintf('COM_CSVI_JOOMLA_VERSION_ERROR', $version->getShortVersion()), 'error'); return false; } // Check if there is an entry in the schemas table if ($type == 'update') { $db = JFactory::getDbo(); // Get the extension id first $query = $db->getQuery(true); $query->select('extension_id')->from('#__extensions')->where($db->qn('type').'='.$db->q('component'))->where($db->qn('element').'='.$db->q('com_csvi')); $db->setQuery($query); $eid = $db->loadResult(); if ($eid) { // Check if there is a version in the schemas table $query->clear(); $query->select('version_id') ->from('#__schemas') ->where('extension_id = ' . $eid); $db->setQuery($query); $version = $db->loadResult(); if (empty($version)) { // Get the current CSVI version $query->clear(); $query->select('params') ->from('#__csvi_settings') ->where('id = 2'); $db->setQuery($query); $version = $db->loadResult(); // Add the version number $query->clear(); $query->insert('#__schemas')->values($eid.','.$db->q($version)); $db->setQuery($query); $db->query(); } } } return true; } /** * method to run after an install/update/uninstall method * * @return void */ function postflight($type, $parent) { // Load the CSS ?> '; echo JHtml::_('link', JRoute::_('index.php?option=com_csvi&view=install'), JText::_('COM_CSVI_CONTINUE_SETUP')); echo ''; } }