To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.geekOpen lugnet.off-topic.geek in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Geek / 3225
3224  |  3226
Subject: 
Previous and next links a la Brickshelf
Newsgroups: 
lugnet.off-topic.geek
Date: 
Wed, 25 Jul 2001 01:07:51 GMT
Viewed: 
97 times
  
Hi all,
If I have a comma separated text file of the form:
filename.ext,thumbnail width,thumbnail height,img width,img height
for example:

inside3.jpg,100,75,640,480
over.jpg,100,75,640,480
stairs.jpg,100,64,640,410
tower.jpg,78,100,320,410
trellis.jpg,78,100,320,410
waterfall.jpg,100,75,640,480

then what is the best way to grab the next and previous images if I am
displaying, for example, "tower.jpg".  (I'm using PHP, but I can work with perl
too.)  Thanks!
--Bram



Message has 1 Reply:
  Re: Previous and next links a la Brickshelf
 
(...) hmmm... dunno php, but try this in perl: #!/usr/bin/perl -w $current = shift; $prev = ''; $next = ''; while (<>) { ($name) = split /,/; if ($name eq $current) { $next = <>; ($next) = split /,/, $next; last; } $prev = $name; } this is untested, (...) (23 years ago, 25-Jul-01, to lugnet.off-topic.geek)

4 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR