Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: normal and pics  (Read 3684 times)

0 Members and 1 Guest are viewing this topic.

Bullmax

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
normal and pics
« on: May 24, 2006, 10:59:54 pm »

I am a little confused on this one.
Sometimes when pics are uploaded, you can hover over the picture and when clicked on, you get a real big picture.  The url to the pic (not the page) has a file name like normal_mypic.jpg.
Sometimes when a pic is uploaded, it does not allow you to click on it to bring up a big pic.  The file name then does not have the normal in it like mypic.jpg.

I would like to have all pics with the ability when clicked on, you get a big picture.

Hope this is clear and thanks.
« Last Edit: May 25, 2006, 05:01:30 pm by TranzNDance »
Logged

Nibbler

  • Guest
Re: normal and pics
« Reply #1 on: May 24, 2006, 11:08:15 pm »

That depends on the size of pic you upload. If the pic is larger than the dimensions set in config for intermediate pics then you get the nornal_ version. If the pic was small then it is displayed as-is.
Logged

Bullmax

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: normal and pics
« Reply #2 on: May 24, 2006, 11:21:39 pm »

Thanks for the reply.
So if I do not allow auto resizing, will they all be as is then?  Will the user get an error message about the file being to big?

My problem is I have BBcode copy and paste for each picture.  It is automatically putting in the normal in every upload.  So if a user meets the file sizes, they get a wrong code output because its adding the normal in the file url.

Here is the bbcode mod part in my displayimage.php:

Code: [Select]
$bbcodenormal_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
    $info['<b>BB Code Copy Info</b>']='<font color="#008000">1) Click anywhere inside the box, then press Ctrl+A to select all the text.<br />2) Press Ctrl+C to copy the selected  text.<br />3) Press Ctrl+V to paste the selected text into your siggy or post.<br />(You can also use your mouse for copy & paste)</font>';
    $info['BB Code<br>Normal (large pic)']='<textarea type=text name=text rows=2 cols=53>[url=http://www.mysite.com/photoalbum/'.$_SERVER["SCRIPT_NAME"]."?pos=-$CURRENT_PIC_DATA[pid]".'][img]'.'http://www.mysite.com/photoalbum/'.$bbcodenormal_url.'[/img][/url]</textarea>';
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: normal and pics
« Reply #3 on: May 25, 2006, 12:46:16 am »

Code: [Select]
if($CONFIG['make_intermediate'] && (max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width'])) {
//fullsize
} else {
//normal
}

Bullmax

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: normal and pics
« Reply #4 on: May 25, 2006, 12:50:28 am »

Thanks for the reply.
Where would I put that code?
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: normal and pics
« Reply #5 on: May 25, 2006, 12:58:43 am »

that's for your bbcode enhancement

Code: [Select]
if($CONFIG['make_intermediate'] && (max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width'])) {
    $bbcodenormal_url = get_pic_url($row, 'normal');
} else {
    $bbcodenormal_url = get_pic_url($row, 'fullsize');
}
    $info['<b>BB Code Copy Info</b>']='<font color="#008000">1) Click anywhere inside the box, then press Ctrl+A to select all the text.<br />2) Press Ctrl+C to copy the selected  text.<br />3) Press Ctrl+V to paste the selected text into your siggy or post.<br />(You can also use your mouse for copy & paste)</font>';
    $info['BB Code<br>Normal (large pic)']='<textarea type=text name=text rows=2 cols=53>[url=http://www.mysite.com/photoalbum/'.$_SERVER["SCRIPT_NAME"]."?pos=-$CURRENT_PIC_DATA[pid]".'][img]'.'http://www.mysite.com/photoalbum/'.$bbcodenormal_url.'[/img][/url]</textarea>';

Bullmax

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: normal and pics
« Reply #6 on: May 25, 2006, 03:37:13 pm »

Hi again, I tried the code but it now does not generate the image location after www.mysite.com/photoalbum/.

Here is the output bbcode I get:
Code: [Select]
[url=http://www.mysite.com/photoalbum/displayimage.php?pos=-733][img]http://www.mysite.com/photoalbum/[/img][/url]
Logged

Nibbler

  • Guest
Re: normal and pics
« Reply #7 on: May 25, 2006, 03:46:27 pm »

Change $row to $CURRENT_PIC_DATA. Also the code may need to be more complex than that, depends on your config settings.
Logged

Bullmax

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: normal and pics
« Reply #8 on: May 25, 2006, 03:56:24 pm »

Thanks for your paitence.  I cannot find $row to change.
Logged

Nibbler

  • Guest
Re: normal and pics
« Reply #9 on: May 25, 2006, 04:01:10 pm »

It's in the code Stramm posted.
Logged

Bullmax

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: normal and pics
« Reply #10 on: May 25, 2006, 04:10:21 pm »

Excellent!  That did it.

Thank you all!!
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.