Avatar of Stiebel Eltron
Stiebel EltronFlag for Thailand

asked on 

How to insert "class=" inside GetImage script in ASP?

Dear EE experts,

We would like to ask for tech support on how to add or insert the class type inside our ASP script...
We would like to add this class="lytebox" , so that when user clicks the image, it will be something like facebook style, float image style...

But the idea would still be the same, if the user loggedin = TRUE, then user would be able to click the image.
At this moment, when user logs in, then click the image, it opens its bigger image, but not floating style like facebook...
We're trying to use the idea from lytebox.

Thank you & hope to hear soon...
<table width="78%" border="0" cellspacing="3" cellpadding="1">
      <% dim iRow, DebugMode
      iRow=0
    DebugMode = false
      Do Until rsProducts.EOF 
      image1 = GetImagePath(1)
      image2 = GetImagePath(2)
      image3 = GetImagePath(3)
      image4 = GetImagePath(4)
      image5 = GetImagePath(5)
      image6 = GetImagePath(6)
      product_name = rsProducts("product_name")
      download1 = iif(rsProducts("download1")&""="","",rsProducts("path_download") & "" & rsProducts("download1"))
                        
       if(download1 & ""= "") then
            download1 = rsProducts("product_file")
            if(download1&""<>"" ) then
				download1=download1
                'download1="photo/"&download1
            end if
      end if
      download2 = rsProducts("path_download") & rsProducts("download2")
       download3 = rsProducts("path_download") & rsProducts("download3")
      download4 = rsProducts("path_download") & rsProducts("download4")                         
      download5 = rsProducts("path_download") & rsProducts("download5")      
         if DebugMode = true      then
        response.write("<tr><td colspan=""6"">" & image1 & "<br/>" &image2 & "<br/>" &image3 & "<br/>" &image4 & "<br/>" &image5 & "<br/>" &image6 & "</td></tr>")
    end if
      %>
    <tr>
          <td style="background-color:#FFFFFF;border-color:#999999;text-align:left;vertical-align:top;" colspan="6">
            <b><%= product_name%></b>
        </td>
    </tr>
      <tr>
        <%= GetImage(Image1,download1,product_name)%>
        <%= GetImage(Image2,download2,product_name)%>
            <%= GetImage(Image3,download3,product_name)%>
            <%= GetImage(Image4,download4,product_name)%>
            <%= GetImage(Image5,download5,product_name)%>
            <%= GetImage(Image6,download5,product_name)%>
      </tr>
   <%
      iRow = iRow + 1
      if iRow mod 5 = 0 then ' let say you want to add empty line after 5 rows %>
      <tr><td colspan="6" bgcolor="#FFFFFF"></td></tr>
      <%end if
      rsProducts.MoveNext()
Loop

Function iif(i,j,k)
      If i Then iif = j Else iif = k
End Function

Function GetImagePath(ImageIndex)
    GetImagePath = iif(rsProducts("image"&ImageIndex)&""="","",rsProducts("path_image") & rsProducts("image"&ImageIndex))
End Function

