adding sound upload like mp3

Discussion in 'Modding/Theme Help' started by skyhigh, Jul 3, 2018.

  1. skyhigh

    skyhigh Member

    Joined:
    Sep 28, 2010
    Messages:
    449
    Likes Received:
    8
    is there any script for mp4 audio so one can upload just like gallery where it create folders and upload d link on line thank you.
     
  2. skyhigh

    skyhigh Member

    Joined:
    Sep 28, 2010
    Messages:
    449
    Likes Received:
    8
    just like the avatar upload how can i get one that upload only mp3 or wav please help needed thank you
     
  3. skyhigh

    skyhigh Member

    Joined:
    Sep 28, 2010
    Messages:
    449
    Likes Received:
    8
    PHP:
    if (isset($_POST['action']) && $_POST['action'] == "update")
    {
       if (isset(
    $_FILES['logo']['tmp_name']) && !empty($_FILES['logo']['tmp_name']))
       {
         
    // Handle logo upload
         
    $inf GetImageSize($_FILES['logo']['tmp_name']);
         if (!empty(
    $_FILES['logo']['tmp_name']) && $_FILES['logo']['tmp_name'] != "none")
         {
           if (
    move_uploaded_file($_FILES['logo']['tmp_name'], UPLOAD_PATH 'logo/' $_FILES['logo']['name']))
           {
             
    $system->writesetting("logo"$_FILES['logo']['name'], "str");
           }
           else
           {
             
    $template->assign_block_vars('alerts', array('TYPE' => 'error''MESSAGE' => $MSG['upload_failed']));
           }
         }
       }
       
    $template->assign_block_vars('alerts', array('TYPE' => 'success''MESSAGE' => $MSG['logo_upload_success']));
    }
    that send directory to database n file to folder i want it to send to auctions table names song_url and file to folder called song_url
     
  4. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,573
    Likes Received:
    549
    Logo upload has changed loads since I first made it as a mod called avatar upload some years ago. You would need to find all the files for the logo upload (should say in each file what others it includes) collect copies of them all and rewrite all the functions for MP4 instead of logo. Copy the logo database tables or rows and create new ones.

    It's a case of re-engineering the code same as most things with webid when you want to make a mod you use what is already available in webid and change it to fit your needs
     
  5. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,327
    Likes Received:
    449
    Hi Skyhigh, will this upload be from the users side or the admins side?
     
    skyhigh likes this.
  6. skyhigh

    skyhigh Member

    Joined:
    Sep 28, 2010
    Messages:
    449
    Likes Received:
    8
    hi pani from the user side, just like uploading pictures but instead mp3 or ogg or wave file, directory will be sent to database file to folder just like the upload image type.

    thank you
     
  7. skyhigh

    skyhigh Member

    Joined:
    Sep 28, 2010
    Messages:
    449
    Likes Received:
    8
    hi i actually rewrote the avatar mod to upload audio files file sent to folder directory to database but several bugs
    1 onrefresh the file disappears unlike the upload gallery
    2 on redit the file disappears
    3 on submit only directory is sent to database no file in folder
    4 cant play the file
     
  8. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,327
    Likes Received:
    449
    I will have a look tonight or tomorrow what we can do.
     
  9. skyhigh

    skyhigh Member

    Joined:
    Sep 28, 2010
    Messages:
    449
    Likes Received:
    8
    thanks alot pani am grateful
     
  10. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,573
    Likes Received:
    549
    I dont know if it still does but when I made it it included a few files think one was called something like PHPThumb.php but that was what dealt with creating the logo/Avatar it would probably want changing to dealwith filetype .mp3 instead of jpg etc to play the file you would need somsort of mediaplayer embed in the page. Probably help panni hence the post
     
  11. skyhigh

    skyhigh Member

    Joined:
    Sep 28, 2010
    Messages:
    449
    Likes Received:
    8
    Y
    Yh i sent him an attached file of what i have done rough work but a nudge to d right direction i know he b able to make it look nicer than mine.

    Programming things
     
    nay27uk likes this.
  12. skyhigh

    skyhigh Member

    Joined:
    Sep 28, 2010
    Messages:
    449
    Likes Received:
    8
    Its g
    It gonna b on d sell. Php page thanks
     
  13. skyhigh

    skyhigh Member

    Joined:
    Sep 28, 2010
    Messages:
    449
    Likes Received:
    8
    Hi havent heard from pani so couple of hours ago i did a work around made extra copy called upload_sound of uploadgallery it now upload mp3 but d issue is if i upload image it shows both on upload_sound and uploadgallery and vice versa any idea why this
     
  14. hhavatar

    hhavatar Donor Donor

    Joined:
    Jul 28, 2014
    Messages:
    747
    Likes Received:
    74
    probably has to do with the "call" in item.php. Check that part is looking for mp3, not jpg etc.
     
  15. skyhigh

    skyhigh Member

    Joined:
    Sep 28, 2010
    Messages:
    449
    Likes Received:
    8
    Am on the sell page
     

Share This Page