Ignore:
Timestamp:
Sep 12, 2013, 9:14:38 PM (11 years ago)
Author:
chronos
Message:
  • Modified: RSS channel management is now part of News module. In this module other modules can register their RSS channel which will be availble on all pages for subscription.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Translation/Translation.php

    r561 r581  
    1616    $this->License = 'GNU/GPL';
    1717    $this->Description = 'Translation of text items and groups from original language to other languages.';
    18     $this->Dependencies = array();
     18    $this->Dependencies = array('News');
    1919  }
    2020 
     
    2525        $this->System->RegisterPage('save.php', 'PageTranslationSave');
    2626    $this->System->RegisterPage('TranslationList.php', 'PageTranslationList');
    27     $this->System->RegisterRSS(array('Title' => 'Poslední překlady', 'Channel' => 'translation'));
     27    $this->System->ModuleManager->Modules['News']->RegisterRSS(array('Title' => 'Poslední překlady',
     28      'Channel' => 'translation', 'Callback' => array($this, 'ShowRSS'), 'Permission' => LICENCE_ANONYMOUS));
     29  }
     30 
     31  function ShowRSS()
     32  {
     33    $DbResult = $this->Database->query('SELECT UNIX_TIMESTAMP(`Date`) AS `Date`, `User`.`Name` AS `UserName`, `Text` FROM `Log` JOIN `User` ON `User`.`ID` = `Log`.`User` WHERE `Type` = 1 ORDER BY `Date` DESC LIMIT 100');
     34    while($DbRow = $DbResult->fetch_assoc())
     35    {
     36      $Items[] = array
     37      (
     38          'Title' => strip_tags($DbRow['Text'].' ('.$DbRow['UserName'].')'),
     39          'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'),
     40          'Description' => $DbRow['Text'],
     41          'Time' => $DbRow['Date'],
     42      );
     43    }
     44    $Output = GenerateRSS(array
     45        (
     46            'Title' => 'WoW překlad - Poslední překlady',
     47            'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'),
     48            'Description' => 'Překlad textů WoW',
     49            'WebmasterEmail' => $this->System->Config['Web']['AdminEmail'],
     50            'Items' => $Items,
     51                ));
     52    return($Output);
    2853  }
    2954}
Note: See TracChangeset for help on using the changeset viewer.