Modificamos viewforum.php
Nos vamos al fichero:
modules/Forums/viewforum.php
He marcado en rojo "(is_user() && $is_auth['auth_mod'])" porque si quisiesemos abrir la opción atodos los usuarios, solo tendriamos que tocar aquí:. Sustituyendolo por
(is_user())----- go to "End of forum prune" and add the next lines ---
Y detras de la función Prune añadimos:
Quote::
//
// End of forum prune
//
If (is_user() && $is_auth['auth_mod']){
$can_watch_forum = TRUE;
$sql = "SELECT notify_status
FROM ".FORUMS_WATCH_TABLE."
WHERE forum_id = $forum_id
AND user_id = ".$userdata['user_id'];
$result = $db->sql_query($sql);
if ( $row = $db->sql_fetchrow($result) ) {
// user watching
if ( isset($_GET['unwatch']) ) {
if ( $_GET['unwatch'] == 'forum' ) {
// user tring to "unwatch"
$sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : '';
$db->sql_query("DELETE $sql_priority FROM ".FORUMS_WATCH_TABLE."
WHERE forum_id = $forum_id
AND user_id = ".$userdata['user_id']);
}
url_refresh(getlink("&file=viewforum&f=$forum_id"));
$message = $lang['No_longer_watching'].'<br /><br />'.sprintf($lang['Click_return_topic'], '<a href="'.getlink("&file=viewforum&f=$forum_id").'">', '</a>');
message_die(GENERAL_MESSAGE, $message);
} else {
// user not ask for "unwatch"
$is_watching_forum = TRUE;
}
} else {
if ( isset($_GET['watch']) ) {
if ( $_GET['watch'] == 'forum' ) {
$is_watching_forum = TRUE;
$sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : '';
$sql = "INSERT $sql_priority INTO ".FORUMS_WATCH_TABLE." (user_id, forum_id, notify_status)
VALUES (".$userdata['user_id'].", $forum_id, 0)";
$result = $db->sql_query($sql);
}
url_refresh(getlink("&file=viewforum&f=$forum_id"));
$message = $lang['You_are_watching'].'<br /><br />'.sprintf($lang['Click_return_topic'], '<a href="'.getlink("&file=viewforum&f=$forum_id").'">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
}
} else {
// no user but try to unwatch
if ( isset($_GET['unwatch']) ) {
if ( $_GET['unwatch'] == 'forum' ) {
url_redirect(getlink('Your_Account'), true);
}
}
}
//
// End of forum watching
//
//
// Forum watch link
//
$s_watching_forum ='';
If ( $can_watch_forum ) {
if ( $is_watching_forum ) {
$s_watching_forum = ' <a href="'.getlink("&file=viewforum&f=$forum_id&unwatch=forum").'">'.$lang['Forum_unwatch'].'</a> ';
} else {
$s_watching_forum = ' <a href="'.getlink("&file=viewforum&f=$forum_id&watch=forum").'">'.$lang['Forum_watch'].'</a> ';
}
}
//
// End Forum watch link
//
--------- go to U_POST_NEW_TOPIC and add SERV_LINE
Por ultimo, buscamos la linea donde pone
U_POST_NEW_TOPIC y detras añadimos una variable.
En nuestro caso esa variable se usa para mandar también el enlace de RSS del foro y otros sevicios.
Quote::
'U_POST_NEW_TOPIC' => getlink("&file=posting&mode=newtopic&".POST_FORUM_URL."=$forum_id"),
// (rss, igoogle, watch forums...)
'SERV_LINE' => '<a href="rss/forums.php?f='.$forum_id.'"><img src="images/rss2.gif" alt="RSS: '.$forum_row['forum_name'].'" style="vertical-align:middle;" /></a> RSS'.$s_watching_forum,