Display image URL below image

jamesh.com.au

Joined: 2005-09-21
Posts: 26
Posted: Tue, 2006-01-10 10:32

Now I have had a look around using the search function but haven't seen an easy way to do this.

I have a gallery which is used by people to host images for a UBB forum. I want to put (under each photo) a link to the photo and the larger version in plain text so the user can easily copy / paste it into the forums ...

eg I want

Copy and paste the following code into the forums to display your image.

(url=http://www.waw.net.au/gallery/v/wz/SE-Australia-02012006-0005UTC-250m-crop.jpg.html?g2_imageViewsIndex=1)
(img)http://www.waw.net.au/gallery/d/1239-2/SE-Australia-02012006-0005UTC-250m-crop.jpg(/img)(/url)

I simply cannot figure out how to get gallery to output a simple URL of my image?

Any help would be greatly appriciated!
Cheers
James

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Tue, 2006-01-10 11:17

http://gallery.menalto.com/node/40396?highlight=generate%2Curl should be useful?


h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org

 
jamesh.com.au

Joined: 2005-09-21
Posts: 26
Posted: Tue, 2006-01-10 19:26

Thanks but the question was never answered in that thread and the long URL solution ....

{if !$child.canContainChildren}
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}">{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}</a>
{/if}

Fails for me, producing the error message:
Fatal error: Call to undefined function: getmimetype() in /home/httpd/vhosts/waw.net.au/httpdocs/gallery/modules/rewrite/classes/RewriteUrlGenerator.class on line 209

 
jamesh.com.au

Joined: 2005-09-21
Posts: 26
Posted: Wed, 2006-01-11 08:16

With the lack of response I take it this is not possible to do?

What is another decent gallery like program that will do this seemingly simple function?

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Wed, 2006-01-11 08:47

It's definately possible to do, I can have a stab at it tonight if you are still interested.


h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org

 
jamesh.com.au

Joined: 2005-09-21
Posts: 26
Posted: Wed, 2006-01-11 10:25

that would be fantastic, but I don't understand why it is that hard- why wont a simple g->url expression work?

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Wed, 2006-01-11 15:13

To be honest, I haven't looked at it. I will later on tonight though.


h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2006-01-11 20:47

where are you adding this?
if you're editing photo.tpl in most themes you can use
{g->url arg1="view=core.DownloadItem" arg2="itemId=`$image.id`"}
this will be the url of the currently viewed size.
you didn't really give enough information to determine why you got an error about getmimetype.

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Wed, 2006-01-11 21:04

Thats what I did on http://sandbox.p0ggel.org/gallery2/main.php?g2_view=core.ShowItem&g2_itemId=2787

Only addition to what mindless did, was that I added the forceFullUrl=true parameter to have it generated a full url instead of a relative one:

{g->url arg1="view=core.DownloadItem" arg2="itemId=`$image.id`" forceFullUrl=true}


h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2006-01-11 22:01

Thanks for the example, h0bbel.. that shows us we should also add forceSessionId=false so you don't get any session id in the url that is shown.

{g->url arg1="view=core.DownloadItem" arg2="itemId=`$image.id`" forceFullUrl=true forceSessionId=false}

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Wed, 2006-01-11 22:11

Yeah, yeah, I forgot something didn't I ;-)


h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org

 
jamesh.com.au

Joined: 2005-09-21
Posts: 26
Posted: Thu, 2006-01-12 12:57
mindless wrote:
where are you adding this?
if you're editing photo.tpl in most themes you can use
{g->url arg1="view=core.DownloadItem" arg2="itemId=`$image.id`"}
this will be the url of the currently viewed size.
you didn't really give enough information to determine why you got an error about getmimetype.

You see ... that is perfect and works perfectly! THANKYOU ... now why the hell did I have to go through all this crap to get a simple response like yours?

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Thu, 2006-01-12 13:09

Excuse me? I'm sorry that I actually took the time to try and figure out how to do this for you, and trying to help you at all.


h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org

 
jamesh.com.au

Joined: 2005-09-21
Posts: 26
Posted: Thu, 2006-01-12 19:45

Sorry I wasn't having a go at you, I was having a go at the documentation ... I must have read it 5 times, and tried 15 different iterations, but could not figure it out. G2 is MUCH harder to use than G1 !!!

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2006-01-13 03:16

we'd appreciate any help with the docs you can provide, thanks.