Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: I have got some problems with spaces in the archives  (Read 5020 times)

0 Members and 1 Guest are viewing this topic.

Sandy

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
I have got some problems with spaces in the archives
« 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
« Last Edit: January 28, 2005, 04:29:53 pm by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: I have got some problems with spaces in the archives
« Reply #1 on: January 23, 2005, 08:38:55 pm »

Logged

Sandy

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: I have got some problems with spaces in the archives
« Reply #2 on: January 24, 2005, 09:55:51 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 :(
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: I have got some problems with spaces in the archives
« Reply #3 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
Code: [Select]
rawurlencode($CURRENT_PIC_DATA['filename']) instead of
Code: [Select]
htmlspecialchars($CURRENT_PIC_DATA['filename']) , that's what I was suggesting.

Joachim

Logged

Sandy

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: I have got some problems with spaces in the archives
« Reply #4 on: January 28, 2005, 03:25:03 pm »

Thanks men, works 100% perfect  ;)
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.