PDF='MAIN' { ATTRIBUTES='*' { PLATFORM='php.txt'; REPTYPE='1'; ATTACHED='0'; PROJECT='36'; OBJECTNAME='resize.php'; LIBLOBJ='*FILES'; TITLE='resize'; WEBPATH='http://esdi.excelsystems.com/wsexmpphp/'; TARGETPATH='/www/zendcore/htdocs/examples'; FTPSITE='ESDI520'; SET='149'; VERSION='4.00'; CRTBNUM='Revision 3270'; CRTTEMPLT='C:\\Program Files\\ESDI\\WebSmart\\Temp\\PHP-A Simple Page.tpl'; SAVBNUM='Revision 3270'; REPSYSTEM='ESDI520'; LASTLOC='1'; VHTML='N'; LASTSAVE='7/8/2008 17:11:33'; } FTPREFINFO='*' { URL='192.168.0.100'; INITIALDIR='/www/websmart/htdocs/wsphp/'; FTPPORT='21'; PASSIVEMODE='0'; WEBPATH='http://esdi.excelsystems.com/webtest/'; } PANELS='*' { PANEL='MainSeg' { DESC='Main Segment'; DETAILS=' resize

Resized Image

Description:   Example description.

Enter Contents Here "; ?>
  1. Start WebSmart go to File->New Managed. Select "PHP- A Simple Page.tpl"

  2. Go to the Attributes Tab-> Program,press the "Files" tab, and type \'XL_WEBDEMO\' in the file library textbox.

  3. click the "Browse Server" button.

  4. Find and add the "MU_ITMF", and then press "synch".



  5. In the PHP-Source Code, near the top replace:

          global $wsnum;

    With the following:

          global $wsnum, $a, $width, $height, $arr1, $maxwidth, $value;

  6. In the PHP-Source Code, between "function generic() {" and "wrtseg(\'MainSeg\');
    }"
    add:

           
    foreach($GLOBALS as $arraykey => $arrayvalue)
        {     if ($arraykey[0]!=\'_\' && $arraykey != \'GLOBALS\')
                global $$arraykey;

            }

        $maxwidth=300;
        if (file_exists($a)){
          $arr1 = getimagesize("http://esdi.excelsystems.com/websmart/Images/cloverquery50.gif");
          $width=$arr1[0];
        $height=$arr1[1];

        if($width > $maxwidth || $width ==0){
          $height = ($maxwidth/$width)*$height;
          $width = $maxwidth;
         
        }
        $a= "http://esdi.excelsystems.com/websmart/Images/cloverquery160x600.gif";
        }
       
        else{
       
        $a = "http://esdi.excelsystems.com/websmart/Images/cloverquery160x600.gif";
        $arr1 = getimagesize("http://esdi.excelsystems.com/websmart/Images/cloverquery160x600.gif");
        $width = $arr1[0];
        $height = $arr1[1];

        if ($width > $maxwidth|| $width == 0) {
            $height = ($maxwidth/$width)*$height;
            $width = $maxwidth;
        }
        $a = "/websmart/Images/cloverquery160x600.gif";
       
    }    
  7.    
    6.b.)So it looks like:

        function generic()
        {

        foreach($GLOBALS as $arraykey => $arrayvalue)
        {
          if ($arraykey[0]!=\'_\' && $arraykey != \'GLOBALS\')
            global $$arraykey;
        }
       

            $maxwidth=300;
        if (file_exists($a)){
          $arr1 = getimagesize("http://esdi.excelsystems.com/websmart/Images/cloverquery50.gif");
          $width=$arr1[0];
          $height=$arr1[1];
            if($width > $maxwidth || $width ==0){
           $height = ($maxwidth/$width)*$height;
           $width = $maxwidth;
       
          }
            $a= "http://esdi.excelsystems.com/websmart/Images/cloverquery160x600.gif";
        }
           
        else{
       
        $a = "http://esdi.excelsystems.com/websmart/Images/cloverquery160x600.gif";
        $arr1 = getimagesize("http://esdi.excelsystems.com/websmart/Images/cloverquery160x600.gif");
        $width = $arr1[0];
        $height = $arr1[1];
        if ($width > $maxwidth || $width == 0) {
        $height = ($maxwidth/$width)*$height;
        $width = $maxwidth;
        }
        $a = "/websmart/Images/cloverquery160x600.gif";

        }
       
        wrtseg(\'MainSeg\');
        }
       
  8. In the "MainSeg" tab , after the < div id="contents"> and before the

    </li>
    < div class="dhtmlgoodies_aTab">

    Add:
        <?php
            echo "< img width =$width height = $height src=\\"" . $a . "\\">";
        ?>
        </div>
          </div> </div>
       
    So it looks like:

        < div id="contents">
        Enter Content Here

        <?php
        echo "< img width =$width height = $height src=\\"" . $a . "\\">";

        ?>    
        </div>
        </div>   </div>
    </li>
        < div class="dhtmlgoodies_aTab">

Program Definition:   resize.php

Rate This Example

Did this knowledge base article help you to achieve your goal?  Yes  No  Don\'t Know

Enter additional comments below.   If you want to hear back from us, include your contact information.

'; } } PREVIEWS='*' { DEFAULT='MainSeg'; PREVIEW='MainSeg' { SEG='MainSeg'; } } ACTIONS=' // Program Name: resize1.php // Program Title: resize1 // Created by: RYAN // Template family: Idaho // Template name: Simple Page // Purpose: // Program Modifications: require(\'/esdi/websmart/v6.6/include/xl_functions001.php\'); global $wsnum,$a, $width, $height, $arr1,$maxwidth, $value; // This code is for the Rate this page section if (isset($_REQUEST[\'wsnum\'])) { $wsnum = $_REQUEST[\'wsnum\']; } // Check the cookie if(isset($_COOKIE[\'wsnumbc\'])) { $wsnum = $_COOKIE[\'wsnumbc\']; } else { setcookie(\'wsnumbc\', $wsnum); } // Retrieve the task (default to "default") if ($pf_task == \'default\') generic(); function generic() { foreach($GLOBALS as $arraykey => $arrayvalue) { if ($arraykey[0]!=\'_\' && $arraykey != \'GLOBALS\') global $$arraykey; } $maxwidth=300; if (file_exists($a)){ $arr1 = getimagesize("http://esdi.excelsystems.com/websmart/Images/cloverquery50.gif"); $width=$arr1[0]; $height=$arr1[1]; if($width > $maxwidth || $width ==0){ $height = ($maxwidth/$width)*$height; $width = $maxwidth; } $a= "http://esdi.excelsystems.com/websmart/Images/cloverquery160x600.gif"; } else{ $a = "http://esdi.excelsystems.com/websmart/Images/cloverquery160x600.gif"; $arr1 = getimagesize("http://esdi.excelsystems.com/websmart/Images/cloverquery160x600.gif"); $width = $arr1[0]; $height = $arr1[1]; if ($width > $maxwidth|| $width == 0) { $height = ($maxwidth/$width)*$height; $width = $maxwidth; } $a = "/websmart/Images/cloverquery160x600.gif"; } wrtseg(\'MainSeg\'); } '; FILES='*' { FILE='MU_ITMF' { LIBRARY='XL_WEBDEMO'; RCDFORMAT='R_ITMF '; LEVELID='1071025172821'; RFLEVELID=' '; EXTDS='0'; } } }