function dropVersionTable() { $kunena_db =& JFactory::getDBO(); $kunena_db->setQuery("DROP TABLE IF EXISTS `{$this->versionTable}`;"); $kunena_db->query(); check_dbwarning('Unable to drop version table.'); }
function com_install() { $kunena_db = JFactory::getDBO(); // Determine MySQL version from phpinfo $kunena_db->setQuery("SELECT VERSION() as mysql_version"); $mysqlversion = $kunena_db->loadResult(); //before we do anything else we want to check for minimum system requirements if (version_compare(phpversion(), KUNENA_MIN_PHP, ">=") && version_compare($mysqlversion, KUNENA_MIN_MYSQL, ">")) { //change fb menu icon $kunena_db->setQuery("SELECT id FROM #__components WHERE admin_menu_link = 'option=com_kunena'"); $id = $kunena_db->loadResult(); check_dberror("Unable to find component."); //add new admin menu images $kunena_db->setQuery("UPDATE #__components SET admin_menu_img = 'components/com_kunena/images/kunenafavicon.png'" . ", admin_menu_link = 'option=com_kunena' " . "WHERE id='" . $id . "'"); $kunena_db->query(); check_dbwarning("Unable to set admin menu image."); //install & upgrade class $fbupgrade = new fx_Upgrade("com_kunena", "kunena.install.upgrade.xml", "fb_", "install", false); // Start Installation/Upgrade $fbupgrade->doUpgrade(); // THIS PROCEDURE IS UNTRANSLATED! ?> <style> .fbscs { margin: 0; padding: 0; list-style: none; } .fbscslist { list-style: none; padding: 5px 10px; margin: 3px 0; border: 1px solid #66CC66; background: #D6FEB8; display: block; font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #333; } .fbscslisterror { list-style: none; padding: 5px 10px; margin: 3px 0; border: 1px solid #FF9999; background: #FFCCCC; display: block; font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #333; } </style> <div style="border: 1px solid #ccc; background: #FBFBFB; padding: 10px; text-align: left; margin: 10px 0;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="20%" valign="top" style="padding: 10px;"><a href="index.php?option=com_kunena"><img src="components/com_kunena/images/kunena.logo.png" alt="Kunena" border="0"></a></td> <td width="80%" valign="top" style="padding: 10px;"> <div style="clear: both; text-align: left; padding: 0 20px;"> <ul class="fbscs"> <?php // // We might want to make the file copy below part of the install as well // jimport('joomla.filesystem.folder'); $ret = JFolder::copy(JPATH_ROOT . DS . "components" . DS . "com_kunena" . DS . "kunena.files.distribution", JPATH_ROOT . DS . "images" . DS . "fbfiles", '', true); if ($ret !== true) { ?> <li class="fbscslisterror"> <div style="border: 1px solid #FF6666; background: #FFCC99; padding: 10px; text-align: left; margin: 10px 0;"> <img src='images/publish_x.png' align='absmiddle' /> Creation/permission setting of the following directories failed: <br /> <pre> <?php echo JPATH_ROOT; ?> /images/fbfiles/ <?php echo JPATH_ROOT; ?> /images/fbfiles/avatars <?php echo JPATH_ROOT; ?> /images/fbfiles/avatars/gallery (you have to put avatars inside if you want to use it) <?php echo JPATH_ROOT; ?> /images/fbfiles/category_images <?php echo JPATH_ROOT; ?> /images/fbfiles/files <?php echo JPATH_ROOT; ?> /images/fbfiles/images </pre> a) You can copy the contents of _kunena.files.distribution under components/com_kunena to your Joomla root, under images/ folder. <br /> b) If you already have the contents there, but Kunena installation was not able to make them writable, then please do it manually.</div> </li> <?php } ?> </ul> </div> <div style="border: 1px solid #FFCC99; background: #FFFFCC; padding: 20px; margin: 20px; clear: both;"> <strong>I N S T A L L : <font color="green">Successful</font> </strong> <br /> <br /> <strong>php version: <font color="green"><?php echo phpversion(); ?> </font> (Required >= <?php echo KUNENA_MIN_PHP; ?> )</strong> <br /> <strong>mysql version: <font color="green"><?php echo $mysqlversion; ?> </font> (Required > <?php echo KUNENA_MIN_MYSQL; ?> )</strong> </div> <?php } else { // Minimum version requirements not satisfied ?> <style> .fbscs { margin: 0; padding: 0; list-style: none; } .fbscslist { list-style: none; padding: 5px 10px; margin: 3px 0; border: 1px solid #66CC66; background: #D6FEB8; display: block; font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #333; } .fbscslisterror { list-style: none; padding: 5px 10px; margin: 3px 0; border: 1px solid #FF9999; background: #FFCCCC; display: block; font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #333; } </style> <div style="border: 1px solid #ccc; background: #FBFBFB; padding: 10px; text-align: left; margin: 10px 0;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="20%" valign="top" style="padding: 10px;"><a href="index.php?option=com_kunena"><img src="components/com_kunena/images/kunena.logo.png" alt="Kunena" border="0"></a></td> <td width="80%" valign="top" style="padding: 10px;"> <div style="border: 1px solid #FFCC99; background: #FFFFCC; padding: 20px; margin: 20px; clear: both;"> <strong>I N S T A L L : <font color="red">F A I L E D - Minimum Version Requirements not satisfied</font> </strong> <br /> <br /> <strong>php version: <font color="<?php echo version_compare(phpversion(), KUNENA_MIN_PHP, '>=') ? 'green' : 'red'; ?> "><?php echo phpversion(); ?> </font> (Required >= <?php echo KUNENA_MIN_PHP; ?> )</strong> <br /> <strong>mysql version: <font color="<?php echo version_compare($mysqlversion, KUNENA_MIN_MYSQL, '>') ? 'green' : 'red'; ?> "><?php echo $mysqlversion; ?> </font> (Required > <?php echo KUNENA_MIN_MYSQL; ?> )</strong> </div> <?php } // Rest of footer ?> <div style="border: 1px solid #99CCFF; background: #D9D9FF; padding: 20px; margin: 20px; clear: both;"> <strong>Thank you for using Kunena!</strong> <br /> Kunena Forum Component <em>for Joomla! </em> © by <a href="http://www.Kunena.com" target="_blank">www.Kunena.com</a>. All rights reserved.</div> </td> </tr> </table> </div> <?php }