Exemplo n.º 1
0
    $tablename = $way == 'reply' ? 'replies' : 'messages';
    $partialquery = "SELECT * FROM `{$db_prefix}{$tablename}` WHERE `repid`='{$repid}' LIMIT 1";
    $m_b = new getblogs();
    $records = $m_b->getbyquery($partialquery);
    if (!is_array($records) || $records['repid'] != $repid) {
        catcherror($lnc[305]);
    }
    if ($reppsw != $records['reppsw']) {
        catcherror($lnc[297]);
    }
    $records['reppsw'] = '';
    $records['reproperty'] = '0';
    if ($way == 'reply') {
        $output_single = $m_b->single_reply($records, floor($onetimecounter));
    } else {
        $output_single = $m_b->single_message($records, floor($onetimecounter));
    }
    catchsuccess($output_single);
}
//OpenID support
if ($job == 'openidaddreply' || $job == 'openidaddmessage') {
    if ($mbcon['enableopenid'] != '1') {
        catcherror($lnc[315] . $lnc[319]);
    }
    $lastpost = $_COOKIE['lastpost'];
    if ($nowtime['timestamp'] - $lastpost < $permission['MinPostInterval']) {
        catcherror($lnc[210]);
    }
    $findintable = $job == 'openidaddreply' ? 'replies' : 'messages';
    $findreplies = $blog->getbyquery("SELECT * FROM `{$db_prefix}{$findintable}` WHERE `repip`='{$userdetail['ip']}' ORDER BY `reptime` DESC LIMIT 1");
    if ($findreplies['repip'] == $userdetail['ip']) {
Exemplo n.º 2
0
    if ($job == 'editadminreply') {
        $queryplus = "`adminrepeditorid`='{$userdetail['userid']}', `adminrepeditor`='{$userdetail['username']}', `adminrepedittime`='{$currenttime}'";
    } else {
        $queryplus = "`adminreplier`='{$userdetail['username']}', `adminrepid`='{$userdetail['userid']}',`adminreptime`='{$currenttime}'";
    }
    $blog->query("UPDATE `{$db_prefix}messages` SET `adminrepcontent`='{$adminreplycontent}' , {$queryplus} WHERE `repid`='{$repid}'");
    if ($ajax != 'on') {
        catchsuccess($finishok2, array($backtoprevious, $backtoindex, $backtodefault));
    } else {
        // For ajax
        $thiscommentwithreply = $blog->getgroupbyquery("SELECT * FROM `{$db_prefix}messages` WHERE `repid`='{$repid}'");
        include "data/cache_emot.php";
        $mbcon['images'] = $template['images'];
        define("ADMIN_LOGIN", 1);
        $m_b = new getblogs();
        $ajaxresult = $m_b->single_message($thiscommentwithreply[0]);
        catchsuccess($ajaxresult);
    }
} else {
    checkpermission('CP');
    confirmpsw();
    //Re-check password
}
if ($job == 'deladminreply') {
    $blog->query("UPDATE `{$db_prefix}messages` SET `adminrepcontent`='', `adminreplier`='', `adminrepid`='0',`adminreptime`='0',  `adminrepeditorid`='0', `adminrepeditor`='', `adminrepedittime`='0' WHERE `repid`='{$repid}'");
    catchsuccess($finishok2, array($backtoprevious, $backtoindex, $backtodefault));
}
if ($job == 'delreply') {
    if (!is_array($repid)) {
        $tmp_array[0] = $repid;
        $repid = $tmp_array;