Changeset 555 for trunk/rss.php


Ignore:
Timestamp:
Mar 29, 2009, 4:21:14 PM (15 years ago)
Author:
george
Message:
  • Přidáno: Mimo RSS kanál článků přidány kanály ticketů a finančních příspěvků.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/rss.php

    r551 r555  
    99$Items = array();
    1010
    11 $DbResult = $db->query('SELECT UNIX_TIMESTAMP(date), articles.* FROM articles ORDER BY date DESC LIMIT '.$NewsCount);
    12 while($Row = $DbResult->fetch_array())
     11if(array_key_exists('category', $_GET))
    1312{
    14   $Items[] = array(
    15     'Title' => $Row['title'],
    16     'Link' => 'http://'.$_SERVER['SERVER_NAME'].$Config['Web']['BaseURL'],
    17     'Description' => $Row['text']." (".$Row['autor'].")",
    18     'Time' => $Row['UNIX_TIMESTAMP(date)'],
    19   );
     13  if($_GET['category'] == 'articles')
     14  {
     15    $Config['Web']['Title'] .= ' - články';
     16    $DbResult = $db->query('SELECT UNIX_TIMESTAMP(date), articles.* FROM articles ORDER BY date DESC LIMIT '.$NewsCount);
     17    while($Row = $DbResult->fetch_array())
     18    {
     19      $Items[] = array(
     20        'Title' => $Row['title'],
     21        'Link' => 'http://'.$_SERVER['SERVER_NAME'].$Config['Web']['BaseURL'],
     22        'Description' => $Row['text']." (".$Row['autor'].")",
     23        'Time' => $Row['UNIX_TIMESTAMP(date)'],
     24      );
     25    }
     26  } else
     27  if($_GET['category'] == 'tickets')
     28  {
     29    $Config['Web']['Title'] .= ' - žádosti hráčů';
     30    $db->select_db($Config['Mangos']['DatabaseCharacters']);
     31    $DbResult = $db->query("SELECT `character_ticket`.`ticket_text` AS `text`, `characters`.`name` AS `name` FROM `character_ticket` JOIN `characters` ON `characters`.`guid` = `character_ticket`.`guid`");
     32    while($Row = $DbResult->fetch_array())
     33    {
     34      $Items[] = array(
     35        'Title' => $Row['name'].': '.$Row['text'],
     36        'Link' => '',
     37        'Description' => $Row['name'].': '.$Row['text'],
     38        'Time' => 0,
     39      );
     40    }
     41  }
     42  if($_GET['category'] == 'finance')
     43  {
     44    $Config['Web']['Title'] .= ' - finanční příspěvky';
     45    $DbResult = $db->query('SELECT UNIX_TIMESTAMP(time), operation, description, money FROM finance ORDER BY time DESC LIMIT '.$NewsCount);
     46    while($Row = $DbResult->fetch_array())
     47    {
     48      $Items[] = array
     49      (
     50        'Title' => $OperationType[$Row['operation']].' '.$Row['description'].' ('.$Row['money'].' Kč)',
     51        'Link' => 'http://'.$_SERVER['SERVER_NAME'].$Config['Web']['BaseURL'].'finance/',
     52        'Description' => $OperationType[$Row['operation']].' '.$Row['description']."<br>".$Row['money']." Kč",
     53        'Time' => $Row['UNIX_TIMESTAMP(time)'],
     54      );
     55    }   
     56  }
    2057}
    2158
Note: See TracChangeset for help on using the changeset viewer.