Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Simple asp gallery
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Simple asp gallery

 Post Reply Post Reply Page  12>
Author
oneminuteguy View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 18 October 2002
Location: Denmark
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote oneminuteguy Quote  Post ReplyReply Direct Link To This Post Topic: Simple asp gallery
    Posted: 18 July 2003 at 7:16pm

I'm doin (tryin to anyway) a simple gallery (asp/access) for a smaller website. I'd like it to be thumb pages linking to the full size images with an added search function and a paging function. (1,2,3,4>>)

The piece of code below can show u what I mean, it just needs the paging function.
My problem is that I'm not good enuff at asp to incorporate a paging function. So I was wondering if anyone's seen a script like that somewhere, or if maybe someone had a script they wouldn't mind sharing..?

TIA

Regards,
OMG

<% OPTION EXPLICIT %>
<!-- #include file="connect.asp" -->
<html><head><title>Photoalbum</title>
</head><body>

<%
dim strAction
strAction=request("action")

Main

select case strAction
  case "search"
    Search request("searchstr"), 0
  case "category"
    Search request("searchstr"), 1
  case "show"
    ShowImage request("image")
end select

' -------------------------------------
' Functions
' -------------------------------------

sub Main
  %>
  <h1>Photoalbum</h1>
  <p>Search: <form
  action="photoalbum.asp?action=search" method="post">
  <input type="text" name="searchstr">
  <input type="submit"
  value="Søg"></form></p>
  <p>Or choose from category:<br>
  <%
  dim strSQL, objRS, arrCategories, i
  strSQL = "SELECT DISTINCT category FROM PhotoAlbum " & _
          "ORDER BY category"
  strSQL = "SELECT category, count(category) as numcat FROM PhotoAlbum " & _
           "GROUP BY category"

  set objRS = server.createobject("ADODB.Recordset")
  objRS.open strSQL, strConnect, adOpenForwardOnly, adLockReadOnly, adCmdText
  if not objRS.EOF then
    arrCategories = objRS.GetRows
  end if
  objRS.close
  set objRS = nothing
  if isArray(arrCategories) then
    for i = 0 to ubound(arrCategories,2)
      response.write _
        " <a href=""photoalbum.asp?action=category&searchstr=" & _
        server.urlencode(arrCategories(0,i)) & """>" & _
        arrCategories(0,i) & "(" & arrCategories(1,i) & ")" & "</a> "
    next
  end if
  %>
  <hr></p><%
end sub


sub Search (strS, intType)
  dim strSQL, objRS
  if intType = 0 then
    strSQL = "SELECT title, imagename FROM PhotoAlbum " & _
             "WHERE title + description + words LIKE '%" & strS & "%'"
  end if
  if intType = 1 then
    strSQL = "SELECT title, imagename FROM PhotoAlbum " & _
             "WHERE category = '" & strS & "'"
  end if
  set objRS = server.createobject("ADODB.Recordset")
  with objRS
    .open strSQL, strConnect, adOpenForwardOnly, adLockReadOnly, adCmdText
    while not .EOF
      response.write _
        "<p><a href=""photoalbum.asp?action=show&image=" & _
        server.urlencode(.Fields("imagename")) & """>" & _
        "<img src=""/thumbs/" & .Fields("imagename") & """ border=0>" & _
        "</a><br clear=all>" & _
        .Fields("title") & "</p>"
      .movenext
    wend
    .close
  end with
  set objRS = Nothing
end sub


sub ShowImage (strImageName)
  dim strSQL, objRS
  strSQL = "SELECT title, description FROM PhotoAlbum " & _
           "WHERE imagename = '" & strImageName & "'"
  set objRS = server.createobject("ADODB.Recordset")
  with objRS
    .open strSQL, strConnect, adOpenForwardOnly, adLockReadOnly, adCmdText
    if not .EOF then
      response.write _
        "<h1>" & .Fields("title") & "</h1>" & _
        "<img src=""/image/" & strImageName & """>" & _
        "<p>" & .Fields("description") & "</p>"
    else
      response.write _
        "<p>No results: " & strImageName & "</p>"
    end if
    .close
  end with
  set objRS = Nothing
end sub

%>

</body></html>

Back to Top
Bliss View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2003
Location: United States
Status: Offline
Points: 181
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bliss Quote  Post ReplyReply Direct Link To This Post Posted: 22 July 2003 at 3:00pm
Look at the paging mod for WWF to get a hint
Back to Top
Flamewave View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 June 2002
Location: United States
Status: Offline
Points: 376
Post Options Post Options   Thanks (0) Thanks(0)   Quote Flamewave Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2003 at 11:19am

Are you looking for something like this? (only an image gallery instead of a download gallery) if so, give me an email (flamewave4@juno.com) and I can give you the source code to help you out. I did that for a client awhile back and had to develop it myself, but I don't mind giving out the source code.

Link: http://www.flameservers.com/tfc-customize/TFC_Custumize.asp?Type=Weapon



Edited by Flamewave
- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.
Back to Top
oneminuteguy View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 18 October 2002
Location: Denmark
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote oneminuteguy Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2003 at 5:04pm
hey flamewave

that would be great!!! I've sent you a mail.

TIA!!

Regards,
OMG
Back to Top
Flamewave View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 June 2002
Location: United States
Status: Offline
Points: 376
Post Options Post Options   Thanks (0) Thanks(0)   Quote Flamewave Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2003 at 9:50pm

Hmm, I didnt get your email, but here is the link to a demo and the code:

http://www.flameservers.com/asp_apps/gallery/

- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.
Back to Top
oneminuteguy View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 18 October 2002
Location: Denmark
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote oneminuteguy Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2003 at 5:08am
thx! looks to be just what I need.

Btw I accidently pasted the mailto: tag into ur mail adress. thats why u didnt' get it

Back to Top
oneminuteguy View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 18 October 2002
Location: Denmark
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote oneminuteguy Quote  Post ReplyReply Direct Link To This Post Posted: 28 July 2003 at 9:55am
In case anyone's interested I found an easy to use app. on http://www.developersdex.com/gurus/code/251.asp

Works!
Back to Top
Badboy View Drop Down
Newbie
Newbie


Joined: 01 August 2003
Location: United States
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Badboy Quote  Post ReplyReply Direct Link To This Post Posted: 01 August 2003 at 7:02am

Can I have a forum that is ASP. But other pages on the server are HTML? Or does everything have to be ASP?

Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.