Profile Music Uploader

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Profile Music Uploader

    Who can help me convert this avatar uploader to an midi wav uploader for profile what i basicly want is u can go to the uploader and upload ur midi or wav file then it will automaticly be added into ur profile and will play the tunes

    and just add a function to remove the music here are the avatar uploader i have

    lists.php
    Code:
    ///////////////Upload avatar///////////////
    
    else if($action=="upavat")
    {
     echo "<head><title>$site_name</title>";
          echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/$theme[0]\" />";
          echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
          <meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
          <meta name=\"description\" content=\"Riderz wap dating portal and community containg chat, forums, blogs and much more\" />
          <meta name=\"keywords\" content=\"chat, forums, wap, dating, games, blogs, polls, quiz, lavalair, news, rap, goth\" /></head>";
    
          echo "<body>";
            addonline(getuid_sid($sid),"Uploading avatar image","lists.php?action=$action");
            $whonick = getnick_uid($who);
               echo "<p><u>Choose the pic:</u><br/>
            <form enctype=\"multipart/form-data\" action=\"genproc.php?action=upavat&sid=$sid\" method=\"post\">
            Image(JPG/JPEG image only):<br/>Size limit: 512KB<br/>Image will be resized to fit its width to 128 pixels.
            <input type=\"file\" name=\"attach\"/><br/>
            <input id=\"inputButton\" type=\"submit\" name=\"submit\" value=\"Send\"/></form></p>";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
        echo "</body>";
    }
    genproc.php
    Code:
    /////////////////Upload avatar////////////////////////
    
    
    else if($action=="upavat"){
    
    addonline(getuid_sid($sid),"Uploading avatar image","");
    
    $size = $_FILES['attach']['size']/1024;
    
    $origname = $_FILES['attach']['name'];
    
    $res = false;
    
    $ext = explode(".", strrev($origname));
    
    switch(strtolower($ext[0])){
    
            case "gpj":
    
        $res = true;
    
        break;
    
        case "gepj":
    
        $res = true;
    
        break;
    
    }
    
    $tm = time();
    
    $uploaddir = "./avatars";
    
    if($size>512){
    
        echo "File is larger than 512KB";
    
    
    
    }
    
    else if ($res!=true){
    
    
    
        echo "File type not supported! Please attach only a JPG/JPEG.";
    
    }
    
    
    
    else{
    
        $name = getuid_sid($sid);
    
        $uploadfile = $name.".".$ext;
    
        $uppath=$uploaddir."/".$uploadfile;
    
        move_uploaded_file($_FILES['attach']['tmp_name'], $uppath);
    
        $filewa=$uppath;
    
        list($width, $height, $type, $attr) = getimagesize($filewa);
    
        $newname=$uploaddir."/".$name."u.jpg";
    
        $newheight = ($height*128)/$width;
    
        $newimg=imagecreatetruecolor(128, $newheight);
    
        $largeimg=imagecreatefromjpeg($filewa);
    
        imagecopyresampled($newimg, $largeimg, 0, 0, 0, 0, 128, $newheight, $width, $height);
    
        imagejpeg($newimg, $newname);
    
        imagedestroy($newimg);
    
        imagedestroy($largeimg);
    
        $file1=$name."u.jpg";
    
        unlink($filewa);
    
            $res1 = mysql_query("UPDATE ibwf_users SET avatar='./avatars/$file1' WHERE id='".$name."'");
    
    }
    
    if($res1){
    
        echo "Your file $origname was successfully uploaded and set to your profile!";
    
    }
    
    else {
    
        echo "File couldn't be processed! Check error messages and report to a moderator or admin if applicable.";
    
    }
    
             echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
        echo "</body>";
    
    }
    usage
    Code:
    echo "<a href=\"lists.php?action=upavat&sid=$sid\">&#187;Upload Avatar</a><br/>";
    ________________
    Jacques
    jacques@gw-designs.co.za
    http://coding.biz.tm
    Come join and lets make it a place to learn all the noobies how to code
    __________________

    NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

    #2
    Code:
    <embed src="file location" loop="false" hidden="true" autostart="true">
    </embed>
    sigpic

    Comment


      #3
      i know that one but can u guys help me change the avatar uploader to support midi and wav files to upload into a music folder
      ________________
      Jacques
      jacques@gw-designs.co.za
      http://coding.biz.tm
      Come join and lets make it a place to learn all the noobies how to code
      __________________

      NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

      Comment


        #4
        Originally posted by riderz View Post
        i know that one but can u guys help me change the avatar uploader to support midi and wav files to upload into a music folder
        so, ? whats the problem ?
        allow midi and wav extention.
        sigpic

        Comment


          #5
          just change the case to midi or wav, instead of jpeg or jpg

          then embed the file
          LDSWAPWORLD sigpic
          site closed.
          im busy with other things in life like facebook , send me PM so i can add you
          www.pinoySG.com

          don't ask for help if you're not even helping yourself!
          i am tired of seeing the line "best site", i want to see something NEW and UNIQUE. maybe if i find one, ill go back to my wap life again.


          Comment


            #6
            Originally posted by opticalpigion View Post
            Code:
            <embed src="file location" loop="false" hidden="true" autostart="true">
            </embed>
            Code:
            [B]Parse error[/B]:  parse error, unexpected '<' in [B]C:\Program Files\xampp\htdocs\happy1\xhtml\index.php[/B] on line [B]5673[/B]
            I do not understand this code ... should not put the echo? shows me this error when I put ...I put this code in action wievuser profile..but it shows we parse error ... how and where to put this code?
            sigpichttp://happy.srecnica.com/web

            Comment


              #7
              sumthing like this!!!

              Code:
               echo"<embed src=\"music\" loop=\"false\" hidden=\"true\" autostart=\"true\"></embed>";
              lists.php
              Code:
              ///////////////Upload avatar///////////////
              
              else if($action=="upbgs")
              {
               echo "<head><title>$site_name</title>";
                    echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/$theme[0]\" />";
                    echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
                    <meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
                    <meta name=\"description\" content=\"Riderz wap dating portal and community containg chat, forums, blogs and much more\" />
                    <meta name=\"keywords\" content=\"chat, forums, wap, dating, games, blogs, polls, quiz, lavalair, news, rap, goth\" /></head>";
              
                    echo "<body>";
                      addonline(getuid_sid($sid),"Uploading BGS","lists.php?action=$action");
                      $whonick = getnick_uid($who);
                         echo "<p><u>Choose the File:</u><br/>
                      <form enctype=\"multipart/form-data\" action=\"genproc.php?action=upbgs&sid=$sid\" method=\"post\">
                      Audio(MIDI/WAV  only):<br/>Size limit: 512KB<br/>I
                      <input type=\"file\" name=\"attach\"/><br/>
                      <input id=\"inputButton\" type=\"submit\" name=\"submit\" value=\"Send\"/></form></p>";
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
                  echo "</body>";
              }
              genproc.php
              Code:
              anyone who can get this part fixed up it would be gr8 the place where the images are declare must change to midi and wav file
              sql

              Code:
              ibwf_users   bgs varchat (100)
              ________________
              Jacques
              jacques@gw-designs.co.za
              http://coding.biz.tm
              Come join and lets make it a place to learn all the noobies how to code
              __________________

              NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

              Comment


                #8
                no .. this is me not working ... and just would like to insert the music in the profile of users
                sigpichttp://happy.srecnica.com/web

                Comment


                  #9
                  ive tried sumthing else now i just need the code to play music in the background

                  sql


                  --
                  -- Table structure for table `ibwf_music`
                  --

                  CREATE TABLE `ibwf_music` (
                  `id` int(10) NOT NULL auto_increment,
                  `musiclink` varchar(150) NOT NULL default '',
                  PRIMARY KEY (`id`),
                  UNIQUE KEY `musiclink` (`musiclink`)
                  ) TYPE=MyISAM AUTO_INCREMENT=5 ;

                  --
                  -- Dumping data for table `ibwf_music`

                  lists.php
                  Code:
                  //////////////////////////////////////////////////////Music
                  
                  else if($action=="music")
                  {
                      addonline(getuid_sid($sid),"Music List","");
                      $pstyle = gettheme($sid);
                        echo xhtmlhead("Music List",$pstyle);
                  
                  
                      //////ALL LISTS SCRIPT <<
                  
                      if($page=="" || $page<=0)$page=1;
                      $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_music"));
                      $num_items = $noi[0]; //changable
                      $items_per_page= 2;
                      $num_pages = ceil($num_items/$items_per_page);
                      if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                      $limit_start = ($page-1)*$items_per_page;
                  
                      //changable sql
                  
                          $sql = "SELECT id, musiclink FROM ibwf_music ORDER BY id DESC LIMIT $limit_start, $items_per_page";
                  
                  
                      echo "<p>";
                      $items = mysql_query($sql);
                      echo mysql_error();
                      if(mysql_num_rows($items)>0)
                      {
                      while ($item = mysql_fetch_array($items))
                     {
                          echo "<bgsound src=\"$item[1]\" alt=\"music\"/><br/>";
                          echo "<a href=\"genproc.php?action=upmusic&amp;musicid=$item[0]\">SELECT</a><br/>";
                          echo "<br/>";
                      }
                      }
                      echo "</p>";
                      echo "<p align=\"center\">";
                      if($page>1)
                      {
                        $ppage = $page-1;
                        echo "<a href=\"lists.php?action=music&amp;page=$ppage&amp;view=$view\">«Prev</a> ";
                      }
                      if($page<$num_pages)
                      {
                        $npage = $page+1;
                        echo "<a href=\"lists.php?action=music&amp;page=$npage&amp;view=$view\">Next»</a>";
                      }
                      echo "<br/>$page/$num_pages<br/>";
                      if($num_pages>2)
                      {
                        $rets = "<form action=\"lists.php\" method=\"get\">";
                          $rets .= "Jump to page<input name=\"page\" format=\"*N\" size=\"3\"/><br/>";
                          $rets .= "<input type=\"submit\" value=\"GO\"/>";
                          $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
                          $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
                  
                          $rets .= "</form>";
                  
                          echo $rets;
                      }
                      echo "</p>";
                    ////// UNTILL HERE >>
                      echo "<p align=\"center\">";
                      echo "<a href=\"index.php?action=cpanel\">";
                  echo "CPanel</a><br/>";
                      $thid = mysql_fetch_array(mysql_query("SELECT themeid FROM ibwf_users WHERE id='".$uid."'"));
                      $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM ibwf_iconset WHERE id='".$thid[0]."'"));
                      echo "<a href=\"index.php?action=main\"><img src=\"http://coding-talk.com/images/themes/$themeimageset[0]/home.gif\" alt=\"*\"/>";
                  echo "Home</a>";
                    echo "</p>";
                      echo xhtmlfoot();
                   exit();
                      }
                  genproc.php
                  Code:
                  ///////////////////////////////////////////////////////////////////Select music
                  else if($action=="upmusic")
                  {
                      addonline(getuid_sid($sid),"Updating music","");
                      $musicid = $_GET["musicid"];
                  $pstyle = gettheme($sid);
                        echo xhtmlhead("$stitle",$pstyle);
                    echo "<p align=\"center\">";
                    //$uid = getuid_sid($sid);
                    $musiclink = mysql_fetch_array(mysql_query("SELECT musiclink FROM ibwf_music WHERE id='".$musicid."'"));
                    $res = mysql_query("UPDATE ibwf_users SET music='".$musiclink[0]."' WHERE id='".$uid."'");
                    if($res)
                          {
                              echo "<img src=\"http://coding-talk.com/images/ok.gif\" alt=\"o\"/>music Selected<br/>";
                          }else{
                            echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
                          }
                          echo "<br/>";
                  
                           $thid = mysql_fetch_array(mysql_query("SELECT themeid FROM ibwf_users WHERE id='".$uid."'"));
                      $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM ibwf_iconset WHERE id='".$thid[0]."'"));
                      echo "<a href=\"index.php?action=main\"><img src=\"http://coding-talk.com/images/themes/$themeimageset[0]/home.gif\" alt=\"*\"/>";
                  echo "Home</a>";
                    echo "</p>";
                    echo xhtmlfoot();
                   exit();
                      }
                  ive tried this in viewuser
                  Code:
                    $musiclink = getmusic($who);
                    if ($musiclink=="")
                    {
                    echo "<br/><bgsound src=\"music/$musiclink\" alt=\"music\"/>";
                    }else{
                    echo "<br/><bgsound src=\"$musiclink\" alt=\"music\"/>";
                    }
                  echo"<br/>";
                  core.php
                  Code:
                  /////////////////////////////////////////getmusic
                  
                  function getmusic($uid)
                  {
                    $music = mysql_fetch_array(mysql_query("SELECT music FROM ibwf_users WHERE id='".$uid."'"));
                    return $music[0];
                  }
                  ok now i have a lil prob how can i make it to play the music in profile i tried to add the avatar code but did not work
                  Last edited by riderz; 22.09.09, 22:51.
                  ________________
                  Jacques
                  jacques@gw-designs.co.za
                  http://coding.biz.tm
                  Come join and lets make it a place to learn all the noobies how to code
                  __________________

                  NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

                  Comment


                    #10
                    $musiclink = getmusic($who);
                    if ($musiclink=="")
                    {
                    echo "<br/><img src=\"images/music.jpg\" alt=\"music\"/>";
                    }else{
                    echo "<br/><img src=\"$musiclink\" alt=\"music\"/>";
                    }
                    echo"<br/>";
                    and this will be to hear music? without embed code?
                    sigpichttp://happy.srecnica.com/web

                    Comment


                      #11
                      well ive tried the embed code
                      Code:
                      echo "<embed name=\"$music\"src=\"/music/$musiclink\"loop=\"false\"hidden=\"true\"autostart=\"true\"></embed>";
                      but it show the music in the folder in every person profile
                      ________________
                      Jacques
                      jacques@gw-designs.co.za
                      http://coding.biz.tm
                      Come join and lets make it a place to learn all the noobies how to code
                      __________________

                      NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

                      Comment


                        #12
                        Search, This Has Been Added Here Before, Im Sure, Anyway..
                        Edit this to suit your site... it will play the tracks..


                        <embed src="yourmusicfile.mid" autostart="true" loop="true">
                        </embed>
                        <noembed>
                        <bgsound src="yourmusicfile.mid" loop="infinite">
                        </noembed>

                        Remember, If you want diff music for each person you will need get the link from the database so it can grab it from the folder.. its easy really, just think about how it will work.
                        but also think about, every time someone clicks a profile its going to play music yeah but what the viewer don't know that when ever he.she clicks the profile he will be charged for the music to download to beable to play.. poor user if they use a phone, imagine the phone bill they will get just for visiting your site.
                        Think about things before you decide to go ahead, a costly site = no members.. a normal gprs phone will charge a bomb to download a image let alone a midi song.
                        your choice. good luck

                        Comment


                          #13
                          no music .....not heard .. musiclink inserted in the database .. all good works but not heard .. I've done in the admincp and adminproc to connect musiclink with the database and it is ok, but the music to be heard not in the profile
                          sigpichttp://happy.srecnica.com/web

                          Comment


                            #14
                            i think mobile browsers doesn't support embed..use bgsound..
                            PHP Code:
                             echo "<br/><bgsound src=\"music/$musiclink\" loop=\"1\"/>"
                            My Blog: http://jhommark.blogspot.com
                            My Facebook: http://www.facebook.com/jhommark
                            My Official Site: http://www.undergroundweb.tk
                            My Community Site: http://undergroundwap.xtreemhost.com

                            Comment


                              #15
                              Haha u need it via who or uid function lyk music from ibwf_users id= $who somethng lyk that w/ch we select userz music background. too easy. . .
                              com site: http://vampist.net
                              download site: http://wapdloads.net
                              fb: http://www.facebook.com/pmplx

                              Comment

                              Working...
                              X