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/ImportZdechovCzNews.php

    r827 r873  
    1616$Author = 'Automat';
    1717$Content = @file_get_contents($SourceURL);
    18 while(strpos($Content, $StartText) !== false)
     18while (strpos($Content, $StartText) !== false)
    1919{
    2020  $Content = substr($Content, strpos($Content, $StartText) + strlen($StartText));
     
    2525  $Content = substr($Content, strpos($Content, $StartLink) + strlen($StartLink));
    2626  $Link = substr($Content, 0, strpos($Content, '"'));
    27   if(substr($Link, 0, 7) != 'http://') $Link = 'http://www.zdechov.cz/'.$Link;
     27  if (substr($Link, 0, 7) != 'http://') $Link = 'http://www.zdechov.cz/'.$Link;
    2828  $Content = substr($Content, strpos($Content, $StartTitle) + strlen($StartTitle));
    2929  $Title = substr($Content, 0, strpos($Content, '<'));
     
    4040  $DbResult = $System->Database->select('News', 'Id', '`Title`="'.$System->Database->real_escape_string($Title).'" AND `Date`="'.$Date.'" AND `Category`='.$Category);
    4141  //echo($System->Database->LastQuery);
    42   if($DbResult->num_rows == 0)
     42  if ($DbResult->num_rows == 0)
    4343  {
    4444    $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.