Example #1
0
<?php

$dbcon = AMP_Registry::getDbcon();
$article_where_clause = 'publish = 1 AND date >= CURRENT_DATE';
$article_sql = "SELECT id FROM articles WHERE {$article_where_clause} ORDER BY date LIMIT 4";
$rows = $dbcon->Execute($article_sql);
$html = '';
$articles = $rows->GetArray();
foreach ($events as $event) {
    $e = new Article(AMP_Registry::getDbcon(), $article['id']);
    $date = date('m/d/Y', strtotime($e->getAssignedDate()));
    if ($date) {
        $date = '<b>' . $date . ':</b> ';
    }
    $html .= '<a class="update-title" href="' . $e->getURL() . '">' . $e->getTitle() . '</a>';
    $html .= '<br />';
    $html .= '<div class="update-desc">';
    $html .= $date . cutOff($a->getBlurb(), 200);
    $html .= '</div>';
}
echo $html;
?>

Example #2
0
    function _RDF_trackbacks($article_id)
    {
        if (!AMP_CONTENT_TRACKBACKS_ENABLED) {
            return false;
        }
        require_once 'AMP/Content/Article.inc.php';
        AMP_config_load('urls');
        $article = new Article($this->comment_set->dbcon, $article_id);
        return '<!--
            <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                     xmlns:dc="http://purl.org/dc/elements/1.1/"
                     xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">

            <rdf:Description
                rdf:about="' . AMP_SITE_URL . $article->getURL() . '"
                dc:identifier="' . AMP_SITE_URL . $article->getURL() . '"
                dc:title="' . $article->getTitle() . '"
                trackback:ping="' . AMP_Url_AddVars(AMP_SITE_URL . AMP_CONTENT_URL_TRACKBACKS, 'id=' . $article_id) . '" />
            </rdf:RDF>
            -->';
    }
Example #3
0
 /**
 * Adiciona um artigo à base
 *
 * @param Article $article Objeto Artigo
 *
 * Ele pega os dados que estão armazenados nos campos da classe e adiciona no Banco
 * @returns mixed $result
 */
 function AddArticle($article)
 {
     $strsql = "INSERT INTO scieloorgusers.articles (\r\n\t\tPID, \r\n\t\turl,\r\n\t\ttitle, \r\n\t\tserial, \r\n\t\tvolume, \r\n\t\tnumber, \r\n\t\tsuppl, \r\n\t\tyear, \r\n\t\tauthors_xml, \r\n\t\tkeywords_xml,\r\n\t\tabstract_xml,\r\n\t\tprocess_date,\r\n\t\tpublication_date,\r\n\t\twp_post_id,\r\n\t\twp_url,\r\n\t\twp_post_date\r\n\t\t) \r\n\t\tVALUES ('" . $article->getPID() . "','" . $article->getURL() . "','" . mysql_escape_string(str_replace("'", "&apos;", $article->getTitle())) . "','" . $article->getSerial() . "','" . $article->getVolume() . "','" . $article->getNumber() . "','" . $article->getSuppl() . "','" . $article->getYear() . "','" . mysql_escape_string($article->getAuthorXML()) . "','" . mysql_escape_string(str_replace("'", "&apos;", $article->getKeywordXML())) . "','" . mysql_escape_string(str_replace("'", "&apos;", $article->getAbstractXML())) . "','" . date('Y-m-d H:i:s') . "','" . formatDate($article->getPublicationDate()) . "'," . $article->getWpPostID() . ",'" . $article->getWpURL() . "','" . $article->getWpPostDate() . "'" . ")";
     $result = $this->_db->databaseExecInsert($strsql);
     return $result;
 }