• Contact Editorial Team
  • Advertise on YNOT
  • Submit PR
Friday, February 6, 2026
  • Login
  • Register
YNOT
  • Home
  • Industry News
    • Porn Star & Adult Talent News
    • Adult Business News
    • Adult Novelty News
    • Adult Industry Legal News
    • Tech News for Adult Webmasters
    • Video Game News for Adults
    • EU News
  • PR Wire
  • Podcasts
  • Industry Guides
  • Newsletters
No Result
View All Result
  • Home
  • Industry News
    • Porn Star & Adult Talent News
    • Adult Business News
    • Adult Novelty News
    • Adult Industry Legal News
    • Tech News for Adult Webmasters
    • Video Game News for Adults
    • EU News
  • PR Wire
  • Podcasts
  • Industry Guides
  • Newsletters
No Result
View All Result
YNOT
No Result
View All Result
Home YNOT Features YNOT University

Coders Corner / ASP Thumbnail Galleries

admin by admin
October 16, 2000
in YNOT University
491
SHARES
Share on FacebookShare on Twitter

What do YOU think about this Script? Add YOUR comments at the end!

I’m very interested in running VBScript on my ASP pages. While I know most of you run some flavor of Unix, I prefer Microsoft Windows NT/2000 with IIS 4/5.What do YOU think about this Script? Add YOUR comments at the end!

I’m very interested in running VBScript on my ASP pages. While I know most of you run some flavor of Unix, I prefer Microsoft Windows NT/2000 with IIS 4/5. I’ve written all my ASP pages and scripts myself, including this cool VBScript that you can use to automate the creation of thumbnail galleries. The only thing you will have to do is create some thumbnail pictures and put them in a different directory than your “large” pictures. The script will find all pictures and create galleries for you. If you have new pictures, or additions to a certain gallery, just place the pictures in the directory, and you’re done!

How It Works
I’m using the File System Object (FSO) to open a the directory containing the files and list them all. (Function GetFiles) Second I create the HTML line for the thumb and link. (e.g. <a href=”\mypics\myfile.jpg” target=”_blank”><img src=”\mypics\thumbs\tn_myfile.jpg”></a>) All these links are put in an array. (Function CreatePictureArray) Then I calculate how many galleries are needed to display all thumbs. You do not want a gallery with 523 thumbs do you? So I check how many thumbs you want on one page, and so calculate the number of galleries needed. (Function HowManyTables).

