I knew I could set it up that when the listing is changed I could have the program set to Admin approval. Which would work, but I didn't want to disrupt the ads from being online.
I know in thanks.php it setups and mails the admin when the listing is made.
Is there a way to have this code implimented in usermodifylisting.php?
PHP Code:
//now display the template
if($continue == true)
{
//should mail the admin?
if($emailnotify != "N")
{
$sSQL="SELECT checkoutNotification FROM ".PREFIX."checkout_settings WHERE checkoutID=1";
$result=$db->query($sSQL);
$rs=$result->fetch();
if($rs['checkoutNotification']=="Y")
{
//get the mail template
$sSQL="SELECT eID, eName, eSubject, eHTML, eText FROM ".PREFIX."email_templates WHERE eID=6";
$result=$db->query($sSQL);
$rs=$result->fetch();
$subject=$rs['eSubject'];
$htmlContent=$rs['eHTML'];
$textContent=$rs['eText'];
$sSQL="SELECT title,price FROM ".PREFIX."products WHERE id=".$lid;
$result=$db->query($sSQL);
$rs=$result->fetch();
$emailmessage.= $htmlContent.'<br>'. LANG_TITLE.": ".safeStripSlashes($rs['title'])."<br>\n";
$emailmessage.= LANG_PRICE .": ".FormatCurrency($rs['price'])."<br>\n";
$emailmessage.= "<a href='".URL."/viewlisting.php?view=".$lid."'>".URL."/viewlisting.php?view=".$lid."</a><br>\n";
$emailmessage.= "<a href='".URL."/administration/listinginfo.php?view=".trim($lid)."'>".URL."/administration/listinginfo.php?view=".trim($lid)."</a>";
// Instantiate mail class
$mail = new PHPMailer();
$mail->From = ADMIN_EMAIL;
$mail->FromName = 'Admin';
$mail->Mailer = "mail";
$mail->IsHTML(true);
$mail->Subject = $subject;
$mail->Body = $emailmessage;
$mail->AltBody = strip_tags($emailmessage);
$mail->AddAddress(ADMIN_EMAIL);
if(!$mail->Send())
{
$class_tpl->assign('title',LANG_ERROR);
$class_tpl->assign('pPageContent',LANG_ERROR_MAIL .' '. $mail->ErrorInfo);
$class_tpl->assign('body','content.tpl.php');
}
}
}