Jump to content

Нужен набор типовых сайтов домашней сети.


Recommended Posts

Немного офтоп, но всё же...

 

Господа, помогите!

 

Мне нужно поставить набор сайтов для домашней сети:

- главный сайт, новости, про сеть, карта, ...

- видео

- музыка

- софт

 

Которче самый обычный набор для сети. Тратить время на написание этого дела жутко не хочется.

 

Если кому не жалко, поделитесь движком сайта (дизайн не нужен), а сэкономленное время обещаю потратить на разработку стг-2.5 :)

Link to post
Share on other sites
А там есть плагины для организации mp3 сайта?

Есть плагины для организации файловых архивов и каталогов.

 

П.С. Сейчас сам собираю сайт сети на "мамбе".

Link to post
Share on other sites
Немного офтоп, но всё же...

 

Господа, помогите!

 

Мне нужно поставить набор сайтов для домашней сети:

- главный сайт, новости, про сеть, карта, ...

- видео

- музыка

- софт

 

Которче самый обычный набор для сети. Тратить время на написание этого дела жутко не хочется.

 

Если кому не жалко, поделитесь движком сайта (дизайн не нужен), а сэкономленное время обещаю потратить на разработку стг-2.5 :)

runcms или phpnuke однозначно!

модулей милион! в том числе и видеотеки мп3 галереии карты.. смс сендеры.. все...

Link to post
Share on other sites
  • 1 year later...

PHP cкрипт для организации Веб архива. (можно поставить на машину и давать ссылки FTP или NetBios)

 

<?php
$trashcan = "wfbtrash";            // Trash can (must be located in base directory)
$trashcaninfofileext = "wfbinfo";  // Extension of information file in trash can
$filealiases = true;               // File aliasing feature
$filealiasext = "wfbalias";        // File alias extension
$defaultsortby = "name";           // Default sort mode (name/size/date)
$hidedotfiles = true;              // Hide dot-files (obsolete : use $hidefilepattern instead)
$hidefilepattern = "^(CVS|\..*)$"; // All files matching that pattern will be hidden
$showunixattrs = false;            // Show perms / owner / group (UNIX)
$filemode = 0664;                  // Create mode for files (UNIX)
$dirmode = 0775;                   // Create mode for directories (UNIX)
$uploadmaxsize = 2097152;          // Max file size for uploads (check your php.ini)
$readmefile = "wfbreadme.html";    // README file name (empty means no README file)
$showreadmefile = false;           // Allows README file to be in file list
$useimages = false;                // Use images, set to false by default to respect the philosophy
$imagesdir = "wfbimages";          // Images directory (must be located in base directory)
$showimagesdir = false;            // Show images directory
$trashcanimage = "trashcan.gif";   // Image for trash can
$upperdirimage = "upperdir.gif";   // Image for upper and main directory
$opendirimage = "opendir.gif";     // Image for open directory
$dirimage = "dir.gif";             // Image for simple directory
$fileimage = "file.gif";           // Image for file directory
$editimage = "edit.gif";           // Image for edit action
$viewimage = "view.gif";           // Image for view action
$searchmaxlevels = 10;             // Search levels (max depth in sub directories for searches, 0 means no limits)
$editcols = 80;                    // Number of columns for edit area
$editrows = 24;                    // Number of rows for edit area
$defaultfileformat = "dos";        // Default file format when editing and saving (dos/unix)
$viewextensions = array(           // Viewable extensions (empty array means every file is viewable)
  "txt",
  "php",
  "php3",
  "jsp",
  "asp",
  "htm",
  "html",
  "shtml",
  "xml",
  "wml",
  "js",
  "css",
  "cgi"
);

$authmethod = "none";      // Do not require user authentication
$noauthprofile = "readonly";          // Default profile used when $authmethod = "none"
$allowunknownusers = false;       // If set to false, any server authenticated but locally unknown user
                                // gets the unknown-user profile (see bellow)
$unknownuserprofile = "readonly"; // Profile used for locally unknown users

// ---- PROFILES ----
// You can create as many profiles as you need using these samples

