Changeset 282 for trunk/index.php
- Timestamp:
- Sep 4, 2009, 1:27:18 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/index.php
r168 r282 2 2 3 3 include('includes/global.php'); 4 include('rss.php');5 4 6 5 function ShowNews() … … 29 28 } 30 29 31 if(array_key_exists('rss', $_GET))30 function ShowRSSChannel() 32 31 { 32 global $Database, $Config; 33 33 34 $Items = array(); 34 35 if($_GET['rss'] == 'news') … … 38 39 { 39 40 $Items[] = array 40 41 ( 41 42 'Title' => $DbRow['user'].'('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')', 42 43 'Link' => $Config['Web']['BaseURL'], … … 44 45 'Time' => $DbRow['UNIX_TIMESTAMP(news.Time)'], 45 46 ); 46 } 47 } 47 48 echo(GenerateRSS(array 48 49 ( … … 60 61 { 61 62 $Items[] = array 62 63 ( 63 64 'Title' => strip_tags($DbRow['text'].' ('.$DbRow['user'].')'), 64 65 'Link' => $Config['Web']['BaseURL'], … … 66 67 'Time' => $DbRow['UNIX_TIMESTAMP(date)'], 67 68 ); 68 } 69 } 69 70 echo(GenerateRSS(array 70 71 ( … … 78 79 if($_GET['rss'] == 'shoutbox') 79 80 { 80 81 81 $TitleLength = 50; 82 mb_internal_encoding('utf-8'); 82 83 $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(date), user, text FROM shoutbox ORDER BY ID DESC LIMIT 20'); 83 84 while($DbRow = mysql_fetch_assoc($DbResult)) 84 85 { 85 86 86 $Title = mb_substr($DbRow['text'], 0, $TitleLength); 87 if(mb_strlen($Title) == $TitleLength) $Title .= '...'; 87 88 $Items[] = array 88 89 ( 89 90 'Title' => $DbRow['user'].': '.$Title, 90 91 'Link' => $Config['Web']['BaseURL'], … … 92 93 'Time' => $DbRow['UNIX_TIMESTAMP(date)'], 93 94 ); 94 } 95 } 95 96 echo(GenerateRSS(array 96 97 ( … … 102 103 ))); 103 104 } 105 } 106 107 if(array_key_exists('rss', $_GET)) 108 { 109 ShowRSSChannel(); 104 110 } else 105 111 {
Note:
See TracChangeset
for help on using the changeset viewer.