Пример #1
0
function clkt($d, $lst = '')
{
    $http = 'http://';
    if (substr($d, 0, 7) != $http) {
        $d = $http . $d;
    }
    $pos = strpos($d, 'msql/');
    if ($pos !== false) {
        $site = substr($d, 0, $pos);
        $nod = substr($d, $pos + 5);
        $call = $site . 'plug/microxml.php?table=' . $nod . '&last=' . $lst;
    }
    $keys = array('key');
    for ($i = 0; $i < 20; $i++) {
        $keys[] = '' . $i;
    }
    //val
    $rss = read_rss($call, "item", $keys);
    //p($rss);
    foreach ($rss as $k => $v) {
        $key = $v[0];
        array_shift($v);
        if ($key == '_menus_') {
            $keys = $v;
        }
        foreach ($v as $ka => $va) {
            if ($va) {
                $n[$k]++;
            }
        }
        if ($key) {
            $re[$key] = $v;
        }
    }
    if ($n) {
        $max = max($n);
        foreach ($re as $k => $v) {
            for ($i = 0; $i < $max; $i++) {
                $ret[$k][$i] = $v[$i];
            }
        }
        //$keys[$i]
        return $ret;
    }
}
Пример #2
0
Файл: pop.php Проект: philum/cms
function rss_art($u, $p, $br)
{
    if (substr($u, 0, 4) != 'http') {
        $u = 'http://' . $u;
    }
    if ($p) {
        $u = rss_read($u);
    }
    //$r=load_xml($u,1);
    $r = read_rss($u, "item", array("title", "link", "pubDate", "description"));
    list($va, $lnk, $dat, $txt) = $r[1];
    $va = html_entity_decode($va);
    $txt = html_entity_decode($txt);
    $txt = stripslashes($txt);
    if ($br) {
        $txt = format_txt($txt, 3, $id);
    } else {
        $txt = format_txt_r($txt, 3, $id);
    }
    if ($va) {
        return bal('h2', lkc('', $lnk, $va)) . divc('justy', $txt);
    }
}