$profile = array(
  "readonly" => array(
     "allowmove" => false,                // Allows file and directory moving
     "allowrename" => false,              // Allows file and directory renaming
     "allowalias" => false,               // Allows file aliasing
     "allowcopy" => false,                // Allows file copying
     "allowdelete" => false,              // Allows file deletion
     "allowremovedir" => false,           // Allows directory deletion
     "allowcreatefile" => false,          // Allows file creation
     "allowcreatedir" => false,           // Allows directory creation
     "allowupload" => false,              // Allows file uploads
     "allowurlupload" => false,           // Allows file uploads from URL
     "allowbrowsetrashcan" => false,      // Allows browsing of trash can
     "allowemptytrashcan" => false,       // Allows emptying of trash can
     "allowrestorefromtrashcan" => false, // Allows restore files from trash can
     "allowdownload" => true,             // Allows file download
     "allowedit" => false,                // Allows file edition
     "allowshow" => true,                 // Allows file viewing (useful only if allowedit is false)
     "allowsearch" => true,               // Allows searches
     "allowregexpsearch" => true          // Allows optional use of regular expressions in searches
  ));

$basedir = "/home/ftp";   // Base directory = custom directory (WINDOWS)
$filelinks = true;                 // Links on files (inhibited with a custom $basedir
                                  // unless you specify $basevirtualdir), works fine
                                  // when $basedir = local directory
$dateformat = "d-m-Y";       // Date format. Here are some other examples (that you can combine) :
                                  // "M D, Y"   = Dec Fri, 2002
                                  // "m/d/y"    = 12/20/02
                                  // "m-d-y"    = 12-20-02
                                  // "l M d, Y" = Friday Dec 20, 2002
                                  // "F dS, Y"  = December 20th, 2002
                                  // "H:i:s"    = 24 hour time with seconds
                                  // "h:i a"    = 12 hour time with am,pm
                                  // etc...
$charset = "windows-1251";
$messages = array(
  "edt1"=>"Invalid name for file to edit",
  "edt2"=>"Invalid name for file to view",
  "edt3"=>"Invalid extension for file to edit",
  "edt4"=>"Invalid extension for file to view",
  "edt5"=>"Unable to read file %VAR1%",
  "edt6"=>"No name for file to edit",
  "edt7"=>"No name for file to view",
  "dir1"=>"Unable to read folder",
  "dir2"=>"Корневая директория",
  "dir3"=>"На уроверь вверх",
  "dir4"=>"Trash can",
  "dir5"=>"Sub-folder",
  "act1"=>"Unknown or unsuitable action",
  "sch3"=>"No files found matching %VAR1%",
  "sch4"=>"Search results for %VAR1%",
  "sch5"=>"Searched folder",
  "sch6"=>"No search pattern",
  "sch7"=>"Use regular expression",
  "sch8"=>"Go to folder of <b>selected</b> file",
  "sch9"=>"Go to folder",
  "dwn2"=>"Invalid name for file to download", 
);
// Checks and rebuilds sub-directory
function extractSubdir($d) {
  global $basedir;
  $tmp = "";
  if ($d != "") {
     $rp = ereg_replace("((.*)\/.*)\/\.\.$", "\\2", $d);
     $tmp = strtr(str_replace($basedir, "", $rp), "\\", "/");
     while ($tmp[0] == '/') $tmp = substr($tmp, 1);
  }
  return $tmp;
}

// Returns full file path
function getFilePath($f, $sd = "") {
  global $basedir, $subdir;

  return $basedir."/".(($sd != "") ? $sd : $subdir)."/".@basename($f);
}

