IMAP spout

by morphiumdeus, Tuesday, July 09, 2013, 18:43 (4081 days ago) @ morphiumdeus

/*---- 2nd part ----*/

/**

* returns an unique id for this item

*

* @return string id as hash

*/

public function getId() {

if($this->items!==false && $this->valid()) {

$id = @current($this->items)->get_id();

if(strlen($id)>255)

$id = md5($id);

return $id;

}

return false;

}

/**

* returns the current title as string

*

* @return string title

*/

public function getTitle() {

if($this->items!==false && $this->valid())

return @current($this->items)->get_title();

return false;

}

/**

* returns the content of this item

*

* @return string content

*/

public function getContent() {

if($this->items!==false && $this->valid())

return @current($this->items)->get_content();

return false;

}

/**

* returns the date of this item

*

* @return string date

*/

public function getDate() {

if($this->items!==false && $this->valid())

$date = @current($this->items)->get_date();

if(strlen($date)==0)

$date = date('Y-m-d H:i:s');

return $date;

}


/**
* returns the global html url for the source
*
* @return string url as html
*/
public function getHtmlUrl() {
if(isset($this->htmlUrl))
return $this->htmlUrl;
return false;
}

/**
* returns the icon of this item
*
* @return string icon url
*/
public function getIcon() {
if(isset($this->faviconUrl))
return $this->faviconUrl;

$this->faviconUrl = false;
$imageHelper = $this->getImageHelper();
$htmlUrl = $this->getHtmlUrl();
if($htmlUrl && $imageHelper->fetchFavicon($htmlUrl))
$this->faviconUrl = $imageHelper->getFaviconUrl();
return $this->faviconUrl;
}


/**
* returns the link of this item
*
* @return string link
*/
public function getLink() {
if($this->items!==false && $this->valid())
return @current($this->items)->get_link();
return false;
}

/**

* destroy the plugin (prevent memory issues)

*/

public function destroy() {

unset($this->items);

$this->items = false;

}

}


Complete thread:

 RSS Feed of thread

powered by my little forum