coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: briandelshasta on September 26, 2007, 07:17:00 AM

Title: Using External MP3 Player
Post by: briandelshasta on September 26, 2007, 07:17:00 AM
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?
Title: Re: Using External MP3 Player
Post by: briandelshasta on September 26, 2007, 07:54:22 AM
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.
Title: Re: Using External MP3 Player
Post by: briandelshasta on September 26, 2007, 08:51:55 AM
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.