// Return UNIX file perms
function getFilePerms($p) {
  if      (($p & 0xc000) === 0xc000) $type = 's';
  else if (($p & 0x4000) === 0x4000) $type = 'd';
  else if (($p & 0xa000) === 0xa000) $type = 'l';
  else if (($p & 0x8000) === 0x8000) $type = '-';
  else if (($p & 0x6000) === 0x6000) $type = 'b';
  else if (($p & 0x2000) === 0x2000) $type = 'c';
  else if (($p & 0x1000) === 0x1000) $type = 'p';
  else $type = '?';

  $u["r"] = ($p & 00400) ? 'r' : '-';
  $u["w"] = ($p & 00200) ? 'w' : '-';
  $u["x"] = ($p & 00100) ? 'x' : '-';
  $g["r"] = ($p & 00040) ? 'r' : '-';
  $g["w"] = ($p & 00020) ? 'w' : '-';
  $g["x"] = ($p & 00010) ? 'x' : '-';
  $o["r"] = ($p & 00004) ? 'r' : '-';
  $o["w"] = ($p & 00002) ? 'w' : '-';
  $o["x"] = ($p & 00001) ? 'x' : '-';

  if($p & 0x800) $u["x"] = ($u[x] == 'x') ? 's' : 'S';
  if($p & 0x400) $g["x"] = ($g[x] == 'x') ? 's' : 'S';
  if($p & 0x200) $o["x"] = ($o[x] == 'x') ? 't' : 'T';

  return $type.$u["r"].$u["w"].$u["x"].$g["r"].$g["w"].$g["x"].$o["r"].$o["w"].$o["x"];
}

// Checks file name
function checkFileName($f) {
  global $subdir, $thisfile, $hidedotfiles, $hidefilepattern, $trashcan, $trashcaninfofileext, $showimagesdir, $imagesdir, $readmefile, $showreadmefile, $filealiases, $filealiasext;

  $f = @basename($f);

  return !(   (($subdir == "") && (strtolower($f) == $thisfile))
           || ($f == "..")
           || (($subdir == "") && ($f == $trashcan))
           || (!$showimagesdir && ((($subdir == "") && ($f == $imagesdir)) || ($subdir == $imagesdir)))
           || ($hidedotfiles && ($f[0] == '.'))
           || (($hidefilepattern != "") && ereg($hidefilepattern, $f))
           || ($filealiases && ereg("^.*\.".strtolower($filealiasext)."$", strtolower($f)))
           || (!$showreadmefile && ($f == $readmefile))
           || (($subdir == $trashcan) && (($f == $readmefile) || ereg(".*\.".strtolower($trashcaninfofileext)."$", strtolower($f)))) );
}

// Checks for edit extension
function checkExtension($f) {
  global $viewextensions;

  if (count($viewextensions) != 0) {
     foreach ($viewextensions as $ext) {
        if (ereg(".*\.".strtolower($ext)."$", strtolower($f))) return true;
     }
     return false;
  } else {
     return true;
  }
}

// Find files matching a regexp pattern
function searchFiles($sd, $searchpattern, $level = 0) {
  global $basedir, $subdir, $searchmaxlevels, $regexpsearch, $hidefilepattern;

  $count = 0;

  if (   ($searchmaxlevels == 0)
      || ($level < $searchmaxlevels)) {
     $dir = $basedir."/".$sd;

     if (!$regexpsearch && $level == 0) {
        $searchpattern = "^".str_replace("*", ".*", str_replace("?", ".", str_replace(".", "\.", $searchpattern)))."$";
     }
        
     $d = @opendir($dir); 

     while (($file = @readdir($d))) { 
        if (@is_dir($dir."/".$file) && ($file != ".") && ($file != "..")) {
           $count += searchFiles($sd."/".$file, $searchpattern, $level + 1); 
        } else if (ereg(strtolower($searchpattern), strtolower($file)) && !ereg($hidefilepattern, $file)) {
           $fp = getFilePath($file, $sd);
           addFileToList($file, $fp, ($subdir != "") ? str_replace($subdir."/", "", extractSubdir($fp)) : extractSubdir($fp), 9);
           $count++;
        }
     } 

     @closedir($d); 
  }

  return $count;
}

