Picture Thumbnails

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Flux
-


Joined: 13 Oct 2006
Posts: 48

PostPosted: Sun Feb 18, 2007 7:01 pm    Post subject: Picture Thumbnails Reply with quote

So I'm using (what I'd assume is) pkSML's directory script to browse my server via the "From Script" mode of Abyss' directory list.
I've managed to successfully add in picture thumbnails, but the thumbnail script can't find the pictures to turn into thumbnails from an aliased directory I installed.
So I copied the thumbnail script and put it into the aliased directory, and tested it. It works. But now I need to figure out how to get from having a filename/location of:
/flux/pics/blah/yadda/jpg.jpg
to
blah/yadda/jpg.jpg

because the script is in the pics folder, and needs to find files from there.

So if i say $_POST['path'] it will give me the full url, and what I'd like to know is how to take away only the "/flux/pics/" part. Isn't there some simple way to manipulate variables to do that?
_________________
My signature is so lame.

I think phpBB forums hates my laptop '.';
Back to top View user's profile Send private message
Flux
-


Joined: 13 Oct 2006
Posts: 48

PostPosted: Sun Feb 18, 2007 7:17 pm    Post subject: Reply with quote

In addition, how do you match the first part of a string as well?
i.e.:

$_POST['path'] = "/flux/pics/blah/yadda/"

how do you test to see if the string begins with "/flux/pics/" and only test for that?

edit: Sorry...forgot I could edit :oops:
_________________
My signature is so lame.

I think phpBB forums hates my laptop '.';
Back to top View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 955
Location: Michigan, USA

PostPosted: Sun Feb 18, 2007 8:38 pm    Post subject: Reply with quote

Could you be specific on the URL that you obtained the script from? (I've tried several and posted sources on this forum.)
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
pkSML
-


Joined: 29 May 2006
Posts: 955
Location: Michigan, USA

PostPosted: Sun Feb 18, 2007 8:41 pm    Post subject: Re: Picture Thumbnails Reply with quote

Flux wrote:
So if i say $_POST['path'] it will give me the full url, and what I'd like to know is how to take away only the "/flux/pics/" part. Isn't there some simple way to manipulate variables to do that?


This is easy:
Code:
<?php echo substr($_POST['path'], 11); ?>


Flux wrote:
In addition, how do you match the first part of a string as well?
i.e.:

$_POST['path'] = "/flux/pics/blah/yadda/"

how do you test to see if the string begins with "/flux/pics/" and only test for that?

Code:
<?php

if (eregi('^/flux/pics/', $_POST['path'])) {
    echo "Yah, it begins with /flux/pics/";
}
?>

_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
Flux
-


Joined: 13 Oct 2006
Posts: 48

PostPosted: Sun Feb 18, 2007 11:40 pm    Post subject: Reply with quote

Cool, thanks.

You're actually the one that gave me the link. From here:
http://stephen.calvarybucyrus.org/code/3

Although that's a directory script, that is indeed the source that I used. I'm still using the same thing as what's on there, except there are no folder restrictions, and I've added a little code here and there to implement picture thumbnails.

I got the thumbnail script that I'm using from:
http://www.gen-x-design.com/downloads/thumbnail_v2.zip

(I'm using the php 5 version)
_________________
My signature is so lame.

I think phpBB forums hates my laptop '.';
Back to top View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 955
Location: Michigan, USA

PostPosted: Mon Feb 19, 2007 2:09 am    Post subject: Reply with quote

OK. Just found the afore-mentioned topic -- http://www.aprelium.com/forum/viewtopic.php?t=11672

If you want a really snazzy directory listing with this feature (picture thumbnails), you might try to implement this directory listing --> http://stephen.calvarybucyrus.org/code/4
Complete installation instructions are on this page.

You can see the demo of this script at http://www.evoluted.net/stuff/. But you'll have to refer to my page because there's a little more to it to get it to work on Abyss.
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group