1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 17:39:46 +01:00

EONE-34 (Improvement): Forum post reporting now working properly

This commit is contained in:
mcfly 2010-03-14 19:07:57 +00:00
parent 8bb1eb7b69
commit 81b13b3289
4 changed files with 20 additions and 12 deletions

View File

@ -28,7 +28,7 @@ function url_forum_thread($parms)
case 'report': case 'report':
$page = (isset($parms['page']) ? (int)$parms['page'] : 0 ); $page = (isset($parms['page']) ? (int)$parms['page'] : 0 );
return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=report&id={$parms['id']}&p={$page}"; return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=report&id={$parms['id']}&post={$parms['post']}&p={$page}";
break; break;
case 'edit': case 'edit':

View File

@ -1211,7 +1211,7 @@ class e107forum
if(substr($tmpFname, 0, 1) == "*") { $tmpFname = substr($tmpFname, 1); } if(substr($tmpFname, 0, 1) == "*") { $tmpFname = substr($tmpFname, 1); }
if ($forum_href) if ($forum_href)
{ {
$BREADCRUMB .= "<a class='forumlink' href='".e_PLUGIN."forum/forum_viewforum.php?{$forum_info['forum_id']}'>".$tp->toHTML($tmpFname, TRUE, 'no_hook,emotes_off')."</a>"; $BREADCRUMB .= "<a class='forumlink' href='".e_PLUGIN."forum/forum_viewforum.php?{$forum_info['forum_id']}'>".$e107->tp->toHTML($tmpFname, TRUE, 'no_hook,emotes_off')."</a>";
} else } else
{ {
$BREADCRUMB .= $tmpFname; $BREADCRUMB .= $tmpFname;

View File

@ -257,7 +257,7 @@ class forum_shortcodes
{ {
global $page; global $page;
if (USER) { if (USER) {
return "<a href='".$this->e107->url->getUrl('forum', 'thread', 'func=report&id='.$this->postInfo['post_thread'])."'>".IMAGE_report.'</a> '; return "<a href='".$this->e107->url->getUrl('forum', 'thread', "func=report&id={$this->postInfo['post_thread']}&post={$this->postInfo['post_id']}")."'>".IMAGE_report.'</a> ';
} }
} }

View File

@ -51,7 +51,13 @@ if(isset($_POST['track_toggle']))
if(isset($_GET['f'])) if(isset($_GET['f']))
{ {
$thread->processFunction(); $ret = $thread->processFunction();
if($ret) {
require_once(HEADERF);
echo $ret;
require_once(FOOTERF);
exit;
}
if($_GET['f'] != 'last') { $thread->init(); } if($_GET['f'] != 'last') { $thread->init(); }
} }
e107::getScParser(); e107::getScParser();
@ -541,7 +547,8 @@ class e107ForumThread
break; break;
case 'report': case 'report':
$postId = (int)$_GET['id']; $threadId = (int)$_GET['id'];
$postId = (int)$_GET['post'];
$postInfo = $forum->postGet($postId, 'post'); $postInfo = $forum->postGet($postId, 'post');
if (isset($_POST['report_thread'])) if (isset($_POST['report_thread']))
@ -556,17 +563,16 @@ class e107ForumThread
} }
$e107->sql->db_Insert('generic', "0, 'reported_post', " . time() . ", '" . USERID . "', '{$thread_info['head']['thread_name']}', " . intval($thread_id) . ", '{$report_add}'"); $e107->sql->db_Insert('generic', "0, 'reported_post', " . time() . ", '" . USERID . "', '{$thread_info['head']['thread_name']}', " . intval($thread_id) . ", '{$report_add}'");
define('e_PAGETITLE', LAN_01 . " / " . LAN_428); define('e_PAGETITLE', LAN_01 . " / " . LAN_428);
require_once (HEADERF); $url = $e107->url->getUrl('forum', 'thread', 'func=post&id='.$postId);
$text = LAN_424 . "<br /><br /><a href='forum_viewtopic.php?" . $thread_id . ".post'>" . LAN_429 . '</a>'; $text = LAN_424 . "<br /><br /><a href='{$url}'>" . LAN_429 . '</a>';
$e107->ns->tablerender(LAN_414, $text, array('forum_viewtopic', 'report')); return $e107->ns->tablerender(LAN_414, $text, array('forum_viewtopic', 'report'), true);
} }
else else
{ {
$thread_name = $e107->tp->toHTML($postInfo['thread_name'], true, 'no_hook, emotes_off'); $thread_name = $e107->tp->toHTML($postInfo['thread_name'], true, 'no_hook, emotes_off');
define('e_PAGETITLE', LAN_01 . ' / ' . LAN_426 . ' ' . $thread_name); define('e_PAGETITLE', LAN_01 . ' / ' . LAN_426 . ' ' . $thread_name);
require_once (HEADERF);
$url = $e107->url->getUrl('forum', 'thread', 'func=post&id='.$postId); $url = $e107->url->getUrl('forum', 'thread', 'func=post&id='.$postId);
$actionUrl = $e107->url->getUrl('forum', 'thread', 'func=report&id='.$postId); $actionUrl = $e107->url->getUrl('forum', 'thread', "func=report&id={$threadId}&post={$postId}");
$text = "<form action='".$actionUrl."' method='post'> $text = "<form action='".$actionUrl."' method='post'>
<table style='width:100%'> <table style='width:100%'>
<tr> <tr>
@ -580,6 +586,8 @@ class e107ForumThread
<tr> <tr>
<td>" . LAN_417 . "<br />" . LAN_418 . " <td>" . LAN_417 . "<br />" . LAN_418 . "
</td> </td>
</tr>
<tr>
<td style='text-align:center;'> <td style='text-align:center;'>
<textarea cols='40' rows='10' class='tbox' name='report_add'></textarea> <textarea cols='40' rows='10' class='tbox' name='report_add'></textarea>
</td> </td>
@ -590,9 +598,9 @@ class e107ForumThread
</td> </td>
</tr> </tr>
</table>"; </table>";
$e107->ns->tablerender(LAN_414, $text, array('forum_viewtopic', 'report2')); return $e107->ns->tablerender(LAN_414, $text, array('forum_viewtopic', 'report2'), true);
} }
require_once (FOOTERF); // require_once (FOOTERF);
exit; exit;
break; break;