Using External MP3 Player Using External MP3 Player
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Using External MP3 Player

Started by briandelshasta, September 26, 2007, 07:17:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

briandelshasta

Here's the issue, I'd like people to be able to play an mp3 into their .mp3 associated player.  This will allow them to rate and comment on the mp3 without worrying about the page refresh.  Has anyone done this.  Maybe it's possible to add a link on the image(mp3) view page which dynamically creates a direct link to the .mp3 file (instead of the database location as per the e-card url)?  Any ideas?

briandelshasta

Here's an update, I'm trying to change the URL: link under file information to a direct link to the mp3 file.
I'm thinking this is the line to edit in displayimage.php:
    // Create the absolute URL for display in info
    $info[$lang_picinfo['URL']] = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" >' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '</a>';


Any ideas what to change?
Thank you.

briandelshasta

Nevermind, I figured it out...thought I'd document here in case anyone else was interested.

Edit displayimage.php:

Add these lines:
    $path_to_pic1 = $CONFIG['fullpath'];
    $path_to_pic2 = $CURRENT_PIC_DATA['filepath'];
    $path_to_pic3 = $CURRENT_PIC_DATA['filename'];

Modify the line that immediately follows // Create the absolute URL for display in info:
    $info[$lang_picinfo['URL']] = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .basename($path_to_pic1) ."/". "$path_to_pic2" ."$path_to_pic3".'" >' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($path_to_pic1)."/". "$path_to_pic2" ."$path_to_pic3" . '</a>';

That's it!
Changes URL link to a direct link to the mp3 file, which opens in an external player.