forum::message::notify_moderators (private)

 forum::message::notify_moderators -message_array message_array \
    -forum_url forum_url -message_url message_url

Defined in packages/forums/tcl/messages-procs.tcl

Notify moderators of a new forum message

Switches:
-message_array (required)
name of message array of forum info in the caller scope
-forum_url (required)
-message_url (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_forum_count_test forum_count_test (test forums) forum::message::notify_moderators forum::message::notify_moderators test_forum_count_test->forum::message::notify_moderators test_forum_message_new forum_message_new (test forums) test_forum_message_new->forum::message::notify_moderators ad_html_text_convert ad_html_text_convert (public) forum::message::notify_moderators->ad_html_text_convert notification::new notification::new (public) forum::message::notify_moderators->notification::new notification::type::get_type_id notification::type::get_type_id (public) forum::message::notify_moderators->notification::type::get_type_id parameter::get parameter::get (public) forum::message::notify_moderators->parameter::get forum::message::do_notifications forum::message::do_notifications (public) forum::message::do_notifications->forum::message::notify_moderators

Testcases:
forum_message_new, forum_count_test
Source code:
    upvar 1 $message_array message

    set useScreenNameP [parameter::get -parameter "UseScreenNameP" -default 0]

    # Moderated messages are never notified in full, as they might
    # contain unsuitable content by definition.
    set href [ns_quotehtml $message_url]
    set message_html "<p>#forums.Message_content_withheld# #forums.To_view_message_follow_link# <a href=\"$href\">$href</a></p>"
    set message_text [ad_html_text_convert -from text/html -to text/plain -- $message_html]

    set html_version ""
    append html_version "#forums.Forum#:  <a href=\"$forum_url\">$message(forum_name)</a><br>\n"
    append html_version "#forums.Thread#: <a href=\"$message_url\">$message(root_subject)</a><br>\n"
    if {$useScreenNameP == 0} {
        append html_version "#forums.Author#: <a href=\"mailto:$message(user_email)\">$message(user_name)</a><br>\n"
    } else {
        append html_version "#forums.Author#: $message(screen_name)<br>\n"
    }
    append html_version "#forums.Posted#: $message(posting_date)<br>"
    append html_version "\n<br>\n"

    append html_version $message_html
    append html_version "<p>   "

    set text_version ""
    append text_version "
#forums.Forum#: $message(forum_name)
#forums.Thread#: $message(root_subject)\n"
    if {$useScreenNameP == 0} {
        append text_version "#forums.Author#: $message(user_name)"
    } else {
        append text_version "#forums.Author#: $message(screen_name)"
    }
    append text_version "
#forums.Posted#: $message(posting_date)
-----------------------------------------
$message_text
-----------------------------------------
#forums.To_view_message_follow_link#
$message_url

#forums.To_view_Forum_forum_name_go_to#
$forum_url
"
    # Do the notification for the forum
    notification::new  -type_id [notification::type::get_type_id  -short_name forums_forum_moderator_notif]  -object_id $message(forum_id)  -response_id $message(message_id)  -notif_subject "\[$message(forum_name)\] $message(subject) (#forums.moderated#)"  -notif_text $text_version  -notif_html $html_version

    # Eventually we need notification for the root message too
    notification::new  -type_id [notification::type::get_type_id  -short_name forums_message_moderator_notif]  -object_id $message(root_message_id)  -response_id $message(message_id)  -notif_subject "\[$message(forum_name)\] $message(subject) (#forums.moderated#)"  -notif_text $text_version  -notif_html $html_version
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/forums/tcl/messages-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: