initially thank to all coppermine developers to publish this product with us. This galery is really so exciting and nice to use.
i had had a fault about sending ecards and had an error message as below;
Fatal error: Cannot redeclare class phpmailer in myrootfolder\includes\class.phpmailer.php on line 21
and i began to scan where a decleration found before. Then minded that i am a user of
phpNukeMailerv1.0.4 and this add-on has the same file on path
../includes/phpmailer/class.phpmailer.php with the file used by coppermine for classes.
Ps for phpNukeMailerv1.0.4
its one of mailer tools 4 phpnuke instead of usind mail() function.
And this class file was declared by my
../includes/phpnukemailer.php earlier then coppermine's
../modules/coppermine/ecard.php did it because i inclueded
../includes/phpnukemailer.php at the end of my
../mainfile.php. Therefore rudey they crashed.
Firstly, i removed
require("includes/class.phpmailer.php");
this line in my
../modules/coppermine/ecard.php file and got ;
// require("includes/class.phpmailer.php");
that line means skipped.
then i decided to modify lines and force coppermine to use my phpnukemailer email functions.
Here is a copy of my phpnukemailer
../includes/phpmailer/class.phpmailer.php file;
http://rapidshare.de/files/17129170/class.phpmailer.php.htmldownload password:
http://coppermine-gallery.net
then just saw that there is a variable that not declared in my phpnukemailer's phpnukemailer class file 2 lines below as;
$mail->SetLanguage();
this variable belongs to coppermine's class file so i removed that line, too. as;
// $mail->SetLanguage();
line skipped and avoided getting error message.
PS
you can delete skipped lines if you want
continue debuging ecard.php..and again i found a line has a variable that my phpnukemailer class file wouldnt declare. as;
$mail->IsHTML(true);
it is again one of coppermine's class file's variables. it declares the way of sending method of mail. and i would use SMTP method.
So, i modify this line as;
$mail->IsSMTP(true);[/
which is compatible with my phpnukemailer class file.
after i finished to debug coppermine's ecard.php file, i have begun to seek in my ../modules/coppermine/include/mailer.inc file.
Pointed that
if (empty($CONFIG['smtp_host'])) {
return mail($to, $subject, $msg_body, $extra_headers);
} else {
return smtp_mail($to, $subject, $msg_body, $extra_headers);
}
word equation. And learned that the condition of using mail() function is null input of smtp_host value. however
i emptied my smtp settings values as below;
$CONFIG['smtp_host'] = '';
$CONFIG['smtp_username'] = '';
$CONFIG['smtp_password'] = '';

seems like the crashed with coppermine documentaries told us

about SMTP usage

but no panic. things allright, so lets go on.
emptying values provides us to hold the if loop mentioned above on first condition to modify the mail() function as known by phpnukemailer users to able to access phpnukemailer methods. if we send the loop mentioned above to second condition hard to control the smtp_mail() function of mailer.inc by filling SMTP variables. Easily we should link the coppermine's mail modulation to phpnukemailer on first condition.
the last step of our debuging in mailer.inc is here...As known, phpnukemail() function loaded as
phpnukemail($to, $subject, $msg, $sender_mail, $sender_name, $encode = 1);
instead of mail() functions in php-nuke.
Here we have to point that this variables, declared by phpnukemailerv1.0.0.4 classes, dont let us using ranged variables as here;
$extra_headers = "From: $sender_name <$sender_email>\n";
$extra_headers .= "Reply-To: $sender_email\n";
$extra_headers .= "MIME-Version: 1.0\n";
$extra_headers .= "Content-Type: text/html; charset=$charset\n\n";
in malier.inc. as seen $extra_headers values contains all sender's info. but as mentioned we couldnt use variables in pfpnukemail() function like this way. so i seperated
$extra_headers into two parts as
$sender_email and $sender_name.
-$encode parameter told to phpnukemail() function wheter message format is html or plain, so i added $encode=1 in my line.
Andi modified the line
return mail($to, $subject, $msg_body, $extra_headers);
as my phpnukemailer requires to;
return phpnukemail($to, $subject, $msg_body, $sender_email,$sender_name, $encode = 1);
thislike. Now all save our files then ecard again.
see how nice its. thanks to coppermine developpers again for this tool.
here is a copy of my phpnukemailer.php file to able understand more about its variables;
http://rapidshare.de/files/17129377/phpnukemailer.php.htmlDownload password:
http://coppermine-gallery.net
Finally i reached the end of my integration of coppermine to phpnukemailer.
Hopefully it will be helpful for phpnukemailer users to use coppermines ecarding module.
i dont have time to modify all files with a better debug way. So my request from developpers
to set the files for phpnukemailer users. I dont think its so difficult to write some more codes to take the information of an installed copy of any phpnukemailer exists or not on php-nuke. If exists force coppermine to use phpnukemailer methods not to get errors, unless use the coppermine's methods to ecard.
Waiting for your integration codes of this usage.
Fairfully