Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- define ('IN_SITE', 1);
- include_once ('../includes/global.php');
- $start = intval($_GET["start"]);
- $limit = intval($_GET["limit"]);
- $results = $db->query("SELECT a.auction_id, a.name, a.description, a.max_bid,
- a.currency, a.buyout_price, a.start_price, a.max_bid, am.media_url, u.city, u.country, u.zip_code, c.name as country_name
- FROM " . DB_PREFIX . "auctions a
- LEFT JOIN " . DB_PREFIX . "auction_media am ON a.auction_id=am.auction_id AND am.media_type=1 AND am.upload_in_progress=0
- LEFT JOIN " . DB_PREFIX . "users u ON u.user_id=a.owner_id
- LEFT JOIN " . DB_PREFIX . "countries c ON u.country=c.id
- WHERE a.closed=0 AND a.active=1 AND a.approved=1 AND a.deleted=0
- GROUP BY a.auction_id
- ORDER BY a.auction_id LIMIT " . $start . ", " . $limit);
- $xml_output = '<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
- <!DOCTYPE yakaz SYSTEM "http://www.yakaz.com/yakaz.dtd" >
- <yakaz version="1.0">
- <ad-miscellaneous category="miscellaneous"> <!-- pour chaque autre annonce -->';
- while ($row=@mysql_fetch_assoc($results)) {
- $auction_link = process_link('auction_details', array('name' => $row['name'], 'auction_id' => $row['auction_id']));
- if (!empty($row['media_url'])) {
- $picpath = '<img src="' . SITE_PATH . 'thumbnail.php?pic=' . $row['media_url'] . '&w=100">';
- }
- $description = preg_replace('!<[^>]+>!Us', '', html_entity_decode($row['description']));
- $xml_output .= '<what>
- <title>'.($row['name']).'</title>
- <description><![CDATA['.$description.']]></description>
- <ad-url>'.htmlentities($auction_link).'</ad-url>
- <picture-url>'.htmlentities($picpath).'</picture-url>
- <!-- logos proscrits - optionnel -->
- <price unit="euro">'.(($row['max_bid']>0)?$fees->display_amount($row['max_bid'], $row['currency']):$fees->display_amount($row['start_price'], $row['currency'])).'</price>
- <!-- caracteres collés, virgule pour décimales - si pas de prix, mettre 0 - optionnel -->
- </what>
- <where>
- <!-- optionnel -->
- <city-name>'.$db->add_special_chars($row['city']).'</city-name>
- <zip-code>'.$db->add_special_chars($row['zip_code']).'</zip-code>
- <country>'.$db->add_special_chars($row["country_name"]).'</country>
- <!-- code pays : FR pour la France -->
- </where>';
- }
- $xml_output .= '</ad-miscellaneous>
- </yakaz>';
- file_put_contents ('monfichier.xml', $xml_output);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement