\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
// end error checking
echo "
"._FRIENDTITLE."";
echo "\n";
}
function sendfemail($fid, $uname, $yemail, $fname, $femail, $smess) {
global $sitename, $nukeurl, $prefix, $db, $modulename, $mainprefix;
$result2=$db->sql_query("select id, parentid, title from ".$prefix."_".$mainprefix."_items where id = '$fid'");
list($id, $parentid, $title) = $db->sql_fetchrow($result2);
$title = stripslashes($title);
$cattitlequery = $db->sql_query("select parentid, title from ".$prefix."_".$mainprefix."_categories where id=$parentid");
list($parentid2,$title2)= $db->sql_fetchrow($cattitlequery);
$title2=getparentlink($parentid2,$title2);
//echo "1:$fid, 2:$uname, 3:$yemail, 4:$fname, 5:$femail, 6:$title, 7:$smess, 8:$title2"; // For Debugging
if ($smess) {
$smess2 = ""._SHORTMESSAGE.":\n\n$smess";
} else {
$smess = "";
}
$to = "$fname <$femail>";
$subject = ""._INTERESTING." $sitename";
$message = ""._HELLO." $fname:\n\n"._YOURFRIEND." $uname "._CONSIDERED."\n\n$title\n"._VBCAT.": $title2\n\n"._LINKMESS."\n"._URL.": $nukeurl/modules.php?name=$modulename&op=ViewItems&vid=$id\n\n"._YOUCANREAD." $sitename\n$nukeurl/modules.php?name=$modulename\n\n$smess2";
mail($to, $subject, $message, "From: \"$uname\" <$yemail>\nX-Mailer: PHP/" . phpversion());
Header("Location: modules.php?name=$modulename&file=friend&op=mailsent&fname=$fname&femail=$femail");
}
function mailsent($fname, $femail) {
echo ""._MAILSENT1."
";
echo ""._MAILSENT2.":
";
echo "$fname at $femail
";
echo "";
}
function getparentlink($parentid2,$title2) {
global $prefix, $db, $modulename, $mainprefix;
$parentid2 = intval($parentid2);
$result2=$db->sql_query("select id, parentid, title from ".$prefix."_".$mainprefix."_categories where id=$parentid2");
list($cid2, $pparentid2, $ptitle2) = $db->sql_fetchrow($result2);
if ($ptitle2!="") $title2="$ptitle2/".$title2;
if ($pparentid2!=0) {
$title2=getparentlink($pparentid2,$title2);
}
return $title2;
}
switch ($op) {
case "FriendSend":
FriendSend($sid);
break;
case "sendfemail":
sendfemail($fid, $uname, $yemail, $fname, $femail, $smess);
break;
case "mailsent":
mailsent($fname, $femail);
break;
}
?>