function appendReceivedPosts()
{
    global $INTERNAL;
    $pids = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_RECEIVED_POSTS]);
    foreach ($pids as $id) {
        markPostReceived($id);
    }
}
function processPosts($counter = 0)
{
    global $USER, $STATS;
    while (isset($_POST["p_p" . $counter])) {
        if (STATS_ACTIVE) {
            $STATS->ProcessAction(ST_ACTION_EXTERNAL_POST);
        }
        $id = md5($USER->Browsers[0]->SystemId . AJAXDecode($_POST[POST_EXTERN_CHAT_ID]) . AJAXDecode($_POST["p_i" . $counter]));
        $post = new Post($id, $USER->Browsers[0]->SystemId, $USER->Browsers[0]->InternalUser->SystemId, AJAXDecode($_POST["p_p" . $counter]), time(), $USER->Browsers[0]->ChatId);
        if (isset($_POST["p_pt" . $counter])) {
            $post->Translation = AJAXDecode($_POST["p_pt" . $counter]);
            $post->TranslationISO = AJAXDecode($_POST["p_ptiso" . $counter]);
        }
        $post->Save();
        $USER->AddFunctionCall("lz_chat_release_post('" . AJAXDecode($_POST["p_i" . $counter]) . "');", false);
        $counter++;
    }
    $counter = 0;
    while (isset($_POST["pr_i" . $counter])) {
        markPostReceived(AJAXDecode($_POST["pr_i" . $counter]));
        $USER->AddFunctionCall("lz_chat_message_set_received('" . AJAXDecode($_POST["pr_i" . $counter]) . "');", false);
        $counter++;
    }
}
Пример #3
0
function processPosts($counter = 0)
{
    global $USER;
    while (isset($_POST["p_p" . $counter])) {
        $id = md5($USER->Browsers[0]->SystemId . $_POST[POST_EXTERN_CHAT_ID] . $_POST["p_i" . $counter]);
        $post = new Post($id, $USER->Browsers[0]->SystemId, $USER->Browsers[0]->Chat->InternalUser->SystemId, AJAXDecode($_POST["p_p" . $counter]), time());
        $post->Save();
        $USER->AddFunctionCall("lz_chat_release_post('" . $_POST["p_i" . $counter] . "');", false);
        $counter++;
    }
    $counter = 0;
    while (isset($_POST["pr_i" . $counter])) {
        markPostReceived($_POST["pr_i" . $counter]);
        $USER->AddFunctionCall("lz_chat_message_set_received('" . $_POST["pr_i" . $counter] . "');", false);
        $counter++;
    }
}