Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2005-05-15 08:17:16

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,387
Website GitHub Mastodon Twitter

Re: [plugin] [ORPHAN] dru_random_image: Random image from image category

Is there a way to have it display thumbnails as oposed to the full size images?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#17 2005-05-15 11:56:22

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: [plugin] [ORPHAN] dru_random_image: Random image from image category

Yes colak. It’s what mine does. If you go to “edit” for the plug-in, 2 lines up from the bottom where it says “if blah return image” simply replace “image” with “thumbnail”. Actually I can’t remember if it says image or something else as it is a while since I changed mine.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#18 2005-05-15 12:34:15

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: [plugin] [ORPHAN] dru_random_image: Random image from image category

although it’s designed for random images, can this be used to output a specific image for a specific category? So for category cows, it has an image of a cow for any entry where the tag is applied?

Offline

#19 2005-05-15 21:09:15

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: [plugin] [ORPHAN] dru_random_image: Random image from image category

I don’t believe it will do that sekhu. It will pick a random image from any that are in the category you select. What you could do is place your specific image in it’s own category (say cows2) then select that category for the plug-in tag. Just an idea. ;)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#20 2005-05-16 12:40:47

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,387
Website GitHub Mastodon Twitter

Re: [plugin] [ORPHAN] dru_random_image: Random image from image category

> thebombsite wrote:

> Yes colak. It’s what mine does. If you go to “edit” for the plug-in, 2 lines up from the bottom where it says “if blah return image” simply replace “image” with “thumbnail”. Actually I can’t remember if it says image or something else as it is a while since I changed mine.

Thanks stuart. that did it.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#21 2005-07-18 10:09:55

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,387
Website GitHub Mastodon Twitter

Re: [plugin] [ORPHAN] dru_random_image: Random image from image category

Hi all,
does anyone know whether this plugin works with rc3?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#22 2005-07-18 10:18:34

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: [plugin] [ORPHAN] dru_random_image: Random image from image category

I’m currently using it with r508.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#23 2005-07-18 10:35:17

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,387
Website GitHub Mastodon Twitter

Re: [plugin] [ORPHAN] dru_random_image: Random image from image category

I guess I cannot use it due to the <a href=“http://forum.textpattern.com/viewtopic.php?id=9372”>image path bug</a>


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#24 2005-07-18 14:50:27

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: [plugin] [ORPHAN] dru_random_image: Random image from image category

I think that may have been fixed today (r514)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#25 2005-07-18 17:06:44

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,387
Website GitHub Mastodon Twitter

Re: [plugin] [ORPHAN] dru_random_image: Random image from image category

yep,
but the plugin still does not return anything:(


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#26 2005-07-18 22:20:48

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: [plugin] [ORPHAN] dru_random_image: Random image from image category

That seems odd. Does your tag look something like:-
<code><txp:dru_random_image category=“mine” /></code>
<br />
Or have you looked at this instead?

Last edited by thebombsite (2005-07-18 22:25:18)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#27 2005-12-25 19:46:32

_astyonax_
New Member
From: somewhere in Italy
Registered: 2005-12-25
Posts: 4

Re: [plugin] [ORPHAN] dru_random_image: Random image from image category

Hi, I tried this plug-in and I found it very interesting, but there are some thing I changed:

possibility to define a table prefix

output a thumbnail of the image. Actually my aim was a switch between thumbnail and full size image, but I’m new to php.

I found some problems with Clean URLs so I fixed the problem

AND, the more important it follow and respect subcategories.

here is the code,
[code] function dru_random_image($atts) { global $path_from_root, $img_dir, $siteurl; $path_from_root=substr($path_from_root,1); $category = ‘%’;

if (is_array($atts)) extract($atts); $pref= (!empty($pref)) ? $pref : “it_”; // define here your default table prefix (with trailing ) remove it, please $rec_query=“SELECT * FROM “.$pref.“txp_category WHERE type=\“image\” AND parent=\”$category\”“; $rec_res=getRows($rec_query,$debug); if($rec_res){ foreach($rec_res as $cat){ extract($cat); $rec_cat=$rec_cat. “ OR category = \”$name\”“; } } $rs = getRow(“SELECT id, ext,alt,caption FROM “.$pref.“txp_image WHERE category = \”$category\” $rec_cat ORDER BY rand() LIMIT 1 “); if($rs) { extract($rs); if (!empty($label)) $label=$label.’<br />’; return $label.’<img src=“http://’.$siteurl.’/’.$img_dir.’/’.$id.‘t’.$ext.’” alt=”’.$alt.’” title=”’.$caption.’” />’; } return image($rs); return ‘<txp:notice message=“malformed random_img tag” />’; }

[/code]
bye bye

Last edited by _astyonax_ (2005-12-25 19:53:12)

Offline

#28 2006-03-23 18:22:58

Quasi
Member
From: Mieres, Asturias (ES)
Registered: 2006-03-16
Posts: 15
Website

Re: [plugin] [ORPHAN] dru_random_image: Random image from image category

Hello! From Spain :).
As I can change width and height property?
Thanks

Offline

#29 2006-09-17 21:48:39

lukepermsn
Member
From: london
Registered: 2004-07-15
Posts: 57
Website

Re: [plugin] [ORPHAN] dru_random_image: Random image from image category

yes, the ability to have the tag output a random image from all child categories of a parent would be very very useful!


“Absorb what is useful, Discard what is not, Add what is uniquely your own” – Bruce Lee

Offline

#30 2006-11-27 15:04:30

hachi
Member
From: switzerland
Registered: 2004-04-24
Posts: 25

Re: [plugin] [ORPHAN] dru_random_image: Random image from image category

Has anyone tried this with the newest release 4.0.4. Does it work or is there an alternative?
Thanks Oliver

Last edited by hachi (2006-11-27 15:05:00)

Offline

Board footer

Powered by FluxBB