View previous topic :: View next topic |
Author |
Message |
Flux -
Joined: 13 Oct 2006 Posts: 48
|
Posted: Sun Feb 18, 2007 7:01 pm Post subject: Picture Thumbnails |
|
|
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 |
|
 |
Flux -
Joined: 13 Oct 2006 Posts: 48
|
Posted: Sun Feb 18, 2007 7:17 pm Post subject: |
|
|
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 |
|
 |
pkSML -
Joined: 29 May 2006 Posts: 955 Location: Michigan, USA
|
Posted: Sun Feb 18, 2007 8:38 pm Post subject: |
|
|
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 |
|
 |
pkSML -
Joined: 29 May 2006 Posts: 955 Location: Michigan, USA
|
Posted: Sun Feb 18, 2007 8:41 pm Post subject: Re: Picture Thumbnails |
|
|
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 |
|
 |
Flux -
Joined: 13 Oct 2006 Posts: 48
|
Posted: Sun Feb 18, 2007 11:40 pm Post subject: |
|
|
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 |
|
 |
pkSML -
Joined: 29 May 2006 Posts: 955 Location: Michigan, USA
|
|
Back to top |
|
 |
|