Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
mem_randimg: Random Image from category
(Obsolete plugin, can be replaced with built in tags.)
I created a plugin that will randomly pick an image from a category (or comma separated list of categories) and then output information assocated with that image. Some of the information that can be retrieved within a form are an <img> tag for the large image or thumbnail, the author, the caption, height, width, image and thumbnail url, etc.
Download and Info HereHere is the list of supported form tags:
<txp:mem_img />
<txp:mem_img_url />
<txp:mem_img_thumbnail />
<txp:mem_img_thumbnail_url />
<txp:mem_img_caption />
<txp:mem_img_alt />
<txp:mem_img_category />
<txp:mem_img_width />
<txp:mem_img_height />
<txp:mem_img_author />
<txp:mem_img_date />
Edit: added a better description of plugin and listed form tags.
{Edited to add note on top. – Uli}
Last edited by uli (2014-02-14 22:52:24)
Offline
Re: mem_randimg: Random Image from category
Is this feature already in txp or something?
Offline
#3 2004-06-09 14:42:34
- Remillard
- Plugin Author

- From: Lenexa, KS
- Registered: 2004-05-16
- Posts: 169
Re: mem_randimg: Random Image from category
There is a random image plugin, but it picks from a directory. As far as I can tell, yours is the first of its specific kind. I added it to the list.
Remillard
Offline
Re: mem_randimg: Random Image from category
Thanks. I thought that I had done something that was tabboo since many people viewed, but no one commented, or I did something that was already in the system.
New Plugin: Comments – It lets you add comments to an article!!
;-)
Offline
#5 2004-06-09 17:08:20
- Remillard
- Plugin Author

- From: Lenexa, KS
- Registered: 2004-05-16
- Posts: 169
Re: mem_randimg: Random Image from category
Nah I think it’s just post fatigue ;-)
Offline
#6 2004-06-09 17:45:38
- Remillard
- Plugin Author

- From: Lenexa, KS
- Registered: 2004-05-16
- Posts: 169
Re: mem_randimg: Random Image from category
You know, I just found another one like this. It’s one of the very first plugins created (I’m going back in time for the catelog). Look on page 4 of the forum (I don’t remember the post ID).
Offline
Re: mem_randimg: Random Image from category
I can’t download this. The txt file doesn’t contain any compressed code.
bludrop studios .::. Creative Expression
Offline
Re: mem_randimg: Random Image from category
oops. I guess it does.
How exactly do you use it, though?
bludrop studios .::. Creative Expression
Offline
Re: mem_randimg: Random Image from category
How does this plugin work?
bludrop studios .::. Creative Expression
Offline
Re: mem_randimg: Random Image from category
blumie607, this is what I did,
I created a misc form called random_image with this in it: <code><txp:mem_img /></code>. I created an image category called “random”, I just want certain images to appear. Then in my page I added this, where I want the image:
<code><txp:mem_randimg form=“random_image” category=“random” /></code>
Offline
#11 2004-09-20 00:58:40
- Roughy
- New Member
- From: Melbourne
- Registered: 2004-07-05
- Posts: 7
Re: mem_randimg: Random Image from category
Hi Manfre – great plug-in, it looks like it will do just what I need.
Some questions though –
When I put <code><txp:mem_img /></code> I get nothing.
But when I put in <code><txp:mem_randimg /></code> I get my image.
I can’t seem to get the other tags to output anything – regardless of whether I use <code><txp:mem_randimg_caption/></code> or<code><txp:mem_img_caption /></code>?
Have I missed something?
________________
Update:
OK I used the form as trailgirl mentioned and I’ve got it working. Still not sure I understand <code><txp:mem_img /></code> and <code><txp:mem_randimg /></code>.
Last edited by Roughy (2004-09-20 01:58:00)
Offline
Re: mem_randimg: Random Image from category
Doesn’t work for me too.
Because of using clean url not messy one?
I need a further example.
Offline
Re: mem_randimg: Random Image from category
nipponzine, Clean urls shouldn’t affect this plugin.
roughy, txp:mem_randimg is the plugin tag, which is used as a place holder in a page or form. This tag should be specified with the form attribute, which tells the plugin to load the form and parse it for plugin data replacement tags. These tags are substituted for the meta data associated with the randomly chosen image; title, description, size, link, etc.
Offline
Re: mem_randimg: Random Image from category
Thanks for your explanation, Manfre.
Finaly I found out how to deal with plugins. I did exactly same way as trailgirl wrote.
Offline
Re: mem_randimg: Random Image from category
Hey! This plugin was a breeze to install. In fact, I (a complete green-horn to all this technical whizz) managed to tweak it a wee bit, to output the image id! I simply added <code>$out = str_replace(“<txp:mem_img_id />”, $id, $out);</code> to it. Heh, I did so, in order to “connect” the generated thumb-nail to its parent image in the gallery. created by Justin Palmer’s cgd_dynagallery.
Thanks for creating something so user-friendly, and educational!
Offline