1. Halo Guest, pastikan Anda selalu menaati peraturan forum sebelum mengirimkan post atau thread baru.

[ASK] Skrip PHP ini artinya apa ya?

Discussion in 'Pemrograman Web' started by aflyingdreamer, Aug 24, 2011.

  1. aflyingdreamer

    aflyingdreamer Ads.id Fan

    Joined:
    Jul 2, 2010
    Messages:
    241
    Likes Received:
    47
    Location:
    Indonesia
    <?php
    if (get_option('sil_logo_header') && function_exists('getimagesize')) {
    list($w, $h) = @getimagesize(get_option('sil_logo_header'));
    $height = $h/2;
    } else {
    $height = 30;
    }
    if(get_option('sil_site_width')) { $site = get_option('sil_site_width'); } else { $site = 800; }
    if(get_option('sil_sidebar_width1')) { $sidebar = get_option('sil_sidebar_width1'); } else { $sidebar = 180; }
    $secondsidebar = get_option('sil_sidebar_width2');
    if(get_option('sil_site_sidebars') != 1) {
    $content = $site - $sidebar - $secondsidebar - 84;
    } else {
    $content = $site - $sidebar - 67;
    }
    ?>
    <style type='text/css'>
    #body, #header, #bottombar, #footer .text { width: <?php echo $site; ?>px; }
    #sidebar, #sidebar .side-widget { width: <?php echo $sidebar; ?>px; }
    #secondsidebar, #secondsidebar .side-widget { width: <?php echo $secondsidebar; ?>px; }
    #leftcontent, .commentlist { width: <?php echo $content; ?>px; }
    #leftcontent img { max-width: <?php echo $content-20; ?>px; }
    <?php

    if($site==800) {
    echo '#bgwrap { background: url('.get_bloginfo('template_url').'/images/800bg.png) repeat-y #333 center; }'."\n";
    if(get_option('sil_extended_footer')=='0') { echo '#footerbar { background: url('.get_bloginfo('template_url').'/images/800bottom.png) no-repeat top center #333; height: 65px; }'."\n"; } else { echo '#footerbar { background: url('.get_bloginfo('template_url').'/images/800bottom-alt.png) no-repeat top #333; }'."\n"; }
    } else {
    echo '#bgwrap { background: url('.get_bloginfo('template_url').'/images/1024bg.png) repeat-y #333 center; }'."\n";
    if(get_option('sil_extended_footer')=='2') { echo '#footerbar { background: url('.get_bloginfo('template_url').'/images/1024bottom.png) no-repeat top center #333; height: 65px; }'."\n"; } else { echo '#footerbar { background: url('.get_bloginfo('template_url').'/images/1024bottom-alt.png) no-repeat top #333; }'."\n"; }
    }
    if (get_option('sil_logo_location') == "3") {
    echo " #title { text-align: center }\n";
    echo " #description { clear: both; text-align: center; }\n";
    echo " #searchform { display:none; }\n";
    } elseif(get_option('sil_logo_location') == "2") {
    echo " #title { float: right; }\n";
    echo " #description { clear: right; float: right; text-align: right }\n";
    echo " #searchform { float: left; padding: ". $height . "px 0 0 20px;}\n";
    } else {
    echo " #title { float: left; }\n";
    echo " #description { clear: left; float: left; }\n";
    echo " #searchform { float: right; padding: ". $height . "px 20px 0 0; }\n";
    }

    if(get_option('sil_sidebar_location') == 3) {
    echo '#leftcontent { margin: 0 0 0 4px; }';
    } elseif(get_option('sil_sidebar_location') == 5) {
    echo '#leftcontent { margin: 0 12px; }';
    } else {
    echo '#leftcontent { margin: 0 4px 0 20px; }';
    }

    ?>
    </style>

    Ada yg ngerti ga :senyum:
     
  2. nicefirework

    nicefirework Super Hero

    Joined:
    Aug 21, 2010
    Messages:
    1,304
    Likes Received:
    251
    itu dynamic styling untuk memformat CSS, untuk tampilan web saja.
     
  3. wididwi

    wididwi Ads.id Pro

    Joined:
    Nov 6, 2009
    Messages:
    273
    Likes Received:
    39
    yup sama seperti pendapat agam nicefirework .... kl dari yg saya baca ... programernya mau buat model tampilan yang dinamis. desain yang mengikuti resolusi layar visitor.
     
  4. Kiwisoft

    Kiwisoft Newbie

    Joined:
    Dec 19, 2010
    Messages:
    8
    Likes Received:
    0
    Location:
    Sydney
    pada jago php nih
     
  5. mp3online

    mp3online Super Hero

    Joined:
    Jul 19, 2011
    Messages:
    2,228
    Likes Received:
    294
    Location:
    jakarta
    tapi pembuatnya kurang teliti tuh, ada sedikit kesalahan seharusnya ditambah juga
    elseif($site < 800) { }

    script yang itu kan kalau dibuka pakai browser hp akan dianggap pakai pc dengan monitor resolusi di atas 800, karena scriptnya cuma ada dua pilihan:

    1. jika resulusi layar lebarnya 800 pakai gambar ukuran 800 pixel
    2. selain resulusi tersebut pakai gambar ukuran 1024 pixel, termasuk browser hp yang cuma punya resolusi 240x320 pixel atau dibawahnyapun juga akan dimuati dengan gambar ukuran 1024 pixel. apa jadinya kalau kasusnya kayak gini? :)
    bener kata nicefirework itu untuk tampilan web saja, tapi kan pengunjung situs kita belum tentu pakai pc semua.
    jadi perlu diperhatikan juga visitor yang pakai hp, bisa kedodoran tuh pulsanya n kapok balik lagi :))
     
  6. nababan

    nababan Ads.id Fan

    Joined:
    Mar 8, 2011
    Messages:
    136
    Likes Received:
    57
    Location:
    Flashdisk

    disediakan aja versi mobile buat website kita :D
     

Share This Page