TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,217
  • Total Topics: 21,351
  • Online today: 556
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 677
  • Total: 678
  • @rjen

mark as read

Started by Ray, October 01, 2005, 05:33:39 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

RoarinRow

My Sub-Boards.php for my SMF 1.0.5 is a little different.  Do you think you line of code will work for mine?

I have it in two places:

// Find all the boards this user can see.
$result = db_query("
SELECT b.ID_BOARD
FROM {$db_prefix}boards AS b
WHERE $user_info[query_see_board]", __FILE__, __LINE__);
if (mysql_num_rows($result) > 0)
{
$boards = array();
while ($row = mysql_fetch_assoc($result))
$boards[] = $row['ID_BOARD'];

markBoardsRead($boards, isset($_REQUEST['unread']));
}
mysql_free_result($result);

$_SESSION['ID_MSG_LAST_VISIT'] = $modSettings['maxMsgID'];
if (!empty($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'action=unread') !== false)
redirectexit('action=unread');

redirectexit();
}
elseif (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'unreadreplies')
{


and

// Find all the boards this user can see.
$result = db_query("
SELECT b.ID_BOARD
FROM {$db_prefix}boards AS b
WHERE b.ID_PARENT = $board
AND childLevel = " . ($board_info['child_level'] + 1) . "
AND $user_info[query_see_board]", __FILE__, __LINE__);
if (mysql_num_rows($result) > 0)
{
$setString = '';
while ($row = mysql_fetch_assoc($result))
$setString .= '
(' . time() . ', ' . $ID_MEMBER . ', ' . $row['ID_BOARD'] . '),';

db_query("
REPLACE INTO {$db_prefix}log_boards
(logTime, ID_MEMBER, ID_BOARD)
VALUES" . substr($setString, 0, -1), __FILE__, __LINE__);
}
mysql_free_result($result);

redirectexit('board=' . $board . '.0');
}
else
{
if (empty($board_info['parent']))
redirectexit();
else
redirectexit('board=' . $board_info['parent'] . '.0');
}
}
}

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

Rasyr

The second code quote appears to be the portion where you get redirected back to the parent board from a child board. The first code quoteis where you want to place the 'action=forum' inside the redirectexit() function.

If you look at the line above what you put in the first quote, it reads:

if (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'all')
{


The important part there is the 'sa' and the 'all', as if you are on the BoardIndex, and hold your mouse over the "Mark Read" button, you will see a url in the bar along the bottom of the browser. That url contains 'sa=all', thus the first section  you quoted is the one you should want.

RoarinRow

Quote from: Rasyr on January 18, 2006, 08:37:40 PM
The second code quote appears to be the portion where you get redirected back to the parent board from a child board. The first code quoteis where you want to place the 'action=forum' inside the redirectexit() function.

If you look at the line above what you put in the first quote, it reads:

if (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'all')
{


The important part there is the 'sa' and the 'all', as if you are on the BoardIndex, and hold your mouse over the "Mark Read" button, you will see a url in the bar along the bottom of the browser. That url contains 'sa=all', thus the first section  you quoted is the one you should want.

Cool, thanks Rasyr.  Karma for you from your help yesterday and today!  :)

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

iwyen

Thanks Rasyr. I tied to edit it to check w/r frontpage is showing forum board index or not so that it will redirect to index.php in the former case and to index.php?action=forum in the latter case. But I failed. I thought it would be cleaner, but I guess it doesn't matter that much  ;)

This website is proudly hosted on Crocweb Cloud Website Hosting.