Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-04-14 21:07:47

fungus_sn
Archived Plugin Author
From: Salt Lake City, UT
Registered: 2004-02-25
Posts: 2
Website

[archived] fng_random_thumb: Random thumbnail from category

Notice: This thread is archived, there is a native txp tag now <txp:image_index>.

**********************************************************

A lot like Drew’s random image, but generates thumbnails instead. It will also link to your photo section for the full version.

Accepts 2 attributes, category and base. category (optional) specifies the directory to pull from, if left out will choose from any image. base (optional) specifies the doc path to the page for your photo section, defaults to photos.

<code><txp:fng_random_thumb base=“photos” category=“mydog” /></code>

The base page for your photos should contain at least the <code><txp:image_display /></code> tag. Dean’s tutorial for a great photos page

Download fng_random_thumb.txt.tgz

Last edited by fungus_sn (2004-04-14 21:10:33)

Offline

#2 2004-04-18 13:51:05

Neko
Member
Registered: 2004-03-18
Posts: 458

Re: [archived] fng_random_thumb: Random thumbnail from category

Neat, thank you! _

~Neko

Offline

#3 2004-04-29 05:51:58

davidm
Member
From: Paris, France
Registered: 2004-04-27
Posts: 719

Re: [archived] fng_random_thumb: Random thumbnail from category

Just what I was looking for !

GREAT :-)
Thx


.: Retired :.

Offline

#4 2004-04-29 15:11:08

davidm
Member
From: Paris, France
Registered: 2004-04-27
Posts: 719

Re: [archived] fng_random_thumb: Random thumbnail from category

Too bad the url is invalid or you website is down… could you repost the plugin ?


.: Retired :.

Offline

#5 2005-06-18 20:26:46

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: [archived] fng_random_thumb: Random thumbnail from category

Does anyone have this working in any of the latet revisions? I’m not getting any output at all for some reason.

Offline

#6 2005-06-18 21:57:30

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: [archived] fng_random_thumb: Random thumbnail from category

Can anybody fix this for rc3?

This was the original code:

<code> function fng_random_thumb($atts) {

global $pfr,$img_dir,$txpcfg;

$category = “%”;

$base = “images/”; if (is_array($atts)) extract($atts); $rs = getRow(“select * from txp_image where category like ‘$category’ and thumbnail=1 order by rand() limit 1”); if ($rs) { extract($rs); $impath = $pfr.$img_dir.”/”.$id.“t”.$ext; $imginfo = getimagesize($txpcfg[“doc_root”].$impath); $dims = (!empty($imginfo3)) ? “ “.$imginfo3 : ‘’; $out[] = ‘<a href=”’.$pfr.$base.’?c=’.urlencode($category).a.‘p=’.$id.’”>’. ‘<img src=”’.$impath.’”’.$dims.’ alt=”’.$alt.’” />’. ‘</a>’; return join(“”,$out); }

}

</code>

Last edited by soulship (2005-06-18 21:58:40)

Offline

#7 2005-06-18 22:02:53

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: [archived] fng_random_thumb: Random thumbnail from category

Codes not displaing correctly.

Here’s a link

Offline

Board footer

Powered by FluxBB