Changeset 551 for trunk/rss.php
- Timestamp:
- Mar 29, 2009, 2:10:27 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/rss.php
r477 r551 1 <?php2 header('Content-Type: text/xml; charset=utf-8');3 header('Expires: ' . date('D, d M Y H:i:s') . ' GMT');4 header('Last-Modified: ' .date('D, d M Y H:i:s') . ' GMT');5 6 7 include_once("./inc/db.php");8 9 ?>10 <<?php ?>?xml version="1.0" encoding="UTF-8"?>11 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">12 <channel>13 <title>HoF Ticket RSS</title>14 <link>http://wow.zdechov.net/</link>15 <description>HoF Ticket RSS</description>16 <language>cs</language>17 <lastBuildDate><?php echo date("j/m/Y H:i:s").""; ?></lastBuildDate>18 <atom:link href="http://www.samuraj-cz.com/rss/" rel="self" type="application/rss+xml" />19 20 1 <?php 21 2 22 mysql_connect("$db_server", "$db_user", "$db_pass"); 23 mysql_select_db($db_characters); 24 mysql_query("SET NAMES 'utf8'"); 25 $result = mysql_query("SELECT * FROM character_ticket ORDER BY ticket_lastchange DESC, ticket_id DESC LIMIT 20 "); 26 while($rec = mysql_fetch_array($result)) { 27 $guid = $rec["guid"]; 28 $time = $rec["ticket_lastchange"]; 29 $human_date = date("d.m.Y H:i", strtotime($time)); 30 $result2 = mysql_query("SELECT name FROM characters where guid='$guid' "); 31 while($rec2 = mysql_fetch_array($result2)) { 32 $name = $rec2["name"]; 33 } 34 ?> 35 <item> 36 37 <title><?php echo "<br><b>$name</b></br>"; ?> sss</title> 38 <pubDate><?php echo"$human_date";?></pubDate> 39 <link>http://wow.zdechov.net/beta</link> 40 <description><?php echo "<br>".htmlspecialchars(strip_tags($rec[ticket_text]))." </br>"; ?></description> 41 42 43 </item> 44 <?php 45 } 3 header("Content-Type: text/xml"); 4 5 include('inc/db.php'); 6 include('inc/rss_generator.php'); 7 8 $NewsCount = 10; 9 $Items = array(); 10 11 $DbResult = $db->query('SELECT UNIX_TIMESTAMP(date), articles.* FROM articles ORDER BY date DESC LIMIT '.$NewsCount); 12 while($Row = $DbResult->fetch_array()) 13 { 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 ); 20 } 21 22 echo(GenerateRSS(array( 23 'Title' => $Config['Web']['Title'], 24 'Link' => $Config['Web']['BaseURL'], 25 'Description' => $Config['Web']['Description'], 26 'WebmasterEmail' => $Config['Web']['AdminEmail'], 27 'Items' => $Items), $Config['Web']['Charset'])); 46 28 47 29 ?> 48 </channel>49 </rss>
Note:
See TracChangeset
for help on using the changeset viewer.