Profile Music Uploader

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

  • riderz
    replied
    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

    Leave a comment:


  • srecnica
    replied
    $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?

    Leave a comment:


  • riderz
    replied
    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.

    Leave a comment:


  • srecnica
    replied
    no .. this is me not working ... and just would like to insert the music in the profile of users

    Leave a comment:


  • riderz
    replied
    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)

    Leave a comment:


  • srecnica
    replied
    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?

    Leave a comment:


  • capofret
    replied
    just change the case to midi or wav, instead of jpeg or jpg

    then embed the file

    Leave a comment:


  • opticalpigion
    replied
    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.

    Leave a comment:


  • riderz
    replied
    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

    Leave a comment:


  • opticalpigion
    replied
    Code:
    <embed src="file location" loop="false" hidden="true" autostart="true">
    </embed>

    Leave a comment:


  • riderz
    started a topic Profile Music Uploader

    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/>";
Working...
X