Question: How do I redirect the member on login to the last created topic in my announcement board, if he didn't read it yet?
Original Topic: -
../Sources/LogInOut.php
Find:
// Just log you back out if it's in maintenance mode and you AREN'T an admin.
if (empty($maintenance) || allowedTo('admin_forum'))
Replace:
// The board to look for.
$board = 1453;
// Get the last topic.
$request = db_query("
SELECT ID_TOPIC
FROM {$db_prefix}topics
WHERE ID_BOARD = $board
ORDER BY ID_TOPIC DESC
LIMIT 1", __FILE__, __LINE__);
list ($topic) = mysql_fetch_row($request);
mysql_free_result($request);
// Check if he read that topic.
$request = db_query("
SELECT ID_TOPIC
FROM {$db_prefix}log_topics
WHERE ID_TOPIC = $topic
AND ID_MEMBER = $ID_MEMBER
LIMIT 1", __FILE__, __LINE__);
list ($read) = mysql_fetch_row($request);
mysql_free_result($request);
// Just log you back out if it's in maintenance mode and you AREN'T an admin.
if((empty($maintenance) || allowedTo('admin_forum')) && empty($read))
redirectexit('topic=' . $topic . '.0');
elseif ((empty($maintenance) || allowedTo('admin_forum')) && !empty($read))
1453 should be change as the ID of the announcement board.