Changeset 938 for trunk/Modules


Ignore:
Timestamp:
Jul 30, 2022, 12:10:48 AM (2 years ago)
Author:
chronos
Message:
  • Fixed: Not working news import due to PHP SSL bug.
  • Added: News import from zdechov.net site.
Location:
trunk/Modules/News
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/News/Import/Vismo.php

    r887 r938  
    33class NewsSourceVismo extends NewsSource
    44{
     5
    56  function Import(): string
    67  {
    78    $Output = parent::Import();
    8     $Content = file_get_contents($this->URL);
     9    $Content = file_get_contents_curl($this->URL);
    910
    1011    $BlockStart = '<h2 class="cvi text-to-speech">Přehled dokumentů</h2>';
     
    2627      $NewsItem->Link = GetUrlBase($this->URL).html_entity_decode(GetTextBetween($Item, '<a href="', '">'));
    2728      $NewsItem->Title = html_entity_decode(GetTextBetween($Item, '', '</a>'));
    28       $NewsItem->Date = GetTextBetween($Item, '<span>(', ')</span>');
    29       $NewsItem->Date = HumanDateToTime($NewsItem->Date);
     29      $Date = GetTextBetween($Item, '<span>(', ')</span>');
     30      $NewsItem->Date = HumanDateToTime($Date);
    3031      $NewsItem->Category = $this->Category;
    3132      if (strpos($Item, '<div>') !== false)
  • trunk/Modules/News/News.php

    r908 r938  
    44include_once(dirname(__FILE__).'/NewsSource.php');
    55include_once(dirname(__FILE__).'/Import/Vismo.php');
     6include_once(dirname(__FILE__).'/Import/ZdechovNET.php');
    67
    78function CategoryItemCompare($Item1, $Item2)
  • trunk/Modules/News/NewsSource.php

    r887 r938  
    7575      $Method = $DbRow['Method'];
    7676      if ($Method == 'vismo') $Source = new NewsSourceVismo();
     77      else if ($Method == 'zdechovnet') $Source = new NewsSourceZdechovNET();
    7778      else {
    7879        $Output .= 'Unsupported parse method: '.$Method.'<br/>';
Note: See TracChangeset for help on using the changeset viewer.