// Kunena uploaded files directory define('KUNENA_RELPATH_UPLOADED', 'media/kunena/attachments'); define('KUNENA_PATH_UPLOADED', KUNENA_ROOT_PATH .'/'. KUNENA_RELPATH_UPLOADED); // Kunena uploaded avatars directory define('KUNENA_RELPATH_AVATAR_UPLOADED', '/media/kunena/avatars'); define('KUNENA_PATH_AVATAR_UPLOADED', KUNENA_ROOT_PATH . KUNENA_RELPATH_AVATAR_UPLOADED); // Kunena legacy uploaded files directory define('KUNENA_RELPATH_UPLOADED_LEGACY', '/images/fbfiles'); define('KUNENA_PATH_UPLOADED_LEGACY', KUNENA_ROOT_PATH . KUNENA_RELPATH_UPLOADED_LEGACY); // Legacy version information define ('KUNENA_VERSION', KunenaForum::version()); define ('KUNENA_VERSION_DATE', KunenaForum::versionDate()); define ('KUNENA_VERSION_NAME', KunenaForum::versionName()); define ('KUNENA_VERSION_BUILD', 0); // Joomla URL define('KUNENA_JLIVEURL', JUri::base(true).'/'); // Joomla template dir define('KUNENA_JTEMPLATEPATH', KUNENA_ROOT_PATH . "/templates/{$app->getTemplate()}"); define('KUNENA_JTEMPLATEURL', KUNENA_JLIVEURL. "templates/{$app->getTemplate()}"); // Kunena live URL define('KUNENA_LIVEURL', KUNENA_JLIVEURL . 'index.php?option=com_kunena'); define('KUNENA_LIVEURLREL', 'index.php?option=com_kunena'); // Kunena files URL define('KUNENA_DIRECTURL', KUNENA_JLIVEURL . 'components/com_kunena/');
protected function insertVersion($state = 'beginInstall') { // Insert data from the new version $this->insertVersionData(KunenaForum::version(), KunenaForum::versionDate(), KunenaForum::versionName(), $state); }
<div class="clearfix"></div> </div> </div> <div class="span5"> <div class="well well-small"> <div class="center"> <img src="components/com_kunena/media/icons/kunena_logo.png"/> </div> <dl class="dl-horizontal"> <hr class="hr-condensed"> <dt><?php echo JText::_('COM_KUNENA_CPANEL_LABEL_VERSION') ?>:</dt> <dd><?php echo KunenaForum::version(); ?></dd> <hr class="hr-condensed"> <dt><?php echo JText::_('COM_KUNENA_CPANEL_LABEL_CODENAME') ?>:</dt> <dd><?php echo KunenaForum::versionName(); ?></dd> <hr class="hr-condensed"> <dt><?php echo JText::_('COM_KUNENA_CPANEL_LABEL_DATE') ?>:</dt> <dd><?php echo KunenaForum::versionDate(); ?></dd> <hr class="hr-condensed"> <dt><?php echo JText::_('COM_KUNENA_CPANEL_LABEL_AUTHOR') ?>:</dt> <dd><a href="https://www.kunena.org/team" target="_blank">Kunena Team</a></dd> <hr class="hr-condensed"> <dt><?php echo JText::_('COM_KUNENA_CPANEL_LABEL_COPYRIGHT') ?>:</dt> <dd>© 2008 - 2016 Kunena, All rights reserved.</dd> <hr class="hr-condensed"> <dt><?php echo JText::_('COM_KUNENA_CPANEL_LABEL_LABEL_LICENSE') ?>:</dt> <dd>GNU General Public License</dd> <hr class="hr-condensed">
/** * Retrieve installed Kunena version as string. * * @return string "Kunena X.Y.Z | YYYY-MM-DD [versionname]" */ static function getVersionHTML() { return 'Kunena ' . KunenaForum::version() . ' | ' . KunenaForum::versionDate() . ' [ ' . KunenaForum::versionName() . ' ]'; }
<hr class="hr-condensed"> <dl class="dl-horizontal"> <dt><?php echo JText::_('COM_KUNENA_CPANEL_LABEL_VERSION'); ?> :</dt> <dd><?php echo KunenaForum::version(); ?> </dd> <dt><?php echo JText::_('COM_KUNENA_CPANEL_LABEL_CODENAME'); ?> :</dt> <dd><?php echo KunenaForum::versionName(); ?> </dd> <dt><?php echo JText::_('COM_KUNENA_CPANEL_LABEL_DATE'); ?> :</dt> <dd><?php echo KunenaForum::versionDate(); ?> </dd> <dt><?php echo JText::_('COM_KUNENA_CPANEL_LABEL_AUTHOR'); ?> :</dt> <dd><a href="http://www.kunena.org/team" target="_blank">Kunena Team</a></dd>
/** * Migrate custom information. * * This function gets called after all folders and tables have been copied. * * If you want to split this task into smaller chunks, * please store your custom state variables into $this->state and return false. * Returning false will force jUpgrade to call this function again, * which allows you to continue import by reading $this->state before continuing. * * @return boolean Ready (true/false) * @since 1.6.4 * @throws Exception */ protected function migrateExtensionCustom() { require_once JPATH_ADMINISTRATOR . '/components/com_kunena/api.php'; // Need to initialize application jimport('joomla.environment.uri'); $app = JFactory::getApplication('administrator'); // Get component object $component = JTable::getInstance('extension', 'JTable', array('dbo' => $this->db_new)); $component->load(array('type' => 'component', 'element' => $this->name)); // First fix all broken menu items $query = "UPDATE #__menu SET component_id={$this->db_new->quote($component->extension_id)} WHERE type = 'component' AND link LIKE '%option={$this->name}%'"; $this->db_new->setQuery($query); $this->db_new->query(); $menumap = $this->getMapList('menus'); // Get all menu items from the component (JMenu style) $query = $this->db_new->getQuery(true); $query->select('*'); $query->from('#__menu'); $query->where("component_id = {$component->extension_id}"); $query->where('client_id = 0'); $query->order('lft'); $this->db_new->setQuery($query); $menuitems = $this->db_new->loadObjectList('id'); foreach ($menuitems as &$menuitem) { // Get parent information. $parent_tree = array(); if (isset($menuitems[$menuitem->parent_id])) { $parent_tree = $menuitems[$menuitem->parent_id]->tree; } // Create tree. $parent_tree[] = $menuitem->id; $menuitem->tree = $parent_tree; // Create the query array. $url = str_replace('index.php?', '', $menuitem->link); $url = str_replace('&', '&', $url); parse_str($url, $menuitem->query); } // Update menu items foreach ($menuitems as $menuitem) { if (!isset($menuitem->query['view'])) { continue; } $update = false; switch ($menuitem->query['view']) { case 'home': // Update default menu item if (!empty($menuitem->query['defaultmenu'])) { $menuitem->query['defaultmenu'] = isset($menumap[$menuitem->query['defaultmenu']]) ? $menumap[$menuitem->query['defaultmenu']]->new : 0; $update = true; } break; } if ($update) { // Update menuitem link $query_string = array(); foreach ($menuitem->query as $k => $v) { $query_string[] = $k . '=' . $v; } $menuitem->link = 'index.php?' . implode('&', $query_string); // Save menu object $menu = JTable::getInstance('menu', 'JTable', array('dbo' => $this->db_new)); $menu->bind(get_object_vars($menuitem), array('tree', 'query')); $success = $menu->check(); if ($success) { $success = $menu->store(); } if (!$success) { echo "ERROR"; } } } // Replace Joomla! 1.5 manifest file with Joomla! 2.5 version jimport('joomla.filesystem.file'); $manifest25 = JPATH_ADMINISTRATOR . '/components/com_kunena/kunena.j25.xml'; $manifest15 = JPATH_ADMINISTRATOR . '/components/com_kunena/kunena.xml'; if (file_exists($manifest25)) { $content = file_get_contents($manifest25); // Take care of Git install $content = preg_replace('/@kunenaversion@/', preg_replace('/-GIT/i', '', KunenaForum::version()), $content); $content = preg_replace('/@kunenaversiondate@/', KunenaForum::versionDate(), $content); $content = preg_replace('/@kunenaversionname@/', KunenaForum::versionName(), $content); JFile::write($manifest15, $content); JFile::delete($manifest25); } jimport('joomla.plugin.helper'); // Mark Kunena as discovered and install it $component->client_id = 1; $component->state = -1; $component->store(); jimport('joomla.installer.installer'); $installer = JInstaller::getInstance(); $installer->discover_install($component->extension_id); // Start Kunena installer require_once dirname(__FILE__) . '/model.php'; $kunena = new KunenaModelInstall(); // Install all plugins $kunena->stepPlugins(); // Install English language $kunena->installLanguage('en-GB', 'English'); return true; }