| 
      1
     | 
    
      <?php
 
     | 
  
  
    | 
      2
     | 
    
      /**
 
     | 
  
  
    | 
      3
     | 
    
       *
 
     | 
  
  
    | 
      4
     | 
    
       * @category        admin
 
     | 
  
  
    | 
      5
     | 
    
       * @package         admintools
 
     | 
  
  
    | 
      6
     | 
    
       * @author          WebsiteBaker Project
 
     | 
  
  
    | 
      7
     | 
    
       * @copyright       Ryan Djurovich
 
     | 
  
  
    | 
      8
     | 
    
       * @copyright       WebsiteBaker Org. e.V.
 
     | 
  
  
    | 
      9
     | 
    
       * @link            http://websitebaker.org/
 
     | 
  
  
    | 
      10
     | 
    
       * @license         http://www.gnu.org/licenses/gpl.html
 
     | 
  
  
    | 
      11
     | 
    
       * @platform        WebsiteBaker 2.8.3
 
     | 
  
  
    | 
      12
     | 
    
       * @requirements    PHP 5.3.6 and higher
 
     | 
  
  
    | 
      13
     | 
    
       * @version         $Id: thumb.php 2 2017-07-02 15:14:29Z Manuela $
 
     | 
  
  
    | 
      14
     | 
    
       * @filesource      $HeadURL: svn://isteam.dynxs.de/wb/2.10.x/trunk/admin/media/thumb.php $
 
     | 
  
  
    | 
      15
     | 
    
       * @lastmodified    $Date: 2017-07-02 17:14:29 +0200 (Sun, 02 Jul 2017) $
 
     | 
  
  
    | 
      16
     | 
    
       *
 
     | 
  
  
    | 
      17
     | 
    
       */
 
     | 
  
  
    | 
      18
     | 
    
      
 
     | 
  
  
    | 
      19
     | 
    
      if(!defined('WB_URL'))
     | 
  
  
    | 
      20
     | 
    
      {
     | 
  
  
    | 
      21
     | 
    
          $config_file = realpath('../../config.php');
     | 
  
  
    | 
      22
     | 
    
          if(file_exists($config_file) && !defined('WB_URL'))
     | 
  
  
    | 
      23
     | 
    
          {
     | 
  
  
    | 
      24
     | 
    
              require($config_file);
 
     | 
  
  
    | 
      25
     | 
    
          }
 
     | 
  
  
    | 
      26
     | 
    
      }
 
     | 
  
  
    | 
      27
     | 
    
      //if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
     | 
  
  
    | 
      28
     | 
    
      $modulePath = dirname(__FILE__);
 
     | 
  
  
    | 
      29
     | 
    
      
 
     | 
  
  
    | 
      30
     | 
    
      /*
 
     | 
  
  
    | 
      31
     | 
    
      // Get image
 
     | 
  
  
    | 
      32
     | 
    
          $requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
 
     | 
  
  
    | 
      33
     | 
    
          $image = (isset(${$requestMethod}['img']) ? ${$requestMethod}['img'] : '');
     | 
  
  
    | 
      34
     | 
    
      print '<pre style="text-align: left;"><strong>function '.__FUNCTION__.'( '.''.' );</strong>  basename: '.basename(__FILE__).'  line: '.__LINE__.' -> <br />';
 
     | 
  
  
    | 
      35
     | 
    
      print_r( $_GET ); print '</pre>';  die(); // flush ();sleep(10);
 
     | 
  
  
    | 
      36
     | 
    
      */
 
     | 
  
  
    | 
      37
     | 
    
      
 
     | 
  
  
    | 
      38
     | 
    
      if (isset($_GET['img']) && isset($_GET['t'])) {
     | 
  
  
    | 
      39
     | 
    
          if(!class_exists('PhpThumbFactory', false)){ include($modulePath.'/inc/ThumbLib.inc.php'); }
     | 
  
  
    | 
      40
     | 
    
      //    require_once($modulePath.'/inc/ThumbLib.inc.php');
 
     | 
  
  
    | 
      41
     | 
    
          $image = addslashes($_GET['img']);
 
     | 
  
  
    | 
      42
     | 
    
          $type = intval($_GET['t']);
 
     | 
  
  
    | 
      43
     | 
    
      //    $media = WB_PATH.MEDIA_DIRECTORY.'/';
 
     | 
  
  
    | 
      44
     | 
    
          $thumb = PhpThumbFactory::create(WB_PATH.MEDIA_DIRECTORY.'/'.$image);
 
     | 
  
  
    | 
      45
     | 
    
      
 
     | 
  
  
    | 
      46
     | 
    
          if ($type == 1) {
     | 
  
  
    | 
      47
     | 
    
              $thumb->adaptiveResize(20,20);
 
     | 
  
  
    | 
      48
     | 
    
      //        $thumb->resize(30,30);
 
     | 
  
  
    | 
      49
     | 
    
      //        $thumb->cropFromCenter(80,50);
 
     | 
  
  
    | 
      50
     | 
    
      //         $thumb->resizePercent(40);
 
     | 
  
  
    | 
      51
     | 
    
          } else {
     | 
  
  
    | 
      52
     | 
    
              $thumb->Resize(300,300);
 
     | 
  
  
    | 
      53
     | 
    
      //         $thumb->resizePercent(25);
 
     | 
  
  
    | 
      54
     | 
    
      //        $thumb->cropFromCenter(80,50);
 
     | 
  
  
    | 
      55
     | 
    
          }
 
     | 
  
  
    | 
      56
     | 
    
          $thumb->show();
 
     | 
  
  
    | 
      57
     | 
    
      
 
     | 
  
  
    | 
      58
     | 
    
       }
 
     |