Changeset 873 for trunk/Modules/News/ImportKinoVatra.php
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/Modules/News/ImportKinoVatra.php ¶
r790 r873 16 16 $doc = new DOMDocument(); 17 17 $doc->load($SourceURL); 18 foreach ($doc->getElementsByTagName('item') as $node)18 foreach ($doc->getElementsByTagName('item') as $node) 19 19 { 20 20 $Title = $node->getElementsByTagName('title')->item(0)->nodeValue; … … 26 26 $Description = str_replace("\r", '', $Description); 27 27 $Description = str_replace("\n", '<br>', $Description); 28 //if (($CommaPos = strpos($Date, ',')) !== FALSE)28 //if (($CommaPos = strpos($Date, ',')) !== FALSE) 29 29 // $Date = substr($Date, $CommaPos + 1); 30 30 $Date = TimeToMysqlDateTime(strtotime($Date)); … … 32 32 $Query = 'SELECT Id FROM News WHERE (`Title`="'.$System->Database->real_escape_string($Title).'") AND (`Category`='.$Category.') AND (`Content` = "'.$System->Database->real_escape_string($Description).'") AND (`Link` = "'.$System->Database->real_escape_string($Link).'")'; 33 33 $DbResult = $System->Database->query($Query); 34 if ($DbResult->num_rows == 0)34 if ($DbResult->num_rows == 0) 35 35 { 36 36 $System->Database->insert('News', array('Title' => $Title, 'Date' => $Date, 'Author' => $Author, 'Category' => $Category, 'Content' => $Description, 'Link' => $Link));
Note:
See TracChangeset
for help on using the changeset viewer.