From 743edf89173499108fbe8190607f6b8658a36521 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 10 Mar 2022 12:54:22 -0800 Subject: [PATCH] Fixes #4669 - Forum print issue. --- e107_plugins/forum/e_emailprint.php | 23 +---------------------- e107_plugins/forum/e_print.php | 15 ++++++++------- email.php | 4 ++-- 3 files changed, 11 insertions(+), 31 deletions(-) diff --git a/e107_plugins/forum/e_emailprint.php b/e107_plugins/forum/e_emailprint.php index 98d02e384..e782488f0 100755 --- a/e107_plugins/forum/e_emailprint.php +++ b/e107_plugins/forum/e_emailprint.php @@ -6,28 +6,7 @@ function print_item($thread_id) // moved to e_print.php } - function email_item($thread_id) { - global $tp; - $gen = new convert; - include_once(e_PLUGIN.'forum/forum_class.php'); - $forum = new e107forum; - $thread_info = $forum->threadGet($thread_id,0,999); - - $thread_name = $tp->toHTML($thread_info[0]['thread_name'], TRUE); - $text = "".$thread_name."
- ".$thread_info[0]['user_name'].", ".$gen->convert_date($thread_info[0]['thread_datestamp'], "forum")."

- ".$tp->toHTML($thread_info[0]['thread_thread'], TRUE); - - $count = 1; - - unset($thread_info[0], $thread_info['head']); - foreach($thread_info as $reply) - { - $text .= "

Re: ".$thread_name."
- ".$reply['user_name'].", ".$gen->convert_date($reply['thread_datestamp'], "forum")."

- ".$tp->toHTML($reply['thread_thread'], TRUE); - } - return $text; + return e107::getAddon('forum','e_print')->render($thread_id); // Quick Fix } \ No newline at end of file diff --git a/e107_plugins/forum/e_print.php b/e107_plugins/forum/e_print.php index d60df5829..a6a261564 100644 --- a/e107_plugins/forum/e_print.php +++ b/e107_plugins/forum/e_print.php @@ -15,7 +15,7 @@ class forum_print // plugin-folder + '_print' //print_a($thread_info); // Check if user is allowed to view this forum topic - if(!$forum->checkPerm($thread_info['thread_forum_id'], 'view')) + if(!$forum->checkPerm($thread_info['thread_forum_id'])) { return LAN_FORUM_0008; } @@ -28,12 +28,12 @@ class forum_print // plugin-folder + '_print' $topic_name = e107::getParser()->toHTML($thread_info['thread_name'], true); // Display topic name - $text .= "".$topic_name."
"; + $text .= "

".$topic_name."

"; // Display initial (first) post in topic - $text .= " + $text .= " ".$post_list[0]['user_name'].", ".e107::getDate()->convert_date($post_list[0]['post_datestamp'], "forum")." -

+


".$tp->toHTML($post_list[0]['post_entry'], true); // Remove original post from $post_list array, so only replies are left @@ -42,9 +42,10 @@ class forum_print // plugin-folder + '_print' // Loop through each reply foreach($post_list as $reply) { - $text .= "

Re: ".$topic_name."
- ".$reply['user_name'].", ".e107::getDate()->convert_date($reply['post_datestamp'], "forum")."

- ".$tp->toHTML($reply['post_entry'], TRUE); + $text .= "
Re: ".$topic_name."
+ ".$reply['user_name'].", ".e107::getDate()->convert_date($reply['post_datestamp'], "forum")."

+ ".$tp->toHTML($reply['post_entry'], true). + "
\n\n"; } return $text; diff --git a/email.php b/email.php index 5040be4d5..615d44aa6 100644 --- a/email.php +++ b/email.php @@ -177,11 +177,11 @@ if (isset($_POST['emailsubmit'])) if (sendemail($email_send, LAN_EMAIL_3.SITENAME,$email_body)) { - $text = "
".LAN_EMAIL_10." ".$email_send."
"; + $text = "
".LAN_EMAIL_10." ".$email_send."
"; } else { - $text = "
".LAN_EMAIL_9."
"; + $text = "
".LAN_EMAIL_9."
"; } $ns->tablerender(LAN_EMAIL_11, $text); }