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.

Icons to Represent Non-Images

edited January 2007 in Vanilla 1.0 Help
Would someone be able to show me how to apply a custom icon to different filetypes (non-images; images can just use thumbnailer.php). It doesn't have to be unique per document, just 1 blanket icon for text, 1 for movies, 1 for html etc... which I could design. I just want to change the "no preview available" icon and I'll be all set. -Aaron

Comments

  • Add the image as a background image to the Stylesheet, very easy, i have done it already. I added a folder icon above the folder names.
  • Thanks!
  • IanTearle, which element did you place th background-image under? Put mine under .Folders li{} and it isn't working.
  • Warning: amateur hacks ahead
    I removed lines 662 - 666:
    $Return .= "<li class=\"ItemThumb NoPreview\">" ."<a href=\"".CurrentUrl().$Params->GetQueryString()."\">" ."Preview Unavailable" ."</a>" ."</li>";
    in the FormatListItem function and replaced it with this:
    $CurrFileExt = substr(strrchr($Name, '.'), 1, strlen($Name)); $ValidThumbExt = array("doc", "txt", "rtf", "pdf"); if (in_array ($CurrFileExt, $ValidThumbExt)) { $ThumbPath = EncodeLinkUrl($CurrFileExt.".png"); $Return .= "<li class=\"ItemThumb\">" ."<a href=\"".CurrentUrl().$Params->GetQueryString()."\" style=\"background:url('".$ThumbPath."') center center no-repeat;\">" ."<img src=\"".$ThumbPath."\" border=\"0\" alt=\"\" />" ."</a>" ."</li>\r\n"; } else { $Return .= "<li class=\"ItemThumb NoPreview\">" ."<a href=\"".CurrentUrl().$Params->GetQueryString()."\">" ."Preview Unavailable" ."</a>" ."</li>"; }

    Feel free to see it in action, along with "wrap long filenames" at http://web.usf.edu/FacultySenate/ay0607/meetings/index.php?fpp=10&did=1-0.
  • WOW Now that's awesome!!!
  • Glad I could help...so here's a link to the icons: http://tango.freedesktop.org
  • mrfreeze i replace the code as described above and i have the icons from the tango site. what are the other steps i need to take to get this to work?
  • Can someone else help me?
This discussion has been closed.