Changeset 555


Ignore:
Timestamp:
Mar 29, 2009, 4:21:14 PM (16 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ů.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/html.php

    r551 r555  
    1212    $this->html_cfg = array
    1313    (
    14       "charset" => "utf-8",
     14/*      "charset" => "utf-8",
    1515      "author" => "Zork",
    1616      "copyright" => "(C) 2008 Heroes of Fantasy, All rights reserved.",
     
    1919      "description" => "Heroes of Fantasy free WoW server běžící na programu MaNGOS",
    2020      "keywords" => "wowserver, world of warcraft, free, wow, server, hof, heroes of fantasy, zdechov, mangos"
    21     );
     21*/    );
    2222
    2323    if((count($values) > 1) or ($values[0] != 0) and ($values[0] != 0))
     
    6363    '<link href="inc/teamspeakdisplay/teamspeakdisplay.css" rel="stylesheet" type="text/css" />'.
    6464    '<link rel="alternate" title="Články" href="rss.php?category=articles" type="application/rss+xml" />'.
     65    '<link rel="alternate" title="Finanční přispěvky" href="rss.php?category=finance" type="application/rss+xml" />'.
    6566    '<script type="text/javascript" src="styles/global.js"></script>'.
    6667    '<!--[if IE]><link rel="stylesheet" type="text/css" href="styles/ie.css" /><![endif]-->'.
  • 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
  • trunk/sql/structure.sql

    r530 r555  
    8383  `date` timestamp NOT NULL default '0000-00-00 00:00:00' on update CURRENT_TIMESTAMP,
    8484  PRIMARY KEY  (`id`)
    85 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=115 ;
     85) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=117 ;
    8686
    8787-- --------------------------------------------------------
     
    117117  `ip` varchar(16) collate utf8_czech_ci NOT NULL,
    118118  PRIMARY KEY  (`id`)
    119 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=63 ;
     119) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=91 ;
    120120
    121121-- --------------------------------------------------------
     
    132132  PRIMARY KEY  (`id`)
    133133) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
     134
     135-- --------------------------------------------------------
     136
     137--
     138-- Struktura tabulky `debug`
     139--
     140
     141CREATE TABLE IF NOT EXISTS `debug` (
     142  `Id` int(11) NOT NULL auto_increment,
     143  `Time` datetime NOT NULL,
     144  `Backtrace` mediumtext collate latin2_czech_cs NOT NULL,
     145  `Log` text collate latin2_czech_cs NOT NULL,
     146  `MangosVersion` varchar(255) collate latin2_czech_cs NOT NULL,
     147  `DbVersion` varchar(255) collate latin2_czech_cs NOT NULL,
     148  `MaxPlayerCount` int(11) NOT NULL,
     149  `Uptime` int(11) NOT NULL,
     150  `ErrorLog` text collate latin2_czech_cs NOT NULL,
     151  `DbErrors` text collate latin2_czech_cs NOT NULL,
     152  `Configuration` text collate latin2_czech_cs NOT NULL,
     153  PRIMARY KEY  (`Id`)
     154) ENGINE=MyISAM DEFAULT CHARSET=latin2 COLLATE=latin2_czech_cs AUTO_INCREMENT=1 ;
    134155
    135156-- --------------------------------------------------------
     
    147168  `ip` varchar(16) collate utf8_czech_ci NOT NULL,
    148169  PRIMARY KEY  (`id`)
    149 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=18 ;
     170) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=41 ;
    150171
    151172-- --------------------------------------------------------
     
    174195  `odmena` varchar(255) character set utf8 collate utf8_czech_ci NOT NULL,
    175196  KEY `ID` (`id`)
    176 ) ENGINE=MyISAM  DEFAULT CHARSET=latin2 COLLATE=latin2_czech_cs AUTO_INCREMENT=127 ;
     197) ENGINE=MyISAM  DEFAULT CHARSET=latin2 COLLATE=latin2_czech_cs AUTO_INCREMENT=128 ;
    177198
    178199-- --------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.