1
It´s not the final version and it can be plenty of bugs. I need help to improve it.
Open modules/newbb/viewforum.php
After line 34 add:
$mark_read = intval($HTTP_GET_VARS['mark_read']);
After line 50 add:
//hack mark all messages read by Samuels
if ($mark_read==1)
{
$topic_lastread = !empty($HTTP_COOKIE_VARS['newbb_topic_lastread']) ? unserialize($HTTP_COOKIE_VARS['newbb_topic_lastread']) : array();
$consulta=$xoopsDB->query("SELECT topic_id FROM " . $xoopsDB->prefix( "bb_topics" ). " WHERE forum_id=$forum order by topic_time desc");
while ($contenido=$xoopsDB->fetchArray($consulta))
{
$topic_lastread[$contenido["topic_id"]] = time();
setcookie("newbb_topic_lastread", serialize($topic_lastread), time()+365*24*3600, $bbCookie['path'], $bbCookie['domain'], $bbCookie['secure']);
}
$url=XOOPS_URL . "/modules/newbb/viewforum.php?forum=".$forum;
redirect_header($url,4,"Todos los mensajes marcados como leídos");
}
//end hack mark all messages read by Samuels
After line:
include XOOPS_ROOT_PATH."/header.php";
Add:
Now you can edit your newbb_viewforum.html theme and add <{$mark_read}> to put the link for mark all post read.
I´m waiting for suggestions.