// Adds a file to file list
function addFileToList($file, $fp, $alias, $level, $image = "", $msg = "") {
  global $files, $subdir, $trashcan, $sortby, $showunixattrs, $dateformat, $useimages, $imagesdir, $dirimage, $fileimage, $messages;

  if ($alias == "") $alias = $file;

  $date = @filemtime($fp);
  $size = (@is_dir($fp)) ? -1 : @filesize($fp); // negative size for directories
  $perms = "";
  $owner = "";
  $group = "";
  if ($showunixattrs) {
     $perms = getFilePerms(@fileperms($fp));
     if (function_exists("posix_getpwuid")) {
        $uid = @posix_getpwuid(@fileowner($fp));
        $owner = $uid["name"];
     }
     if (function_exists("posix_getgrgid")) {
        $gid = @posix_getgrgid(@filegroup($fp));
        $group = $gid["name"];
     }
  }

  if ($sortby == "size") {
     $key = $level." ".str_pad($size, 20, "0", STR_PAD_LEFT)." ".$alias;
  } else if ($sortby == "date") {
     $key = $level." ".date("YmdHis", $date)." ".$alias;
  } else {
     $key = $level." ".$alias;
  }

  $files[$key] = array(
     "name" => $file,
     "alias" => (($useimages) ? "<img src=\"$imagesdir/".(($image != "") ? $image : ((@is_dir($fp)) ? $dirimage : $fileimage))."\" border=0 align=center> " : "").(($subdir == $trashcan) ? ereg_replace("(.*)\.[0-9]*$", "\\1", $alias) : $alias),
     "level" => $level,
     "path" => $fp,
     "size" => $size,
     "date" => date($dateformat, $date),
     "perms" => $perms,
     "owner" => $owner,
     "group" => $group,
     "dir" => @is_dir($fp),
     "link" => @is_link($fp),
     "readonly" => !@is_writeable($fp),
     "statusmsg" => (($msg != "") ? $msg : ((@is_dir($fp)) ? $messages["inf4"] : $messages["inf5"]))
  );
}

// Generates full message
function getMsg($class, $msgcode, $msgparam1 = "", $msgparam2 = "") {
  global $messages;

  $msg = str_replace("%VAR1%", $msgparam1, str_replace("%VAR2%", $msgparam2, $messages[$msgcode]));

  return (($class != "") ? "<p class=$class>" : "").htmlspecialchars($msg);
}

// Manages redirections
function redirectWithMsg($class, $msgcode, $msgparam1 = "", $msgparam2 = "", $extraparams = "") {
  global $thisscript, $subdir, $sortby;

  $msg = getMsg($class, $msgcode, $msgparam1, $msgparam2);
  header("Location: $thisscript?subdir=".rawurlencode($subdir)."&sortby=$sortby&msg=".rawurlencode($msg).$extraparams);
  exit;
}

// Page header
function pageHeader() {
include("parts.php");
echo '<div id=pcenter><div class="blocktitle l middle">Archive</div><div class=block>';   }

// Return quoted string for JavaScript usage
function quoteJS($str) { return str_replace("'", "\\'", $str);}

// Getting variables (TODO : increase security here)
if (!empty($HTTP_POST_VARS)) extract($HTTP_POST_VARS);
if (!empty($HTTP_GET_VARS)) extract($HTTP_GET_VARS);

if (function_exists("ini_set")) {
  // Try to inhibate error reporting setting
  @ini_set("display_errors", 0); } 

// Inhibitate file links with custom base directory
if ($filelinks && (($basedir != @dirname(__FILE__)) && ($basevirtualdir == ""))) {
  $filelinks = false;
  $hiddeninfo .= "\nFile links feature inhibited";
}

// Prevents from seeing this file
$thisfile = strtolower(@basename(__FILE__));

// Turns antislashes into slashes for base directory
$basedir = strtr($basedir, "\\", "/");

// This script URI
$thisscript = $HTTP_SERVER_VARS["PHP_SELF"];

// General HTTP directives
header("Expires: -1");
header("Pragma: no-cache");
header("Cache-Control: max-age=0");
header("Cache-Control: no-cache");
header("Cache-Control: no-store");
if ($act != "download") {
  header("Content-Type: text/html; charset=$charset");
}

// Check of user's profile
if ($authmethod != "none") {
  if ($username == "") {
     pageHeader();
     echo getMsg("error", "rlm1");
     pageFooter();
     exit;
  } else if (!isset($user[$username])) {
     if (!$allowunknownusers) {
        pageHeader();
        echo getMsg("error", "rlm2");
        pageFooter();
        exit;
     } else {
        $userprofile = $unknownuserprofile;
     }
  } else {
     $userprofile = $user[$username]["profile"];
  }
} else {
  $userprofile = $noauthprofile;
}

