Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-07-08 12:17:46

tweak
Archived Plugin Author
Registered: 2004-05-25
Posts: 5
Website

[plugin] [ORPHAN] akh_selrecent 0.2 - Dropdown list of recent articles

This plugin is a modified txp:recent_articles tag. It changes the output from a list to a dropdown list via a select tag. It supports all the parameters that txp:recent_articles supports, and also supports css styling via the class akhRecentArticles.

Download the plugin <a href=“http://www.ember.co.nz/resources/textpattern/” target=”_blank”>HERE</a>.

Last edited by tweak (2006-08-11 05:43:16)


Arg! Too much pressure!

Offline

#2 2004-07-08 13:51:47

Daragh
Member
From: Toronto Canada
Registered: 2004-05-26
Posts: 60
Website

Re: [plugin] [ORPHAN] akh_selrecent 0.2 - Dropdown list of recent articles

That looks awesome – I’ll give it a workout shortly.

Saaay, on that topic, anyone into making a popup menu that lists archives by month? I’d start a new topic, but I think I’m skewing “demanding” around here. ;)

Offline

#3 2004-08-04 09:01:12

tweak
Archived Plugin Author
Registered: 2004-05-25
Posts: 5
Website

Re: [plugin] [ORPHAN] akh_selrecent 0.2 - Dropdown list of recent articles

The plugin has been updated to v0.3 to fix some errors in the output. It is now standards-compliant.

Download the plugin <a href=“http://www.ember.co.nz/resources/textpattern/” target=”_blank”>HERE</a>.

Last edited by tweak (2006-08-11 05:43:31)


Arg! Too much pressure!

Offline

#4 2004-08-04 15:47:42

andrea
Member
From: la la land
Registered: 2004-02-24
Posts: 62
Website

Re: [plugin] [ORPHAN] akh_selrecent 0.2 - Dropdown list of recent articles

all i see is is < ? php and ? > with nothing in between. am i doing something wrong?

Offline

#5 2004-08-04 17:40:45

Tom Alday
Member
Registered: 2004-04-27
Posts: 38
Website

Re: [plugin] [ORPHAN] akh_selrecent 0.2 - Dropdown list of recent articles

^^^ right click and “save as…” ^^^^^

Is there any way to control the length of the drop down box? It breaks my edge.

Offline

#6 2004-08-04 17:54:40

andrea
Member
From: la la land
Registered: 2004-02-24
Posts: 62
Website

Re: [plugin] [ORPHAN] akh_selrecent 0.2 - Dropdown list of recent articles

ah! thanks :P works perfect.

Offline

#7 2004-08-04 19:43:45

tweak
Archived Plugin Author
Registered: 2004-05-25
Posts: 5
Website

Re: [plugin] [ORPHAN] akh_selrecent 0.2 - Dropdown list of recent articles

> Tom Alday wrote:

> Is there any way to control the length of the drop down box? It breaks my edge.

Theres a couple ways to control the list. It can be limited in contents via limit=”“. If no limit is specified it will default to limit=“10”.

Secondly, it looks for the style class akhRecentArticles in whichever stylesheet you happen to be using, so you can create that class in your preferred stylesheet and control its appearance from there.

Last edited by tweak (2004-08-04 19:45:02)


Arg! Too much pressure!

Offline

#8 2004-08-19 21:50:34

tweak
Archived Plugin Author
Registered: 2004-05-25
Posts: 5
Website

Re: [plugin] [ORPHAN] akh_selrecent 0.2 - Dropdown list of recent articles

I found another error in the output which affects standards compliance again.
There is a new version fixing this error available <a href=“http://www.ember.co.nz/resources/textpattern/” target=”_blank”>HERE</a>.

Last edited by tweak (2006-08-11 05:43:50)


Arg! Too much pressure!

Offline

#9 2006-08-10 12:09:52

alicson
Member
Registered: 2004-05-26
Posts: 465
Website

Re: [plugin] [ORPHAN] akh_selrecent 0.2 - Dropdown list of recent articles

Hopeful request:
‘wondering if someone who knows how would be willing to add a feature to this plugin, enabling it to be section aware? That would be really, really awesome :)


textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation

Offline

#10 2009-03-24 14:20:10

Piru
Member
From: Antwerp, Belgium
Registered: 2008-06-03
Posts: 17
Website

Re: [plugin] [ORPHAN] akh_selrecent 0.2 - Dropdown list of recent articles

Long time since the initial request, but maybe still handy so here you go!

function akh_selrecent($atts)
	{       
		if (is_array($atts)) extract($atts);
		global $pretext;
		extract($pretext);
		$label    = (empty($label))    ? '' : $label;
		$break    = (empty($break))    ? '' : $break;
		$wraptag  = (empty($wraptag))  ? '' : $wraptag;
		$limit    = (empty($limit))    ? 10 : $limit;
                $section  = (empty($section))  ? '' : doSlash($section);
		$category = (empty($category)) ? '' : doSlash($category);
                $sortby   = (empty($sortby))   ? '' : doSlash($sortby);
		$sortdir  = (empty($sortdir))  ? '' : doSlash($sortdir);
		$secq     = ($section) ? "and Section='$section'" : '';
                $catq = ($category) ? "and (Category1='$category' or Category2='$category')" :'';
		$sortq = ($sortby) ? "$sortby" : 'Posted';
		$dirq = ($sortdir) ? "$sortdir" : 'desc';
		$rs = safe_rows(
			"*", 
			"textpattern", 
			"Status = 4 and Posted <= now() $catq $secq order by $sortq $dirq limit 0,$limit"
		);
		if ($rs) {
			if ($label) $out[] = $label;
			$out[] = '<select class="akhRecentArticles" size="1" onchange="window.location.replace(this.value);">'."\n";
			$out[] = '<option value=""></option>'."\n";
			foreach ($rs as $a) {
				extract($a);
				$conTitle = ($url_title) ? $url_title : stripSpace($Title);
				$out[] =  ($url_mode)
				? '<option value="'.$pfr.$Section.'/'.$ID.'/'.$conTitle.'">'.$Title.'</option>'."\n"
				: '<option value="'.$pfr.'index.php?id='.$ID.'">'.$Title.'</option>'."\n";
			}
			$out[] = '</select><br />';
			if (is_array($out)) {
				if($break == 'li') {
					return ($wraptag) 
					?	tag("<li>".join("</li>\n<li>",$out)."</li>",$wraptag) 
					: 	"<li>".join("</li>\n<li>",$out)."</li>";
				}
				return ($wraptag) 
				?	tag(join($break.n,$out),$wraptag) 
				: 	join($break.n,$out);
			}
		}
		return '';
	}

Offline

Board footer

Powered by FluxBB