$strings = $props['strings']; $praefix = 'COM_JOOMLEAGUE_ST_'; foreach ($strings as $key => $value) { // Add all Sport-types e.g. Soccer to #__joomleague_sports_type $pos = strpos($key, $praefix); if ($pos !== false) { $name = strtolower(substr($key, strlen($praefix))); $tblSportsType = JTable::getInstance("SportsType", "Table"); //fix for existing items $tblSportsType->load(array("name" => $key)); $tblSportsType->name = $key; $tblSportsType->icon = JPATH::clean('images/com_joomleague/database/sport_types/' . $name . '.png'); if (!$tblSportsType->store()) { //echo($tblSportsType->getError()); $status = 2; } JFolder::create(JPATH::clean(JPATH_ROOT . '/images/com_joomleague/database/events/' . $name)); } } return $status; } //_checkVersionTable(); $versionData = getVersion(); $major = $versionData->major; $minor = $versionData->minor; $build = $versionData->build; $revision = $versionData->revision; $version = sprintf('v%1$s.%2$s.%3$s.%4$s', $major, $minor, $build, $revision); echo PrintStepResult(addGhostPlayer()); echo PrintStepResult(addSportsType()); echo PrintStepResult(updateVersion($versionData));
echo '<span style="color:green">'; echo JText::sprintf('It would be better to update your JoomLeague installation to v0.93 before you update to JoomLeague %1$s!', '<b>' . $version . '</b>'); echo '</span><br /><br />'; echo '<span style="color:red">' . JText::_('COM_JOOMLEAGUE_DB_UPDATE_DANGER') . '</span><br /><br />'; echo '<span style="color:red">' . JText::_('This script also DELETES the content of some JoomLeague v1.5 related tables inside your database without warning to update them by using the data of the JoomLeague 0.93b tables!!!') . '</span><br />'; echo '<span style="color:red">' . JText::_('PLEASE use this script ONLY IF you REALLY know what you do!!!') . '</span><br />'; } } if (getUpdatePart() == 2) { echo HandleVersion(); echo '<hr>'; echo HandlePositionEventtype(); echo '<hr>'; echo HandleTemplateConfig(); echo '<hr>'; echo addSportsType(); echo '<hr>'; echo TruncateTablesForDevelopment(); echo '<hr>'; echo Update_Tables($updates, 'joomleague_project'); echo Update_Tables($updates, 'joomleague_person'); echo Update_Tables($updates, 'joomleague_playground'); echo Update_Tables($updates, 'joomleague_club'); echo Update_Tables($updates, 'joomleague_league'); echo Update_Tables($updates, 'joomleague_season'); echo Update_Tables($updates, 'joomleague_project_team'); echo Update_Tables($updates, 'joomleague_team'); echo Update_Tables($updates, 'joomleague_division'); echo Update_Tables($updates, 'joomleague_team_player'); echo Update_Tables($updates, 'joomleague_team_staff'); echo Update_Tables($updates, 'joomleague_position');
$db->setQuery($query); $result = $db->execute(); } } foreach ($RefereePositions as $rkey => $rid) { foreach ($events_referees as $erkey => $erid) { $query = build_InsertQuery_PositionEventType($rid, $erid); $db->setQuery($query); $result = $db->execute(); } } foreach ($ClubStaffPositions as $cskey => $csid) { foreach ($events_clubstaff as $ecskey => $escid) { $query = build_InsertQuery_PositionEventType($csid, $escid); $db->setQuery($query); $result = $db->execute(); } } echo PrintStepResult($result) . '<br />'; if (!$result) { echo JText::_('DO NOT WORRY... Surely at least one of the position related events was already existing in your database!!!') . '<br />'; } return ''; } ?> <hr> <?php $output = JText::sprintf('JoomLeague v%1$s - Update filedate/time: %2$s / %3$s %4$s', $version, $updateFileDate, $updateFileTime, '<br />' . $updateDescription . '<br />'); JToolBarHelper::title($output); echo addSportsType() . '<br />'; echo addStandardsForSoccer() . '<br />';