return $filecount; } if (isset($_REQUEST["v"])) { $v = $_REQUEST["v"]; } if (isset($v)) { $v = decrypt($v); $v = json_decode($v, true); $file = urldecode($v['file']); $pid = $v['pid']; $referip = $_SERVER['REMOTE_ADDR']; $authenticFileName = $file; $status = false; // upload file to directory $uploaddir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "Video/WPTCreatedVideos/" . $pid . "/"; $dirCount = getDirFileCount($uploaddir); $status = ""; foreach ($_FILES as $file) { $tmpFileOriginalName = $file['name']; if (strcasecmp($authenticFileName, $tmpFileOriginalName) == 0) { $path_parts = pathinfo($tmpFileOriginalName); $ext = $path_parts['extension']; if (array_search($ext, $acceptedExts) !== false) { $tmpFile = $file['tmp_name']; // Change file name based on previous files in folder $uploadFileName = $pid . "-{$dirCount} from ({$referip})." . $ext; $uploadFileLocation = $uploaddir . $uploadFileName; if (!file_exists($uploaddir)) { mkdir($uploaddir, 0777, true); } if (move_uploaded_file($tmpFile, $uploadFileLocation)) {
} .load-more-select select{ margin-top: 10px; } </style> <?php function getDirFileCount($dir) { return count(scandir($dir)) - 2; } if ($_SESSION['RF']["subfolder"] = '328eb3c3-d632-11e4-9a8c-00163e002b11' && $_SESSION['RF']['view_type'] == 0) { } else { echo "<div class=\"load-more-div load-more-select\"><select id=\"page-nav\">"; $AllPages = getDirFileCount($current_path . $rfm_subfolder . $subdir); $AllPages = ceil($AllPages / 20); if ($AllPages > 1) { for ($i = 1; $i <= $AllPages; $i++) { echo "<option value=\"{$i}\">{$i}</option>"; } } echo "</select></div>"; // echo "<div class=\"load-more-div load-more-next\">下一页</div>"; } ?> <script type="text/javascript"> $('.load-more-next').click(function(){ $.get('ajax/addfileloadcount.php',function(){ localStorage.fromLoadMore="true";
<?php $dir = $_REQUEST['dir']; function getDirFileCount($directory) { if (glob("{$directory}*.*") != false) { $filecount = count(glob("{$directory}*.*")); } else { $filecount = 0; } return $filecount; } echo getDirFileCount("../../" . $dir);