예제 #1
0
파일: umvoc.php 프로젝트: philum/cms
function ud_imz($f, $n = '2')
{
    list($w, $hb) = fwidth($f);
    $w = round($w / $n);
    $h = round($h / $n);
    return image('/' . $f, $w, $h);
}
예제 #2
0
파일: umdico.php 프로젝트: philum/cms
function udc_imz($f, $n = '2')
{
    list($w, $hb) = fwidth($f);
    $w = round($w / $n);
    $h = round($h / $n);
    return divs('width:' . $w . 'px;', image('/' . $f, $w, $h));
}
예제 #3
0
파일: ajxf.php 프로젝트: philum/cms
function photo_screen($im, $w, $h, $sz)
{
    $ng = ses('negcss') ? '_neg' : '';
    $klr = $_SESSION['clrs'][$_SESSION['prmd'] . $ng];
    $clr = hexrgb($klr[1], 9);
    list($sw, $sh, $ph, $id) = explode('-', $sz);
    $sw -= 60;
    $sh -= 40;
    $id = is_numeric($id) ? $id : $_SESSION['read'];
    if (!$id) {
        list($hub, $id, $nm) = explode('_', $im);
    }
    if (!$w && !$h) {
        list($w, $h) = fwidth($im);
    }
    if ($w && $h) {
        $r1 = $w / $h;
    }
    $r2 = $sw / $sh;
    $ml = ($sw - $w) / 2;
    $mt = ($sh - $h) / 2;
    $nw = $w;
    $nh = $h;
    if ($r1 > $r2) {
        if ($w > $sw) {
            $ml = 0;
            $nw = $sw;
            $nh = $h * ($sw / $w);
            $mt = ($sh - $nh) / 2;
        }
    } else {
        if ($h > $sh) {
            $mt = 0;
            $nh = $sh;
            $nw = $w * ($sh / $h);
            $ml = ($sw - $nw) / 2;
        }
    }
    if ($id) {
        $o = photos_art_bt(substr($im, 4), $sz, $id);
    }
    $rid = 'imz' . randid();
    $o .= lkt('', $im, picto('url')) . ' ';
    if ($w > $nw or $h > $nh) {
        $o .= lj('', 'popup_overim__x_' . ajx($im) . '_' . $sz, picto('fullscreen')) . ' ';
    }
    $cs1 = atd('popu') . ats('position:absolute; width:' . $nw . 'px; height:' . $nh . 'px; box-shadow:0 0 100px 10px #000; z-index:-1; background:' . $clr . ';"');
    $popa = popa(' ', $o, 'background:' . $clr . '; padding:0 4px;');
    //strrchr_b($im,'/')
    if (substr($im, 0, 4) != 'http') {
        $im = '/' . $im;
    }
    return $popa . div($cs1, divd($rid, image($im, round($nw), round($nh))));
}