示例#1
0
        }
        ?>
                            </div>
                            <div class="resultLocation">
                                <p><?php 
        echo filterText($item->location);
        ?>
</p>
                            </div>
                            <div class="resultContain">
                                <?php 
        if ($item->picture) {
            ?>
                                <div class="resultPhoto">
                                    <p><a href="<?php 
            echo itemLink($item->hash);
            ?>
" title="<?php 
            echo filterText($item->title);
            ?>
" rel="nofollow"><img src="<?php 
            echo filterText($item->picture);
            ?>
" alt="<?php 
            echo filterText($item->title);
            ?>
"></a></p>
                                </div>
                                <?php 
        }
        ?>
示例#2
0
 /**
  * 
  * @param array $data
  * @param array $getData
  * @return string
  */
 public function getRSS($data = array(), $getData = array())
 {
     Loader::helper('XML');
     $dom = xmlDOM();
     $rss = xmlAddChild($dom, 'rss');
     xmlSetAttribute($rss, 'version', '2.0');
     xmlSetAttribute($rss, 'xmlns:dc', 'http://purl.org/dc/elements/1.1/');
     xmlSetAttribute($rss, 'xmlns:sy', 'http://purl.org/rss/1.0/modules/syndication/');
     xmlSetAttribute($rss, 'xmlns:admin', 'http://webns.net/mvcb/');
     xmlSetAttribute($rss, 'xmlns:rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');
     xmlSetAttribute($rss, 'xmlns:content', 'http://purl.org/rss/1.0/modules/content/');
     xmlSetAttribute($rss, 'xmlns:media', 'http://search.yahoo.com/mrss/');
     $channel = xmlAddChild($rss, 'channel');
     xmlAddChild($channel, 'title', Config::get('siteName', 'seo'));
     xmlAddChild($channel, 'link', baseURL());
     xmlAddChild($channel, 'description', Config::get('siteDesc', 'seo'));
     xmlAddChild($channel, 'dc:language', 'en-en');
     $atom = xmlAddChild($channel, 'atom10:link');
     xmlSetAttribute($atom, 'xmlns:atom10', 'http://www.w3.org/2005/Atom');
     xmlSetAttribute($atom, 'href', searchLink($getData, TRUE, NULL, TRUE));
     xmlSetAttribute($atom, 'rel', 'self');
     xmlSetAttribute($atom, 'type', 'application/rss+xml');
     if (isset($data['items'])) {
         foreach ($data['items'] as $entry) {
             $item = xmlAddChild($channel, 'item');
             xmlAddChild($item, 'title', xmlConvert(filterText($entry->title)), TRUE);
             $itemLink = itemLink($entry->hash);
             xmlAddChild($item, 'link', $itemLink);
             xmlAddChild($item, 'guid', $itemLink);
             xmlAddChild($item, 'description', filterText($entry->content, TRUE, TRUE), TRUE);
             xmlAddChild($item, 'pubDate', date('D, d M Y H:i:s O', $entry->time));
             if ($entry->picture) {
                 $media = xmlAddChild($item, 'media:thumbnail');
                 xmlSetAttribute($media, 'url', $entry->picture);
                 xmlSetAttribute($media, 'width', '120');
                 xmlSetAttribute($media, 'height', '100');
             }
         }
     }
     return xmlPrint($dom, TRUE);
 }