replace image

Description:   Example description.

Inventory Category Item Short Description Inventory Item Code Suggested List Price Image URL
VIOLIN Violin shoulder rest 417 46.50
AMPS Tube buffered parallel effects loops with front panel mix control 416 895.00
AMPS All modules include two 12AX9 preamp tubes, 3 band EQ w/bright switch, and level 415 1200.00
MANDOLIN New! Limited edition. Exact replica of 30's style F-5 411 2450.00
MANDOLIN Spruce top, Maple back and sides. 410 3500.00
MANDOLIN A unique, high-quality alto recorder. 406 105.00
GUITAR For solo playing and performance with other instruments in a "broken consort." 405 95.00
BANJO A soprano size uke made from solid Updated version of the traditional Martin Sty 404 225.00
VIOLIN 4/4, two-piece back is made of a strong, narrow-flamed maple 403 1255.00
VIOLIN 4/4, flamed maple back, ribs and scroll, with an even-grained spruce top. 402 695.00
VIOLIN 4/4, two-piece back is made of a medium-to-narrow, flamed maple 401 1750.00
  1. Start WebSmart go to File->New. In the new window select PHP Templates-> iSeries SQL-> Idaho->Record Listing.tpl .

  2. In the file library add MU_ITMF as the file and XL_WEBDEMO as the file library.

  3. In the field selection, select IMCAT, IMSDESC, IMITEM, IMRETPRC, IMURL and click finish.

  4. In the PHP-Source Code tab, where it says
    $query = "select IMCAT, IMSDESC, IMITEM, IMRETPRC, IMURL  from XL_WEBDEMO/MU_ITMF";
    	     	
    Add:
    			where IMITEM >400 AND IMITEM<420 ORDER BY IMITEM desc
    	   
    So it looks like:
    	   
    $query = "select IMCAT, IMSDESC, IMITEM, IMRETPRC, IMURL  from XL_WEBDEMO/MU_ITMF
    where IMITEM >400 AND IMITEM<420 ORDER BY IMITEM desc";

  5. Where it says
     	// Global variables should be defined here
    Add:
    		global  $IMURL, $a, $b;

    So it looks like this:
    	// Global variables should be defined here
    global $IMURL, $a, $b;
  6. Immediately after $IMURL = $row["IMURL"];

    Add:
    	$a = 'http://esdi.excelsystems.com/websmart/wsdemo/musicstore/'.trim($IMURL);
    	$b = "http://esdi.excelsystems.com/websmart/wsdemo/musicstore/no_photo.gif";
    	
    
    	if (@$fp= fopen($a , "r")){
    		
    		
    	}
    	else{
    		$a=$b;
    	}
    		
    So it looks like:
    	$IMURL = $row["IMURL"];
    	$a = 'http://esdi.excelsystems.com/websmart/wsdemo/musicstore/'.trim($IMURL);
    	$b = "http://esdi.excelsystems.com/websmart/wsdemo/musicstore/no_photo.gif";
    	
    
    	
    	if (@$fp= fopen($a , "r")){
    		
    		
    	}
    	else{
    		$a=$b;
    	}
    
        


  7. In the ListDetails tab,replace:
    	< td class="text"> $IMURL </td >
    	
    with the following:
    	< td class="text">
    	<?php
    	echo "<img width =$width  height = $height src=\"$a\">";
    	
    	?>
        
  8. Generate and launch.

Program Definition:   resized&replace.pdw

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.