diff --git a/e107_plugins/forum/e_emailprint.php b/e107_plugins/forum/e_emailprint.php
index eb2667cd8..98d02e384 100755
--- a/e107_plugins/forum/e_emailprint.php
+++ b/e107_plugins/forum/e_emailprint.php
@@ -3,33 +3,10 @@ if (!defined('e107_INIT')) { exit; }
function print_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 "
".print_r($thread_info,TRUE).""; - return $text; + // moved to e_print.php } + function email_item($thread_id) { global $tp; @@ -53,5 +30,4 @@ function email_item($thread_id) ".$tp->toHTML($reply['thread_thread'], TRUE); } return $text; -} - +} \ No newline at end of file diff --git a/e107_plugins/forum/e_print.php b/e107_plugins/forum/e_print.php index 06d6c2031..d60df5829 100644 --- a/e107_plugins/forum/e_print.php +++ b/e107_plugins/forum/e_print.php @@ -1,15 +1,52 @@ threadGet($thread_id); + //print_a($thread_info); - -} + // Check if user is allowed to view this forum topic + if(!$forum->checkPerm($thread_info['thread_forum_id'], 'view')) + { + return LAN_FORUM_0008; + } + + // Get all posts in this topic + $post_list = $forum->postGet($thread_id, 0, 9999); + //print_a($post_list); + + // Set topic name + $topic_name = e107::getParser()->toHTML($thread_info['thread_name'], true); + + // Display topic name + $text .= "".$topic_name."