need some help for getid3 plss.

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

    need some help for getid3 plss.

    Need to show relevant mp3 files tag details on file download page using getid3 script please need your help.

    my download code is as follows

    PHP Code:
    require('db.php');
    $id=$_REQUEST['id'];
    $query "SELECT * from files where id='".$id."'"
    file $url = ' $row['mp3path']'


    #2
    Something on the lines of:
    PHP Code:
    <?
    function scanID3($file)
    {
    require_once  
    'libraries/getid3/getid3.php'//change to getid3 location
    $res false;
    $getID3 = new getID3();
    $id3 $getID3->analyze($file);
    if (isset(
    $id3["fileformat"]) && $id3["fileformat"] == "mp3") {
    $res = array();
    $res["file"] = $file;
    $res["album"] = $id3["tags"]["id3v2"]["album"][0];
    $res["title"] = $id3["tags"]["id3v2"]["title"][0];
    if (isset(
    $id3["tags"]["id3v2"]["artist"][0])) {
    $res["artist"] = $id3["tags"]["id3v2"]["artist"][0];
    } else {
    $res["artist"] = "Unknown";
    }
    $res["trackNumber"] = $id3["tags"]["id3v2"]["track_number"][0];
    $res["link"] = str_replace(["_aaID_""_trackID_"], [md5($res["artist"] . "_" $res["album"]), $res["trackNumber"]], $this->config["link"]);
    if (
    strpos($res["trackNumber"], "/")) {
    $res["trackNumber"] = substr($res["trackNumber"], 0strpos($res["trackNumber"], "/"));
    }
    $res["trackNumber"] = sprintf("d"$res["trackNumber"]);
    } else {
    //var_dump($file);
    }
    return 
    $res;
    }

    require(
    'db.php');
    $id=$_REQUEST['id'];
    $query "SELECT * from files where id='".$id."'"
    file $url ' $row['mp3path']'
    $mp3data scanID3($url);
    echo 
    'Album: '.$mp3data['album'].'<br/>';
    echo 
    'Title: '.$mp3data['title'].'<br/>';
    echo 
    'Artist: '.$mp3data['artist'].'<br/>';
    echo 
    'Track number: '.$mp3data['trackNumber'].'<br/>';
    ?>
    I have not tested this ^

    Comment


      #3
      file $url = ' $row['mp3path']' here there is a syntax error bro

      Comment


      #4
      PHP Code:

      include('db.php');

      $id=$_REQUEST['id'];
      $query "update files SET views = views+1 where id ='".$id."'";
      $update mysqli_query($con,$query) or die(mysql_error());
      $query "SELECT * from files where id='".$id."'";
      $result mysqli_query($con,$query) or die(mysql_error());
      $row mysqli_fetch_assoc($result); 

      this is my actual code how can i include above code to this?? please consider me as a noob.

      Comment


        #5
        PHP Code:
        include('db.php');

        function 
        scanID3($file)
        {
        require_once  
        'libraries/getid3/getid3.php'//change to getid3 location 
        $res false;
        $getID3 = new getID3();
        $id3 $getID3->analyze($file);
        if (isset(
        $id3["fileformat"]) && $id3["fileformat"] == "mp3") {
        $res = array();
        $res["file"] = $file;
        $res["album"] = $id3["tags"]["id3v2"]["album"][0];
        $res["title"] = $id3["tags"]["id3v2"]["title"][0];
        if (isset(
        $id3["tags"]["id3v2"]["artist"][0])) {
        $res["artist"] = $id3["tags"]["id3v2"]["artist"][0];
        } else {
        $res["artist"] = "Unknown";
        }
        $res["trackNumber"] = $id3["tags"]["id3v2"]["track_number"][0];
        $res["link"] = str_replace(["_aaID_""_trackID_"], [md5($res["artist"] . "_" $res["album"]), $res["trackNumber"]], $this->config["link"]);
        if (
        strpos($res["trackNumber"], "/")) {
        $res["trackNumber"] = substr($res["trackNumber"], 0strpos($res["trackNumber"], "/"));
        }
        $res["trackNumber"] = sprintf("d"$res["trackNumber"]);
        } else {
        //var_dump($file);
        }
        return 
        $res;
        }

        $id=$_REQUEST['id'];
        $query "update files SET views = views+1 where id ='".$id."'";
        $update mysqli_query($con,$query) or die(mysql_error());
        $query "SELECT * from files where id='".$id."'";
        $result mysqli_query($con,$query) or die(mysql_error());
        $row mysqli_fetch_assoc($result); 

        $url $row['mp3path'];
        $mp3data scanID3($url);
        echo 
        'Album: '.$mp3data['album'].'<br/>';
        echo 
        'Title: '.$mp3data['title'].'<br/>';
        echo 
        'Artist: '.$mp3data['artist'].'<br/>';
        echo 
        'Track number: '.$mp3data['trackNumber'].'<br/>';
        ?> 

        Comment


          #6
          Is there anyway to show mp3 cover photo ??

          Comment


            #7
            Something on the lines of:
            PHP Code:
            <?
            include('db.php');

            function 
            scanID3($file)
            {
            require_once 
            'libraries/getid3/getid3.php'//change to getid3 location
            $res false;
            $getID3 = new getID3();
            $id3 $getID3->analyze($file);
            if (isset(
            $id3["fileformat"]) && $id3["fileformat"] == "mp3") {
            $res = array();
            $res["file"] = $file;
            $res["album"] = $id3["tags"]["id3v2"]["album"][0];
            $res["title"] = $id3["tags"]["id3v2"]["title"][0];
            if (isset(
            $id3["tags"]["id3v2"]["artist"][0])) {
            $res["artist"] = $id3["tags"]["id3v2"]["artist"][0];
            } else {
            $res["artist"] = "Unknown";
            }
            $res["trackNumber"] = $id3["tags"]["id3v2"]["track_number"][0];
            $res["link"] = str_replace(["_aaID_""_trackID_"], [md5($res["artist"] . "_" $res["album"]), $res["trackNumber"]], $this->config["link"]);
            if (
            strpos($res["trackNumber"], "/")) {
            $res["trackNumber"] = substr($res["trackNumber"], 0strpos($res["trackNumber"], "/"));
            }
            $res["trackNumber"] = sprintf("d"$res["trackNumber"]);
            if(isset(
            $id3['comments']['picture'][0])){
            $res['image'] = 'data:'.$id3['comments']['picture'][0]['image_mime'].';charset=utf-8;base64,'.base64_encode($id3['comments']['picture'][0]['data']);
            }
            else
            {
            $res['image'] = 'unknown';
            }
            } else {
            //var_dump($file);
            }

            return 
            $res;
            }

            $id=$_REQUEST['id'];
            $query "update files SET views = views+1 where id ='".$id."'";
            $update mysqli_query($con,$query) or die(mysql_error());
            $query "SELECT * from files where id='".$id."'";
            $result mysqli_query($con,$query) or die(mysql_error());
            $row mysqli_fetch_assoc($result);

            $url $row['mp3path'];
            $mp3data scanID3($url);
            echo 
            'Album: '.$mp3data['album'].'<br/>';
            echo 
            'Title: '.$mp3data['title'].'<br/>';
            echo 
            'Artist: '.$mp3data['artist'].'<br/>';
            echo 
            'Track number: '.$mp3data['trackNumber'].'<br/>';
            if(
            $mp3data['image']!='unknown')
            {
            echo 
            '<img src="'.$mp3data['image'].'" alt=""/><br/>';
            }
            ?>
            Last edited by something else; 04.11.20, 10:53. Reason: Edited code to be correct

            Comment


              #8
              echo '<img src="'.if($mp3data['image'].'" alt=""/><br/>'; syntax error bro

              Comment


              • something else
                something else commented
                Editing a comment
                Must have been tired:
                PHP Code:
                echo '<img src="'.$mp3data['image'].'" alt=""/><br/>'

              #9
              HTTP ERROR 500 bro

              Comment


                #10
                when running error.php?page=file3.php it shows blank sometime my hosting is not vps. is that can be a reason for this??

                Comment


                  #11
                  no it will work fine on shared hosting etc

                  Comment


                    #12
                    Ok i'try bro

                    Comment


                      #13
                      This is file.php i need to make the download.php or get.php file to force mp3 file not to stream but to download with update downlod count ($dcount+1) everytime when user hit download button. When download button function as get.php?id=($id) or download.php?id=($id)

                      is there anyway you can help me to develop this brother?? In this few days i had grabed lots of things from you brother thank you verymuch for that.

                      Comment

                      Working...
                      X