coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: Sandy on January 23, 2005, 07:29:03 PM

Title: I have got some problems with spaces in the archives
Post by: Sandy on January 23, 2005, 07:29:03 PM
Hi all

First, excuse my write english please, because im from spain and im not very good.

I Have install the last version of coppermine on www.lokuras.net, for to do a spanishs comics recopilations web.

I want to put in the info page javascript of the medium size image (normal_) a link to download the image, i can see that the script comes with a option to put in on a Favorites section, but i keep out all that.

In displayimage.php I have change the following lines (335/337):

Quote$info[$lang_picinfo['addFavPhrase']] = "<a target=_blank href=http://www.lokuras.net/albums/" . $CURRENT_PIC_DATA['filepath'] . "" . htmlspecialchars($CURRENT_PIC_DATA['filename']) . " >http://www.lokuras.net/albums/" . $CURRENT_PIC_DATA['filepath'] . "" . htmlspecialchars($CURRENT_PIC_DATA['filename']) . '</a>';
   } else {
       $info[$lang_picinfo['addFavPhrase']] = "<a target=_blank href=http://www.lokuras.net/albums/" . $CURRENT_PIC_DATA['filepath'] . "" . htmlspecialchars($CURRENT_PIC_DATA['filename']) . " >http://www.lokuras.net/albums/" . $CURRENT_PIC_DATA['filepath'] . "" . htmlspecialchars($CURRENT_PIC_DATA['filename']) . '</a>';

The original code is:

Quote$info[$lang_picinfo['addFavPhrase']] = "<a href=addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . " >" . $lang_picinfo['addFav'] . '</a>';
   } else {
       $info[$lang_picinfo['addFavPhrase']] = "<a href=addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . " >" . $lang_picinfo['remFav'] . '</a>';
 

And this changes works perfect, but i have a problem with the filenames with spaces, because the url os the filename if not completed.

Here you have some examples:

http://www.lokuras.net/displayimage.php?album=296&pos=33 (This is the coppermine url of one image with spaces, is all perfect, but do click in the info and look the url os the bottom)

http://www.lokuras.net/albums/12_01_04/LaSecretariaCoq/La (This is the link, BAD URL)

http://www.lokuras.net/albums/12_01_04/LaSecretariaCoq/La Secretaria_033.jpg (This is the goog url)

Can somebody help me ?

Can I put something in the code for when the scripts see a filename with spaces, in the space put %20 ?

Thanks for all
Title: Re: I have got some problems with spaces in the archives
Post by: Joachim Müller on January 23, 2005, 08:38:55 PM
You're probably looking for http://www.php.net/manual/en/function.rawurlencode.php

Joachim
Title: Re: I have got some problems with spaces in the archives
Post by: Sandy on January 24, 2005, 09:55:51 PM
Quote from: GauGau on January 23, 2005, 08:38:55 PM
You're probably looking for http://www.php.net/manual/en/function.rawurlencode.php

Joachim

Sorry but i dont understand well that php manual, is very complicated for my bad english...

Can somebody help me with some steps in the code i have to do it?

I only want to put a link to the original image for the people can download it easylly (comics have so many pages, and there are big of size) in the middle page, so them the people only have to do click on Next and on the link of the image, but if the image have a space, all is a disaster :(
Title: Re: I have got some problems with spaces in the archives
Post by: Joachim Müller on January 25, 2005, 08:18:10 AM
The php manual is available in spanish as well: http://www.php.net/manual/es/function.rawurlencode.php

Try using rawurlencode($CURRENT_PIC_DATA['filename']) instead ofhtmlspecialchars($CURRENT_PIC_DATA['filename']) , that's what I was suggesting.

Joachim

Title: Re: I have got some problems with spaces in the archives
Post by: Sandy on January 28, 2005, 03:25:03 PM
Thanks men, works 100% perfect  ;)