$id = $msg['id'] = uniqid(); echo 'uniqid' . $msg['id']; } echo "<pre><a href='?path={$path}&delete={$id}'>X</a>" . '<strong title="' . $msg['email'] . '">' . htmlspecialchars($msg['username']) . '</strong>' . htmlspecialchars($msg['content']) . "\n" . date('Y-m-d', $msg['postTime'] / 1000) . "\n[" . $msg['ip'] . "\n][" . $msg['email'] . "]</pre>"; } if ($save) { $data = json_encode($json); file_put_contents($path, $data); } } $delete = @$_GET['delete']; $path = @$_GET['path']; if ($delete && $path) { $data = @file_get_contents($path); $json = json_decode($data, true); if (!$json) { return; } $newmsgs = array(); foreach ($json['messages'] as $msg) { $id = @$msg['id']; if ($id != $delete && $msg['email']) { array_push($newmsgs, $msg); } } $json['messages'] = $newmsgs; $data = json_encode($json); file_put_contents($path, $data); } showDir('./guide/');
function getimages() { global $mainframe, $option; $live_site = $mainframe->isAdmin() ? $mainframe->getSiteURL() : JURI::base(); require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . $option . DS . 'configuration.php'; $config = new FPSSConfig(); if (!defined("_FPSSBASEPATH")) { define("_FPSSBASEPATH", $config->basepath); } if (!defined("_FPSSLIVESITE")) { define("_FPSSLIVESITE", $live_site); } $listdir = JRequest::getVar('listdir', _FPSSBASEPATH, 'get', 'text'); $listdir = makeSafe($listdir); $js = '<script type="text/javascript" language="javascript"> <!-- function sendtomain(thesi) { parent.document.forms[\'adminForm\'].serverimage.value = document.getElementById(\'image\' + thesi).src; parent.document.forms[\'adminForm\'].imageaction[1].checked=true; top.TB_remove(); return false; } //--> </script>'; $mainframe->addCustomHeadTag($js); ?> <div id="jwfpss-imgbrowser"> <form method="get" name="adminForm" action="index.php"> <div class="changedir"> <?php echo _FPSS_IMGBR_DIR; ?> <?php echo changeDir($listdir); ?> <div class="jwfpss-clr"></div> </div> <h2><?php echo _FPSS_IMGBR_LIST; ?> </h2> <div class="jwpds-comments"><?php echo _FPSS_IMGBR_CLICK; ?> </div> <?php echo showDir($listdir); ?> <input type="hidden" name="option" value="<?php echo $option; ?> "> <input type="hidden" name="task" value="getimages"> <input type="hidden" name="tmpl" value="component"> </form> </div> <?php }
showShipadress($_GET['id'], $_GET['Q']); break; case 'showContact': showContactadress($_GET['id']); break; case 'editTevent': editTevent($_GET['id']); break; case 'geteventlist': listTevents($_GET['id'], $_GET['fid'], $_GET['tab']); break; case 'getCustomTermin': getCustomTermin($_GET['id'], $_GET['tab'], $_GET['day'], $_GET['month'], $_GET['year']); break; case 'showDir': showDir($_GET['id'], $_GET['dir']); break; case 'showFile': showFile($_GET['pfad'], $_GET['file']); break; case 'lockFile': lockFile($_GET['file'], $_GET['pfad'], $_GET['id']); break; case 'moveFile': moveFile($_GET['file'], $_GET['pfadleft']); break; case 'saveAttribut': saveAttribut($_GET['name'], $_GET['oldname'], $_GET['pfad'], $_GET['komment'], $_GET['id']); break; case 'newDir': newDir($_GET['pfad'], $_GET['newdir']);
public function showDir($filedir) { //打开目录 $dir = @dir($filedir); //列出目录中的文件 while (($file = $dir->read()) !== false) { if (is_dir($filedir . "/" . $file) and $file != "." and $file != "..") { // echo "dirname: ".$file."<br />"; showDir($filedir . "/" . $file); } else { echo "filename: " . $filedir . "/" . $file . "<br />"; } } $dir->close(); }