o: ActiveSupport::Cache::Entry :@compressedF: @value" G"G
Web/thumb.php
1
<?php
2

  
3
        function file_type($file){
4
                $path_chunks = explode("/", $file);
5
                $thefile     = $path_chunks[count($path_chunks) - 1];
6
                $dotpos      = strrpos($thefile, ".");
7
                return strtolower(substr($thefile, $dotpos + 1));
8
        }
9

  
10
                $path         = "/var/www/Modules/".$HTTP_GET_VARS["pth"]."/";
11
                $filename     = $HTTP_GET_VARS["fname"]."_Small.jpg";
12
        //      $thumbnail    = thumbnail_name($filename);
13
                $extension    = file_type($filename);
14
                $remove_thumb = false;
15
                $img_size     = array();
16
                $width          = "150";
17
                $height         = "150";
18

  
19
  if (!file_exists("/tmp/".$filename)) {
20

  
21
                if(in_array($extension, array('png', 'gif', 'jpg', 'jpeg'))){
22
                        if(!$img_size = getimagesize($path.$filename)){
23
                                $remove_thumb = true;
24
                        }
25
                        if($extension == 'gif'){
26
                                if(!$image = imagecreatefromgif($path.$filename)){
27
                                        $remove_thumb = true;
28
                                }
29
                        }elseif($extension == 'png'){
30
                                if(!$image = imagecreatefrompng($path.$filename)){
31
                                        $remove_thumb = true;
32
                                }
33
                        }elseif($extension == 'jpg' || $extension == 'jpeg'){
34
                                if(!$image = imagecreatefromjpeg($path.$filename)){
35
                                        $remove_thumb = true;
36
                                }
37
                        }
38
                        $img_height = $img_size['1'];
39
                        $img_width  = $img_size['0'];
40
                        if($img_width > $img_height){
41
                                $thumb_width  = $width;
42
                                $thumb_height = ($img_height)*($height/$img_width);
43
                        }elseif($img_width < $img_height) {
44
                                $thumb_width  = ($img_width)*($width/$img_height);
45
                                $thumb_height = $height;
46
                        }elseif($img_height == $img_width) {
47
                                $thumb_width  = $width;
48
                                $thumb_height = $height;
49
                        }
50
                        if($remove_thumb == false){
51
                                $thumb = imagecreatetruecolor($thumb_width, $thumb_height);
52
                                imagecopyresampled($thumb, $image, 0, 0, 0, 0, $thumb_width, $thumb_height, $img_size[0], $img_size[1] );
53
                                imagejpeg($thumb, "/tmp/".$filename);
54

  
55
                        }       
56
                }else{
57
                        $remove_thumb = true;
58
                }
59

  
60
  }
61

  
62

  
63
header("Content-type: image/jpeg");
64
readfile("/tmp/".$filename);
65
?>
Web/modules.inc.php
7 7

  
8 8

  
9 9

  
10
          if (file_exists($path.$folder.'/'.$HTTP_GET_VARS["file"]."/".$soubor1."/".$img)) {
10
/*          if (file_exists($path.$folder.'/'.$HTTP_GET_VARS["file"]."/".$soubor1."/".$img)) {
11 11
            echo "<td><img src=\"".$www.$folder.'/'.$HTTP_GET_VARS["file"]."/".$soubor1."/".$img."\"></td>\n";
12
          } else { echo "<td><img src=\"http://www.mlab.cz/Web/PIC/nopicture2.jpg\"></td>\n"; }
12
          } else { echo "<td><img src=\"http://www.mlab.cz/Web/PIC/nopicture2.jpg\"></td>\n"; }*/
13 13

  
14
          echo "<td><img src=\"thumb.php?pth=".$soubor."/".$soubor1."&fname=".$soubor1."\"></td>\n";
15

  
14 16
          if (file_exists($path.$folder."/".$HTTP_GET_VARS["file"]."/".$soubor1."/DOC/HTML/".$soubor1.".".$lang.".html")) {
15 17
            echo "<td><a href=\"".$www.$folder."/".$HTTP_GET_VARS["file"]."/".$soubor1."/DOC/HTML/".$soubor1.".".$lang.".html\">".$soubor1."</a></td>\n";
16 18
          } else { echo "<td>".$soubor."/<b>".$soubor1."</b></td>\n"; }
Web/modules.php
117 117

  
118 118
      if (file_exists($path.$folder."/".$soubor."/CAM_AMA")) {
119 119
        echo "<tr>";
120
        if (file_exists($path.$folder.'/'.$soubor."/".$img)) { echo "<td><img src=\"".$www.$folder.'/'.$soubor."/".$img."\"></td>\n"; }
121
         else { echo "<td><img src=\"http://www.mlab.cz/Web/PIC/nopicture2.jpg\"></td>\n"; }
120
/*        if (file_exists($path.$folder.'/'.$soubor."/".$img)) { echo "<td><img src=\"".$www.$folder.'/'.$soubor."/".$img."\"></td>\n"; }
121
         else { echo "<td><img src=\"http://www.mlab.cz/Web/PIC/nopicture2.jpg\"></td>\n"; }*/
122
        echo "<td><img src=\"thumb.php?pth=".$soubor."&fname=".$soubor."\"></td>\n";         
122 123
        if (file_exists($path.$folder."/".$soubor."/DOC/HTML/".$soubor.".".$lang.".html")) {
123 124
          echo "<td><b><a href=\"".$www.$folder."/".$soubor."/DOC/HTML/".$soubor.".".$lang.".html\">".$soubor."</a></b></td>\n";
124 125
        } else { echo "<td><b>".$soubor."</b></td>\n"; }
:@created_atf1423347764.3764639ü:@expires_in0