DELETE BUTTON

Submit ideas and requests for new features in kPlaylist

DELETE BUTTON

Postby radmofo » Wed Apr 02, 2008 3:32 pm

I absolutely must have a delete button! Shouldn't there be an easy way to add a couple of lines of code to check if admin, then place a delete button that just simply deletes the file?

Correct me if I'm wrong. Maybe I can pursue this task with someones help.

I definitley need a delete button, I will even pay if thats what it takes! Great script, just need a delete button.
radmofo
 
Posts: 4
Joined: Tue Apr 01, 2008 12:40 am

Re: DELETE BUTTON

Postby joshkrz » Sat Apr 12, 2008 2:19 pm

radmofo wrote:I absolutely must have a delete button! Shouldn't there be an easy way to add a couple of lines of code to check if admin, then place a delete button that just simply deletes the file?

Correct me if I'm wrong. Maybe I can pursue this task with someones help.

I definitley need a delete button, I will even pay if thats what it takes! Great script, just need a delete button.


Yerh i agree, a delete button would be helpful, and maybe more file management controls (move to folder etc). Just a suggestion.
joshkrz
 
Posts: 30
Joined: Wed Feb 20, 2008 9:06 pm
Location: UK, Leeds

Postby nonob » Tue May 20, 2008 1:38 pm

Hi :)

+1, a delete button could be useful for the administrator.

I have to use ftp to delete unwanted file or album....

What do you think about it Aba ?

Thanks

Bye
nonob
 
Posts: 74
Joined: Tue Oct 24, 2006 7:56 am

Re: DELETE BUTTON

Postby buhp » Fri Dec 11, 2009 8:45 pm

I just want to add kind of a part-idea to this thread..
i'm thinking about a "mark for deletion" button for the users so they can browse the library and if they find double files, fake songs or whatever they can just hit this button and the admin will get a list or a notification about all those marked songs and can check if they really should be deleted. and of course he can just hit the delete button.
and maybe, its just another idea, the user can propose a change in the filename, and again, the admin(s) can just grant those and then its done.
we got a lot of double and wrong-named files so this could would really help to clean up our library.
im not really into the file so im really trying to get this done by myself but if anybody allready tried to do this i would really appreciate to get the code or maybe some help where i should start looking..im able to change the php but not the js...

thats it for the moment and thanks for reading =)

grüsse an alle,
stephan
buhp
 
Posts: 1
Joined: Fri Dec 11, 2009 7:48 pm

Re: DELETE BUTTON

Postby tomgard » Tue Sep 07, 2010 10:08 pm

