Ejemplo n.º 1
0
 public function setSource($url, $content)
 {
     if (!empty($url) && !empty($content)) {
         $this->_itemSource['url'] = RSSFeedTools::checkUrl($url);
         $this->_itemSource['content'] = $content;
     }
 }
Ejemplo n.º 2
0
 public function setImage($url, $title, $link, $description = '', $width = 0, $height = 0)
 {
     // Add the needed image information in the image array
     $this->_feedImage['url'] = $url;
     $this->_feedImage['title'] = $title;
     $this->_feedImage['link'] = RSSFeedTools::checkUrl($link);
     // Check the image description
     if (!empty($description)) {
         $this->_image['description'] = $description;
     }
     // Check the image width
     if (!empty($width) && is_numeric($width)) {
         $width = intval($width);
         if ($width > 0 && $width <= 144) {
             $this->_feedImage['width'] = $width;
         } else {
             throw new RSSFeedException('The feed image width must be lower than 144px', __CLASS__, __METHOD__);
         }
     }
     // Check the image height
     if (!empty($height) && is_numeric($height)) {
         $height = intval($height);
         if ($height > 0 && $height <= 400) {
             $this->_feedImage['height'] = $height;
         } else {
             throw new RSSFeedException('The feed image height must be lower than 400px', __CLASS__, __METHOD__);
         }
     }
 }
Ejemplo n.º 3
0
 public function setLink($link)
 {
     $this->_link = RSSFeedTools::checkUrl($link);
 }