// Setting rights
$allowmove = $profile[$userprofile]["allowmove"];
$allowrename = $profile[$userprofile]["allowrename"];
$allowalias = $profile[$userprofile]["allowalias"];
$allowcopy = $profile[$userprofile]["allowcopy"];
$allowdelete = $profile[$userprofile]["allowdelete"];
$allowremovedir = $profile[$userprofile]["allowremovedir"];
$allowcreatefile = $profile[$userprofile]["allowcreatefile"];
$allowcreatedir = $profile[$userprofile]["allowcreatedir"];
$allowupload = $profile[$userprofile]["allowupload"];
$allowurlupload = $profile[$userprofile]["allowurlupload"];
$allowbrowsetrashcan = $profile[$userprofile]["allowbrowsetrashcan"];
$allowemptytrashcan = $profile[$userprofile]["allowemptytrashcan"];
$allowrestorefromtrashcan = $profile[$userprofile]["allowrestorefromtrashcan"];
$allowdownload = $profile[$userprofile]["allowdownload"];
$allowedit = $profile[$userprofile]["allowedit"];
$allowshow = $profile[$userprofile]["allowshow"];
$allowsearch = $profile[$userprofile]["allowsearch"];
$allowregexpsearch = $profile[$userprofile]["allowregexpsearch"];

// Parameters check
if (!isset($subdir) || $subdir == ".") $subdir = "";
if (  ($subdir != "")
  && (   strstr($subdir, "..")
      || (!$allowbrowsetrashcan && ($subdir == $trashcan))
      || (!$showimagesdir && ($subdir == $imagesdir)) ) ) {
  $subdir = "";
  $hiddeninfo .= "\nRedirected to base directory";
}
$subdir = extractSubdir($basedir."/".$subdir);
if (!isset($sortby)) $sortby = $defaultsortby;
if (!isset($act)) $act = "";
if (!isset($file)) {
  if (!isset($selfiles) || !is_array($selfiles)) {
     $file = "";
  } else {
     $file = $selfiles[0];
  }
}

// Array for file lists
$files = array();

// Processes actions and redirects to pages
if (($act != "edit") && ($act != "show")) {
  if ($act == "") {
     @clearstatcache();

     if ($d = @opendir($basedir."/".$subdir)) {
        // builds an indexed array for files
        if ($subdir != "") {
           addFileToList("", $basedir, "[".$messages["dir2"]."]", 0, $upperdirimage, $messages["inf6"]);
        }
        if ($subdir != $trashcan) {
           addFileToList("..", getFilePath(".."), "[".$messages["dir3"]."]", 2, $upperdirimage, $messages["inf7"]);
        }
        if ($allowbrowsetrashcan && ($subdir != $trashcan) && (@is_dir($basedir."/".$trashcan))) {
           addFileToList($trashcan, $basedir."/".$trashcan, "[".$messages["dir4"]."]", 1, $trashcanimage, $messages["inf8"]);
        }
        while ($file = @readdir($d)) {
           if (checkFileName($file)) {
              $fp = getFilePath($file);
              $fp_alias = $fp.".".$filealiasext;

              $alias = "";
              if ($filealiases && @is_readable($fp_alias)) {
                 $fd = @fopen($fp_alias, "r");
                 $alias = trim(@fread($fd, @filesize($fp_alias)))." <i>(".(($subdir == $trashcan) ? ereg_replace("(.*)\.[0-9]*$", "\\1", $file) : $file).")</i>";
                 @fclose($fd);
              }

              addFileToList($file, $fp, $alias, 9);
           }
        }

        @closedir($d);

        // Sort the array according to indexes
        ksort($files);
     } else {
        pageHeader();
        echo getMsg("error", "dir1", $subdir);
        pageFooter();
        exit;
     }
  } else if ($allowsearch && ($act == "search")) {
     $searchpattern = trim($searchpattern);

     if ($searchpattern != "") {
        if (!isset($regexpsearch)) $regexpsearch = false;

        @clearstatcache();

        addFileToList($subdir, getFilePath("."), "[".$messages["sch5"]."]", 1, $upperdirimage);

        if (searchFiles($subdir, $searchpattern) == 0) {
           redirectWithMsg("warning", "sch3", $searchpattern, "", "&searchpattern=".rawurlencode($searchpattern).(($allowregexpsearch) ? "&regexpsearch=$regexpsearch" : ""));
        }

        ksort($files);
     } else {
        redirectWithMsg("error", "sch6");
     }
  }
  else if ($allowdownload && ($act == "download") && ($subdir != $trashcan)) {
     if (isset($file) && ($file != "")) {
        $subdir = @dirname($file);

        if (!checkFileName($file) || (($subdir == "") && ($file == $trashcan))) {
           redirectWithMsg("warning", "dwn2");
        } else {
           $fp = getFilePath($file);

           if (@is_readable($fp)) {
              @clearstatcache();

              header("Content-Type: application/force-download");
              header("Content-Transfer-Encoding: binary");
              header("Content-Length: ".@filesize($fp));
              header("Content-Disposition: attachment; filename=\"".@basename($file)."\"");

              @readfile($fp);

              exit;
           } else {
              redirectWithMsg("error", "dwn3", $file);
           }
        }
     } else {
        redirectWithMsg("warning", "dwn4");
     }
  } else {
     redirectWithMsg("error", "act1");
  }
}


