* Wassim M. <[EMAIL PROTECTED]> [2003-02-11 02:13]:
> I have a HUGE directory of pictures that are numbered 1,2,3,4,5,6,
> etc, etc.. I have divided this directory into subdirecotry sets of
> 100. I'm needing to determine which set we are in via the current
> image number.

[-- snip --]

> An example image call in the template:
>  <img src="tids/[% set( data.tid ) %]/[% data.tid %]-m.jpg" border="1">

I think you want:

  <img src="tids/[% data.tid - (data.tid MOD 100) %]/[% data.tid %]-m.jpg" border="1">

In terms of your get_set function, the equivalent would be:

  sub get_set {
      my $pic = $_[0];
      return $pic - ($pic % 100);
  }

(darren)

-- 
The mere tendency of speech to encourage unlawful acts is not a
sufficient reason for banning it. [...]  The right to think is the
beginning of freedom, and speech must be protected from the government
because speech is the beginning of thought.
    -- Anthony Kennedy

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to