Home General Discussion

Looking to update the Head Model Resource..

thnom
polycounter lvl 18
Offline / Send Message
thnom polycounter lvl 18
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

  • thnom
    Offline / Send Message
    thnom polycounter lvl 18
    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..
  • arshlevon
    Offline / Send Message
    arshlevon polycounter lvl 18
    "All images are made from the 'Dakota County Jail Bookings' site"

    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.
  • thnom
    Offline / Send Message
    thnom polycounter lvl 18
    Haha Arsh.

    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 />
  • thnom
    Offline / Send Message
    thnom polycounter lvl 18
    I rock! All working and updated to ASP. Now uses an external CSS file and a txt file to update the 'news'! It is also FULLY compliant with the w3c HTML 4.01.

    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 />
  • thnom
    Offline / Send Message
    thnom polycounter lvl 18
    Ok, here's the deal. I need hosting for the head model resource (and only the head model resource). Right now the site sits at 20mb so I'll need at least that (Every fullsize image is approx 350kb with every thumbnail approx 2kb) with ASP. I know its kind of cheeky but where its at now I CANNOT update. I have written the ASP code so all I need to do is just the drop the images into the folders. I do plan on updating it to include an upload feature.

    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!
    currentroster4tc.jpg
  • Ninjas
    Offline / Send Message
    Ninjas polycounter lvl 18
    Hey, that is really cool! I didn't even know you were doing this.

    I'm sorry I can't host it personally.
  • Vito
    Offline / Send Message
    Vito polycounter lvl 18
    Does this really require a special hosting situation with ASP? Isn't it just directories of photos which happen to be headshots?

    Couldn't Polycount host it as a resource and just throw a generic PHP thumbnailing script on there?
  • Slum
    Offline / Send Message
    Slum polycounter lvl 18
    I can host it for you. This month I used 25mb of my 250gb bandwidth limit, and I've got at least 9gb disk space available.

    edit: just checked, apparently my host doesn't support ASP. Whoops :\
  • thnom
    Offline / Send Message
    thnom polycounter lvl 18
    Cheers slum, nice of you to offer. Vito - its ASP for my college project - the tutor liked that. If we can make it PHP and do the same thing then I'll do that; I have the ASP version so I can show my tutor that - it just means finding the PHP script. As long as it still exists I aren't fussed. The ASP script currently reads the directory, exports a txt file with all the filenames, reads it and loads up the thumbnails with a link (using that filename).
  • Ramucho
    Offline / Send Message
    Ramucho polycounter lvl 18
    Oh noes!! there's Mr.Poopster!!!
  • thnom
    Offline / Send Message
    thnom polycounter lvl 18
    iefirefox0tx.th.jpg

    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 laugh.gif
  • Slum
    Offline / Send Message
    Slum polycounter lvl 18
    Ah, if you can manage to get it working in PHP, I'd be glad to host it for you.
  • thnom
    Offline / Send Message
    thnom polycounter lvl 18
    [ QUOTE ]
    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 />
  • thnom
    Offline / Send Message
    thnom polycounter lvl 18
    The beast that I am - I have managed to convert it to PHP smile.gif I must admit, PHP seems the better of the two. For instance, the code to read an external txt file (as used on the actual main body text).

    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 smile.gif

    Anyhow, so now Slum you can host or I can wait for Vito to get me planetquake hosting smile.gif

    aspphp5on.th.jpgcodecomparison1rz.th.jpg

    A comparison shot. The only difference is in the order of the actual pictures smile.gif
    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..
  • Slum
    Offline / Send Message
    Slum polycounter lvl 18
    Neato. I tried PM'ing you, but it says you're not accepting PM's.

    I can set you up an FTP account as well, so you can maintain the files directly.
  • thnom
    Offline / Send Message
    thnom polycounter lvl 18
    Slum I've turned my PMs on smile.gif

    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 smile.gif.
  • thnom
    Offline / Send Message
    thnom polycounter lvl 18
    Ok, the PHP Code!

    <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..
  • thnom
    Offline / Send Message
    thnom polycounter lvl 18
    UPDATE YOUR BOOKMARKS...

    Now hosted by slum (big thankyou to you, kind sir)

    http://www.isleepinabox.com/users/thnom/index.php
Sign In or Register to comment.