MOD to allow audio as ECARD MOD to allow audio as ECARD
 

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

MOD to allow audio as ECARD

Started by dreams83, July 18, 2007, 01:02:11 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

dreams83

I am using: http://forum.coppermine-gallery.net/index.php?topic=29104.0
to made this mod for my site.

http://www.ehmongmusic.com

I am using CPG 1.14.12 to add this modification so I am not about the location on other version of CPG

This modification will allow users to send ecard with audio. Will not actually send someone the audio file. It will just send them a ecard with a picture link that link them back to your site where the music is at.


included picture are the preview and the image "music4you.gif" I use to show instead of audio on the card.


Open ecard.php

Go to line 65 find:

if (!is_image($row['filename'])) cpg_die(ERROR, $lang_ecard_php['error_not_image'], __FILE__, __LINE__);

replace with:

//Adding audio ecard so you can send ecard and linking them back to the site
if (!is_image($row['filename'])) {
if (!is_audio($row['filename'])) {
cpg_die(ERROR, $lang_ecard_php['error_not_image'], __FILE__, __LINE__);
}
}



Go to line 130 find:

$message = template_eval($template_ecard, $params);

Before that add:

//Replace image with a picture to tell user they have a music ecard
if (is_audio($data['p'])) {
$myimage = '<img src="http://localhost/coppermine/music4you.gif" border="0">';
//print_r($template_ecard);
$template_ecard = str_replace('<img src="{PIC_URL}" border="1" alt="" />', $myimage, $template_ecard);
}


Go to line 212 find:

starttable('100%', $lang_ecard_php['preview']);

before that add:

//Replace image with a picture to tell user they have a music ecard
if (is_audio($data['p'])) {
$myimage = '<img src="http://localhost/coppermine/music4you.gif" border="0">';
//print_r($template_ecard);
$template_ecard = str_replace('<img src="{PIC_URL}" border="1" alt="" />', $myimage, $template_ecard);
}


Close ecard.php


Now open displayecard.php

Go to line 62 find:

// Parse template
echo template_eval($template_ecard, $params);


before that add:

//Replace image with a picture to tell user they have a music ecard
if (is_audio($data['p'])) {
$myimage = '<img src="http://localhost/coppermine/music4you.gif" border="0">';
//print_r($template_ecard);
$template_ecard = str_replace('<img src="{PIC_URL}" border="1" alt="" />', $myimage, $template_ecard);
}




Besure to change the location of the image.

For my case it is:

http://localhost/coppermine/music4you.gif

to where ever you put your image.

jerrykemic99

Well it seems seem it supports e-cards only not the audio file?Am i all right?
 *Link Removed*
*Link Removed*
*Link Removed*