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
You're probably looking for http://www.php.net/manual/en/function.rawurlencode.php
Joachim
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 :(
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