Gotta love "labeltag" · Oct 3, 11:54 am 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__,
'labeltag' => '',
),$atts));
if($sense)
$category = $pretext['c'] ? $pretext['c'] : $category;
$catq = ($category) ? "and (Category1='".doSlash($category)."'
or Category2='".doSlash($category)."')" : '';
$rs = safe_rows_start(
"*, id as thisid, unix_timestamp(Posted) as posted",
"textpattern",
"Status = 4 and Posted <= now() $catq order by $sortby $sortdir limit 0,$limit"
);
if ($rs) {
while ($a = nextRow($rs)) {
extract($a);
$out[] = href(escape_title($Title),permlinkurl($a));
}
if (is_array($out)) {
return doLabel($label, $labeltag).doWrap($out, $wraptag, $break, $class);
}
}
return '';
}
labeltag allows you to independently wrap your label in the tag of your choice. Example @ Codevillain