hi all, i have sucsesfully created a delete button that works :D , the button is displayed to the left of each tick box. To create this I:
changed the File presentation template (under customize) to
Code: Select all
<a href="%i"[ title="%a %y"]><span class="%c">[%R. ][%t - %l|%f]</span></a> <span class="finfo">[(%b kbit %s mins)] %S</span><div style="margin-top:-13; margin-left:-50; float:left;"><form action="#####/delete.php?do=delete" method="post" name="%f" target="_blank" id="%f"><input type="hidden" name="file" value="%f" id="file" /><input type="submit" name="b" id="b" value="X" style="border:none;background-color:#CCC;color:#F00;font-size:10px" /></form></div>
please note you will need to change #####
I then created a php file which deletes the files. this file will need to be uploaded into the music directory
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>php delete file</title>
<link href="../kplaylist.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
   <!--
   function openwin(name, url)
   {
      popupWin = window.open(url, name, 'resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,width=675,height=320,left=150,top=270');
      if (popupWin) popupWin.focus();
   }
   
   var jwflvwin = null;

   function openJWFLV(theFile, url, height, width)
   {
      jwflvwin = open("", "jwflvwin",  'width='+width+',height='+height);
      if (!jwflvwin || jwflvwin.closed || !jwflvwin.createPlayer)
      {
         jwflvwin = window.open(url, "jwflvwin", 'width='+width+',height='+height);
      } else jwflvwin.focus();
      
      jwflvwin.loadXMLDoc(theFile);
   }

   function newwinscroll(name, url, height, width)
   {
      popupWin = window.open(url, name, 'resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,width='+width+',height='+height+',left=250,top=270');
      if (popupWin) popupWin.focus();
   }
   
   function newwin(name, url, height, width)
   {
      popupWin = window.open(url, name, 'resizable=yes,scrollbars=no,status=no,toolbar=no,menubar=no,width='+width+',height='+height+',left=250,top=270');
      if (popupWin) popupWin.focus();
   }

   function flashwin(name, url, height, width)
   {
      flashpop = window.open(url, name, 'resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,width='+width+',height='+height+',left=250,top=270');      
      if (flashpop) flashpop.focus();
   }

   function flashwinsharedplaylist(name, url, height, width)
   {
      d = document.getElementById('sel_shplaylist');
      if (d) url = url + "&plid=" + d.value;
      flashpop = window.open(url, name, 'resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,width='+width+',height='+height+',left=250,top=270');      
      if (flashpop) flashpop.focus();
   }

   function flashwinuserplaylist(name, url, height, width)
   {
      d = document.getElementById('sel_playlist');
      if (d) url = url + "&plid=" + d.value;
      flashpop = window.open(url, name, 'resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,width='+width+',height='+height+',left=250,top=270');      
      if (flashpop) flashpop.focus();
   }

   function savescrolly()
   {
      var scrOfY = 0;
      if( typeof( window.pageYOffset ) == 'number' )
      {
         scrOfY = window.pageYOffset;
      } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop))
      {
         scrOfY = document.body.scrollTop;
      } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop))
      {
         scrOfY = document.documentElement.scrollTop;
      }
      
      sy = document.getElementById('scrolly');
      if (sy) sy.value = scrOfY;
   }

   function kptoggle()
   {
      for(var i=0;i<document.psongs.elements.length;i++)
      {
         if(document.psongs.elements[i].type == "checkbox")
         {
            if (document.psongs.elements[i].checked == false) document.psongs.elements[i].checked = true;
               else
            if (document.psongs.elements[i].checked == true) document.psongs.elements[i].checked = false;
         }
      }
   }   

   function selectall()
   {
      for(var i=0;i<document.psongs.elements.length;i++)
         if(document.psongs.elements[i].type == "checkbox") if (document.psongs.elements[i].checked == false) document.psongs.elements[i].checked = true;
   }   

   function disselectall()
   {
      for(var i=0;i<document.psongs.elements.length;i++)
         if(document.psongs.elements[i].type == "checkbox") if (document.psongs.elements[i].checked == true) document.psongs.elements[i].checked = false;
   }   

   function anyselected()
   {
      for(var i=0;i<document.psongs.elements.length;i++) if(document.psongs.elements[i].type == "checkbox") if (document.psongs.elements[i].checked == true) return true;
      return false;
   }

   function chhttp(where) {
      document.location = where;
   }
   //-->
   </script>
</head>
<body>

<?php 
if (isset($_GET["do"])) {

   $do = explode(":",$_GET["do"]);
   }
$file=$_POST['file'];
//     stage 1   _________________________________________________
if ($do[0] == "delete") { 
   echo "Attempting to delete <a href='$file'>$file</a>
      < br/>
      <form action='delete.php?do=deleting' method='post' name='confirm' id='confirm'>
      Enter password:<input name='password' type='password' id='password'>
      <input type='hidden' name='file' value='$file' id='file' />
      <input type='submit' name='b' id='b' value='Confirm delete' style='border:none;background-color:#CCC;color:#F00;font-size:16px' />
      </form><input class='fatbuttom' type='submit' name='button' value='Close' onclick='javascript: window.close(); '/>";

}  //     stage 2   _________________________________________________
elseif ($do[0] == "deleting") {
   $pass=$_POST['password'];
   if ($pass == "@@@@@") {
      unlink($file) or die("$file was not deleted.");
      if (!file_exists('$file')) { echo "<h2>$file has sucsesfully been deleted.</h2><input class='fatbuttom' type='submit' name='button' value='Close' onclick='javascript: window.close(); '/>"; }
      } else {echo"You do not have permition to delete files<input class='fatbuttom' type='submit' name='button' value='Close' onclick='javascript: window.close(); '/>";}
 
   }
   
   
else {echo "What you doing?< br/><input class='fatbuttom' type='submit' name='button' value='Close' onclick='javascript: window.close(); '/>";} 
?> 
</body> 
</html>

remember to change ##### to your music directory and @@@@@ to your desired password
hope you like it
tomgard
 
Posts: 1
Joined: Tue Sep 07, 2010 9:54 pm


Return to Request for new features