Ignore:
Timestamp:
Apr 27, 2009, 8:00:50 AM (16 years ago)
Author:
george
Message:
  • Upraveno: Názvy tabulek a sloupců aktualit pozměněny na názvy se slovy začínající velkými písmeny.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/aktuality/rss.php

    r187 r196  
    11<?php
    22
    3 Header("Content-Type: text/xml");
     3Header('Content-Type: text/xml');
    44
    55include_once('../global.php');
     
    2828// Get category names
    2929$Categories = array();
    30 $DbResult = $Database->select('news_category', '*');
     30$DbResult = $Database->select('NewsCategory', '*');
    3131while($Category = $DbResult->fetch_array())
    3232{
    33   $Categories[$Category['id']] = $Category['caption'];
     33  $Categories[$Category['Id']] = $Category['Caption'];
    3434}
    3535
     
    6161  $Database->select_db('forum');
    6262}
     63$Database->select_db('is');
    6364*/
    64 $Database->select_db('is');
    6565
    6666// Get news from database by selected categories
    6767$UploadedFilesFolder = 'uploads/';
    68 $DbResult = $Database->query('SELECT enclosure,category,title,content,UNIX_TIMESTAMP(date),author FROM news WHERE '.$Where.' ORDER BY date DESC LIMIT 0,'.$NewsCount);
    69 while($Row = $DbResult->fetch_array())
     68$DbResult = $Database->query('SELECT *, UNIX_TIMESTAMP(Date) FROM News LEFT JOIN `User` ON `User`.`Id`=`News`.`User` WHERE '.$Where.' ORDER BY News.Date DESC LIMIT 0,'.$NewsCount);
     69while($Row = $DbResult->fetch_assoc())
    7070{
    7171  $EnclosuresText = '';
    72   if($Row['enclosure'] != '')
     72  if($Row['Enclosure'] != '')
    7373  {
    7474    $EnclosuresText .= '<br />Přílohy: ';
    75     $Enclosures = explode(';', $Row['enclosure']);
     75    $Enclosures = explode(';', $Row['Enclosure']);
    7676    foreach($Enclosures as $Enclosure)
    7777    {
     
    7979    }
    8080  }
     81  if($Row['Name'] == '') $Author = $Row['Author'];
     82    else $Author = $Row['Name'];
    8183  $Items[] = array(
    82     'Title' => $Categories[$Row['category']].' - '.$Row['title'],
    83     'Link' => 'http://centrala.zdechov.net/aktuality/index.php?category='.$Row['category'],
    84     'Description' => $Row['content']." (".$Row['author'].")".$EnclosuresText,
    85     'Time' => $Row['UNIX_TIMESTAMP(date)'],
     84    'Title' => $Categories[$Row['Category']].' - '.$Row['Title'],
     85    'Link' => 'http://centrala.zdechov.net/aktuality/index.php?category='.$Row['Category'],
     86    'Description' => $Row['Content'].' ('.$Author.')'.$EnclosuresText,
     87    'Time' => $Row['UNIX_TIMESTAMP(Date)'],
    8688  );
    8789}
     
    9395  'WebmasterEmail' => $Config['Web']['AdminEmail'],
    9496  'Items' => $Items)));
     97 
    9598?>
Note: See TracChangeset for help on using the changeset viewer.