public function menu_frontend($parent = 0, $hasil, $cls_css = NULL) { $replace = new Replace(); $where['parent'] = $parent; $w = $this->db->get_where("nav_menu", $where); $w_q = $this->db->get_where("nav_menu", $where)->row(); if ($w->num_rows() > 0) { $hasil .= "<ul class='" . $cls_css . "'>"; } foreach ($w->result() as $h) { $where_sub['parent'] = $h->id_menu; $w_sub = $this->db->get_where("nav_menu", $where_sub); if ($w_sub->num_rows() > 0) { if ($h->type == 'link_url') { $hasil .= "<li><a href='" . base_url() . "" . $h->link_url . "'>" . $h->title . "</a>"; } else { $spages = $this->db->get_where('pages', array('id_pages' => $h->static_pages))->row(); $hasil .= "<li><a href='" . base_url('pages') . "/" . $h->static_pages . "/" . $replace->CleanUrl($spages->title) . ".html'>" . $h->title . "</a>"; } } else { if ($h->parent == 0) { if ($h->type == 'link_url') { $hasil .= "<li><a href='" . base_url() . "" . $h->link_url . "'>" . $h->title . "</a>"; } else { $spages = $this->db->get_where('pages', array('id_pages' => $h->static_pages))->row(); $hasil .= "<li><a href='" . base_url('pages') . "/" . $h->static_pages . "/" . $replace->CleanUrl($spages->title) . ".html'>" . $h->title . "</a>"; } } else { if ($h->type == 'link_url') { $hasil .= "<li><a href='" . base_url() . "" . $h->link_url . "'>" . $h->title . "</a>"; } else { $spages = $this->db->get_where('pages', array('id_pages' => $h->static_pages))->row(); $hasil .= "<li><a href='" . base_url('pages') . "/" . $h->static_pages . "/" . $replace->CleanUrl($spages->title) . ".html'>" . $h->title . "</a>"; } } } $hasil = $this->menu_frontend($h->id_menu, $hasil); $hasil .= "</li>"; } if ($w->num_rows > 0) { $hasil .= "</ul>"; } return $hasil; }
function link_callback($value, $row) { $replace = new Replace(); if ($row->type == 'link_url') { return site_url() . $row->link_url . '.html'; } else { $query = $this->db->get_where('pages', array('id_pages' => $row->static_pages))->row(); return site_url() . 'pages' . '/' . $row->static_pages . '/' . $replace->CleanUrl(substr($query->title, 0, 70)) . '.html'; } }
<?php defined('BASEPATH') or exit('No direct script access allowed'); ?> <ul class="grid-holder col-3 events-grid"> <?php $replace = new Replace(); foreach ($tampil as $row) { ?> <li class="grid-item format-standard"> <div class="grid-item-inner"> <a href="<?php echo base_url('gallery') . "/" . $row->id . "/" . $replace->CleanUrl($row->subject); ?> " class="media-box"> <img src="<?php echo site_url(); ?> assets/uploads/gallery/<?php echo $row->cover; ?> " alt=""> </a> <div class="grid-content"> <h3><a href="<?php echo base_url('gallery') . "/" . $row->id . "/" . $replace->CleanUrl($row->subject); ?> "><?php echo $row->subject; ?> </a></h3> <p><?php echo $row->deskripsi; ?>
echo site_url(); ?> assets/uploads/news/<?php echo $row->thumb; ?> " class="media-box" data-rel="prettyPhoto[Gallery]"> <img src="<?php echo site_url(); ?> assets/uploads/news/<?php echo $row->thumb; ?> " alt="" class="img-thumbnail"> </a></div> <div class="col-md-8"> <div class="post-title"> <h2><a href="<?php echo base_url('news') . "/" . $row->id_news . "/" . $replace->CleanUrl($row->title); ?> "><?php echo $row->title; ?> </a></h2> <span class="meta-data"><i class="fa fa-calendar"></i> <?php echo tgl_indo($row->date_publish); ?> | <i class="fa fa-user"></i> <?php echo $row->author; ?> | <i class="fa fa-users"></i> <?php echo $row->viewer; ?> dilihat</span>
$replace = new Replace(); $this->db->order_by('id_event', 'desc'); $query = $this->db->get_where('event', array('publish' => 'publish'), 5); foreach ($query->result() as $row) { ?> <li class="item event-item"> <div class="event-date"> <span class="date"><?php echo substr($row->tanggal, 8, 2); ?> </span> <span class="month"><?php echo substr(getBulan(substr($row->tanggal, 5, 2)), 0, 3); ?> </span> </div> <div class="event-detail"> <h4><a href="<?php echo base_url('event') . "/" . $row->id_event . "/" . $replace->CleanUrl($row->title); ?> "><?php echo $row->title; ?> </a></h4> <span class="event-dayntime meta-data"><?php echo $row->jam; ?> </span> </div> <div class="to-event-url"> <div><a href="<?php echo base_url('event') . "/" . $row->id_event . "/" . $replace->CleanUrl($row->title); ?> " class="btn btn-default btn-sm">Selengkapnya</a></div> </div>