Example #1
0
function user_tagging_datahandler_post_update(&$post)
{
    global $mybb;
    //pull vars from object
    $msg = $post->post_update_data['message'];
    $tid = $post->data['tid'];
    $pid = $post->data['pid'];
    $time = $post->post_update_data['edittime'];
    //if they have tagging disabled, do nothing
    if (!$mybb->settings['user_tagging_on']) {
        return $msg;
    }
    //build the pm from user settings
    $pmBody = $mybb->settings['user_tagging_body'];
    $pmBody = str_replace('{thread}', "[url=" . $mybb->settings["bburl"] . "/showthread.php?tid=" . $tid . "&pid=" . $pid . "#" . $pid . "]" . $mybb->settings["bburl"] . "/showthread.php?tid=" . $tid . "&pid=" . $pid . "#" . $pid . "[/url]", $pmBody);
    $msg = user_tagging_tag($pmBody, $pmBody, $msg);
    $post->post_update_data['message'] = $msg;
    return $post;
}
function user_tagging_datahandler_post_update(&$post)
{
    global $mybb;
    //pull vars from object
    $msg = $post->post_update_data['message'];
    $tid = $post->data['tid'];
    $pid = $post->data['pid'];
    $time = $post->post_update_data['edittime'];
    //if they have tagging disabled, do nothing
    if (!$mybb->settings['user_tagging_on']) {
        return $msg;
    }
    //if user is not allowed to tag, or forum is disabled for tagging
    if (!user_tagging_check_permissions()) {
        return $msg;
    }
    //if PMs are enabled
    if ($mybb->settings['user_tagging_pm_on']) {
        //build the pm from user settings
        $pmBody = $mybb->settings['user_tagging_body'];
        $pmBody = str_replace('{thread}', "[url=" . $mybb->settings["bburl"] . "/showthread.php?tid=" . $tid . "&pid=" . $pid . "#" . $pid . "]" . $mybb->settings["bburl"] . "/showthread.php?tid=" . $tid . "&pid=" . $pid . "#" . $pid . "[/url]", $pmBody);
    } else {
        $pmBody = "";
    }
    $msg = user_tagging_tag($pmBody, $pmBody, $msg);
    $post->post_update_data['message'] = $msg;
    return $post;
}