Esempio n. 1
0
File: pop.php Progetto: philum/cms
function place_image($doc, $media, $large, $largb, $txt = '')
{
    $nl = substr($_SESSION['nl'], 0, 2);
    $nla = substr($media, 0, 2);
    $p['id'] = 'rez';
    if (substr($doc, 0, 4) == 'http') {
        if (eradic_acc($doc) == $doc) {
            $ok = joinable($doc);
        }
        if ($ok) {
            list($w, $h) = @getimagesize($doc);
        }
        if ($w > $large) {
            $w = $large;
        }
        return image($doc, $w, '', atr($p)) . "\n\n";
    } else {
        $pre = jcim($doc);
    }
    $dca = $pre . $doc;
    if ($nl or $nla == 'nl') {
        $http = host() . '/';
        $dca = str_replace('../', '', $dca);
    }
    if (file_exists($dca)) {
        list($w, $h) = getimagesize($dca);
    }
    if (!$w && !$pre) {
        $dca = $doc;
        $w = $largb;
    }
    if ($media == "noimages") {
        return;
    } elseif ($media != "nlc") {
        //rss
        if (rstr(17)) {
            $largb /= 2;
        }
        if (rstr(9) && !$com && $w < $largb) {
            $p['style'] = 'float:left; margin-right:10px;';
        }
        if ($w && $w < $largb) {
            $p['style'] .= ' width:' . $w . 'px;';
        }
        $p['src'] = $http . $dca;
        if (!rstr(9)) {
            $br = "\n\n";
        }
        //$h>40 or
        $ret = '<img ' . atr($p) . ' />';
        $send = 'photo_' . str_replace('_', '*', $dca) . '_' . $w . '_' . $h;
        if ($txt && !$com) {
            $icon = picto('img') . ' ';
            if ($w && !$nl) {
                return ljb('', 'SaveBf', $send, $icon . $txt);
            } else {
                return lkt('', $dca, $txt);
            }
        }
        if ($w > $large && $large && !$com) {
            if ($nl or $nla == 'nl') {
                return $ret . $br;
            } else {
                return ljb('', 'SaveBf', $send, $ret) . $br;
            }
        } else {
            return $ret . $br;
        }
    }
}
Esempio n. 2
0
File: pop.php Progetto: philum/cms
function place_image($doc, $media, $large, $largb, $txt = '', $com = '')
{
    $nl = substr($_SESSION['nl'], 0, 2);
    $nla = substr($media, 0, 2);
    $p['id'] = 'rez';
    if (substr($doc, 0, 4) == 'http') {
        if (eradic_acc($doc) == $doc) {
            $ok = joinable($doc);
        }
        if ($ok) {
            list($w, $h) = @getimagesize($doc);
        }
        if ($w > $large) {
            $w = $large;
        }
        return image($doc, $w, '', atr($p)) . "\n\n";
    } else {
        $pre = jcim($doc);
    }
    $dca = $pre . $doc;
    if ($nl or $nla == 'nl') {
        $http = host() . '/';
        $dca = str_replace('../', '', $dca);
    }
    if (file_exists($dca)) {
        list($w, $h) = getimagesize($dca);
        $_SESSION['lastimw'] = $w;
    }
    if (!$w && !$pre) {
        $dca = $doc;
        $w = $largb;
    }
    if ($media == "noimages") {
        return;
    } elseif ($media != "nlc") {
        //rss
        if (rstr(9)) {
            // && $com=''
            if ($w < $largb) {
                $p['style'] = 'float:left; margin-right:10px;';
            } else {
                $br = "\n\n";
            }
        } else {
            $br = "\n\n";
        }
        $p['src'] = $http . $dca;
        $re = '<img ' . atr($p) . ' />';
        $send = 'photo_' . str_replace("_", "*", $dca) . '_' . $w . '_' . $h;
        if ($txt && !$com) {
            $icon = picto('img') . ' ';
            if ($w && !$nl) {
                return ljb('', 'SaveBf', $send, $icon . $txt);
            } else {
                return lkt('', $dca, $txt);
            }
        }
        if ($w > $large && $large && !$com) {
            if ($nl or $nla == 'nl') {
                return $re . "\n\n";
            } else {
                return ljb('', 'SaveBf', $send, $re) . $br;
            }
        } elseif ($com) {
            $attrb = ' class="blocktext"';
            if ($w > $largb && ($nl or $nla == 'nl')) {
                return div($attrb, $re . $txt);
            } else {
                if ($w > $large) {
                    return ljb('', 'SaveBf', $send, $re) . div($attrb, $txt);
                } else {
                    return divc('clear', '') . div('style="width:' . $w . 'px;" ' . $attrb, $re . $txt);
                }
            }
        } else {
            return $re . $br;
        }
    }
}
Esempio n. 3
0
File: ajxf.php Progetto: 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);
}