[pmwiki-users] More on Thumblist

Petko Yotov 5ko at free.fr
Fri Aug 24 18:31:18 CDT 2007


On Saturday 25 August 2007, Sameer Kumar wrote:
> The recipe page describes how I can get the thumblist to start at any
> image counting from the LAST image uploaded.

At the moment, this actually is not possible. :-)

The script performs a case insensitive natural sort [1] on the whole current 
list of files (filenames), and shows them in that order (unless a "shuffle 
mode" is requested).


> Can I get the thumblist to count from the FIRST image uploaded??
>
> In other words, if I want a thumblist showing the same 5 images on the
> page (the first five uploaded) no matter how many more are added, how
> can I achieve that??
>
> I do know that I can hard-code the image names in the thumblist
> directive, but am looking for a simpler solution.

I would (re)name them with some distinguished prefix/suffix and then, use 
the "name=" parameter, for example '_' as in _myphoto.jpg:

  (:thumblist limit=5 name="_*.jpg":) [2]

The feature that Thumblist lacks is a sorting order on some information other 
than the file name. To obtain such information (i.e. picture size/timestamp 
or worse: exif data) would require to open/stat/getimagesize/extractEXIF of 
all pictures in the upload directory and would slow things a lot, this was 
discussed on the talk page.

So, I have no plans to write such thing, unless I see both very good 
reasons/benefits of it, and a good idea for the implementation. The script is 
allready far more complex than I originally imagined... :-)

Thanks,
Petko

--
[1] http://php.net/natcasesort
[2] Note however that a prefix "_" for attached files is only allowed in 
recent Betas of PmWiki; with the Stable, use another prefix.




More information about the pmwiki-users mailing list