4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 22, 2014, 05:11:49 AM

Login with username, password and session length
Search:     Advanced search
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  General / Allgemeines
| |-+  Programming
| | |-+  Re: Second Thumbnail Size
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
This topic has not yet been rated!
Author Topic: Re: Second Thumbnail Size  (Read 5386 times)
haider512
Full Member
***
Offline Offline

Posts: 153

Thank You
-Given: 57
-Receive: 2


View Profile
« on: February 28, 2011, 07:54:09 PM »

thank you sir for reply but problem is still not solved.

I implemented your code on mawenzi code.. i got some error.. please check what did i do wrong?

i have attached the functions.php file..please check if this code is correct.. but i think i applied it correctly.

Please sir look what did i do wrong.
1
Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\library\includes\functions.php on line 562
===============================================

EDIT :

Sir i think you forgot semicolon ( ; )  in your code after $thumb_height = $thumb_height."px"

i added semicolon.. the error is gone ..but image not coming up.. are you sure your code is working fine?


* functions.php (69.74 KB - downloaded 5 times.)
« Last Edit: February 28, 2011, 08:07:34 PM by haider512 » Logged
Rembrandt
4images Moderator
4images Guru
*****
Offline Offline

Posts: 4098

Thank You
-Given: 108
-Receive: 860

Vienna


View Profile WWW
« Reply #1 on: February 28, 2011, 08:18:15 PM »

sorry my mistake, i have edit your functions.php (special)
not more as $max = 1  Smile  $max=1 is the size of your media files.

$max = 0.5; is half from your media file...
$max = 0.4; is smaller, e.t.c.

mfg Andi
 

* functions.php (69.75 KB - downloaded 5 times.)
Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
haider512
Full Member
***
Offline Offline

Posts: 153

Thank You
-Given: 57
-Receive: 2


View Profile
« Reply #2 on: February 28, 2011, 08:31:29 PM »

Many Thanks Sir..
Im trying now..

Thanks again..


==================

Sir i increased the size to 2..so the image quality went got poor.. isnt it possible the image quality still remains the same?? its ok if there is way to generate more two images , i mean resize image in two.. as long as image quality is good..

i did 2 in max the image quality got bad.  is there a fix for this?
« Last Edit: February 28, 2011, 09:36:41 PM by haider512 » Logged
Rembrandt
4images Moderator
4images Guru
*****
Offline Offline

Posts: 4098

Thank You
-Given: 108
-Receive: 860

Vienna


View Profile WWW
« Reply #3 on: February 28, 2011, 10:04:11 PM »

...
Sir i increased the size to 2.....
1.) you can not set $max=2, $max=2 would be the double! of your media file (not thumbnail), that does not work.


2.) i think you have not the right file downloadet, this is the right file:
http://www.4homepages.de/forum/index.php?topic=25017.msg156086#msg156086
Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
haider512
Full Member
***
Offline Offline

Posts: 153

Thank You
-Given: 57
-Receive: 2


View Profile
« Reply #4 on: February 28, 2011, 10:35:08 PM »

oh! sorry..

i downloaded file and replaced with my one.. the other thumbnail image was very big so i tried to make it smaller ..but its not rezing to small??

i even tried to changed the no to 0.01 but it is same in size and its not getting small??
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//################################# Thumbnail small Code ########################################################
function get_thumbnail_small_code($media_file_name$thumb_file_name ""$image_id$cat_id$image_name ""$mode ""$show_link 1$open_window 0) {
  global 
$site_sess$config;

  
$max "0.01"// Factor !

  
if (!check_media_type($media_file_name)) {
    
$thumb "<img src=\"".ICON_PATH."/404.gif\" style=\"border:0px;width:$thumb_width px; height:$thumb_height px;\" />";
  }
  else {
    if (!
get_file_path($media_file_name"media"$cat_id00)) {
      
$file_src ICON_PATH."/".get_file_extension($media_file_name).".gif";
      
$image_info = @getimagesize($file_src);

    
$thumb_width $image_info[0]*$max;
	
	
	
$thumb_height $image_info[1]*$max;
	
	
	
 
$thumb_width $thumb_width."px";
	
	
	
$thumb_height $thumb_height."px";

	
	
$thumb "<img  src=\"".$file_src."\" style=\"border:0px;width:$thumb_width; height:$thumb_height;\"  alt=\"".format_text($image_name2)."\" />";

	
	
}
    else {
      
$file_src get_file_path($media_file_name"media"$cat_id01);
      
$image_info = @getimagesize($file_src);

      
$thumb_width $image_info[0]*$max;
	
	
	
$thumb_height $image_info[1]*$max;

      
$thumb "<img src=\"".$file_src."\" style=\"border:0px;width:$thumb_width; height:$thumb_height;\"  alt=\"".$image_name."\"  />";
    }
  }
  if (
$show_link) {
    if (
$open_window) {
      
$thumb "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode ""))." #z1\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
    }
    else {
      
$thumb "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode ""))." #z1\">".$thumb."</a>";
    }
  }


  return 
$thumb;
}

//#######################################Thumbnail small Code #######################################################

how to resize it smaller to my specific width and height??

====================================

Hello sir i have IDM. so after applying your php file a .pdf file is automatically trying to download it self. why is that idm is catching file from media folder

its the link which always tries to download it self ..  and also i still couldnt figure out how to resize the image?
« Last Edit: February 28, 2011, 10:49:55 PM by haider512 » Logged
Rembrandt
4images Moderator
4images Guru
*****
Offline Offline

