Posted on: 07/09/05 05:33pm
By: Anonymous (julianna)
function mailstory ($sid, $to, $toemail, $from, $fromemail, $shortmsg) { global $_CONF, $_TABLES, $_USER, $LANG01, $LANG08; $retval = COM_refresh (COM_buildUrl ($_CONF['site_url'] . '/article.php?story=' . $sid)); // check for correct $_CONF permission if (empty ($_USER['username']) && (($_CONF['loginrequired'] == 1) || ($_CONF['emailstoryloginrequired'] == 1))) { return $retval; } // check if emailing of stories is disabled if ($_CONF['hideemailicon'] == 1) { return $retval; } // check mail speedlimit COM_clearSpeedlimit ($_CONF['speedlimit'], 'mail'); if (COM_checkSpeedlimit ('mail') > 0) { return $retval; } $sql = "SELECT uid,title,introtext,bodytext,UNIX_TIMESTAMP(date) AS day FROM {$_TABLES['stories']} WHERE sid = '$sid'"; $result = DB_query ($sql); $A = DB_fetchArray ($result); $shortmsg = COM_stripslashes ($shortmsg); $mailtext = sprintf ($LANG08[23], $from, $fromemail) . LB; if (strlen ($shortmsg) > 0) { $mailtext .= LB . sprintf ($LANG08[28], $from) . $shortmsg . LB; } $mailtext .= LB . COM_undoSpecialChars(stripslashes(strip_tags($A['introtext']))).LB.LB . COM_undoSpecialChars(stripslashes(strip_tags($A['bodytext']))).LB.LB . '------------------------------------------------------------'.LB . $LANG08[24] . LB . COM_buildUrl ($_CONF['site_url'] . '/article.php?story=' . $sid . '#comments'); $mailto = COM_formatEmailAddress ($to, $toemail); $mailfrom = COM_formatEmailAddress ($from, $fromemail); $subject = COM_undoSpecialChars(strip_tags(stripslashes('From Julie's Blog: '.$A['title']))); COM_mail ($toemail, $subject, $mailtext, $mailfrom); COM_updateSpeedlimit ('mail'); // Increment numemails counter for story DB_query ("UPDATE {$_TABLES['stories']} SET numemails = numemails + 1 WHERE sid = '$sid'"); return $retval; }
Posted on: 07/10/05 12:57am
By: matthewcox
Posted on: 07/10/05 10:22am
By: Anonymous (julianna)