Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Topic closed
[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
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
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
Offline
Pages: 1
Topic closed