Changeset 282 for trunk/index.php


Ignore:
Timestamp:
Sep 4, 2009, 1:27:18 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Změna formátu stránek na XHTML 1.1 a oprava validace některých stránek.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r168 r282  
    22
    33include('includes/global.php');
    4 include('rss.php');
    54 
    65function ShowNews()
     
    2928}
    3029
    31 if(array_key_exists('rss', $_GET))
     30function ShowRSSChannel()
    3231{
     32  global $Database, $Config;
     33 
    3334  $Items = array(); 
    3435  if($_GET['rss'] == 'news')
     
    3839    {
    3940      $Items[] = array
    40           (
     41    (
    4142        'Title' => $DbRow['user'].'('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')',
    4243        'Link' =>  $Config['Web']['BaseURL'],
     
    4445        'Time' => $DbRow['UNIX_TIMESTAMP(news.Time)'],
    4546      );
    46     }   
     47    } 
    4748    echo(GenerateRSS(array
    4849    (
     
    6061    {
    6162      $Items[] = array
    62           (
     63    (
    6364        'Title' => strip_tags($DbRow['text'].' ('.$DbRow['user'].')'),
    6465        'Link' =>  $Config['Web']['BaseURL'],
     
    6667        'Time' => $DbRow['UNIX_TIMESTAMP(date)'],
    6768      );
    68     }   
     69    } 
    6970    echo(GenerateRSS(array
    7071    (
     
    7879  if($_GET['rss'] == 'shoutbox')
    7980  {
    80         $TitleLength = 50;
    81         mb_internal_encoding('utf-8');
     81  $TitleLength = 50;
     82  mb_internal_encoding('utf-8');
    8283    $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(date), user, text FROM shoutbox ORDER BY ID DESC LIMIT 20');
    8384    while($DbRow = mysql_fetch_assoc($DbResult))
    8485    {
    85           $Title = mb_substr($DbRow['text'], 0, $TitleLength);
    86           if(mb_strlen($Title) == $TitleLength) $Title .= '...';
     86    $Title = mb_substr($DbRow['text'], 0, $TitleLength);
     87    if(mb_strlen($Title) == $TitleLength) $Title .= '...';
    8788      $Items[] = array
    88           (
     89    (
    8990        'Title' => $DbRow['user'].': '.$Title,
    9091        'Link' =>  $Config['Web']['BaseURL'],
     
    9293        'Time' => $DbRow['UNIX_TIMESTAMP(date)'],
    9394      );
    94     }   
     95    } 
    9596    echo(GenerateRSS(array
    9697    (
     
    102103    )));
    103104  }
     105}
     106
     107if(array_key_exists('rss', $_GET))
     108{
     109  ShowRSSChannel();
    104110} else
    105111{
Note: See TracChangeset for help on using the changeset viewer.