Changeset 873 for trunk/Modules/News/ImportZdechovCzNews.php
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/News/ImportZdechovCzNews.php
r827 r873 16 16 $Author = 'Automat'; 17 17 $Content = @file_get_contents($SourceURL); 18 while (strpos($Content, $StartText) !== false)18 while (strpos($Content, $StartText) !== false) 19 19 { 20 20 $Content = substr($Content, strpos($Content, $StartText) + strlen($StartText)); … … 25 25 $Content = substr($Content, strpos($Content, $StartLink) + strlen($StartLink)); 26 26 $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; 28 28 $Content = substr($Content, strpos($Content, $StartTitle) + strlen($StartTitle)); 29 29 $Title = substr($Content, 0, strpos($Content, '<')); … … 40 40 $DbResult = $System->Database->select('News', 'Id', '`Title`="'.$System->Database->real_escape_string($Title).'" AND `Date`="'.$Date.'" AND `Category`='.$Category); 41 41 //echo($System->Database->LastQuery); 42 if ($DbResult->num_rows == 0)42 if ($DbResult->num_rows == 0) 43 43 { 44 44 $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.