// Common part of the page


pageHeader();
echo "<p><table width=100% border=0 cellspacing=2 cellpadding=2>";
echo "<td class=row>";
if ($act == "search") echo getMsg("", "sch4", $searchpattern)." (";
if ($subdir == "") echo "Корневая директория";
else echo 'Под-папка'.": ".htmlspecialchars($subdir);
if ($act=="search") echo ")";
echo "</td>";
echo "<form action=$thisscript method=get name=searchForm>";
echo "<td class=row width=183>";
echo "<input name=act type=hidden value=search>";
echo "<input name=subdir type=hidden value=\"$subdir\">";
echo "<input name=sortby type=hidden value=$sortby>";
echo "<input name=searchpattern class=entries type=text size=15 value=\"$searchpattern\"> ";
echo "<input type=submit class=entries value='Поиск'>";
if ($allowregexpsearch) echo "<br><input type=checkbox value=true name=regexpsearch".(($regexpsearch) ? " checked" : "")."> Use regular expression";
echo "</td></tr></form></table>";

/* // Edit or show page
if (($allowedit && ($act == "edit")) || ($allowshow && ($act == "show")) && ($subdir != $trashcan)) {
  if (isset($file) && ($file != "")) {
     if (!checkFileName($file) || (($subdir == "") && ($file == $trashcan))) {
        echo getMsg("warning", ($act == "edit") ? "edt1" : "edt2");
     } else if (!checkExtension($file)) {
        echo getMsg("warning", ($act == "edit") ? "edt3" : "edt4");
     } else {
        if (!isset($data)) {
           $fp = getFilePath($file);

           if ($fd = @fopen($fp, "r")) {
              $data = @fread($fd, @filesize($fp));
              @fclose($fd);
           } else {
              echo getMsg("error", "edt5");
           }
        }
else {
           echo "<p><b>".$messages["edt9"]." : </b>".htmlspecialchars($file);
           echo "<p><table border=0 cellspacing=0 cellpadding=10>";
           echo "<tr><td width=700><pre>".htmlspecialchars($data)."</pre> </td></tr>";
           echo "</table>";
           echo "<p><a href=$thisscript?subdir=".rawurlencode($subdir)."&sortby=$sortby onMouseOver='return statusMsg(\"".quoteJS($messages["edt12"])."\");' onMouseOut='return statusMsg(\"\");'>".$messages["edt12"]."</a>";
        }
     }
  } else {
     echo getMsg("warning", ($act == "edit") ? "edt6" : "edt7");
  }
// File list page
}  */        
     
