mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-27 10:21:29 +00:00
allow forwarding multiple articles by email
This commit is contained in:
@@ -681,6 +681,15 @@
|
||||
print "<input type=\"hidden\" name=\"op\" value=\"rpc\">";
|
||||
print "<input type=\"hidden\" name=\"subop\" value=\"sendEmail\">";
|
||||
|
||||
$result = db_query($link, "SELECT email FROM ttrss_users WHERE
|
||||
id = " . $_SESSION["uid"]);
|
||||
|
||||
$user_email = htmlspecialchars(db_fetch_result($result, 0, "email"));
|
||||
$user_name = htmlspecialchars($_SESSION["name"]);
|
||||
|
||||
$_SESSION['email_replyto'] = $user_email;
|
||||
$_SESSION['email_fromname'] = $user_name;
|
||||
|
||||
require_once "lib/MiniTemplator.class.php";
|
||||
|
||||
$tpl = new MiniTemplator;
|
||||
@@ -688,39 +697,33 @@
|
||||
|
||||
$tpl->readTemplateFromFile("templates/email_article_template.txt");
|
||||
|
||||
$result = db_query($link, "SELECT link, content, title
|
||||
FROM ttrss_user_entries, ttrss_entries WHERE id = ref_id AND
|
||||
id = '$param' AND owner_uid = " . $_SESSION["uid"]);
|
||||
|
||||
$line = db_fetch_assoc($result);
|
||||
|
||||
$subject = htmlspecialchars(__("[Forwarded]") . " " . $line["title"]);
|
||||
|
||||
$tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"]));
|
||||
|
||||
/* $tpl->setVariable('ARTICLE_EXCERPT',
|
||||
truncate_string(strip_tags($line["content"]), 200)); */
|
||||
|
||||
$tpl->setVariable('ARTICLE_URL', strip_tags($line["link"]));
|
||||
|
||||
$result = db_query($link, "SELECT email FROM ttrss_users WHERE
|
||||
id = " . $_SESSION["uid"]);
|
||||
|
||||
$user_email = htmlspecialchars(db_fetch_result($result, 0, "email"));
|
||||
$user_name = htmlspecialchars($_SESSION["name"]);
|
||||
|
||||
//print "<input type=\"hidden\" name=\"replyto\" value=\"$user_email\">";
|
||||
//print "<input type=\"hidden\" name=\"fromname\" value=\"$user_name\">";
|
||||
|
||||
$_SESSION['email_replyto'] = $user_email;
|
||||
$_SESSION['email_fromname'] = $user_name;
|
||||
|
||||
$tpl->setVariable('USER_NAME', $_SESSION["name"]);
|
||||
$tpl->setVariable('USER_EMAIL', $user_email);
|
||||
$tpl->setVariable('TTRSS_HOST', $_SERVER["HTTP_HOST"]);
|
||||
|
||||
// $tpl->addBlock('header');
|
||||
|
||||
$result = db_query($link, "SELECT link, content, title
|
||||
FROM ttrss_user_entries, ttrss_entries WHERE id = ref_id AND
|
||||
id IN ($param) AND owner_uid = " . $_SESSION["uid"]);
|
||||
|
||||
if (db_num_rows($result) > 1) {
|
||||
$subject = __("[Forwarded]") . " " . __("Multiple articles");
|
||||
}
|
||||
|
||||
while ($line = db_fetch_assoc($result)) {
|
||||
|
||||
if (!$subject)
|
||||
$subject = __("[Forwarded]") . " " . htmlspecialchars($line["title"]);
|
||||
|
||||
$tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"]));
|
||||
$tpl->setVariable('ARTICLE_URL', strip_tags($line["link"]));
|
||||
|
||||
$tpl->addBlock('article');
|
||||
}
|
||||
|
||||
$tpl->addBlock('email');
|
||||
|
||||
|
||||
$content = "";
|
||||
$tpl->generateOutputToString($content);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user