Exemplo n.º 1
0
Arquivo: tri.php Projeto: 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;
}
Exemplo n.º 2
0
Arquivo: pop.php Projeto: philum/cms
function rssin_xml($f)
{
    $rss = load_xml($f);
    //p($rss);
    if ($rss) {
        foreach ($rss as $k => $v) {
            list($va, $lnk, $dat) = $v;
            $va = trim(del_n(strip_tags($va)));
            $va = clean_title($va);
            //$va=unescape($va); $va=html_entity_decode($va);
            $lnk = utmsrc($lnk);
            if ($dat) {
                $dat = rss_date($dat);
            }
            $ret[] = array($va, $lnk, $dat);
        }
    }
    return $ret;
}
Exemplo n.º 3
0
Arquivo: sav.php Projeto: philum/cms
function save_art()
{
    $dayx = $_SESSION['dayx'];
    $frm = $_SESSION['frm'];
    $qb = $_SESSION['qb'];
    $base = $_SESSION['qda'];
    $qdm = $_SESSION['qdm'];
    $USE = $_SESSION['USE'];
    if (!$frm or $frm == "Home" or $frm == "user") {
        $frm = "public";
    }
    $suj = clean_title($_POST['suj']);
    $suj = etc($suj, 240);
    $msg = nl2br($_POST['msg']);
    $name = $_POST['name'];
    $mail = $_POST['mail'];
    $ib = trim($_POST['ib']);
    $pdat = $_POST['postdat'];
    $urlsrc = $_POST['urlsrc'];
    if ($_POST['pub']) {
        $re = 1;
    }
    if ($urlsrc) {
        $mail = https($urlsrc);
    }
    $mail = utmsrc($mail);
    if (!$ib) {
        $ib = '/';
    }
    //!$_POST['sub'] or
    if (!$name or $name == nms(38)) {
        alert("empty_name {$name}");
        $stoop = "ok";
    }
    if ($mail == "mail" or $mail == "url") {
        $mail = '';
        $urlsrc = '';
    }
    $msg = str_replace(array("<br />", "<br/>", "<br>", "<BR>"), "\n", $msg);
    $msg = str_replace("\n", "", $msg);
    $msg = str_replace("\r", "\n", $msg);
    if (!$msg && $urlsrc) {
        list($suj, $msg) = vacuum($mail, $suj);
    }
    $msg = html_entity_decode_b($msg);
    $msg = embed_links($msg);
    $msg = unescape($msg);
    $msg = clean_br_lite($msg);
    $msg = clean_punct($msg);
    if ($pdat != date("y-m-d-H-i", $dayx) && $pdat) {
        $rdat = explode('-', $pdat);
        $pdt = mktime($rdat[3], $rdat[4], 0, $rdat[1], $rdat[2], $rdat[0]);
    } else {
        $pdt = $dayx;
    }
    if (empty($suj)) {
        $suj = "forbidden title";
    }
    if (empty($msg)) {
        alert('msg forbidden');
        $stoop = 'ok';
    }
    if ($stoop == "") {
        $msg = mysql_real_escape_string(stripslashes($msg));
        $siz = strlen($msg);
        $suj = mysql_real_escape_string(stripslashes($suj));
        $frm = mysql_real_escape_string(stripslashes($frm));
        $nid = msquery("INSERT INTO {$base} VALUES ('','{$ib}','{$name}','{$mail}','{$pdt}','{$qb}','{$frm}','{$suj}','{$re}','{$lu}','{$img}','{$kywk}','{$siz}')");
        $nid = msquery("INSERT INTO {$qdm} VALUES ('{$nid}','{$msg}')");
    }
    if ($nid && $USE != $qb && $_SESSION["auth"] < 6) {
        mail($_SESSION['qbin']["adminmail"], 'new article: ' . stripslashes($suj), '
	' . host() . '/' . $nid . ',
	auth_level: ' . $_SESSION["auth"] . "\n", 'From: ' . $USE);
    }
    if ($_SESSION['vacuum'][nohttp($urlsrc)]) {
        unset($_SESSION['vacuum'][nohttp($urlsrc)]);
    }
    if ($nid) {
        $_SESSION['rqt'][$nid] = array($pdt, stripslashes($frm), stripslashes($suj), '', $qb, '', '', '', $siz, $urlsrc, $ib, $re);
        $msg = correct_txt($msg, $nid, 'savimg');
        $exp_out = $nid;
        $_GET['read'] = $nid;
        deductions_from_read($nid, '');
        $_POST = '';
    }
    $_SESSION['daya'] = $_SESSION['dayx'];
    return $exp_out;
}
Exemplo n.º 4
0
Arquivo: ajxf.php Projeto: philum/cms
function batch($f, $d)
{
    $f = utmsrc($f);
    $fb = nohttp($f);
    $idt = 'adc';
    //if($d=='c')$idt.='p';
    if ($f == 'z') {
        req('sav');
        return save_art_batch();
    }
    if (substr($f, 0, 4) != 'http' && $f && $f != 'x' && $f != '1') {
        $f = 'http://' . $f;
    }
    if ($f == 'x') {
        $_SESSION['vacuum'] = '';
    }
    //p($_SESSION['vacuum']);
    if (trim($f) && $f != '1' && $d != '1' && $f != 'x' && $d != 'x' && !@$_SESSION['vacuum'][$fb]) {
        if (joinable($f)) {
            $_SESSION['vacuum'][$fb] = read_file($f);
        }
    }
    //
    if ($d == 'x') {
        unset($_SESSION['vacuum'][$fb]);
    }
    //echo $f; //p($_SESSION['vacuum']);
    if ($d == 'p') {
        return 'ok';
    }
    if ($d == 'c') {
        $ret = lj('', sj('popup_batch') . ' closebub(this);', picto('get'));
    }
    $ret .= lj('', $idt . '_batch____in_' . $d, picto('reload'));
    $ret .= lj('', $idt . '_batch___x_1', picto('del'));
    $ret .= lj('', 'popup_rssjb___rssurl_1', picto('rss'));
    $ret .= lj('', $idt . '_batchfbi__3', picto('update'));
    $ret .= lj('', 'page_deskbkg', picto('desktop'));
    $ret .= msqlink('', ses('qb') . '_rssurl');
    $r = $_SESSION['vacuum'];
    if ($r) {
        $r = array_reverse($r);
    }
    if ($r) {
        $ret .= lj('popsav', $idt . '_batch___z_1', nms(57));
    }
    if ($r) {
        foreach ($r as $k => $v) {
            $i++;
            if ((!$_SESSION['vacsuj'][$k] or $k == $f) && $k != 1 && $k && $k != 'http://loading...') {
                list($_SESSION['vacsuj'][$k], $msg) = vacuum($k, '');
            }
            if (!$_SESSION['vacsuj'][$k] && $v) {
                $suj = 'no_title';
            } else {
                $suj = $_SESSION['vacsuj'][$k];
            }
            $kb = ajx($k, '');
            $cat = $_SESSION['vaccat'][$k];
            $rid = randid('bth');
            $btb = ljc('', 'popup', 'ajxf_batch*preview_' . $kb, picto('view'));
            $btb .= slct_cat($rid, $cat, $i);
            //$btb.=select_j($rid,'category',$cat,3,$cat?$cat:picto('list'));
            $btb .= saveiec($kb, $cat, $rid);
            $btb .= lj('', 'popup_search__3_' . ajx($suj) . '_', picto('search'));
            $btb .= lkt('" title="' . preplink($k) . ' ' . $_SESSION['vacdat'][$k], http($k), picto('url'));
            $btb .= lj('', $idt . '_batch___' . $kb . '_x', picto('del')) . ' ';
            $btb .= btn('small', http_domain($k)) . br();
            $ret .= divc('small', $btb . $suj);
        }
    }
    if ($d != 'in') {
        $ret = div(atd($idt) . ats('padding:2px; min-width:240px;'), $ret);
    }
    return scroll_b($i, $ret, 10);
}
Exemplo n.º 5
-1
Arquivo: art.php Projeto: philum/cms
function f_inp($mil, $link)
{
    $_SESSION['cur_div'] = 'content';
    $ip = hostname();
    $qda = $_SESSION['qda'];
    $USE = $_SESSION['USE'];
    $cont = $_GET['continue'];
    $read = $_SESSION['read'];
    $raed = $_SESSION['raed'];
    $frm = $_SESSION['frm'];
    if ($USE) {
        $us = $USE;
    } else {
        list($us, $ml) = sql('name,mail', 'qdi', 'r', 'host="' . $ip . '" ORDER BY id DESC LIMIT 1');
    }
    $currid = lastid('qda') + 1;
    if ($frm == "" or $frm == "Home") {
        $frm = "public";
    }
    //sections
    if ($_GET['edit'] == "=") {
        $cit = "&edit==";
    }
    $goto = '/?read=' . $read . $cit;
    if (substr($link, 0, 4) == 'http' && !$cont) {
        $link = https(utmsrc($link));
        //vacuum
        $_GET['urlsrc'] = $link;
        list($suj, $msg) = vacuum($link, '');
    }
    //elseif($read)$link=$_SESSION['rqt'][$read][9];
    if (!$cont) {
        $r['urlsrc'] = autoclic('urlsrc', "url", '10" id="urlsrc" onClick="SaveI(\'urlsrc\')" onContextMenu="SaveIt()" value="' . $link, '250', '') . btd('urledt', '');
    }
    //urlsrc
    if ($USE && !$cont) {
        $r['trkname'] = hidden('name', 'trkname', $USE) . hidden('mail', 'trkmail', '');
        $r['slcat'] = select_j('frm', 'category', $frm, '3', $frm, '');
    } elseif (!$USE) {
        $gn = '" onkeyup="log_goodname(\'trkname\');';
        $r['trkname'] = autoclic('name" id="trkname' . $gn, $us ? $us : nms(38), '8', '50', 'txtx');
        //name
        $r['trkmail'] = autoclic('mail" id="trkmail', $ml ? $ml : 'mail', '13', '50', 'txtx');
    }
    //mail
    if (!$cont) {
        $r['parent'] = select_jp('ib', 'parent', rstr(10) ? $read : '', '0', picto('topo'), '1');
    }
    //if(!$cont)$r['parent']=togbub();
    if (!$cont && auth(3)) {
        $r['publish'] = checkbox_j('pub', $_SESSION['auth'] < 4 ? 0 : rstr(11), nms(29));
    } else {
        $r['publish'] = hidden('pub', 'pub', 0);
    }
    if (!$cont) {
        //new
        $r['pstdat'] = select_j('postdat', 'date', date('y-m-d-H-i'), 0, picto('time'), 0);
        $r['pstsuj'] = balise('input', array('', '', 'suj', 'suj1', '', 'editor', 7 => 255, 16 => 'width:100%;', 23 => $suj ? $suj : nms(71)), '');
    }
    if ($cont) {
        $msg = sql('msg', 'qdm', 'v', 'id=' . $read);
        $btcntn = 'continue=ok#' . $read;
        $alrt = conn_correct($msg);
    } else {
        $goto = '/?read=' . $currid;
        $btcntn = 'insert=ok';
    }
    //&continue==#'.$currid
    $msg = str_replace("\r", "", $msg);
    //msg
    $msg = str_replace(array("<br />\n", "<br />", "<br>"), "\n", $msg);
    //save
    $ids = 'suj1|frm|urlsrc|postdat|trkname|trkmail|ib|pub';
    //|sub
    $c = 'popbt';
    $sav = ljb($c, 'SaveJb', 'socket_saveart_txtarea_id4_' . $read . '_no\',\'art' . $read . '_readart___' . $read, picto('save'));
    if ($cont && rstr(53)) {
        $sav .= ljb($c, 'SaveJb', 'txarea_saveart_txtarea_id4_' . $read . '\',\'art' . $read . '_readart___' . $read, nms(57)) . ' ';
    } elseif (!rstr(53)) {
        $sav .= submitj($c, 'sav', nms(57)) . ' ';
    } else {
        $sav .= lj($c, 'socket_newart_txtarea_' . (rstr(57) ? 7 : 9) . '_____' . $ids, nms(57)) . ' ';
    }
    //pop
    $btdt = lj('', 'popup_artwedit_txtarea__', pictit('editor', nms(107))) . ' ';
    $btdt .= ljb('' . '" title="test', 'captslct', 'preview', picto('valid')) . ' ';
    if ($cont && $read) {
        $btdt .= urledt_id($read);
    }
    //defcon//urledt($link)
    $ret = '<form method="POST" id="sav" action="' . $goto . '&' . $btcntn . '">' . "\n";
    //form
    $ret .= btd('bts' . $read, $sav) . ' ' . $btdt;
    $ret .= implode(' ', $r);
    $ret .= sesmk('conn_edit', '', '');
    //1
    $ret .= $alrt;
    $ret .= divd('txarea', txarea1($msg));
    //if(auth(4))$ret.=checkbox("randim","ok","rename_img",0);
    $ret .= ' </form>' . "\n";
    return $ret;
}