function render_author($source) { $author = $source->getAuthor(); $author_url = $source->getAuthorURL(); if (!AMP_validate_url($author_url)) { $author_url = false; } if (!trim($author)) { $author = 'a stranger'; } return $this->_renderer->link($author_url, converttext($author), array('class' => AMP_CONTENT_CSS_CLASS_ARTICLE_AUTHOR)); }
function publish($section_id, $class_id, $destroy_self = true) { $text = utf8_decode(preg_replace("/\\n/", "<br/>", $this->getBody())); $blurb = AMP_trimText($text, AMP_CONTENT_ARTICLE_BLURB_LENGTH_DEFAULT, false); # this line doesnt work since upgrading adodb? ap #$title = $this->dbcon->qstr( utf8_decode( $this->getName( ))); $title = utf8_decode($this->getName()); $feed_name = $this->getFeedName(); if (!$section_id) { return false; } $article_data = array('title' => $title, 'body' => $text, 'shortdesc' => $blurb, 'uselink' => !AMP_CONTENT_RSS_FULLTEXT, 'linkover' => !AMP_CONTENT_RSS_FULLTEXT, 'link' => $this->getLinkURL(), 'subtitle' => $this->getSubtitle(), 'source' => $feed_name, 'sourceurl' => AMP_validate_url($this->getLinkURL()), 'type' => $section_id, 'class' => $class_id, 'date' => $this->getItemDate(), 'publish' => AMP_CONTENT_STATUS_LIVE, 'enteredby' => AMP_SYSTEM_USER_ID, 'updatedby' => AMP_SYSTEM_USER_ID, 'contact' => $this->getContacts()); require_once 'AMP/Content/Article.inc.php'; $article =& new Article($this->dbcon); $article->setDefaults(); $article->setData($article_data); if (!$article->save()) { return false; } if ($destroy_self) { $this->delete(); } return true; }
function render_source_link(&$source) { return $this->_renderer->link(AMP_validate_url($source->getLinkURL()), $this->_renderer->image(AMP_SYSTEM_ICON_PREVIEW, array('alt' => AMP_TEXT_VIEW_SOURCE, 'width' => 16, 'height' => 16, 'align' => 'left', 'border' => 0)), array('target' => '_blank')) . ' ' . $this->_renderer->link(AMP_validate_url($source->getLinkURL()), AMP_TEXT_SOURCE . ': ' . AMP_trimText($source->getLinkURL(), 45), array('target' => '_blank')); }
function _HTML_author($author, $author_url = null) { $href = isset($author_url) && $author_url && AMP_validate_url($author_url) ? $author_url : false; return $this->_HTML_italics('Comment by ' . $this->link($href, $author, array('target' => 'blank'))); }
function render_author_link($source) { $credit = $source->getData('author'); $url = $source->getData('author_url'); if (!($url && AMP_validate_url($url))) { return $credit; } return $this->_renderer->link($url, $credit, array('target' => 'blank')); }