Changeset 146 for trunk


Ignore:
Timestamp:
Mar 5, 2009, 7:10:25 AM (16 years ago)
Author:
george
Message:
  • Přidáno: RSS kanál shoutboxu.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/export/download_console.php

    r117 r146  
    88$_SERVER['REMOTE_ADDR'] = '';
    99
    10 include('download.php');
     10include('index.php');
    1111
    1212?>
  • trunk/index.php

    r145 r146  
    7575      'Items' => $Items,
    7676    )));
    77   }
     77  } else
     78  if($_GET['rss'] == 'shoutbox')
     79  {
     80        $TitleLength = 50;
     81        mb_internal_encoding('utf-8');
     82    $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(date), user, text FROM shoutbox ORDER BY ID DESC LIMIT 20');
     83    while($DbRow = mysql_fetch_assoc($DbResult))
     84    {
     85          $Title = mb_substr($DbRow['text'], 0, $TitleLength);
     86          if(mb_strlen($Title) == $TitleLength) $Title .= '...';
     87      $Items[] = array
     88          (
     89        'Title' => $DbRow['user'].': '.$Title,
     90        'Link' =>  $Config['Web']['BaseURL'],
     91        'Description' => $DbRow['text'],
     92        'Time' => $DbRow['UNIX_TIMESTAMP(date)'],
     93      );
     94    }   
     95    echo(GenerateRSS(array
     96    (
     97      'Title' => 'WoW překlad - Shoutbox',
     98      'Link' => $Config['Web']['BaseURL'],
     99      'Description' => 'Překlad textů WoW',
     100      'WebmasterEmail' => $Config['Web']['AdminEmail'],
     101      'Items' => $Items,
     102    )));
     103  }
    78104} else
    79105{
     
    81107    array('Title' => 'Změny systému', 'URL' => '?rss=news'),
    82108    array('Title' => 'Poslední překlady', 'URL' => '?rss=translation'),
     109    array('Title' => 'Shoutbox', 'URL' => '?rss=shoutbox'),
    83110  );
    84111  ShowPage();
Note: See TracChangeset for help on using the changeset viewer.