Example #1
0
function notifyRequester($article, $user, $user, $text, $summary)
{
    global $wgTitle, $wgRequest;
    $requested = $wgRequest->getVal('requested', null);
    if ($requested != null && $summary != "Request now answered.") {
        $actualTitleObj = Title::newFromDBKey("Request:" . $wgTitle->getDBKey());
        $actualkey = $wgTitle->getDBKey();
        if ($requested != $actualkey) {
            $ot = Title::newFromDBKey("Request:" . $requested);
            $nt = Title::newFromDBKey("Request:" . $actualkey);
            $error = $ot->moveTo($nt);
            if ($error !== true) {
                echo $error;
            }
            $actualTitleObj = $nt;
        }
        Request::notifyRequest($wgTitle, $actualTitleObj);
        // strip categories
        $at = new Article($actualTitleObj);
        $text = $at->getContent(true);
        //echo $t->getFullText();
        $text = ereg_replace("[\\[]+Category\\:([- ]*[.]?[a-zA-Z0-9_/-?&%])*[]]+", "", $text);
        $text .= "[[Category:Answered Requests]]";
        $at->updateArticle($text, "Request now answered.", true, false);
    }
    return true;
}