コード例 #1
1
ファイル: meta.php プロジェクト: philum/cms
function prep_msg($id)
{
    $msg = sql('msg', 'qdm', 'v', 'id=' . $id);
    $msg = html_entity_decode($msg);
    if (strpos($msg, ':import') or strpos($msg, ':read')) {
        $msg = strip_tags(format_txt($msg, $id, 3));
    } else {
        $msg = clean_internaltag($msg);
    }
    $msg = strtolower(eradic_acc($msg));
    $msg = deln($msg, ' ');
    $msg = str_replace(" ", " ", $msg);
    return $msg;
}
コード例 #2
0
ファイル: deploy.php プロジェクト: philum/cms
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;
}
コード例 #3
0
ファイル: tri.php プロジェクト: philum/cms
function treat_link($aa_inner, $txa)
{
    if ($txa) {
        $tag = 'href=';
        $len = 6;
        if (substr($txa, 0, 1) == ' ') {
            $sp = ' ';
        }
        $txt = clean_internaltag($txa);
        ///testing
        if (strpos($txt, '>')) {
            $txt = substr($txt, strpos($txt, '>') + 1);
        }
    } else {
        $tag = 'src=';
        $len = 5;
        $im = "ok";
    }
    $root = findroot($_GET['urlsrc'] ? $_GET['urlsrc'] : $_POST['urlsrc']);
    $imnb = strpos(strtolower($aa_inner), $tag);
    if ($imnb !== false) {
        $imnc = substr($aa_inner, $imnb + $len - 1, 1);
        if ($imnc == '"' or $imnc == "'") {
            $bend = strpos($aa_inner, $imnc, $imnb + $len);
            $nb = $len;
        } else {
            $bend = strpos($aa_inner, " ", $imnb + $len - 1);
            $nb = $len - 1;
        }
    }
    if ($bend === false) {
        $bend = strpos($aa_inner, '>', $imnb + $nb);
    }
    $src = substr($aa_inner, $imnb + $nb, $bend - $imnb - $nb);
    if (strpos($aa_inner, 'popup_nbp')) {
        $mid = '[' . $txt . ':nh]';
    }
    //philum_anchor
    if (strpos($src, 'base64')) {
        $mid = '[' . b64img($src) . ']';
    } elseif ($src) {
        $src = utmsrc($src);
        $txt = utmsrc($txt);
        if ($tag == 'src=') {
            if ($pos = strpos($src, '?')) {
                $src = substr($src, 0, $pos);
            }
        }
        $src = str_replace(' ', "%20", $src);
        $src = mb_ereg_replace("(\n)|(\t)", '', $src);
        $txt = mb_ereg_replace("(\n)|(\t)", '', $txt);
        if (substr($src, 0, 2) == '//') {
            $src = 'http:' . $src;
        }
        if (strpos($src, 'http') === false) {
            $rot = partsoflink($root, $src);
        }
        if (substr($src, 0, 1) == '/') {
            $src = substr($src, 1);
        }
        if (substr($src, -1) == '/') {
            $src = substr($src, 0, -1);
        }
        if (substr($txt, 0, 1) == '/') {
            $txt = substr($txt, 0, -1);
        }
        $src = str_replace('../', '', $src);
        //if(!is_image($rot.$src,xt($src)) && $im)$ext=":img";
        if (strpos($src, "javascript") !== false) {
            $src = "";
        }
        //if(strpos($aa_inner,'cs_glossaire')!==false)$mid='['.($txa).':pop]';//dico
        if (strpos($aa_inner, 'cs_glossaire') !== false) {
            $mid = $txa;
        } elseif ($txt && $txt != ' ') {
            $posdiez = strpos($src, '#');
            $rt = array('youtube.com/watch', 'youtu.be', 'dailymotion', 'vimeo', 'rutube');
            if ($posdiez !== false) {
                //$mid=$txt; //skip_anchors
                $id = prop_detect($aa_inner, 'name');
                if (!$id) {
                    $id = prop_detect($aa_inner, "name='", "'");
                }
                if (!$id) {
                    $id = prop_detect($aa_inner, 'id');
                }
                if (!$id) {
                    $id = embed_detect($aa_inner, "id='", "'");
                }
                if (substr($src, $posdiez + 1, 2) == "nb") {
                    $mid = '[' . $txt . ':nh]';
                } elseif (substr($src, $posdiez + 1, 2) == "nh") {
                    $mid = '[' . $txt . ':nb]';
                }
                if (substr($src, $posdiez + 1, 4) == "_ftn") {
                    $mid = '[' . $txt . ':nh]';
                } elseif (substr($src, $posdiez + 1, 7) == "_ftnref") {
                    $mid = '[' . $txt . ':nb]';
                }
                if (!$mid) {
                    if (!$txt) {
                        $mid = substr($src, $posdiez + 1);
                    } elseif (substr($txt, 0, 1) == '[' or substr($txt, 0, 1) == '(') {
                        $mid = $txt;
                    } else {
                        $mid = '[' . $txt . ']';
                    }
                }
            } elseif (in_array_p($src, $rt)) {
                if (!is_image($txt) && !ishttp($txt)) {
                    $txb = $txt;
                    $pop = '';
                }
                $mid = auto_video($src, $pop, $txb);
            } elseif (strpos($src, "mailto:") !== false) {
                $mid = '[' . substr($src, 7) . '] ';
            } elseif (is_image($src) && is_image($txt)) {
                $mid = '[' . $rot . $src . '] ';
            } elseif ($txt && $src && strpos($txt, $src) !== false) {
                $mid = '[' . $rot . $src . '] ';
            } elseif ($rot . $src != $txt) {
                $txt = trim($txt);
                if (is_image($src)) {
                    if (!is_image($txt) && $txt != 'https') {
                        $mid = '[' . $rot . $src . ($txt ? '§' . $txt : '') . ']';
                    } else {
                        $mid = '[' . $rot . $src . ']';
                    }
                } elseif (strpos($txt, '...') !== false && strpos($src, str_replace('...', '', $txt)) !== false) {
                    $mid = '[' . $rot . $src . '] ';
                } else {
                    $mid = '[' . $rot . $src . '§' . $txt . '] ';
                }
            } else {
                $mid = '[' . $rot . $src . '] ' . $txb;
            }
        } else {
            $mid = '[' . $rot . $src . $ext . '] ' . $txb;
        }
    } elseif ($txt) {
        $mid = $txt . ' ';
    }
    return $sp . $mid;
}
コード例 #4
0
ファイル: art.php プロジェクト: philum/cms
function prepare_msg_rech($id, $msg, $r = '', $n)
{
    $rech = good_rech();
    if ($_GET['bool']) {
        $parts = explode(' ', trim($rech));
    }
    $nbp = count($parts);
    $msg = strip_tags($msg);
    $msg = clean_internaltag($msg);
    $r = explode('.', $msg);
    if (!$_GET['titles']) {
        foreach ($r as $k => $v) {
            if ($nbp > 1) {
                foreach ($parts as $kb => $vb) {
                    if ($v && $vb) {
                        $va = str_detect($v, $vb, $id);
                    } else {
                        $va = '';
                    }
                }
                if ($va) {
                    $ret .= divc('track', $va . '.');
                }
            } else {
                $res = str_detect($v, $rech, $id);
                if ($res) {
                    $ret .= divc('track', $res . '.');
                }
            }
        }
    }
    if ($_GET['titles']) {
        $panout['msg'] = '';
    } else {
        $panout['msg'] = clean_br_lite($ret);
    }
    return $panout;
}