I use this code to show a list of files in user's profile page:
public static function getUserProfilemusic() {
$path = Xenforo_Application::getInstance()->getRootDir() . '/styles/default/dadparvar/profilemusic/songs/';
$directoryList = scanDir($path.'/'.func_get_arg(1));
unset($directoryList[0]);
unset($directoryList[1]);
$string = '';
foreach ($directoryList as &$listEntry) {
$songURL = /*$path*/ '/styles/default/dadparvar/profilemusic/songs/' . func_get_arg(1) . '/'. $listEntry;
$string .= "<a href='$songURL' class='Tooltip' title='Click to Download $listEntry'> $listEntry </a>
| <a href='#' class='Tooltip' title='Click to Remove $listEntry' target='_blank'> X </a>
<br>
";
}
return $string;
}
How can I set, when user clicked on X the file be deleted?
Any opinion will be appreciated.