[Clipart] Transitioning to theautomatic/dynamicscreenshotsgallery

Jonadab the Unsightly One jonadab at bright.net
Wed Sep 29 17:42:01 PDT 2004


Nicu Buculei <nicu at apsro.com> writes:

> looking at the current version of tha page, with 6 images on it, i
> think something areound 10 is good

Okay, it will now show up to ten at a time, by default.  Of course,
there are currently fewer than ten, so if you want to see this
functionality kick in, you have to tell it to view fewer.  The
following address tells it to view only two at a time (and starts
partway into the list), which is good for getting a preview of what
the navigation will look like when the are multiple pages:

http://openclipart.org/cgi-bin/view_screenshots.cgi?images_per_page=2&startat=1

(Yes, startat=1 means start at the second image -- but people aren't
going to be typing these by hand; they'll be clicking next/previous
links.  It's that way because if you don't specify anything it's zero,
which starts you at the first image.)

If you drop the stuff after the ? you will currently see all the
images, because there are fewer than ten.  When there are more than
ten, the next/previous logic will start to kick in without having
anything special in the query string.

Actually, the number 10 is not hardcoded; it's read from the query
string if it's specified there (as with the URI above) or otherwise
it's taken from the configuration file (where it's currently set to
10).  If it's not specified in the config file either, only then does
the code revert to a hard-coded value.

-- 
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
split//,"ten.thgirb\@badanoj$/ --";$\=$ ;-> ();print$/




More information about the clipart mailing list