Ejemplo n.º 1
0
function plug_deploy($deploy)
{
    $qb = $_SESSION['qb'];
    $USE = $_SESSION['USE'];
    $raed = suj_of_id($deploy);
    $nl = $_GET['nl'] ? $_GET['nl'] : "nl";
    if ($deploy && $USE) {
        //prep
        list($qauth, $subj) = sql('name,suj', 'qda', 'r', 'id="' . $deploy . '"');
        $msg = sql('msg', 'qdm', 'v', 'id="' . $deploy . '"');
        if ($USE == $qauth or auth(5)) {
            $http = host();
            if (!$_POST['dpl']) {
                reqp('mail');
                $qmail = mail_list_tosend();
                $ret .= form("/?read={$deploy}&deploy={$deploy}&nl=nlb", txarea('dpl" maxlength="1000', $qmail, 40, 10) . br() . checkbox("dpf", "ok", "html", 1) . checkbox("multiple", "ok", "each_one", 1) . input2('submit', "send", nms(50), 'popbt'));
            } else {
                $htacc = urlread($deploy);
                $_SESSION['nl'] = $nl;
                //deploy
                if ($_POST['dpf'] == "ok") {
                    $mail_format = "html";
                    $txt = format_txt($msg, $nl, $deploy);
                    $txt = html_entity_decode($txt);
                    $txt = str_replace('href="/', 'href="' . $http . '/', $txt);
                    $msg = lkc("", $http . $htacc, bal("h2", $subj));
                    $msg .= divc("panel justy", $txt);
                } else {
                    $mail_format = "txt";
                    $msg = clean_internaltag($msg);
                    $msg = html_entity_decode($msg);
                }
                $_SESSION['nl'] = "";
                //send
                $sender = sql('mail', 'qdu', 'v', 'name="' . $USE . '"');
                $lstm = str_replace("\n", ",", $_POST['dpl']);
                $lstm = str_replace("\r", ",", $lstm);
                $listmail = explode(",", trim($lstm));
                if ($_POST['multiple'] == "ok" && is_array($listmail)) {
                    $sentto = send_mail_r($listmail, $mail_format, $qb . ' :: ' . $raed, $msg, $sender, $htacc);
                } else {
                    $sentto = $_POST['dpl'];
                    $vm = str_replace(array(",", ";", "\n", " "), ",", $sentto);
                    send_mail($mail_format, $vm, $qb . ' :: ' . $raed, $msg, $sender, $htacc);
                }
                $ret .= lkc("popbt", '/?read=' . $deploy, 'article ' . $deploy . ' sent to: ' . $sentto);
            }
        } else {
            $ret .= btn("popdel", "forbidden");
        }
    }
    //if($_POST['dpl'])return $ret;
    return $ret;
}
Ejemplo n.º 2
0
Archivo: spe.php Proyecto: philum/cms
function send_track_to_user($id)
{
    $sender = $_SESSION['qbin']['adminmail'];
    //i.
    list($name, $day, $idt, $msg) = sql('name,day,frm,msg', 'qdi', 'r', 'id=' . $id);
    $by = helps('trackmail');
    $msg = format_txt($msg, '', $idt) . "\n\n";
    $msg = nl2br($by . "\n\n" . 'By: ' . $name . ', ' . mkday($day) . "\n\n" . $msg);
    $suj = sql('suj', 'qda', 'v', 'id=' . $idt);
    $rmails = sql('mail', 'qdi', 'k', 'frm="' . $idt . '"');
    if ($rmails) {
        $r = array_keys_b($rmails);
    }
    if ($r) {
        send_mail_r($r, 'html', $suj, $msg, $sender, $id);
    }
}
Ejemplo n.º 3
0
function save_track($msg, $id, $name, $mail)
{
    $pdt = time();
    $iq = hostname();
    //ses('iq');
    if (is_numeric($id) or substr($id, 0, 4) == 'wall') {
        $local = true;
    }
    if (!$msg) {
        return;
    }
    // btn('popdel','bruuu! '.helps('empty_msg'));
    req('sav');
    $qb = $_SESSION['qb'];
    $base = $_SESSION['qdi'];
    $_GET['idy'] = 'ok';
    $_GET['insert'] = 'ok';
    $_POST['name'] = $nm;
    $_POST['msg'] = $msg;
    if (!rstr(2) or auth(4)) {
        $op = 1;
    } else {
        $op = 0;
    }
    $here = host() . '/?read=' . $id;
    $msg = str_replace(":chat", "", $msg);
    $msg = repair_latin($msg);
    $msg = embed_links($msg);
    //$amsg=mysql_real_escape_string(stripslashes($msg));
    $values = array($ib, $name, $mail, $pdt, $qb, $id, $suj, $msg, $op, $ip);
    //,'','',''
    $nread = insert('qdi', mysqlra($values));
    $suj = $local ? suj_of_id($id) : nms(84);
    $nmsg = lka($here . '#trk' . $nread, $local ? helps('trackmail') : nms(84)) . br() . br();
    $nmsg .= nms(68) . ': ' . $name . ', ' . mkday($pdt) . br() . br() . format_txt($msg, '', '');
    $admail = $_SESSION['qbin']['adminmail'];
    //to_admin
    if ($name != $_SESSION['USE']) {
        send_mail_html($admail, $suj, $nmsg, $mail, urlread($id));
    }
    if ($local) {
        $rmails = sql('mail', 'qdi', 'k', 'frm="' . $id . '" AND re>="1"');
    }
    //deploy
    $kem = sql('name', 'qda', 'v', 'id="' . $id . '"');
    //send_to_author
    if ($kem != $name) {
        $kmail = sql('mail', 'qdu', 'v', 'name="' . $kem . '"');
        if ($admail != $kmail) {
            $rmails[$kmail] = 1;
        }
    }
    //send_track_to_user
    if ($rmails && $op == 1) {
        send_mail_r(array_keys_b($rmails), 'html', $suj, $nmsg, $mail, $id);
    }
    if (!$local) {
        return popup(nms(34), divc('', helps('formail')), '');
    }
    return tracks_read($nread, '', '');
}