Tag hack / recent_articles · Sep 29, 08:48 pm by Rick Silletti
function recent_articles($atts)
{
+ global $pretext;
extract(lAtts(array(
+ 'sense' => '',
'label' => '',
'break' => br,
'wraptag' => '',
'limit' => 10,
'category' => '',
'sortby' => 'Posted',
'sortdir' => 'desc',
'class' => __FUNCTION__
),$atts));
+ if($sense)
+ $category = $pretext['c'] ? $pretext['c'] : $category;
$catq = ($category) ? "and (Category1='".doSlash($category)."'
or Category2='".doSlash($category)."')" : '';
Original
function recent_articles($atts)
{
global $pretext;
extract(lAtts(array(
'label' => '',
'break' => br,
'wraptag' => '',
'limit' => 10,
'category' => '',
'sortby' => 'Posted',
'sortdir' => 'desc',
'class' => __FUNCTION__
),$atts));
$catq = ($category) ? "and (Category1='".doSlash($category)."'
or Category2='".doSlash($category)."')" : '';
Added “sense” attribute to select tag to return only recent articles from selected category.
