coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 upload => Topic started by: Bullmax on May 24, 2006, 10:59:54 PM

Title: normal and pics
Post by: Bullmax 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.
Title: Re: normal and pics
Post by: Nibbler 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.
Title: Re: normal and pics
Post by: Bullmax 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:

$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>';
Title: Re: normal and pics
Post by: Stramm on May 25, 2006, 12:46:16 AM
if($CONFIG['make_intermediate'] && (max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width'])) {
//fullsize
} else {
//normal
}

Title: Re: normal and pics
Post by: Bullmax on May 25, 2006, 12:50:28 AM
Thanks for the reply.
Where would I put that code?
Title: Re: normal and pics
Post by: Stramm on May 25, 2006, 12:58:43 AM
that's for your bbcode enhancement

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>';
Title: Re: normal and pics
Post by: Bullmax 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:
[url=http://www.mysite.com/photoalbum/displayimage.php?pos=-733][img]http://www.mysite.com/photoalbum/[/img][/url]
Title: Re: normal and pics
Post by: Nibbler 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.
Title: Re: normal and pics
Post by: Bullmax on May 25, 2006, 03:56:24 PM
Thanks for your paitence.  I cannot find $row to change.
Title: Re: normal and pics
Post by: Nibbler on May 25, 2006, 04:01:10 PM
It's in the code Stramm posted.
Title: Re: normal and pics
Post by: Bullmax on May 25, 2006, 04:10:21 PM
Excellent!  That did it.

Thank you all!!