Posts: 4098

Thank You
-Given: 108
-Receive: 860

Vienna


View Profile WWW
« Reply #5 on: March 01, 2011, 07:31:00 AM »

next version  Cool

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//################################# Thumbnail small Code ########################################################
function get_thumbnail_small_code($media_file_name$thumb_file_name ""$image_id$cat_id$image_name ""$mode ""$show_link 1$open_window 0) {
  global 
$site_sess$config$site_template;
  
//####### Config ###############################  
  
$maxwidth "150"// pixel
//####### Config ############################### 

  
if (!check_media_type($media_file_name)) {
    
$thumb "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
  }
  else {
    if (!
get_file_path($media_file_name"media"$cat_id00)) {
      
$file_src ICON_PATH."/".get_file_extension($media_file_name).".gif";
      
$image_info = @getimagesize($file_src);
       
$thumb_width $image_info[0]."px";
       
$thumb_height $image_info[1]."px";
       
$thumb "<img src=\"".$file_src."\" style=\"border:0px;width:$thumb_width; height:$thumb_height;\" alt=\"".format_text($image_name2)."\" />";
    }
    else {
      
$file_src get_file_path($media_file_name"media"$cat_id01);
      
$image_info = @getimagesize($file_src);
      
$thumb_width $image_info[0];
      
$thumb_height $image_info[1];
      
      if (
$thumb_width $maxwidth){ 
        
$imageprop=$maxwidth/$thumb_width;
        
$imagevsize$thumb_height*$imageprop
        
$thumb_width=$maxwidth."px"
        
$thumb_heightround($imagevsize)."px";
      } 
      else{
        
$thumb_width $image_info[0]."px";
        
$thumb_height round($image_info[1])."px";
      }
      
      
$thumb "<img src=\"".$file_src."\" style=\"border:".$config['image_border']."px solid;width:$thumb_width; height:$thumb_height;\" alt=\"".format_text($image_name2)."\">";
    }
  }

  if (
$show_link) {
    if (
$open_window) {
      
$thumb "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode ""))." #z1\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
    }
    else {
      
$thumb "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode ""))." #z1\">".$thumb."</a>";
    }
  }
  return 
$thumb;
}

mfg Andi
Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
haider512
Full Member
***
Offline Offline

Posts: 153

Thank You
-Given: 57
-Receive: 2


View Profile
« Reply #6 on: March 02, 2011, 06:07:02 PM »

Thank you sir..your code is working now without blur thing..also now it can be resized to smaller size.. but one more issue is still here.

i have uploaded a pdf file ..and im using my site as eductational purpose .. ppt pdf files etc..

so my download programer automatically is trying to download the pdf file i have uploaded on my 4 images site..

also files with no images should show respective icon.. i mean like if i have uploaded zip file.. it should show zip icon..etc but it instead showing the name of the file?


==============================================

Many Thanks . sir.. little change back to old code in your code ..saved the problem..

many thanks .. superb work sir...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//################################# Thumbnail small Code ########################################################
function get_thumbnail_small_code($media_file_name$thumb_file_name ""$image_id$cat_id$image_name ""$mode ""$show_link 1$open_window 0) {
  global 
$site_sess$config$site_template;

//####### Config ###############################
  
$maxwidth "270"// pixel
//####### Config ###############################

  
if (!check_media_type($media_file_name)) {
    
$thumb "<img src=\"".ICON_PATH."/404.gif\" style=\"border:0;width:$thumb_width ; height:$thumb_height ;\" />";
  }
  else {
    if (!
get_file_path($thumb_file_name"thumb"$cat_id00)) {
      
$file_src ICON_PATH."/".get_file_extension($media_file_name).".gif";
      
$image_info = @getimagesize($file_src);
       
$thumb_width $image_info[0]."px";
       
$thumb_height $image_info[1]."px";
       
$thumb "<img src=\"".$file_src."\" style=\"border:0px;width:$thumb_width; height:$thumb_height;\" alt=\"".format_text($image_name2)."\" />";
    }
    else {
      
$file_src get_file_path($media_file_name"media"$cat_id01);
      
$image_info = @getimagesize($file_src);
      
$thumb_width $image_info[0];
      
$thumb_height $image_info[1];

      if (
$thumb_width $maxwidth){
        
$imageprop=$maxwidth/$thumb_width;
        
$imagevsize$thumb_height*$imageprop;
        
$thumb_width=$maxwidth."px";
        
$thumb_heightround($imagevsize)."px";
      }
      else{
        
$thumb_width $image_info[0]."px";
        
$thumb_height round($image_info[1])."px";
      }

      
$thumb "<img src=\"".$file_src."\" style=\"border:".$config['image_border']."px solid;width:$thumb_width; height:$thumb_height;\" alt=\"".format_text($image_name2)."\">";
    }
  }

  if (
$show_link) {
    if (
$open_window) {
      
$thumb "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode ""))." #z1\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
    }
    else {
      
$thumb "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode ""))." #z1\">".$thumb."</a>";
    }
  }
  return 
$thumb;
}
//------------------------End Thumbnail small


in first else part i changed to $thumb_file_name, "thumb"

from $media_file_name, "media"

now pdf file is not downloading it self.. i mean idm not detecting it..its nice..

Many thanks again..
« Last Edit: March 02, 2011, 06:33:54 PM by haider512 » Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.133 seconds with 19 queries.