Example #1
0
File: spe.php Project: philum/cms
function read_msg($d, $m)
{
    $id = find_id($d);
    if (!$id) {
        return;
    }
    $ok = sql('id', 'qda', 'v', 'id=' . $id . ' and substring(frm,1,1)!="_" and re>0');
    if (!$ok) {
        return;
    }
    $ret = sql('msg', 'qdm', 'v', 'id=' . $id);
    if ($m == 2 or $m == "noimages" or $m == "nl") {
        $ret = kmax($ret);
    }
    if ($m != 'brut') {
        $ret = format_txt($ret, $m, $d);
    }
    return $ret;
}
Example #2
0
File: rss1.php Project: philum/cms
function flux_data()
{
    $qb = $_SESSION['qb'];
    $qda = $_SESSION['qda'];
    $qdm = $_SESSION['qdm'];
    $_SESSION['nl'] = 'nlb';
    $qba = 'WHERE nod="' . $qb . '"';
    $prw = $_GET['preview'];
    if ($_GET['read']) {
        $qba = 'WHERE id="' . $_GET['read'] . '"';
    } elseif ($_GET['tag']) {
        $qba = 'WHERE thm LIKE "%' . $_GET['tag'] . '%"';
    }
    if ($_GET['topic']) {
        $frma = 'AND frm="' . $_GET['topic'] . '"';
    }
    if ($_GET['order']) {
        $ordr = str_replace("_", " ", $_GET['order']);
    } else {
        $ordr = 'day DESC';
    }
    if ($_SESSION['dayb'] && $_GET['read'] == "") {
        $sqlimit = 'AND day > ' . $_SESSION['dayb'];
    }
    $sql = "SELECT id,mail,day,suj,frm,thm,img,re FROM {$qda} {$qba} {$frma} {$sqlimit} ORDER BY {$ordr}";
    $rq = mysql_query($sql) or die('Erreur SQL !<br>' . $sql . '<br>' . mysql_error());
    while ($data = mysql_fetch_array($rq)) {
        if ($data['re']) {
            if ($prw) {
                $msg = sql('msg', 'qdm', 'v', 'id="' . $data["id"] . '"');
                if ($_GET['brut'] && strpos($msg, ':import')) {
                    $msg = sql('msg', 'qdm', 'v', 'id="' . embed_detect($msg, '[', ':import]', '') . '"');
                }
                if (!$_GET['brut']) {
                    $msg = format_txt_r($msg, "nlb", "");
                } else {
                    $msg = str_replace('[' . $qb . '/', '[' . host() . '/users/' . $qb . '/', $msg);
                    $msg = str_replace('[' . $qb, '[' . host() . '/img/' . $qb, $msg);
                    $msg = str_replace('[users', '[' . host() . '/users', $msg);
                }
                if ($prw != "full") {
                    $msg = kmax($msg);
                }
                $msg = str_replace("imgl", "", $msg);
                //$msg=nl2br($msg);
                $http = 'http://' . $_SERVER['HTTP_HOST'];
                $msg = str_replace("../img/", $http . '/img/', $msg);
                $msg = str_replace("../imgb/", $http . '/imgb/', $msg);
                $msg = str_replace("../imgc/", $http . '/imgc/', $msg);
                $msg = str_replace("../users/", $http . '/users/', $msg);
                $msg = str_replace('href="/', 'href="' . $http . '/', $msg);
                $msg = str_replace('img src="img', 'img src="' . $http . '/img', $msg);
                $msg = str_replace('img src="imgb', 'img src="' . $http . '/imgb', $msg);
                $msg = str_replace('img src="imgc', 'img src="' . $http . '/imgc', $msg);
                $msg = str_replace('img src="users/', 'img src="' . $http . '/users/', $msg);
                $msg = parse_msg_xml($msg);
            }
            //array('date','cat','title','img','hub','tag','lu','author','lenght','url','ib')
            $ret[$data['id']] = array(0 => $data["day"], 1 => $data["frm"], 2 => $data["suj"], 3 => $data['img'], 4 => $data["mail"], 5 => $data["thm"], 12 => $msg);
        }
    }
    $_SESSION['nl'] = '';
    return $ret;
}
Example #3
0
File: art.php Project: philum/cms
function prepare_msg($id, $msg, $r, $prw)
{
    $read = $_GET['read'];
    $USE = $_SESSION['USE'];
    if (rstr(21) && $prw > 1) {
        $ath = $r['options']['authlevel'];
    }
    if (rstr(21) && $ath && $ath != 'all' && $ath > $_SESSION['auth']) {
        $msg = restricted_area($ath);
    } elseif (substr($_SESSION['frm'], 0, 1) == '_' && $_SESSION['auth'] < 3) {
        $msg = restricted_area(6);
    } elseif ($id == $read && $prw > 2 && !$_GET['page'] or $prw > 2) {
        $msg = format_txt($msg, $prw, $id);
        if ($prw != 'nl') {
            tometa($msg);
        }
        if ($_SESSION['USE']) {
            $lenght_msg = strlen($msg);
            //maj_lenght
            if ($lenght_msg != $r['host']) {
                update("qda", "host", $lenght_msg, "id", $id);
            }
        }
        update("qda", "lu", $r['lu'] + 1, "id", $id);
    } elseif ($prw == 1) {
        $msg = "";
    } elseif ($id != $read or $prw == 2) {
        if (strlen($r['host']) < 15) {
            if (strpos($msg, ':import')) {
                $msg = sql('msg', 'qdm', 'v', 'id=' . substr($msg, 1, strlen($id)));
            }
        }
        if (rstr(34)) {
            $msg = correct_txt($msg, 'b i h c l /2 /3 table', 'corrfast');
        }
        if (rstr(64)) {
            $msg = correct_txt($msg, 'q', 'stripconn');
        }
        ////thumb
        $msg = kmax($msg);
        $msg = format_txt($msg, "noimages", $id);
        $msg = clean_br_lite($msg);
    }
    //if(rstr(9))
    if ($_GET['look']) {
        $msg = str_detect($msg, $_GET['look'], 0);
    }
    $panout['msg'] = $msg;
    return $panout;
}