Go to content Go to navigation Go to search

Testing - Testing 1,2 · Feb 11, 10:32 pm by Rick Silletti


There is a plugin at the bottom of the download list that I have just started testing.
Its in the public list to make it available to kick around some. Be aware that it is very new and that the help section is very brief.
Any feedback is welcome, and recommends for improvements are as well.


Section: article


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


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.



Page 1's List Navigation