Permalink
Browse files

Re: Bug 3033 - fixed incorrect arguments in markposts for the forum i…

…ndex

screen.
  • Loading branch information...
1 parent 6cb79c4 commit c39748f4b47fb747f19770101dc0a7eb419911c2 mchurch committed Apr 28, 2005
Showing with 10 additions and 6 deletions.
  1. +2 −2 mod/forum/index.php
  2. +1 −1 mod/forum/lib.php
  3. +7 −3 mod/forum/markposts.php
View
@@ -145,7 +145,7 @@
$unread = forum_tp_count_forum_unread_posts($USER->id, $forum->id, $groupid);
if ($unread > 0) {
$unreadlink = '<span class="unread"><a href="view.php?f='.$forum->id.'">'.$unread.'</a>';
- $unreadlink .= '<a title="'.$strmarkallread.'" href="markposts.php?id='.
+ $unreadlink .= '<a title="'.$strmarkallread.'" href="markposts.php?f='.
$forum->id.'&amp;mark=read"><img src="'.$CFG->pixpath.'/t/clear.gif" alt="" /></a></span>';
} else {
$unreadlink = '<span class="read"><a href="view.php?f='.$forum->id.'">'.$unread.'</a>';
@@ -290,7 +290,7 @@
$unread = forum_tp_count_forum_unread_posts($USER->id, $forum->id, $groupid);
if ($unread > 0) {
$unreadlink = '<span class="unread"><a href="view.php?f='.$forum->id.'">'.$unread.'</a>';
- $unreadlink .= '<a title="'.$strmarkallread.'" href="markposts.php?id='.
+ $unreadlink .= '<a title="'.$strmarkallread.'" href="markposts.php?f='.
$forum->id.'&amp;mark=read"><img src="'.$CFG->pixpath.'/t/clear.gif" alt="" /></a></span>';
} else {
$unreadlink = '<span class="read"><a href="view.php?f='.$forum->id.'">'.$unread.'</a></span>';
View
@@ -1826,7 +1826,7 @@ function forum_print_discussion_header(&$post, $forum, $group=-1, $datestring=""
echo '<a href="'.$CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.'#unread">';
echo $post->unread;
echo '</a>';
- echo '<a title="'.$strmarkalldread.'" href="'.$CFG->wwwroot.'/mod/forum/markposts.php?id='.
+ echo '<a title="'.$strmarkalldread.'" href="'.$CFG->wwwroot.'/mod/forum/markposts.php?f='.
$forum->id.'&amp;d='.$post->discussion.'&amp;mark=read&amp;returnpage=view.php">' .
'<img src="'.$CFG->pixpath.'/t/clear.gif" height="11" width="11" border="0" /></a>';
echo '</span>';
View
@@ -5,12 +5,12 @@
require_once("../../config.php");
require_once("lib.php");
- require_variable($id); // The forum to mark
+ require_variable($f); // The forum to mark
require_variable($mark); // Read or unread?
optional_variable($d); // Discussion to mark.
optional_variable($returnpage, 'index.php'); // Page to return to.
- if (! $forum = get_record("forum", "id", $id)) {
+ if (! $forum = get_record("forum", "id", $f)) {
error("Forum ID was incorrect");
}
@@ -49,7 +49,11 @@
exit;
}
- $returnto = forum_go_back_to($returnpage.'?id='.$cm->id.'&f='.$forum->id);
+ if ($returnpage == 'index.php') {
+ $returnto = forum_go_back_to($returnpage.'?id='.$course->id);
+ } else {
+ $returnto = forum_go_back_to($returnpage.'?f='.$forum->id);
+ }
$info->name = fullname($user);
$info->forum = format_string($forum->name);

0 comments on commit c39748f

Please sign in to comment.