Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Editors and Tools > Other PHP Tools

Other PHP Tools This is were to discuss other non-desktop PHP related tools.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 2006-05-26, 11:32 AM
Junior Member
 
Join Date: May 2006
Posts: 1
camelota is on a distinguished road
Default script convert the mp3

Hello all,
Need your help, i have a music script, i have admin interface i link the music from another site and somebody download an mp3 the script upload songs to my site automaticaly at the end script remove from site, when 100 people download from site not work because to many download and the script can`t stand, i put here code of download.php, help me pls to fix it , to see example go here http://www.reteauabaicului.net/manele/index.php and go in one album and download one song, i repeat don`t have mp3`s in my site
Code:
<?php
/*
+--------------------------------------------------------------------------
|   Opial Version 1.0
|   =============================================
|   by Opial.com
|   (c) 2006 - 2010 Opial, LLC.
|                               
|   =============================================
|                                                       
+---------------------------------------------------------------------------
|
|   Opial.com and its products are Copyright protected.
|    
+--------------------------------------------------------------------------
*/
$parts = split('[[:space:]]+', trim(php_uname()));
$PATH_SEP = (isset($parts[0]) && $parts[0] == "Windows") ? "\\" : $PATH_SEP = "/";
if ($PATH_SEP == "\\")
{
    require_once "lib\paths.php";
}
else 
{
    require_once "lib/paths.php";
}
require_once 'common.php';
/**/
$id = @$_REQUEST['id'];
if (empty($id))
{
    header("Content-type: text/plain\n\r");
    echo "Link broken";
    exit();
}

/* update stats */
$download = new Downloads();
$download->songId = $id;
$download->find(true);
if (empty($download->id))
{
    $download->downloadsCount = 1;    
    $download->todayDownloadsCount = 1;
    $download->downloadDT     = date('Y-m-d H:i:s');
    $download->insert();
}
else
{
    $download->downloadsCount = $download->downloadsCount + 1;
    $download->todayDownloadsCount = $download->todayDownloadsCount + 1;
    $download->downloadDT     = date('Y-m-d H:i:s');
    $download->update();
}
$song = new Song();
$song->get($id);
if (!empty($song->fileName))
{
    $source = $song->getDir(true) . "artist_" . $song->artistId . "/" . $song->fileName;
}
else
{
    $source = $song->url;
}
header('Content-type: application/octet-stream');
if (!empty($song->fileName)) 
{
    header('Content-Disposition: filename=' . str_replace(" ", "_", $song->fileName));
    header('Content-Length: ' . $song->fileSize);
}
else 
{
    $filesize = remote_filesize($source);
    header('Content-Disposition: filename=' . str_replace(" ", "_", basename($song->title)) . ".mp3");        
    if ($filesize != "unknown")
    {
        header('Content-Length: ' . $filesize);
    }
}
$cd = new CurrentDownloads();
$cd->songId = $song->id;
$cd->insert();
$fh = fopen($source, "rb");
fpassthru($fh);
fclose($fh);
/* delete current upload */
$cd->delete();
exit();
?>
Reply With Quote
  #2 (permalink)  
Old 2006-06-13, 03:33 AM
Junior Member
 
Join Date: Jun 2006
Posts: 1
hits2205 is on a distinguished road
Send a message via MSN to hits2205 Send a message via Yahoo to hits2205
Default i have the solution

hi ma dear am the webmaster of Yallahits Network
i read ur message and i have the solution for you
just add me on ur MSNmessenger: WEBMASTER@YALLAHITS.COM
waiting ur email address
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.0 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.0 (a popular PHP IDE) and NuCoder 1.4 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:10 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.