Foro de Portal DragonFlyCMS, CPGNuke: Información y Soporte sobre DragonFlyCMS, antiguo CPGNuke, el CMS para construir Portales Web y que integra su propia versión de foros PhpBB, galerias de fotos, y muchas cosas mas
if ($mode == 'reply' || $mode == 'newtopic' ) {
$result = $db->sql_query('SELECT user_id FROM '.USERS_TABLE.' WHERE user_level<1');
$user_id_sql = '';
while ($row = $db->sql_fetchrow($result)) { $user_id_sql .= ', '.$row['user_id']; }
$sql = "SELECT u.user_id, u.user_email, u.user_lang
FROM ".FORUMS_WATCH_TABLE." tw, ".USERS_TABLE." u
WHERE tw.forum_id = $forum_id
AND tw.user_id NOT IN (".$userdata['user_id'].", ".ANONYMOUS.$user_id_sql.")
AND u.user_id = tw.user_id";
$result = $db->sql_query($sql);
reset($bcc_list_ary);
while (list($user_lang, $bcc_list) = each($bcc_list_ary))
{
$emailer->use_template('topic_notify', $user_lang);
for ($i = 0; $i < count($bcc_list); $i++) {
$emailer->bcc($bcc_list[$i]);
}
// The Topic_reply_notification lang string below will be used
// if for some reason the mail template subject cannot be read
// ... note it will not necessarily be in the posters own language!
// modificacion importante
$emailer->set_subject($lang['Forum_watch_subject'].": $forum_id: - ".$topic_title);
// translators update their templates
$emailer->msg = preg_replace('#[ ]?{USERNAME}#', '', $emailer->msg);
$emailer->assign_vars(array(
'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '',
'SITENAME' => $board_config['sitename'],
// Important Modify
'TOPIC_TITLE' => $lang['Forum_watch_subject'].": $forum_id: - ".$topic_title,
Nos vamos al fichero: modules/Forums/viewforum.php
He marcado en rojo "(is_user() && $is_auth['auth_mod'])" porque si quisiesemos abrir la opcion atodos los usuarios, solo tendriamos que tocar aqui:. Sustituyendolo por (is_user())----- go to "End of forum prune" and add the next lines ---
Y detras de la funcion 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 tambien el enlace de RSS del foro y otros sevicios.
Puede publicar nuevos temas en este foro No puede responder a temas en este foro No puede editar sus mensajes en este foro No puede borrar sus mensajes en este foro No puede votar en encuestas en este foro No Puedes adjuntar archivos en este foro Tu puedes descargar archivos en este foro