Ignore:
Timestamp:
Apr 6, 2020, 11:17:40 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Improved code format.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/News/ImportKinoVatra.php

    r790 r873  
    1616$doc = new DOMDocument();
    1717$doc->load($SourceURL);
    18 foreach($doc->getElementsByTagName('item') as $node)
     18foreach ($doc->getElementsByTagName('item') as $node)
    1919{
    2020  $Title = $node->getElementsByTagName('title')->item(0)->nodeValue;
     
    2626  $Description = str_replace("\r", '', $Description);
    2727  $Description = str_replace("\n", '<br>', $Description);
    28   //if(($CommaPos = strpos($Date, ',')) !== FALSE)
     28  //if (($CommaPos = strpos($Date, ',')) !== FALSE)
    2929  //  $Date = substr($Date, $CommaPos + 1);
    3030  $Date = TimeToMysqlDateTime(strtotime($Date));
     
    3232  $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).'")';
    3333  $DbResult = $System->Database->query($Query);
    34   if($DbResult->num_rows == 0)
     34  if ($DbResult->num_rows == 0)
    3535  {
    3636    $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.