Skip to content

Commit

Permalink
Re: Bug 3033 - fixed incorrect arguments in markposts for the forum i…
Browse files Browse the repository at this point in the history
…ndex

screen.
  • Loading branch information
mchurch committed Apr 28, 2005
1 parent 6cb79c4 commit c39748f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mod/forum/index.php
Expand Up @@ -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>';
Expand Down Expand Up @@ -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>';
Expand Down
2 changes: 1 addition & 1 deletion mod/forum/lib.php
Expand Up @@ -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>';
Expand Down
10 changes: 7 additions & 3 deletions mod/forum/markposts.php
Expand Up @@ -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");
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c39748f

Please sign in to comment.