I'm looking to update the head model resource to be using ASP and auto-generated. Roughly keeping the same layout I'm wanting it basically to auto-generate the thumbnails from a certain directory and display them in a similar fashion to how they are now.
Click here for a reference.. Now I don't know ASP so looking for some help. Online ASP Galleries online are WAY too complex involving comments for every image, auto-thumbnailing (ugh). I just want it to display the ASP images as they are now, reading a directory for the thumbnail and for the actual images.
Any help, links to directions/tutorials would be greatly appreciated.
Replies
HAHAHAHAHA!!!! the best part about this line was the fact poops head is in there with them all!! and he dosent look out of place in the least.
Update! Got the ASP displaying thumbnails and linking them! Its currently using a txt file then reads it for the files it needs. This works but at the moment its making a thumbnail and linking to the actual text file itself, any work arounds, heres the code:
<font class="small">Code:</font><hr /><pre>
<%
dim fs,fo,image,tfile,nfile,filepath
const Filename = "black.txt"
Const THUMB_DIR = "./thumbs/male_black/"
Const IMG_DIR = "./male/black/"
Filepath = Server.MapPath(Filename)
set fs = Server.CreateObject("Scripting.FileSystemObject")
set fo = fs.GetFolder("C:\Inetpub\wwwroot\Reference\male\black\")
Set tfile = fo.CreateTextFile(Filename,true)
Set nfile=fs.OpenTextFile("C:\Inetpub\wwwroot\Reference\male\black\black.txt")
for each image in fo.files
tfile.WriteLine(image.Name)
strImageSrcText = THUMB_DIR & image.Name
linkUrl = IMG_DIR & image.Name
%>
<a href = "<%= linkUrl %>" >
<img src = "<%= strImageSrcText %>"
width = "75"
height = "75"
border = "0"
/></a>
<%
set fo=nothing
set fs=nothing
next
set tfile=nothing
%>
</pre><hr />
And the code if anyone else wants to put it on their site:
This is for a REALLY simple update feature. Simply reads 'update.txt' (accepts all the HTML code).
<font class="small">Code:</font><hr /><pre>
<!-- reads updates.txt -->
<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile(Server.MapPath("updates.txt"), 1)
Response.Write(f.ReadAll)
f.Close
Set f=Nothing
Set fs=Nothing
%>
</pre><hr />
This reads the directory builds an external txt file with all the names, then uses that list to display the thumbnails and link to the main picture.
<font class="small">Code:</font><hr /><pre>
<!-- reads directory set and displays thumbnails with links -->
<%
dim fs,fo,image,tfile,nfile, fp
const Filename = "white.txt"
Const THUMB_DIR = "./thumbs/male_white/"
Const IMG_DIR = "./male/white/"
set fs = Server.CreateObject("Scripting.FileSystemObject")
set fo = fs.GetFolder("C:\Inetpub\wwwroot\Reference\male\white\")
set fp = fs.GetFolder("C:\Inetpub\wwwroot\Reference\")
Set tfile = fp.CreateTextFile(Filename,true)
Set nfile=fs.OpenTextFile(Server.MapPath(Filename), 1)
for each image in fo.files
tfile.WriteLine(image.Name)
strImageSrcText = THUMB_DIR & image.Name
linkUrl = IMG_DIR & image.Name
altTxt = image.Name
%>
<a href = "<%= linkUrl %>" >
<img src = "<%= strImageSrcText %>"
width = "75"
height = "75"
border = "0"
alt = "<%= altTxt %>"
/></a>
<%
set fo=nothing
set fs=nothing
next
set tfile=nothing
%>
</pre><hr />
The current "Roster" (the Dakota County Jail call it a 'Prison Roster')
FOR YOU NFL FANS. 3rd row down, 5th across - that guy looks like a scruffier version of Jerome Bettis!
I'm sorry I can't host it personally.
Couldn't Polycount host it as a resource and just throw a generic PHP thumbnailing script on there?
edit: just checked, apparently my host doesn't support ASP. Whoops
I checked the website stats today and found out it was 50% IE and 50% netscape 7 (guessing thats firefox); so I've checked it out in firefox and it had some problems (namely not reading the CSS). I've updated that so now its perfect in both
Progress! Got it to display a list of the folder in hand (the images) and display the last image on that list (it uses the variable that gets used throughout and puts that in a variable to use in the image tag.. maybe use an array, hmm..
[/ QUOTE ]
Tehehe. I'm starting on the PHP version. Right now I'm at this stage again. Its currently reading the directory and putting that into an array named files. This is then exporting to a .txt file with all the names (although it isn't adding breaks after each one.
Example:
<font class="small">Code:</font><hr /><pre>
b_asian.jpgb_asiantash.jp
</pre><hr />
ASP:
<font class="small">Code:</font><hr /><pre>
<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile(Server.MapPath("updates.txt"), 1)
Response.Write(f.ReadAll)
f.Close
Set f=Nothing
Set fs=Nothing
%>
</pre><hr />
PHP:
<font class="small">Code:</font><hr /><pre>
<?php echo file_get_contents("updates.txt"); ?>
</pre><hr />
Yes, I'm serious
Anyhow, so now Slum you can host or I can wait for Vito to get me planetquake hosting
A comparison shot. The only difference is in the order of the actual pictures
A code comparison shot. PHP side looks a fair bit shorter but the link layout is in one long line rather than seperated like in ASP. They're probably near enough the same..
AND SO MY CODING WEEKEND ENDS... 48 hours and now knowledgeable (or enough to do the same site twice) in two website languages..
I can set you up an FTP account as well, so you can maintain the files directly.
From this, I've decided to try and build a very simple portfolio site. The aim will be to have some kind of admin backend; upload feature (with admin selection place); and a simple system: The thumbnail will look for a folder; if the folder exists it will load the website within that/ if it doesn't - it will look for the imagename in the images folder, so depending on how far the model is (done/WIP,etc) it will link either way. I'm off to college now (2 week break over) but I'll start Wednesday night I think. I'll also "publish" (hehehe) the PHP code tonight in case anyone wants it .
<font class="small">Code:</font><hr /><pre>
<?php
//for every file in IMG_DIR, export to txt and load up thumbnail
$files = (scandir("male/black"));
function new_array(&$item1)
{
$item1 = "$item1\r\n";
}
array_walk($files,'new_array');
fopen("black.txt", "w+");
file_put_contents("black.txt",array_slice($files,2));
$IMG_DIR = "thumbs/male_black/";
$LINK_URL = "male/black/";
$eTxt=file('black.txt');
foreach ($eTxt as $imageName) {
?>
<a href="<?php echo $LINK_URL,$imageName ?>"><img src="<?php echo $IMG_DIR,$imageName ?>" width="75" height="75" border="0" alt="<?php echo $imageName ?>"></a>
<?
}
?>
</pre><hr />
Hope it helps some of ya..
Now hosted by slum (big thankyou to you, kind sir)
http://www.isleepinabox.com/users/thnom/index.php