if (!empty($files)) {
     echo "<p><table width=100% cellpadding=4 cellspacing=4 border=0>";
     echo "<form action=$thisscript method=post name=listForm>";
     echo "<input name=act type=hidden value=''>";
     echo "<input name=subdir type=hidden value=\"$subdir\">";
     echo "<input name=sortby type=hidden value=$sortby>";
     echo "<tr>";
     echo "<td align=center><b>";
     echo "<a href=$thisscript?subdir=".rawurlencode($subdir)."&sortby=name".(($act == "search") ? "&act=search&searchpattern=".rawurlencode($searchpattern) : "").">Имя</a>";
     echo "</b></td>";
     echo "<td align=center width=50><b>";
     echo "<a href=$thisscript?subdir=".rawurlencode($subdir)."&sortby=size".(($act == "search") ? "&act=search&searchpattern=".rawurlencode($searchpattern) : "").">Размер</a>";
     echo "</td></b>";
     echo "<td align=center width=80><b>"."<a href=$thisscript?subdir=".rawurlencode($subdir)."&sortby=date".(($act == "search") ? "&act=search&searchpattern=".rawurlencode($searchpattern) : "").">Date</a>"."</td>";
     echo "</tr>";
     // Files and directories
     $total = 0;
    $nbfiles = 0;
     $nbdirs = 0;
     reset($files);
     while (list($key, $file) = each($files)) {
        // Directory section
        if ($file["dir"]) {
           if (($subdir != "") || ($file["name"] != "..")) {
              echo "<tr><td class=row>";
              if ($file["link"]) {
                 echo "<i><b>".htmlspecialchars($file["name"])."</b></i>";
              } else {
                 echo "<a href=$thisscript?subdir=".rawurlencode(extractSubdir($file["path"]))."&sortby=$sortby>";
                 echo $file["alias"];
                 echo "</a>";
              }
              echo "</td>";
              echo "<td width=50 class=row> </td>";
       echo "<td width=80 class=row> </td>";
              echo "</tr>";

              if ($file["level"] == 9) $nbdirs++;
           }
        // File section
        } else {
           echo "<tr>";
            echo "<td class=row>".(($file["link"]) ? "<i>" : "");
           if ($filelinks) {
              if ($basevirtualdir == "") {
                 echo "<a href=".str_replace("%2F", "/", rawurlencode(extractSubdir($file["path"])));
              } else {
                 echo "<a href=".$basevirtualdir."/".rawurlencode($file["name"]);
              }
              echo " onMouseOver='return statusMsg(\"".quoteJS($file["statusmsg"])."\");' onMouseOut='return statusMsg(\"\");'>";
              echo $file["alias"];
              echo "</a>";
           } else {
//               echo htmlspecialchars($file["name"]);
    echo "<a href='ftp://your_url/".str_replace("%2F", "/", rawurlencode(extractSubdir($file["path"])))."'>".htmlspecialchars($file["name"])."</a>";
           }
           echo (($file["link"]) ? "</i>" : "")."</td>";
    echo "<td class=row width=40>".round(($file["size"]/1024)/1024)."Mb</td>";
           echo "<td class=row width=80>".$file["date"]."</td>";
//    echo "<td class=row width=40 align=center>";
           if (($act != "search") && ($allowedit || $allowshow) && checkExtension($file["name"]) && ($subdir != $trashcan)) {
            echo "<center><a href=$thisscript?act=show&subdir=".rawurlencode($subdir)."&sortby=$sortby&file=".rawurlencode($file["name"]).">Show</a></center>";
           } 
           if (($allowdownload) && ($subdir != $trashcan)) {
           //   echo "<center><a href=$thisscript?act=download&subdir=".rawurlencode($subdir)."&sortby=$sortby&file=".str_replace("%2F", "/", rawurlencode(extractSubdir($file["path"]))).">Download</a></center>";
//     echo "<center><a href='ftp://your_url/".str_replace("%2F", "/", rawurlencode(extractSubdir($file["path"])))."'>Download</a></center>";
            }
           echo "</td></tr>";
           $total += $file["size"];
           $nbfiles++; }}
echo "<th colspan=3>$nbdirs папок, $nbfiles файлов (".round(($total/1024)/1024)." Mb".")</th></tr>"; }
echo "</table></div></div>";
?>

 

Извеняюсь за прикрепленный файл, нет аттачей в теме.

Link to post
Share on other sites
PHP cкрипт для организации Веб архива. (можно поставить на машину и давать ссылки FTP или NetBios)

 

// Page header
function pageHeader() {
include("parts.php");
echo '<div id=pcenter><div class="blocktitle l middle">Archive</div><div class=block>';   }

 

Извеняюсь за прикрепленный файл, нет аттачей в теме.

нехватает файлика

include("parts.php");

Link to post
Share on other sites

Это можно безболезнено закомментировать, я привел лишь пример скрипта. Т.е. если есть двига со стилями, то ей можно просто ссылаться на этот файл.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...