4) { /* Newest one has priority 1, older ones lower priority. */ $pri = (sizeof($versions) - $ver) / sizeof($versions); $date = date('Y-m-d', $source_data{'creation_date'}); $suffix = substr($package, $len - 4, 4); if (strcasecmp($suffix, ".txt") == 0) { /* Skip text files (probably documentation). */ continue; } else if (strcasecmp($suffix, ".zip") == 0 || strcasecmp($suffix, ".tar") == 0 || strcasecmp($suffix, ".tgz") == 0 || strcasecmp($suffix, ".tbz") == 0 || ($len > 5 && strcasecmp(substr($package, $len - 5, 5), ".tbz2") == 0) || ($len > 6 && strcasecmp(substr($package, $len - 6, 6), ".tar.z") == 0) || ($len > 7 && strcasecmp(substr($package, $len - 7, 7), ".tar.gz") == 0) || ($len > 8 && strcasecmp(substr($package, $len - 8, 8), ".tar.bz2") == 0) ) { $type = "archive"; } else if (strcasecmp(substr($package, $len - 3, 3), ".pm") == 0) { /* Someone uploaded a Perl script... */ $type = "perl"; } else if (strcasecmp(substr($package, $len - 3, 3), ".py") == 0) { /* ... and someone uploaded a Python script... */ $type = "python"; } else if (strcasecmp($suffix, ".tcl") == 0) { /* ... and someone uploaded a Tcl script... */ $type = "tcl"; } else { /* Catch-all: the site is for Vim scripts, so assume that everything * that is not an archive is a Vim script. ".vim.gz" should be OK. * ".vba" and ".vbz.gz" are Vimball scripts (not Visual basic). */ $type = "vim"; } ?> http://www.vim.org/scripts/download_script.php?src_id=