HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/web/expressmusic/get-product-image-list.asp
<%Option Explicit%>
<!--#include file="dbfunctions.asp"-->
<!--#include file="apputils.asp"-->
<html>
<head><%HTMLHeadStart%>
<title>Get Product Image List</title>
</head>

<body>
<div>

<%

GetProductImageList


%>


</body>
</html>
<%Finalise%>

<%

' 04/11/2019 for Express Music (reverb.com)
' created with help from create-image-cache.asp

Sub GetProductImageList
  Dim LSQL, LType, LCode, LCode2, LPictureID, LImageURL  

  ' (SS,5/4/19) removed products.ProductCode, products.ProductName, moved ORDER BY to later
  LSQL = "SELECT pictures.PictureID, pictures.Type, pictures.Code, pictures.Code2, pictures.SortOrder" &_
    " FROM pictures" &_
    " INNER JOIN products ON products.ProductCode = pictures.Code" &_
    " WHERE pictures.Type = 'P' AND pictures.Enabled AND NOT products.ProductDisabled"
 
  
  '   " ORDER BY products.ProductCode, pictures.SortOrder, pictures.Code2, pictures.PictureID"
  ' (SS,5/4/19) replaced above with following for all records in union query
  LSQL = LSQL & " ORDER BY IF(Type = 'P', ' ', Type), Code, SortOrder, Code2, PictureID"   
    
  OpenQuery(LSQL)
  
  'Response.Write "### " & LSQL & " ###<br>"
    
  Do While Not EndOfQuery
  
    LCode = GetQueryValue("Code")
    LPictureID = GetQueryValue("PictureID")
    
    ' show the URL of original image
    LImageURL = GetStoreURL & "/getpic.asp?code=" & LCode & "&amp;" & "id=" & LPictureID & "&amp;" & "size=o"
    Response.Write "<a href=""" & LImageURL & """>" & LImageURL & "</a>" & BR & NL
    
    NextQueryRecord
  Loop
  
  CloseQuery

End Sub


%>