我正在写一个WordPress博客.以前的开发人员使用"Exec-PHP"在某个页面中执行PHP脚本.
以下一个显示在http://url-of-the-page/"/homez.406/xxx/www/wp-content/xxx/xxx/"中包含的文件列表中.
我想按日期订购文件,但我不知道怎么做!有人已经用过吗?
<!--?php showContent('/homez.406/xxx/www/wp-content/xxx/xxx/','http://url-of-the-page/',false,false); ?-->
Run Code Online (Sandbox Code Playgroud)
这是我在functions.php中找到的
function showContent($path,$webpath,$adminclear,$adminup){
if ($handle = opendir($path))
{
if ($adminclear==true)
{
global $user_ID; if( $user_ID ) :
if( current_user_can('level_10') ) :
$auth=true;
else :
$auth=false;
endif;
endif;
}
if ($adminup==true)
{
global $user_ID; if( $user_ID ) :
if( current_user_can('level_10') ) :
$authup=true;
else :
$authup=false;
endif;
endif;
}
else{$auth=true;$authup=true;}
if ((isset($_POST['dlfile']))&&($auth==true))
{
$removefile=$_POST['dlfile'];
unlink ($removefile);
}
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{ …Run Code Online (Sandbox Code Playgroud)