Changeset 51


Ignore:
Timestamp:
Jan 2, 2020, 12:34:24 AM (4 years ago)
Author:
chronos
Message:
  • Added: New section Events to import dance events from various dance clubs and dance schools.
Location:
trunk
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SQL/Structure.sql

    r50 r51  
    4444  PRIMARY KEY (`Id`)
    4545) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
     46
     47-- Export dat nebyl vybrán.
     48
     49-- Exportování struktury pro tabulka tanec.Event
     50CREATE TABLE IF NOT EXISTS `Event` (
     51  `Id` int(11) NOT NULL AUTO_INCREMENT,
     52  `TimeFrom` datetime DEFAULT NULL,
     53  `TimeTo` datetime DEFAULT NULL,
     54  `Source` int(11) DEFAULT NULL,
     55  `Link` varchar(255) DEFAULT NULL,
     56  `Hidden` int(11) DEFAULT 0,
     57  `Description` text DEFAULT NULL,
     58  `Title` varchar(255) DEFAULT NULL,
     59  `Price` int(11) DEFAULT NULL,
     60  `Location` varchar(255) DEFAULT NULL,
     61  `TimeImport` datetime DEFAULT NULL,
     62  `RemoteId` varchar(255) DEFAULT NULL,
     63  PRIMARY KEY (`Id`),
     64  KEY `Source` (`Source`)
     65) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4;
     66
     67-- Export dat nebyl vybrán.
     68
     69-- Exportování struktury pro tabulka tanec.EventSource
     70CREATE TABLE IF NOT EXISTS `EventSource` (
     71  `Id` int(11) NOT NULL AUTO_INCREMENT,
     72  `Name` varchar(255) DEFAULT NULL,
     73  `Method` varchar(255) DEFAULT NULL,
     74  `URL` varchar(255) DEFAULT NULL,
     75  PRIMARY KEY (`Id`)
     76) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
    4677
    4778-- Export dat nebyl vybrán.
  • trunk/SQL/Update.php

    r48 r51  
    5656ALTER TABLE `MeetItem`
    5757  ADD COLUMN `Hidden` INT NULL DEFAULT '0' AFTER `RemoteId`;
     58
     59-- rev 51
     60CREATE TABLE IF NOT EXISTS `Event` (
     61  `Id` int(11) NOT NULL AUTO_INCREMENT,
     62  `TimeFrom` datetime DEFAULT NULL,
     63  `TimeTo` datetime DEFAULT NULL,
     64  `Source` int(11) DEFAULT NULL,
     65  `Link` varchar(255) DEFAULT NULL,
     66  `Hidden` int(11) DEFAULT 0,
     67  `Description` text DEFAULT NULL,
     68  `Title` varchar(255) DEFAULT NULL,
     69  `Price` int(11) DEFAULT NULL,
     70  `Location` varchar(255) DEFAULT NULL,
     71  `TimeImport` datetime DEFAULT NULL,
     72  `RemoteId` varchar(255) DEFAULT NULL,
     73  PRIMARY KEY (`Id`),
     74  KEY `Source` (`Source`)
     75) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4;
     76
     77CREATE TABLE IF NOT EXISTS `EventSource` (
     78  `Id` int(11) NOT NULL AUTO_INCREMENT,
     79  `Name` varchar(255) DEFAULT NULL,
     80  `Method` varchar(255) DEFAULT NULL,
     81  `URL` varchar(255) DEFAULT NULL,
     82  PRIMARY KEY (`Id`)
     83) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
  • trunk/index.php

    r48 r51  
    1313require_once('Modules/School/School.php');
    1414require_once('Modules/Club/Club.php');
     15require_once('Modules/Event/Event.php');
     16require_once('Modules/Event/EventPage.php');
    1517
    1618if(isset($_SERVER['REMOTE_ADDR'])) session_start();
     
    220222      '/tance/',
    221223      '/filmy/',
     224      '/udalosti/',
    222225    );
    223226    $Result = '<?xml version="1.0" encoding="UTF-8"?>'."\n".
     
    230233        '</url>'."\n";
    231234    }
    232     // MeetItems
     235
     236    // Meets
    233237    $DbResult = $this->Database->query('SELECT `Id`,`Time` FROM `MeetItem` WHERE (`Hidden`=0)');
    234238    while ($DbRow = $DbResult->fetch_array())
     
    236240      $Url = '/seznamka/inzerat/'.$DbRow['Id'];
    237241      $Time = MysqlDateTimeToTime($DbRow['Time']);
     242      $Result .= '<url>'."\n".
     243        '  <loc>'.$this->System->AbsoluteLink($Url).'</loc>'."\n".
     244        '  <lastmod>'.date('c', $Time).'</lastmod>'."\n".
     245        '</url>'."\n";
     246    }
     247
     248    // Events
     249    $DbResult = $this->Database->query('SELECT `Id`,`TimeFrom` FROM `Event` WHERE (`Hidden`=0)');
     250    while ($DbRow = $DbResult->fetch_array())
     251    {
     252      $Url = '/udalosti/udalost/'.$DbRow['Id'];
     253      $Time = MysqlDateTimeToTime($DbRow['TimeFrom']);
    238254      $Result .= '<url>'."\n".
    239255        '  <loc>'.$this->System->AbsoluteLink($Url).'</loc>'."\n".
     
    293309}
    294310
    295 $Revision = 48; // Subversion revision
    296 $DatabaseRevision = 48; // SQL structure revision
    297 $ReleaseTime = strtotime('2019-12-22');
     311$Revision = 51; // Subversion revision
     312$DatabaseRevision = 51; // SQL structure revision
     313$ReleaseTime = strtotime('2020-01-01');
    298314
    299315$Application = new ApplicationTanec();
Note: See TracChangeset for help on using the changeset viewer.