netdisk.php

来自「通达OA2007SE源代码 非常好的」· PHP 代码 · 共 1,855 行 · 第 1/5 页

PHP
1,855
字号
                                                                        }
                                                                        else
                                                                        {
                                                                          if (eregi ((''.'\\.ppt$'), $fichier))
                                                                          {
                                                                            $image = 'ppt.gif';
                                                                            $nom_type = $mess[97];
                                                                          }
                                                                          else
                                                                          {
                                                                            if (eregi ((''.'\\.pdf$'), $fichier))
                                                                            {
                                                                              $image = 'pdf.gif';
                                                                              $nom_type = $mess[79];
                                                                            }
                                                                            else
                                                                            {
                                                                              if (eregi ((''.'\\.mov$'), $fichier))
                                                                              {
                                                                                $image = 'mov.gif';
                                                                                $nom_type = $mess[80];
                                                                              }
                                                                              else
                                                                              {
                                                                                if (eregi ((''.'\\.avi$'), $fichier))
                                                                                {
                                                                                  $image = 'avi.gif';
                                                                                  $nom_type = $mess[81];
                                                                                }
                                                                                else
                                                                                {
                                                                                  if (eregi ((''.'\\.mpg$'), $fichier))
                                                                                  {
                                                                                    $image = 'mpg.gif';
                                                                                    $nom_type = $mess[82];
                                                                                  }
                                                                                  else
                                                                                  {
                                                                                    if (eregi ((''.'\\.mpeg$'), $fichier))
                                                                                    {
                                                                                      $image = 'mpeg.gif';
                                                                                      $nom_type = $mess[83];
                                                                                    }
                                                                                    else
                                                                                    {
                                                                                      if (eregi ((''.'\\.swf$'), $fichier))
                                                                                      {
                                                                                        $image = 'flash.gif';
                                                                                        $nom_type = $mess[91];
                                                                                      }
                                                                                      else
                                                                                      {
                                                                                        $image = 'defaut.gif';
                                                                                        $nom_type = $mess[23];
                                                                                      }
                                                                                    }
                                                                                  }
                                                                                }
                                                                              }
                                                                            }
                                                                          }
                                                                        }
                                                                      }
                                                                    }
                                                                  }
                                                                }
                                                              }
                                                            }
                                                          }
                                                        }
                                                      }
                                                    }
                                                  }
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    if (($quoi == 'image'))
    {
      return $image;
    }
    else
    {
      return $nom_type;
    }
  }
  function init ($rep)
  {
    global $racine;
    global $sens;
    global $mess;
    global $font;
    global $DISK_ID;
    if (($rep == ''))
    {
      $nom_rep = $racine;
    }
    if (($sens == ''))
    {
      $sens = 1;
    }
    else
    {
      if (($sens == 1))
      {
        $sens = 0;
      }
      else
      {
        $sens = 1;
      }
    }
    if (($rep != ''))
    {
      $nom_rep = (((''.$racine).'/').$rep);
    }
    if (!file_exists ($racine))
    {
      echo ((((''.$mess['72']).'<br><br><a href="netdisk.php"><span class=Big1>').$mess['32']).'</span></a>
');
      exit ();
    }
    if (!is_dir ($nom_rep))
    {
      echo ((((''.$mess['76']).'<br><br><a href="javascript:window.history.back()"><span class=Big1>').$mess['32']).'</span></a>
');
      exit ();
    }
    return $nom_rep;
  }
  function assemble_tableaux ($t1, $t2)
  {
    global $sens;
    if (($sens == 0))
    {
      $tab1 = $t1;
      $tab2 = $t2;
    }
    else
    {
      $tab1 = $t2;
      $tab2 = $t1;
    }
    if (is_array ($tab1))
    {
      while (list ($cle, $val) = each ($tab1))
      {
        $liste[$cle] = $val;
      }
    }
    if (is_array ($tab2))
    {
      while (list ($cle, $val) = each ($tab2))
      {
        $liste[$cle] = $val;
      }
    }
    return $liste;
  }
  function txt_vers_html ($chaine)
  {
    $chaine = str_replace ('&#8216;', '\'', $chaine);
    $chaine = str_replace ('&#339;', 'oe', $chaine);
    $chaine = str_replace ('&#8217;', '\'', $chaine);
    $chaine = str_replace ('&#8230;', '...', $chaine);
    $chaine = str_replace ('&', '&amp;', $chaine);
    $chaine = str_replace ('<', '&lt;', $chaine);
    $chaine = str_replace ('>', '&gt;', $chaine);
    $chaine = str_replace ('"', '&quot;', $chaine);
    return $chaine;
  }
  function show_hidden_files ($fichier)
  {
    global $showhidden;
    $retour = 1;
    if (((substr ($fichier, 0, 1) == '.') AND ($showhidden == 0)))
    {
      $retour = 0;
    }
    return $retour;
  }
  function listing ($nom_rep)
  {
    global $sens;
    global $ordre;
    global $size_unit;
    $poidstotal = 0;
    $handle = opendir ($nom_rep);
    while ($fichier = readdir ($handle))
    {
      if (((($fichier != '.') AND ($fichier != '..')) AND (show_hidden_files ($fichier) == 1)))
      {
        $poidsfic = get_filesize ((((''.$nom_rep).'/').$fichier));
        ($poidstotal += $poidsfic);
        if (is_dir ((((''.$nom_rep).'/').$fichier)))
        {
          if (($ordre == 'mod'))
          {
            $liste_rep[$fichier] = filemtime ((((''.$nom_rep).'/').$fichier));
            continue;
          }
          else
          {
            $liste_rep[$fichier] = $fichier;
            continue;
          }
          continue;
        }
        else
        {
          if (($ordre == 'nom'))
          {
            $liste_fic[$fichier] = mimetype ((((''.$nom_rep).'/').$fichier), 'image');
            continue;
          }
          else
          {
            if (($ordre == 'taille'))
            {
              $liste_fic[$fichier] = $poidsfic;
              continue;
            }
            else
            {
              if (($ordre == 'mod'))
              {
                $liste_fic[$fichier] = filemtime ((((''.$nom_rep).'/').$fichier));
                continue;
              }
              else
              {
                if (($ordre == 'type'))
                {
                  $liste_fic[$fichier] = mimetype ((((''.$nom_rep).'/').$fichier), 'type');
                  continue;
                }
                else
                {
                  $liste_fic[$fichier] = mimetype ((((''.$nom_rep).'/').$fichier), 'image');
                  continue;
                }
                continue;
              }
              continue;
            }
            continue;
          }
          continue;
        }
        continue;
      }
    }
    closedir ($handle);
    if (is_array ($liste_fic))
    {
      if (($ordre == 'nom'))
      {
        if (($sens == 0))
        {
          ksort ($liste_fic);
        }
        else
        {
          krsort ($liste_fic);
        }
      }
      else
      {
        if (($ordre == 'mod'))
        {
          if (($sens == 0))
          {
            asort ($liste_fic);
          }
          else
          {
            arsort ($liste_fic);
          }
        }
        else
        {
          if ((($ordre == 'taille') OR ($ordre == 'type')))
          {
            if (($sens == 0))
            {
              asort ($liste_fic);
            }
            else
            {
              arsort ($liste_fic);
            }
          }
          else
          {
            if (($sens == 0))
            {
              ksort ($liste_fic);
            }
            else
            {
              krsort ($liste_fic);
            }
          }
        }
      }
    }
    if (is_array ($liste_rep))
    {
      if (($ordre == 'mod'))
      {
        if (($sens == 0))
        {
          asort ($liste_rep);
        }
        else
        {
          arsort ($liste_rep);
        }
      }
      else
      {
        if (($sens == 0))
        {
          ksort ($liste_rep);
        }
        else
        {
          krsort ($liste_rep);
        }
      }
    }
    $liste = assemble_tableaux ($liste_rep, $liste_fic);
    if ((1073741824 <= $poidstotal))
    {
      $poidstotal = (((round ((($poidstotal / 1073741824) * 100)) / 100).' G').$size_unit);
    }
    else
    {
      if ((1048576 <= $poidstotal))
      {
        $poidstotal = (((round ((($poidstotal / 1048576) * 100)) / 100).' M').$size_unit);
      }
      else
      {
        if ((1024 <= $poidstotal))
        {
          $poidstotal = (((round ((($poidstotal / 1024) * 100)) / 100).' K').$size_unit);
        }
        else
        {
          $poidstotal = (($poidstotal.' ').$size_unit);
        }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?