How to get the photo url?

aj510

Joined: 2006-10-10
Posts: 24
Posted: Fri, 2007-11-09 01:29

How can I get the image url for a separate link on the photo page?

So in the photo.tpl file i'd like to get the 'http://www.mydomain.com/image.jpg'

How can I do this please guys?

cheers,
AJ

 
aj510

Joined: 2006-10-10
Posts: 24
Posted: Fri, 2007-11-09 01:58

Also - can I get image attributes like height and width?

If need be, I am willing to pay someone to do this if there isn't a fix like this around.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2007-11-09 04:31

Enable buffered debug:
FAQ: How to set/use Gallery in debug mode?
in the popup window you will see all the smarty variable available.
Example:
{$theme.item.width} will give you the width
{$theme.item.height} will give you the height
{$theme.item.pathComponent} will give you the name of the item as saved in the g2data directory.

What is it you are after? do you want to paste a image on a external site? Then use the geturls module.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
aj510

Joined: 2006-10-10
Posts: 24
Posted: Fri, 2007-11-09 05:52

Thanks Dave, i'll give that a go.

I want to add an mms for each image and need to get the path and width/height to do so.

 
aj510

Joined: 2006-10-10
Posts: 24
Posted: Fri, 2007-11-09 05:54

The width and height work perfectly, however the full url of the image doesn't seem work (only the image name itself).

Any idea how I can get the full path of the image?

mod_rewrite is enabled and working...

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2007-11-09 06:01

If you followed directions your G2data directory will be outside the web viewable location.
you want the image url on photo.tpl?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
aj510

Joined: 2006-10-10
Posts: 24
Posted: Fri, 2007-11-09 06:18

Yes I would like the full image url on photo.tpl

I can hotlink images ie
http://mydomain.com/gallerys/d/26164-2/image.jpg
However I can't seem to work out how to extract that url and use it on the photo.tpl page. I always end up with <img src= or <a href tags around it.

Is there a way to go about doing this?

cheers,
AJ

 
aj510

Joined: 2006-10-10
Posts: 24
Posted: Sat, 2007-11-10 00:19

bump - finding it quite strange to think that obtaining the url of an image on the page it is displayed could be this difficult?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2007-11-10 05:25
Full URL:{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`" forceFullUrl=true}<br/>
resized URL:{g->url arg1="view=core.DownloadItem" arg2="itemId=`$image.id`" forceFullUrl=true}

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
aj510

Joined: 2006-10-10
Posts: 24
Posted: Sun, 2007-11-11 00:14

Dave - that does exactly what I was wanting.

Thank you so much - tell your wife to be extra friendly tonight :)

 
anastasia84

Joined: 2008-12-10
Posts: 1
Posted: Wed, 2008-12-10 11:10

hey i neeed help,i want to get the url for a picture i need to opload on myspace? some good pages where they do that?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2008-12-12 04:53

http://codex.gallery2.org/Gallery2:Modules:geturls

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team