The Sub DrawTable puts the table on the screen. It uses the gallerynumber to check what pictures to display. The DrawLinks Sub will create the |<, <, > and >| icons at the bottom. They can be used to navigate through the galleries. It uses the ?g= paramter in the URL to navigate. (e.g. http://mydomain.com/thumb4.asp?g=5 to see the 5th gallery) It would be quit nasty to have your webserver check the whole directory at every hit. Therefore stuff that you need on all pages (the PictureArray etc.) will be put in a Session variable the first time you access the page. This way it will be available to the user throughout the entire session. If you have a really loaded webserver with numerous hits/seconds you might consider using Application variables instead of the Session variables. Remember, if you do that and you add more pictures, you will have to restart the web application!

At the bottom you see the actual call to it all. If the ?g= is empty, this is the first time the script is run. Therefore it will scan your pictures directory and set the Session parameters in BuildSession. Otherwise it will just display the gallery the user wanted by using the DrawTable and DrawLinks Subs. Have fun!

There are a few easily understood parameters in the script that must be changed:

WebPath : Where does the WEB start physically on the drive
Picture Path: Where are the larger images relative to the WebPath
WebPicture Path : What’s the relative path to the pics in the Web
WebThumbPath: Where did ya hide the thumbs
ThumbPrefix: What is the prefic for thumbnail pics
TargetFrame: In what targetframe should the large images load
TableWidth: How many thumbs in a row
TableHeight: How may rows in a table
TotalTableWidth: Width (in pixels) of the table

Copy the script below, and save it in a text document as THUMBS4.ASP

”””””””””””””””””””””””””””””””””””””””””””””””””””
Function GetFiles (Path)
Dim fso, folder
Set fso = CreateObject (“Scripting.FileSystemObject”)
Set folder = fso.GetFolder (Path)
Set GetFiles = folder.Files
End Function

Function CreatePictureArray (FilesList, WebPicPath, WebThPath, ThPrefix, TarFrame)
Dim pcounter, returnarray ()
ReDim returnarray (FilesList.Count)
pcounter = 0
For Each File in FilesList
returnarray (pcounter) = “target='” & TarFrame & “‘>File.Name & “‘>”
Next
CreatePictureArray = returnarray
End Function

Function HowManyTables (FilesList, TbWidth, TbHeight)
Dim addition
If (FilesList.Count / (TbWidth * TbHeight)) Int (FilesList.Count / (TbWidth * TbHeight)) Then
Else
addition = 0
End If
HowManyTables = (Int (FilesList.Count / (TbWidth * TbHeight))) + addition
End Function

Sub DrawTable (TableNumber, PicArray, TbWidth, TbHeight, TotalWidth)
Dim currentpicture, rcounter, ccounter, width
width = TotalWidth / TbWidth
‘ Response.Write “”
Response.Write “”
If currentPicture > UBound (PicArray, 1) Then
‘ Nothing
Else
Response.Write “”
If currentpicture > UBound (PicArray, 1) Then
‘ Response.Write “.”
Response.Write “.”
Else
‘ Response.Write “” & PicArray (currentpicture) & “”
Response.Write “” & PicArray (currentpicture) & “”
‘ Response.Write “” & currentpicture & “”
End If
Next
Response.Write “”
End If
Next
Response.Write “”
Response.Write “”
End Sub

Sub DrawLinks (TableNumber, TotalTables)
Response.Write “”
Response.Write “|<”
Response.Write ” ”
Response.Write “”‘><”
Response.Write ” ”
Else
Response.Write “|<”
Response.Write ” ”
Response.Write “<”
Response.Write ” ”
End If
If Int(TableNumber) < TotalTables Then
Response.Write “”‘>>”
Response.Write ” ”
Response.Write “>|”
Response.Write ” ”
Else
Response.Write “>”
Response.Write ” ”
Response.Write “>|”
Response.Write ” ”
End If
Response.Write “”
End Sub

Sub BuildSession
Dim WebPath, PicturePath, WebPicturePath, WebThumbPath, ThumbPrefix,
TargetFrame, TableWidth, TableHeight, TotalTableWidth
WebPath = “C:\InetPub\WWWRoot\PornStartsHere\”
PicturePath = “Pics\Hardcore\”
WebPicturePath = “Pics/Hardcore/”
WebThumbPath = “Pics/Hardcore/Thumbs/”
ThumbPrefix = “tn_”
TargetFrame = “_blank”
TableWidth = 4
TableHeight = 5
TotalTableWidth = 400
Set Session(“files”) = GetFiles (WebPath & PicturePath)
Session (“PictureArray”) = CreatePictureArray (Session (“files”),
WebPicturePath, WebThumbPath, ThumbPrefix, TargetFrame)
Session (“TableWidth”) = TableWidth
Session (“TableHeight”) = TableHeight
Session (“TotalTableWidth”) = TotalTableWidth
Session (“tables”) = HowManyTables (Session (“files”), TableWidth,
TableHeight)
‘ Response.Write “——- Building Session ——-”
‘ Response.Write “Session Files: ” & Session (“files”).Count & “”
‘ Response.Write “Picture Array: ” & UBound (Session (“PictureArray”), 1) &
“”
‘ Response.Write “Tables: ” & Session (“tables”) & “”
‘ Response.Write “——– Session Built ———“
End Sub
”””””””””””””””””””””””””””””””””””””””””””””””””””
Dim gallery
If Request(“g”) = “” Then
BuildSession
Else
gallery = Request (“g”)
End if
‘Response.Write “——– Session Variables ——”
‘Response.Write “Session Picture Array: ” & UBound (Session
(“PictureArray”), 1) & “”
‘Response.Write “Session TableWidth: ” & Session (“TableWidth”) & “”
‘Response.Write “Session TableHeight: ” & Session (“TableHeight”) & “”
‘Response.Write “Session Tables: ” & Session (“tables”) & “”
‘Response.Write “———————————”
‘Response.Write “You want gallery ” & gallery & “”

Response.Write “Table ” & gallery & “”
DrawTable gallery, Session (“PictureArray”), Session (“TableWidth”), Session
(“TableHeight”), Session (“TotalTableWidth”)
DrawLinks gallery, Session (“tables”)
Response.Write “”
”””””””””””””””””””””””””””””””””””””””””””””””””””
%>

[ MORE SCRIPTS | CODER’S CORNER >>

Reader Comments on this Article:

Comment by:Summary:
StephenGreat to see some NT/ASP stuff
hgjjh
PsylockeTried the script, but it does nothi…

Share196Tweet123
admin

admin

YNOT Admin wields his absolute power without mercy. When he's not busy banning spam comments to hell he enjoys petting bunnies and eating peanut butter. He recommends everyone try the YNOT Mail (ynotmail.com) email marketing platform and avoid giving their money to mainstream services that hate adult companies.

Related Posts

Adult Business News

UK Online Safety Act Cuts Pornhub Traffic 36% as Age Verification Takes Effect

December 13, 2025
Adult Business News

The Cambassador: Lindsey Banks, Flirt4Free and Brand Representation

September 5, 2018
Adult Business News

ImLive’s Mere Menezes Siqueira Manages Models, Makes the Machine Work

August 23, 2018
Corey Silverstein of Adult.law
Adult Business News

Silverstein Says: 3 Legal Issues Cam Companies, Models Must Pay Attention To

August 22, 2018
Load More

SPONSOR

INDUSTRY EVENTS

Currently Playing

YNOT Summit Model Track: Nerds Dig Sexy Gamers

YNOT Summit Model Track: Nerds Dig Sexy Gamers

01:05:46

YNOT Summit Webmaster Track: Understanding Webcam Business Models

00:51:11

YNOT Summit Model Track: Cam Law 101

01:26:24

SPONSOR

POPULAR NEWS

Wisconsin committee hears proposal to regulate minors’ use of chatbots

February 5, 2026

Will Sergey Lagodinsky’s proposal make AI ‘nudification’ illegal across the EU?

February 5, 2026

Honey Play Box Introduces Gift Wishlist System for Adult Entertainment Streamers

February 5, 2026

Sponsor

YNOT YNOT

QUICK LINKS:

  • About YNOT
  • Terms of Use
  • Privacy Policy
  • Editorial Team
  • Advertise on YNOT
  • Sitemap

FRIENDS OF YNOT:

  • Best Adult Cams
  • Live Porn
  • Adult Reviews
  • Adult Email Marketing
  • Discounted Porn
  • vr porn sites
  • European Adult Biz Magazine

FRIENDS OF YNOT:

  • Rabbits Reviews
  • XXX Job Interviews
  • Adult Site Broker
  • Femdom
  • Paid Porn Sites
  • Live Sex
  • Cam girl sites
  • AI Girlfriend

Welcome Back!

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Fill the forms below to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • Home
  • Adult Business News
  • Adult Industry Legal News
  • Adult Novelty News
  • Porn Star & Adult Talent News
  • Tech News for Adult Webmasters
  • Video Game News for Adults
  • Interviews
  • Opinions
  • YNOT Industry Wire
  • Newsletters

Copyright © 2026 YNOT Group LLC.

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.