Displaying picture URL under the pictures...

pkx

Joined: 2003-01-27
Posts: 54
Posted: Mon, 2005-03-07 07:15

I know a *bit* of php, but I'm having a hell of a time going through all of the includes to find the variable to the actual IMG SRC url.

Unlike most others, I have bandwidth to spare. Each picture is watermarked, so I don't mind people posting pictures from my site on forums around the 'net.

Under each picture, I'd like to display both the HTML and BB code for the image itself, making it easy for someone to cut/paste it.

For example, under a picture it would say:

HTML code: <img src="http://domain.com/album/album01/pic.sized.jpg">
BBcode: [img]http://www.domain.com/album/album01/pic.sized.jpg[/url]

Any ideas on how to do this would be greatly appreciated.

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Tue, 2005-03-08 00:36

I've done this for my guilds forums, it spits out 3 or 4 different bbcode combos to give thumbs with links, thumbs, sized, sized with links, blah blah. Give me a day or two to dig out the code :)

 
pkx

Joined: 2003-01-27
Posts: 54
Posted: Tue, 2005-03-08 05:03
fryfrog wrote:
Give me a day or two to dig out the code :)

I really appreciate it!

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Tue, 2005-03-08 05:54

I put the following some where around line 778 in view_photo.php, but you can of course put it anywhere you want. It should help you disect the parts that are used to generate the names and let you use it in any way you wish. This is in a slightly aged version of gallery, v1.4.3-pl2 so it may not be exactly perfect. Also, its embeded in postnuke or something, so of course you'll have to modify some urls :)

<table border=1>
   <tr>
      <td><b>Thumb</b></td>
      <td>[img]<?php echo $gallery->album->getAlbumDirURL("full") . "/" . $image->name .".thumb." . $image->type?>[/img]</td>
   </tr>
   <tr>
      <td><b>Sized</b></td>
      <td>[img]<?php echo $gallery->album->getAlbumDirURL("full") . "/" . $image->name .".sized." . $image->type?>[/img]</td>
   </tr>
   <tr>
      <td><b>Full</b></td>
      <td>[img]<?php echo $gallery->album->getAlbumDirURL("full") . "/" . $image->name ."." . $image->type?>[/img]</td>
   </tr>
   <tr>
      <td><b>Thumb & Link</b></td>
      <td>[url=http://www.thekeepers-eq.org/modules.php?set_albumName=<?php echo$gallery->session->albumName?>&id=<?php echo $image->name?>&op=modload&name=gallery&file=index&include=view_ph$
   </tr>
   <tr>
      <td><b>Sized & Link</b></td>
      <td>[url=http://www.thekeepers-eq.org/modules.php?set_albumName=<?php echo$gallery->session->albumName?>&id=<?php echo $image->name?>&op=modload&name=gallery&file=index&include=view_ph$
   </tr>
   <tr>
   </tr>
   <tr>
      <td><b>Full & Link</b></td>
      <td>[url=http://www.thekeepers-eq.org/modules.php?set_albumName=<?php echo$gallery->session->albumName?>&id=<?php echo $image->name?>&op=modload&name=gallery&file=index&include=view_ph$
   </tr>
</table>
 
pkx

Joined: 2003-01-27
Posts: 54
Posted: Tue, 2005-03-08 07:56

That's exactly what I needed... thanks again!

I made the text that you cut & paste really small just to take up a smaller width. Besides, don't need to read it when you're just cut&pasting.

Here's an example:
http://www.linquist.net/gallery/050213_Yosemite/IMG_2087

 
xchido
xchido's picture

Joined: 2004-02-20
Posts: 24
Posted: Tue, 2007-09-11 03:17

I have a successful integration using the methods described here. I only have one minor problem. Before I had it integrated to PostNuke I used PageWrap to include into my site. I added the direct link to the main page of the gallery and it was working ok. Now with the full integration the gallery works even better, user have their own album, and all works perfectly. This is the problem, I have several outside links that point to the main page of the gallery [http://www.zacatecas.net/modules/mGallery2/gallery2/main.php] I changed the parameters in the config file to only allow PN integrated access to the site so the above link does not work anymore when accessed firectly. The new direct link to access the main page inside PN is [http://www.zacatecas.net/index.php?name=mGallery2&file=index] and this link works wonderfully. The issues is when somebody access the old direct link it leaves the visitor with an error page and they are not able to click on any link or be re-directed to a page they can use. In essence, if they access the direct link they get lost and I lose them.

I tried to use the redirect 301 command in an htaccess file but I get this problem. Using the redirect 301 command in my htaccess file makes all of the image links disappear. Since they use the same old path.

Using this method visitors to http://www.zacatecas.net/modules/mGallery2/gallery2/main.php are redirected to http://www.zacatecas.net/index.php?name=mGallery2&file=index - There is no problem there. But when I look at the images I find that their path is set to /modules/mGallery2/gallery2/main.php thus being redirected to the new address, in dong this all links for the images in the gallery are broken.

This is what I added in the htaccess file:

Redirect 301 /modules/mGallery2/gallery2/main.php http://www.zacatecas.net/index.php?name=mGallery2&file=index