// grabbing the date $date = date("D, d M G:i:s O"); // sending the xml header header("Content-type: text/xml"); echo << $user's Photoblog http://www.photoblog.com/user/$user $date http://photoblog.com en EOF; // seeing if the user is there first $blogs = array(); $DB->query("SELECT title,photos,text,date,created,category FROM entries INNER JOIN members ON members.id=entries.userid WHERE M ATCH(`username`) AGAINST('$user') ORDER BY date DESC LIMIT 10"); while ($row = $DB->fetch_array()) { $blogs[] = $row; } foreach ($blogs as $value) { $create = date("D, d M G:i:s O", $value['created']); // formating the link now list($y,$m,$d) = explode("-", $value['date']); $url = "http://www.photoblog.com/user/". $user ."/$y/$m/$d"; $desc = htmlspecialchars(ellipsis($value['text'], 200)); $value['title'] = htmlspecialchars($value['title']); $DB->query("SELECT name FROM categories WHERE id='{$value['category']}' LIMIT 1"); $row = $DB->fetch_array(); $row['name'] = htmlspecialchars($row['name']); echo << {$value['title']} $url $url#comments $create $user {$row['name']} $url $desc EOF; //http://blog.meso.com/?feed=rss2&p=42 } ?>