Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with arrays for Image navigator ... please :( 1

Status
Not open for further replies.

Technos

Programmer
Mar 15, 2002
47
US
Hi There,
I am working on images.I read the image files using File system objects and put them in the combo box to access. For this I'm using different ASP page. Everything is working fine. Now I want to create Navigation (Prev & Next) for the picture. I want to use session variables with arrays on it. Can anybody help me HOW??? Where??? Please help
Here is code:
Code:
<%dim selectedEvent
    selectedEvent = Request.Form(&quot;event1&quot;)%>
						<select style=&quot;width:100%;&quot; id=&quot;event1&quot; name=&quot;event1&quot;
						onChange=&quot;javascript:window.document.selectionForm.selEvent.value=window.document.selectionForm.event1.value;
								javascript:window.document.selectionForm.selChoice.value=&quot;EVENT&quot;; 
								javascript:window.document.selectionForm.submit();&quot; >
					
						<%Dim fso
							set fso = Server.CreateObject(&quot;Scripting.fileSystemObject&quot;)
						Dim l_fldrname
							l_fldrname =&quot;d:\\Pictures&quot;
						Dim picFolder
								set picFolder = fso.GetFolder(l_fldrname)
						Dim subFolders
								set subFolders = picFolder.subFolders%>
						<%if selectedEvent = &quot;&quot; then%>
							<option selected>Select Event</option> 
						<%else%>
							<option >Select Event</option> 
						<%end if%>
						<%For Each folder in subFolders 
																<option value =&quot;<% Response.Write (folder.name)%>&quot; selected ><% Response.Write folder.name%></option>
								<%else%>
									<option	value =&quot;<% Response.Write (folder.name)%>&quot; ><% Response.Write folder.name%></option>
								<%end if%>
						<%	end if 
						Next%>
						</select>
...----------.............

<%dim selectedPicture
							selectedPicture = Request.Form(&quot;picture1&quot;)%>
						<%if selectedEvent = &quot;&quot; then%>
							<select style=&quot;width:100%;&quot; id=&quot;picture1&quot; name=&quot;picture1&quot; disabled>
							<option selected value=&quot;&quot;>Select an event first</option>
						<%else%>
						<select style=&quot;width:100%;&quot; id=&quot;picture1&quot; name=&quot;picture1&quot; >
							<option selected value=&quot;&quot;>Select Picture</option>
							<% 
							set picFolder = fso.GetFolder(l_fldrname & &quot;\&quot; & selectedEvent)
							Dim files
								set files = picFolder.files
								For Each file in files%>
								
									<%if selectedPicture = file.name then%>
										
										<option value=<%Response.Write (file.name)%> selected> <%Response.Write fso.GetBaseName(file.name)%> </option>
									<%else%>
									<option value=<%Response.Write (file.name)%> > <%Response.Write fso.GetBaseName(file.name)%> </option>
								<%end if	
								Next %>
						<%end if%>
						</select>
					</td>
						
					<td width=&quot;15%&quot;>
						<a href=&quot;javascript:window.document.selectionForm.selPicture.value=window.document.selectionForm.picture1.value; 
								javascript:window.document.selectionForm.selEvent.value=window.document.selectionForm.event1.value;
								javascript:window.document.selectionForm.selChoice.value=&quot;PICTURE&quot;; 
								javascript:window.document.selectionForm.submit();&quot;><img src=&quot;./images/go_off.gif&quot; border=&quot;0&quot; WIDTH=&quot;44&quot; HEIGHT=&quot;27&quot;></a>
					</td>


........
<%
			dim selChoice
			dim selEvent
			dim selPicture
			dim iFrameURL
			selChoice = Request.Form(&quot;selChoice&quot;)
			selPicture = Request.Form(&quot;selPicture&quot;)
			selEvent = Request.Form(&quot;selEvent&quot;)
			iFrameURL = &quot;showPicture.asp?selChoice=&quot; & selChoice & &quot;&selEvent=&quot; & selEvent & &quot;&selPicture=&quot; & selPicture
			if selChoice = &quot;THUMBNAIL&quot; then
				Response.Write(&quot;&nbsp;You are looking at thumbnails of all pictures in <b>&quot; & selEvent & &quot;</b> event.&quot;)
			elseif selchoice=&quot;PICTURE&quot; then
				Response.Write(selEvent & &quot;>&quot; & selPicture)
			end if
			%>
			<iframe width=&quot;100%&quot; height=&quot;400%&quot; frameborder=&quot;no&quot; src=&quot;<%=iFrameURL%>&quot;>
			</iframe>


<b>otherpage.asp has following code:</b>

dim selEvent
	dim selChoice
	dim selPicture
	dim fromWhere

	selChoice = Request.QueryString(&quot;selChoice&quot;)
	selEvent = Request.QueryString(&quot;selEvent&quot;)
	selPicture = Request.QueryString(&quot;selPicture&quot;)
	
	if selChoice = &quot;&quot; then
		selChoice=Request.QueryString(&quot;selChoice&quot;)
	end if
	if selEvent = &quot;&quot; then
		selEvent=Request.QueryString(&quot;selEvent&quot;)
	end if
	if selPicture = &quot;&quot; then
		selPicture=Request.QueryString(&quot;selPicture&quot;)
	end if

	fromWhere= Request.QueryString(&quot;fromWhere&quot;)
	if fromwhere = &quot;Thumbnails&quot; then
		call gobackicon(&quot;&quot;)
		Response.Write(&quot;<br>&quot;)
	end if
	%>
	<%select case selChoice
		case &quot;PICTURE&quot;%>
			<div align=center>
				<img src='[URL unfurl="true"]http://www.dfdf.com/Pictures/<%=selEvent%>/<%=selPicture%>'>[/URL]
			</div>

		<%case &quot;THUMBNAIL&quot;%>
<%Dim fso
on error goto 0
	set fso = Server.CreateObject(&quot;Scripting.fileSystemObject&quot;)
	
Dim t_fldrname
t_fldrname = &quot;d:\...\...\Pictures\&quot; & selEvent & &quot;\thumbnails&quot;

Dim thumbFolder
set thumbFolder = fso.GetFolder(t_fldrname)
	'Response.Write t_fldrname 
	Dim t_files
	set t_files = thumbFolder.Files
		
%>
				<table width=100% cols=4>
					<tr align=left id=&quot;picRow&quot; name=&quot;picRow&quot;>
<% For Each file In t_files align=left id=&quot;&quot;picRow&quot;&quot; name=&quot;&quot;picRow&quot;&quot;>&quot;)%>
						<td id =&quot;numCell&quot; name=&quot;numCell&quot;>
						<a href='[URL unfurl="true"]http://www.fgfg.com/Pictures/ShowPicture.asp?selChoice=PICTURE&selEvent=<%=selEvent%>&selPicture=<%Response.Write[/URL] (file.name)%>&fromWhere=Thumbnails'>
							<img src='[URL unfurl="true"]http://www.sdfsdf.com/Pictures/<%=selEvent%>/thumbnails/<%[/URL] Response.Write (file.name)%> ' border=0>
							<br><%Response.Write fso.GetBaseName(file.name)%></br>
						</a>
						</td>
						
						<% Next %>
						</tr>
				</table>
	<%end select%>
 
Technos,

All the elements are there in the thread that I suggested last time - I know it seems a lot of work, but it is the solution you require.

Thread248-230355

Basically all it does is create a list of images in ASP (in this case form a database, but it can be from the FSO just as easily)

Then it creates the javascript code using embedded ASP to create the image array which will be used clinet side to move the images.

Finally there are two scripts to move the image left and right through the array and change the image accordingly.

You must check out the thread and then respond, else people will ignore your subsequent threads. Derren
[The only person in the world to like Word]
 
Thanks Derren,
I got You... I am going to try this now. :)))
Technos
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top