I made these changes to recommend.php:
To display a message that you must be logged in:
Before:
Code:
if(isset($requestTitle)){
$requestID = $db->get_var("SELECT link_id FROM " . table_links . " WHERE `link_title_url` = '$requestTitle';");
}else{
if(!is_numeric($requestID)){
$requestID = $db->get_var("SELECT link_id FROM " . table_links . " WHERE `link_title_url` = '$requestID';");
}
}
if(!isset($_REQUEST['email_to_submit'])){ // we're not submitting the form
After:
Code:
if(isset($requestTitle)){
$requestID = $db->get_var("SELECT link_id FROM " . table_links . " WHERE `link_title_url` = '$requestTitle';");
}else{
if(!is_numeric($requestID)){
$requestID = $db->get_var("SELECT link_id FROM " . table_links . " WHERE `link_title_url` = '$requestID';");
}
}
if (!$current_user->user_login){
echo "<br>Must be logged in to email.<br>";
return;
}
if(!isset($_REQUEST['email_to_submit'])){ // we're not submitting the form
To make a more readable email message:
Before:
Code:
$body = $message . "\r\n" . Included_Text_Part1 . $current_user->user_login . Included_Text_Part2 . $link_url . ' "' . $link->title . '" ' . $link->content;
After:
Code:
if ($current_user->user_login){
$body = $message . "\r\n\r\n" . Included_Text_Part1 ."\r\n\r\n". $current_user->user_login .", ". Included_Text_Part2 ." ".$link->title." - " .$link->content."\r\n\r\n" ."Here is a link to the story: ". $link_url;
}
else{
$body = $message . "\r\n\r\n" . Included_Text_Part1 ."\r\n\r\nAnonymous, ". Included_Text_Part2 ." ".$link->title." - " .$link->content."\r\n\r\n" ."Here is a link to the story: ". $link_url;
}
The else is if you don't do the first mod and just want the message to say it is from "Anonymous" for non registered users.
kb
favester.com