function kcfinderurl() { $this->load->helper('mc_helper'); $img = $this->input->get('img'); $withBase = $this->input->get('baseurl'); $newurl = imagePath($img); if ($withBase == TRUE) { echo json_encode(array('original' => urlApp() . $img, 'newurl' => base_url() . $newurl)); } else { echo json_encode(array('original' => $img, 'newurl' => $newurl)); } }
</style> <script type="text/javascript"> function openKCFinder(field) { var div = document.getElementById('kcfinder_div'); if (div.style.display == "block") { div.style.display = 'none'; div.innerHTML = ''; return; } window.KCFinder = { callBack: function(url) { window.KCFinder = null; //field.value = url; $("#"+field).val(url); $("#imgfeature").attr('src','<?php echo urlApp(); ?> '+url); $("#imgfeature").show(); $("#remFeature").show(); div.style.display = 'none'; div.innerHTML = ''; if(url!=''){ $("#addFeature").hide(); } } }; div.innerHTML = '<iframe name="kcfinder_iframe" src="<?php echo locationPlugin("url") . "kcfinder"; ?> /browse.php?type=images&dir=assets/uploads/" ' +
function coverImage($img) { $imgurl = urlApp() . $img; return '<img src="' . $imgurl . '" style="width:64px"/>'; }
if ($tipe == "post") { ?> <div class="box box-primary"> <div class="box-header with-border"> <h5 class="box-title">Feature Image</h5> <div class="box-tools pull-right"> <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button> </div> </div> <div class="box-body"> <?php $feature = postTaxonomy($row->post_id, 'feature_image'); if (!empty($feature)) { ?> <img src="<?php echo urlApp() . $feature; ?> " class="thumbnail img-responsive" style="height: 300px"/> <?php } ?> <a href="javascript:;" onclick="openKCFinder('featureimage')">Set Feature Image</a> <input type="hidden" name="featureimage" id="featureimage" value="<?php echo $feature; ?> "/> </div> <div class="box-footer"> <small class="text-warning">Jika menampilkan gambar custom pada daftar berita. Beberap template nantinya membutuhkan feature image, kalau kosong maka akan ditampilkan gambar pertama dari berita atau "no image"</small> </div> </div>