Unregistered
Unregistered
Guest   Less than 1 minute ago
#1

Hi!

I currently have my own little photo album and am planning on moving over to zenphoto.

Right now I have everything set up and running, but I need a way to get the filename. On each image page I want to grab more data about the image that I already have stored in another MySQL table. To grab the correct information I need to be able top grab the filename of the image that is being shown, add a bit of text to it so it will match the thumb address of the second table and then call in the required fields.

The problem I am having is figuing out how to grab the filename of the image.

Thank you much for your time!
-Mr. Dobolina, Mr. Bob Dobolina

Developer
Developer
trisweb   11-08-2006, 02:44
#2

From a theme, it's in the following variable for the current image (whether you're on the image page, or in the while(next_image): loop).

$_zp_current_image->name

If you need it for some other image, take a look at the gallery, album and image classes in classes.php and the things that return images. You can get any of those and get their name or do anything else you want with them

Member
Member
jayray999   28-11-2006, 07:02
#3

Ok,

works.

It echoes filename.jpg on the image page.

But how to strip the extension .jpg and display the filename on an image page?

Developer
Developer
trisweb   28-11-2006, 08:12
#4

That is the filename...

If you want to strip the extension, try
``

Member
Member
jayray999   28-11-2006, 08:24
#5

Thanks Tristan. It works.

Developer
Developer
trisweb   28-11-2006, 08:25
#6

Cool, no problem.

Member
Member
wdiggles   07-05-2011, 03:20
#7

This is an old thread so wondering if this still works? I tried putting

in the h2 tag but it is blank on page

Also tried it in page title but still blank

Member
Member
wdiggles   07-05-2011, 03:30
#8

found a post that said you changed name to filename, it works now ;-)

Member
Member
wdiggles   07-05-2011, 03:49
#9

Another question, does getFileName function exist? or printFileName? If not, how can it be done?

Administrator
Administrator
acrylian   07-05-2011, 09:31
#10

Yes, see the documentation.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.