https://www.icyphoenix.com/viewtopic.php?f=1&t=7214&p=49409#p49409
-----------------------------------
Danielc
Thu 01 Jul, 2010 21:33

Re: Icy Phoenix 1.3.11.64
-----------------------------------
Thanks for your reply.
Related to templates, i will do that when i finish the design and start with the coding.

Related to CSS and JS merging,ok, no problem, if you include that switch, better for me as i don't have to modify my files :mrblue: .

Related to the thumbnails.. Really i had seen all the parts you mentioned, but no one worked for my request:

[code]if(file_exists($pic_thumbnail_fullpath))
                        {
                            $thumb_exists = true;
                            $params['src'] = $server_url . str_replace(IP_ROOT_PATH, '', $pic_thumbnail_fullpath);
                        }[/code]
This code checks if the thumbnail exists, and in this case, it changes the image source to the thumbnail. My idea is use the same image URL (not thumbnail) if the width and height are lesser than the max size and the image is hosted in my site, so you don't use TWO links for the same content (thumbnail and original image). As $params['src'] has the original URL as value, i don't need to set that. First i tried to modify $pic_thumbnail_fullpath but it didn't worked (i don't know why, i think it was coded correctly). I set $thumb_exists to true because if i wouldn't do that, in the following code, Icy Phoenix it would change the image source to image_thumbnail.php (with the image as param):
[code]if (($thumb_exists == false) || ($cache_image == false))
				{
					$params['src'] = 'posted_img_thumbnail.' . PHP_EXT . '?' . $cache_append . 'pic_id=' . $img_url_enc;
				}[/code]

Also, before modify bbcode.php, i took a look at image_thumbnail.php and i saw the code you mentioned:

[code]if(($pic_width < $config['thumbnail_size']) && ($pic_height < $config['thumbnail_size']))
{
    if($config['thumbnail_cache'] == true)
    {
        $copy_success = @copy($pic_fullpath, $pic_thumbnail_fullpath);
        @chmod($pic_thumbnail_fullpath, 0777);
    }[/code]

First, i noticed an error there, i think it must check if pic_width and pic_height are lesser or equal to the thumbnail size, so i replaced
[code]if(($pic_width < $config['thumbnail_size']) && ($pic_height < $config['thumbnail_size']))[/code]
to:
[code]if(($pic_width <= $board_config['thumbnail_size']) && ($pic_height <= $board_config['thumbnail_size']))[/code]

After, i started to modify this code, so it doesn't copy the same image as thumbnail. I replaced:
[code]$copy_success = @copy($pic_fullpath, $pic_thumbnail_fullpath);
			@chmod($pic_thumbnail_fullpath, 0777);[/code]
to:
[code]if($pic_local == true)
		{
			$pic_thumbnail_fullpath = $pic_fullpath;
		}else {
			$copy_success = @copy($pic_fullpath, $pic_thumbnail_fullpath);
			@chmod($pic_thumbnail_fullpath, 0777);
		}[/code].
Then i tested, but fail!. The forum still used two urls for the same url (my idea is use consistent url's for the same content), so i modify bbcode.php as i said before.

I hope you understand my idea and why i modified it.

Thanks!


