<?php include 'libraries/initial.inc.php'; include 'libraries/project.lib.php'; if (isset($_GET['f'])) { $f = $_GET['f']; } else { $f = 0; } if (fetch_file_change($f) == FALSE) { } else { //file name, last commit time, page title, page sub title $db_array = fetch_file_change($f); $db_array_file = fetch_file($f); $file_name = $db_array[0]['name']; $file_last_update = time_uk($db_array[0]['time']); $page_title = $file_name; $page_title_sub = "last commit : [" . $file_last_update . "]"; $file_change_number = count($db_array); if ($file_change_number <= 1) { $version_title = "version"; } else { $version_title = "versions"; } } include 'style/header.inc.php'; if (fetch_file_change($f) == FALSE) { ?> <div class="alert-message error"> <a class="close" href="<?php echo $after_login_redirect;
//delete - 删除文件 if (count($argv) < 2) { echon("Missing parameters. Please check again."); die; } delete_file($access_token, $argv[2]); echon('File deleted.'); break; case 'fetch': //fetch - 离线下载 //好像需要一定的权限,无法使用。 if (count($argv) < 3) { echon("Missing parameters. Please check again."); die; } fetch_file($access_token, $argv[2], $argv[3]); break; case 'uploadbig': //uploadbig - 大文件上传 switch (count($argv)) { case 0: case 1: case 2: case 3: //参数数目不够 echon('Missing parameters. Please check again.'); die(9099); case 4: //设置默认值(单个文件大小->1G) $argv[4] = 1073741824; //因为需要继续下面的操作所以这里没有break
<form action="<?php echo $_SERVER['PHP_SELF']; ?> " method='POST'> <input type="hidden" name='rfile' value='<?php echo $_GET['rfile']; ?> '/> <input type="submit" value="SAVE EDIT" name="EDITFILE"/><br> <textarea id='highlightit' style='height:700px;width:700px;' class='<?php echo 'brush:' . file_type($_GET['rfile']); ?> ' name="textforEdit"> <?php fetch_file($_GET['rfile']); ?> </textarea><br> <input type="submit" value="SAVE EDIT" name="EDITFILE"/> </form> <?php } ?> <?php if (!empty($_POST['EDITFILE']) && !empty($_POST['textforEdit']) && !empty($_POST['rfile'])) { $fope = fopen($_POST['rfile'], "w++"); $fre = fputs($fope, $_POST['textforEdit']); fclose($fope); $location = $_SERVER["PHP_SELF"] . '?path=' . $_POST['rfile'];