Function GetImage(Image,download,productname)
      dim RV, bGenerateLink
      RV = "<td align=""center"" bordercolor=""#000000"" bgcolor=""#FFFFFF"">"
    bGenerateLink = false
      if Trim(Image & "") <>"" then
               bGenerateLink = (download&""<>"") and Session("loggedIn") = true
            If bGenerateLink  Then
                  RV = RV & "<a href=""" & Replace(download, "DOWNLOAD", "download") & """>"
                 'RV = RV & "<a href=""" & Replace(download, "DOWNLOAD", "download") & """>"
            End If
            RV = RV & "<img src=""" & image & """ alt=""" & Server.HTMLEncode(productname) &""" style=""border:0px;""/>"
           'RV = RV & "<img src=""" & image & """ alt=""" & Server.HTMLEncode(productname) &""" style=""border:0px;""/>"
            If bGenerateLink  Then
                  RV = RV & "</a>"
            End If
      end if
      GetImage = RV & "</td>"
End Function
%>

Open in new window

ASPWeb DevelopmentJScript

Avatar of undefined
Last Comment
Stiebel Eltron
Avatar of Eyal
Eyal
Flag of Israel image

Avatar of Stiebel Eltron

ASKER

Hi there Eyal! Is it for free? I think some of it are not...
We prefer #10 or #17, the Pirobox...
Avatar of Eyal
Eyal
Flag of Israel image

both options you mentioned are free

select one of them so we can continue

and post all page code here so I can make the modifications
Avatar of Stiebel Eltron

ASKER

#17 is fine. Thank you!
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Set connectString = Server.CreateObject("ADODB.Connection")
connectString.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("..\asia2\photo\products_asia.mdb") & ";"
connectString.Open

SeriesID = request.QueryString("SeriesID")

Set sqlContent = CreateObject("ADODB.Command")
sqlContent.ActiveConnection=connectString
sqlContent.Prepared = true

sqlContent.commandtext = "SELECT products.ID, products.seriesid, products.product_name, products.path_image, products.image1, products.image2, products.image3, products.image4, products.image5, products.image6, products.path_download, products.download1, products.download2, products.download3, products.download4, products.download5, products.product_file, products.updateby, products.updatedate, series.typeid, series.categoryid, series.brandid, series.series_name FROM products INNER JOIN series ON products.seriesid = series.seriesid WHERE products.seriesid=?"

sqlContent.Parameters.Append sqlContent.CreateParameter("@seriesid", 3, 1, , SeriesID)
Set rsProducts = sqlContent.Execute
if not rsProducts.eof then
series_name = rsProducts("series_name")
end if
%>

<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta name="Author" content="IT" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />

<meta name="GENERATOR" content="Mozilla/4.7 [en] (Win98; I) [Netscape]" />


<title>..:: Stiebel Eltron's iPhoto Stock Gallery - Powered by STE IT Dept. ::..</title>
<style type="text/css">
<!--
	a
 	{
  		color:#000080;
		font-family:verdana;
		text-decoration:none;
		font-size:12px
	}
	
	
	a:active
 	{
  		color:red;

	}

	a:hover
 	{
  		color:#FF0000;
		text-decoration:none;
		cursor:crosshair;
	}
		
	table
	{
		font-family:verdana;
	}
	
	td
	{
		font-family:verdana;
		font-size:10e;
	}

	.b
	{
		font-color:#0A0EB7;
	}		

-->
</style>

<!--date-->
<script type="text/javascript">

<!-- Begin
dayName = new Array("", "¿¿¿¿¿¿", "¿¿¿¿¿¿", "¿¿¿", "¿¿¿¿¿¿¿¿", "¿¿¿¿¿", "¿¿¿¿¿", "¿¿¿¿¿¿¿")
monName = new Array("¿¿¿¿¿¿", "¿¿¿¿¿¿¿¿¿¿", "¿¿¿¿¿¿", "¿¿¿¿¿¿", "¿¿¿¿¿¿¿", "¿¿¿¿¿¿¿¿", "¿¿¿¿¿¿¿", "¿¿¿¿¿¿¿", "¿¿¿¿¿¿¿", "¿¿¿¿¿¿", "¿¿¿¿¿¿¿¿¿", "¿¿¿¿¿¿¿")
now = new Date
//  End -->
</script>

<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

</head>

<body bgproperties="fixed" bgcolor="#000000" onload="javascript:startmenu()">
<table width="760" border="0" cellspacing="3" cellpadding="1">
  <tr>
    <td><img src="IMG/logo_res.jpg" alt="STIEBEL ELTRON" /></td>
    <td valign="top" bgcolor="#666666"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="548" height="197">
      <param name="movie" value="homeintro20.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <embed src="homeintro20.swf" quality="high" wmode="opaque" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="548" height="197"></embed>
    </object></td>
    <td><img src="IMG/white_square.png" alt="STIEBEL ELTRON" /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="right" bgcolor="#999999"><font face="Verdana, Geneva, sans-serif" color="#ffffff">
    <%
   '// If user is logged in show name and logout link
   If Session("loggedin") = true Then
      Response.Write "Welcome: " & Session("name")
      Response.Write "<br /><a href=""../asia2/login2/logout.asp"">Logout</a>"
   Else
      Response.Write "<a href=""ste-iphoto-login.asp"" title=""CLICK TO LOGIN"">REGISTERED USERS</a>"
   End If
	%>&nbsp;
	</td>
    <td bgcolor="#666666" align="center">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    
    <td align="left" bordercolor="#999999" bgcolor="#FFFFFF">
    » <img src="IMG/imgfolder.gif" alt="" />&nbsp;
       <%if rsProducts.eof then
	response.Write"STE Shower Units - <br><br><center>Sorry, there is no product images for that ID...</center>"
	else%>
    <a href="javaScript:menu0func()">STE Shower Units - <b><font face="verdana" size="+1"> - 
	<%=series_name%></font></b></a><%end if%>
	</td>
	<td bgcolor="#999999" align="center">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    
	<td align="left" bordercolor="#999999" bgcolor="#FFFFFF">
<table width="78%" border="0" cellspacing="3" cellpadding="1">
      <% dim iRow, DebugMode
      iRow=0
    DebugMode = false
      Do Until rsProducts.EOF 
      image1 = GetImagePath(1)
      image2 = GetImagePath(2)
      image3 = GetImagePath(3)
      image4 = GetImagePath(4)
      image5 = GetImagePath(5)
      image6 = GetImagePath(6)
      product_name = rsProducts("product_name")
      download1 = iif(rsProducts("download1")&""="","",rsProducts("path_download") & "" & rsProducts("download1"))
                        
       if(download1 & ""= "") then
            download1 = rsProducts("product_file")
            if(download1&""<>"" ) then
				download1=download1
                'download1="photo/"&download1
            end if
      end if
      download2 = rsProducts("path_download") & rsProducts("download2")
       download3 = rsProducts("path_download") & rsProducts("download3")
      download4 = rsProducts("path_download") & rsProducts("download4")                         
      download5 = rsProducts("path_download") & rsProducts("download5")      
         if DebugMode = true      then
        response.write("<tr><td colspan=""6"">" & image1 & "<br/>" &image2 & "<br/>" &image3 & "<br/>" &image4 & "<br/>" &image5 & "<br/>" &image6 & "</td></tr>")
    end if
      %>
    <tr>
          <td style="background-color:#FFFFFF;border-color:#999999;text-align:left;vertical-align:top;" colspan="6">
            <b><%= product_name%></b>
        </td>
    </tr>
      <tr>
        <%= GetImage(Image1,download1,product_name)%>
        <%= GetImage(Image2,download2,product_name)%>
            <%= GetImage(Image3,download3,product_name)%>
            <%= GetImage(Image4,download4,product_name)%>
            <%= GetImage(Image5,download5,product_name)%>
            <%= GetImage(Image6,download5,product_name)%>
      </tr>
   <%
      iRow = iRow + 1
      if iRow mod 5 = 0 then ' let say you want to add empty line after 5 rows %>
      <tr><td colspan="6" bgcolor="#FFFFFF"></td></tr>
      <%end if
      rsProducts.MoveNext()
Loop

Function iif(i,j,k)
      If i Then iif = j Else iif = k
End Function

Function GetImagePath(ImageIndex)
    GetImagePath = iif(rsProducts("image"&ImageIndex)&""="","",rsProducts("path_image") & rsProducts("image"&ImageIndex))
End Function

Function GetImage(Image,download,productname)
      dim RV, bGenerateLink
      RV = "<td align=""center"" bordercolor=""#000000"" bgcolor=""#FFFFFF"">"
    bGenerateLink = false
      if Trim(Image & "") <>"" then
               bGenerateLink = (download&""<>"") and Session("loggedIn") = true
            If bGenerateLink  Then
                  RV = RV & "<a href=""" & Replace(download, "DOWNLOAD", "download") & """>"
                 'RV = RV & "<a href=""" & Replace(download, "DOWNLOAD", "download") & """>"
            End If
            RV = RV & "<img src=""" & image & """ alt=""" & Server.HTMLEncode(productname) &""" style=""border:0px;""/>"
           'RV = RV & "<img src=""" & image & """ alt=""" & Server.HTMLEncode(productname) &""" style=""border:0px;""/>"
            If bGenerateLink  Then
                  RV = RV & "</a>"
            End If
      end if
      GetImage = RV & "</td>"
End Function
%>        			

  		<tr>
        	<td colspan="5">
            	<font size="-10e" face="verdana"><b>
                <%
   					If Session("loggedIn") = true Then
   					Response.Write "Please click the thumbnails to grab its original size..."
   					End If
	   			%>
                </b></font>
            </td>
        </tr>
	</table>
    </td>
	<td bgcolor="#999999" align="center">&nbsp;</td>
  </tr>
  <tr>
  	<td bgcolor="#000000">&nbsp;
    	
    </td>
  	<td bgcolor="#666666" colspan="2" align="left">
    	<a href = "javascript:history.back()"><font size="0.5e">&nbsp;BACK</font></a>
    </td>
  </tr>
  <tr>
  	<td bgcolor="#000000">&nbsp;
    	
    </td>
  	<td align="center" bgcolor="#999999" colspan="2">
    	<a href = "http://www.cssasia.info/iphoto/"><font size="0.5e">BACK TO MAIN&nbsp;<img src="IMG/base.gif" alt="BACK TO MAIN PAGE" border="0" /></font></a>
    </td>
  </tr>  
  
</table>
</body>
</html>

Open in new window

Avatar of Eyal
Eyal
Flag of Israel image

you have JQuery library somewhere in your project? if not... where it will be located?
Avatar of Eyal
Eyal
Flag of Israel image

by the way this worth alot more than 500 points
Avatar of Stiebel Eltron

ASKER

Refer to your ID: 36914843, I don't have any yet. About to add.

Refer to your ID: 36914846, how can I give you more than 500 points? :-)
Avatar of Eyal
Eyal
Flag of Israel image

when you open a question you can select how many points it will worth 500 is the default :)
Avatar of Stiebel Eltron

ASKER

So, you mean I can declare how many points I want to give to an expert? Let's say 1000 points, is possible?
Avatar of Stiebel Eltron

ASKER

Ok, I got it, on how to declare more points... Next time, I'll do it!

:-)
ASKER CERTIFIED SOLUTION
Avatar of Eyal
Eyal
Flag of Israel image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Stiebel Eltron

ASKER

Did u change something from the codes? Could u please advise which lines? And what should I do with the demo from pirolab? Do I need to keep it as well or you just showing it?

Please advise...
Avatar of Eyal
Eyal
Flag of Israel image

sure, I changed lines: 92-113, 225
Avatar of Stiebel Eltron

ASKER

Why does line #112 is having  a syntax error? Code hinting may not work until fix this error...

It shows after I copied it into my Dreamweaver...
Avatar of Stiebel Eltron

ASKER

From line #225, kindly advise if this is correct: class=""pirobox_"?

Because I'm trying the script that you add, but it's not working...
SOLUTION
Avatar of Eyal
Eyal
Flag of Israel image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Eyal
Eyal
Flag of Israel image

please send me a screenshot of the console panel of firebug (this is the most easy way to see client side problems)

or provide me a link (the best option)
Avatar of Stiebel Eltron

ASKER

Sorry for the late response, had meeting... Anyway, it's working now, just that missed line :-)

I'll give more points to my upcoming thread...

What is the maximum Points that can give to an expert?
Avatar of Stiebel Eltron

ASKER

Great!
Avatar of Eyal
Eyal
Flag of Israel image

happy it works for you:)

have no clue, I don't ask questions only answer
Avatar of Stiebel Eltron

ASKER

Lol... ok, wait for my next thread to open...
ASP
ASP

Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.

82K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo