Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Add random thumbnail to each folder on index.php?

3stripe3stripe ✭✭
edited March 2006 in Vanilla 1.0 Help
I'm trying to add a random image, or even hard code an image, to each folder listed on the main page. I need to add something into $FileList - maybe somewhere after // Add actual folders... I think.... can anyone help? (EDIT - Managed to hard code an image into the <li> loop, ok for now as I only have 1 folder at the moment, will look a bit stupid if I add any more folders!)

Comments

  • Options
    Guess this is one for Mark if he ever gets a moment to answer more boring questions
  • Options
    I'll keep an eye on this thread as it's something I'd like to do as well :)
  • Options
    I think if i played around i might be able to work it out but i dont have the code to hand and i wont be home till around this time tomorrow. Presumably you want a random image from within that directory..right?
  • Options
    3stripe3stripe ✭✭
    edited October 2005

    Yeah I think a random image from each sub directory would be nice as a start, or the option to choose the first image or something. However I know about this much php... . ..... so I can't take it any further myself.

    I've stuck up the full code if anyone wants to have a peek : http://www.3stripe.net/beta/filebrowser_index.zip

    If you have time to take a quick look tomorrow or whenever that would be sweet :-)

    Anyhows here the chunk that I was messing about with:

    //////////////////////////////////////////////////////////

    // Add actual folders

    $thumb = "image
    ";

    for ($i = 0; $i < count($FolderCollection); $i++) {
    $Params->Set("did",FormatDelimitedString($Config->FolderIDs,$i,$Config->FolderDelimiter));
    $FileList .= "

    " . $thumb ."
    GetQueryString()."\">".$FolderCollection[$i]."
    ";
    }
    $FileList .= "\r\n";
    }

    //////////////////////////////////////////////////////////

  • Options
    If this is what I think it is, it is also something that has had me interested for awhile.
  • Options
    3stripe3stripe ✭✭
    edited October 2005
    If this can be made to work, and also the option to add an image name (http://lussumo.com/community/comments.php?DiscussionID=301) I will be a very very happy bunny :-) I know the addition of both of these will make Filebrowser slightly less light-weight, but once these two are in place I think of tons more places I'd like to use Filebrowser (eg in an actual gallery context where you'd want to have an title for each image, not a filename)
  • Options
    To be honest i dont see that adding a thumbnail will add a huge amount of weight to it. The filenames would be a lot more difficult though.
  • Options
    Would image names stored in a flat text file be simpler?
  • Options
    um. simpler perhaps, but retarded? I suppose it wouldnt be that much work to make the thumbnailer write a text doc of the files it had done... i wonder what mark thinks of this.
  • Options
    don't think retarded is the politically correct term but i know what you mean. just mentioned that because it's how eSPG does naming.
  • Options
    yeah i considered changing it but i couldnt be bothered. I'm not a very PC person (i dont care much for stuff like that in the mainstream).
  • Options
    fair enuf.
  • Options
    has anyone tried their hand at any of the above yet? (i've switched to zen photo now for my image stuff)
This discussion has been closed.