Ejemplo n.º 1
0
<?php

$finder = new Article(AMP_Registry::getDbcon());
$articles = $finder->find(array('type' => 77, 'displayable' => 1, 'sort' => 'date DESC', 'limit' => 3));
$html = '';
if ($articles) {
    foreach ($articles as $a) {
        $html .= '<div class="update">
        						<a class="update-title" target="_blank" href="' . $a->getURL() . '">' . $a->getTitle() . '</a>
        						<div class="update-desc">';
        $html .= cutOff($a->getBlurb(), 200);
        $html .= '<div class="update-more"<a class="update-title" target="_blank" href="' . $a->getURL() . '">read more <span class="raquo">&raquo;</span></a>
        							 </div>
        						</div>
        					</div>';
    }
}
echo $html;
?>

Ejemplo n.º 2
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;
?>