示例#1
0
    foreach ($g['data'] as $r) {
        $tgl = "";
        $jam = "";
        $tglEvent = postTaxonomy($r->post_id, 'tanggal_event');
        $jamEvent = postTaxonomy($r->post_id, 'jam_event');
        if (!empty($tglEvent)) {
            $tgl = $tglEvent;
        } else {
            $tgl = "";
        }
        if (!empty($jamEvent)) {
            $jam = $jamEvent;
        } else {
            $jam = "";
        }
        $url = permalinkPost($r->post_id);
        $merge = $tgl . " " . $jam . ":00";
        $konversi = date("d-M-Y H:i", strtotime($merge));
        $jadwalNama = '<span class="widget-item-calendar">' . $konversi . '</span>';
        $day = date("d", strtotime($merge));
        $month = date("M", strtotime($merge));
        ?>
		<div class="widget-content">
		<a href="<?php 
        echo $url;
        ?>
" class="widget-anchor">
		<div class="widget-left">
			<div class="event-day"><?php 
        echo $day;
        ?>
示例#2
0
<div class="col-md-8">
	<div class="homepage-left">
		<div class="slide">
		<div id="carousel-slide" class="carousel slide" data-ride="carousel">
		<div class="carousel-inner">
		<?php 
$param = array('post_type' => 'post');
$dPost = mc_allpost($param, "post_date DESC", "", 5);
$iSlide = 0;
if ($dPost['jumlah'] > 0) {
    foreach ($dPost['data'] as $rPost) {
        $iSlide += 1;
        $postId = $rPost->post_id;
        $postTitle = $rPost->post_title;
        $postImage = mc_imagepost($postId);
        $postLink = permalinkPost($postId);
        if ($iSlide == 1) {
            ?>
					<div class="item active">
				      <img src="<?php 
            echo $postImage;
            ?>
" alt="<?php 
            echo $postTitle;
            ?>
">
				      <div class="carousel-caption">
				        <a href="<?php 
            echo $postLink;
            ?>
"><?php 
示例#3
0
 function mc_menu_link($termid)
 {
     $CI =& get_instance();
     $CI->load->helper('posts_helper');
     $relasi = menuInfoJSON($termid, "relasi");
     switch ($relasi) {
         case "page":
             $pageid = menuInfoJSON($termid, "pageid");
             if (!empty($pageid)) {
                 return permalinkPost($pageid);
             } else {
                 return base_url();
             }
             break;
         case "link":
             return menuInfoJSON($termid, "value");
         case "category":
             $uriCat = optionGet('permalink_category');
             $catid = menuInfoJSON($termid, "categoryid");
             $slugCat = categoryInfo($catid, "slug");
             if (!empty($slugCat)) {
                 return base_url() . $uriCat . "/" . $slugCat;
             } else {
                 return base_url();
             }
             break;
         case "gallery":
             $gID = menuInfoJSON($termid, "galleryid");
             return base_url() . "media/" . $gID;
         default:
             return base_url();
             break;
     }
 }
示例#4
0
 function commentPost($postid)
 {
     $url = permalinkPost($postid);
     $title = dbField('posts', 'post_id', $postid, 'post_title');
     $p = '<a href="' . $url . '">' . $title . '</a>';
     return $p;
 }
示例#5
0
echo $catName;
?>
</h3>
	<div class="widget-tools pull-right"><a href="<?php 
echo permalinkCategory($catID);
?>
">+ indexs</a></div>
</div>
<div class="widget-body">
<?php 
if (!empty($data)) {
    $i = 0;
    foreach ($data as $row) {
        $i += 1;
        $postid = $row->post_id;
        $url = permalinkPost($postid);
        $img = mc_imagepost($postid);
        $title = stringWordLimit($row->post_title, 10);
        $desc = stringWordLimit($row->post_content, 20);
        $count = mc_countPostInfo($postid, 'comment');
        ?>
<div class="widget-content">
<a href="<?php 
        echo $url;
        ?>
" class="widget-anchor with-space">
<div class="widget-left">
<span class="widget-number"><?php 
        echo $i;
        ?>
</span><?php 
示例#6
0
 function comment()
 {
     $token = tokenGenerate();
     $this->load->library('m_security');
     $this->m_security->filterPost('postid', 'required');
     $this->m_security->filterPost('name', 'required');
     $this->m_security->filterPost('email', 'required');
     $this->m_security->filterPost('data', 'required');
     $this->load->library('user_agent');
     if ($this->m_security->startPost() == TRUE) {
         $postid = $this->input->post('postid', TRUE);
         $name = $this->input->post('name', TRUE);
         $email = $this->input->post('email', TRUE);
         $dataX = $this->input->post('data', TRUE);
         $data = $this->m_security->filterXSS($dataX);
         $this->load->helper('security');
         $data = xss_clean($dataX);
         $url = permalinkPost($postid);
         $back = '<a href="' . $url . '">' . "Kembali ke halaman berita" . '</a>';
         if ($this->agent->is_robot == FALSE) {
             $proses = commentInsert($postid, $name, $email, $data);
             redirect($url, 'refresh');
         } else {
             redirect($url, 'refresh');
         }
     } else {
         redirect($url, 'refresh');
     }
 }
示例#7
0
 function viewpost()
 {
     $id = $this->input->get('id');
     redirect(permalinkPost($id), 'refresh');
 }
示例#8
0
 function generateFeed($type = "atom", $view)
 {
     //$this->CI->load->library('ext/feed');
     require_once dirname(__FILE__) . '/ext/Feedweb.php';
     $this->CI->load->helper('text');
     $feed = new Feedweb();
     $this->CI->load->library('m_database');
     $maxDate = $this->CI->m_database->maxRow('posts', '', 'post_date');
     $feed->title = optionGet('site_title');
     $feed->description = optionGet('site_description');
     $feed->link = base_url();
     $feed->lang = "id";
     $feed->pubdate = $maxDate;
     $param = array('post_status' => 'publish');
     $dPost = mc_allpost($param, 'post_date DESC', '', 20);
     if ($dPost['jumlah'] > 0) {
         foreach ($dPost['data'] as $rPost) {
             $title = $rPost->post_title;
             $author = "";
             $url = permalinkPost($rPost->post_id);
             $date = $rPost->post_date;
             $desc = word_limiter($rPost->post_content, 50);
             if (!empty($rPost->post_user)) {
                 $author = dbField('userlogin', 'user_id', $rPost->post_user, 'nama');
             } else {
                 $author = "Administrator";
             }
             $feed->add($title, $author, $url, $date, $desc);
         }
     } else {
         $feed->add(optionGet('site_title'), optionGet('site_title'), base_url(), dateNow(TRUE), optionGet('site_description'));
     }
     $feed->render($type, $view);
 }
示例#9
0
 function pageContent($postID, $menuID, $menuTitle)
 {
     $p = '';
     $title = postInfo($postID, 'post_title');
     $urlPage = permalinkPost($postID);
     $p .= '<i>Navigation Label</i><br>';
     $p .= '<input type="text" class="form-control" id="page_' . $menuID . '" value="' . $menuTitle . '"/>';
     $p .= '<small class="form-control">';
     $p .= '<i>Original</i> : ';
     $p .= '<a href="' . $urlPage . '" target="_blank">' . $title . '</a>';
     $p .= '</small>';
     return $p;
 }
示例#10
0
<section class="blog">
<div class="row">
<div class="col-md-8">
<div class="blog-left">
<?php 
if (!empty($data)) {
    $p = array('post_content LIKE' => '%' . $data . '%');
    $dPost = mc_allpost($p, "post_date DESC", "", 20);
    if ($dPost['jumlah'] > 0) {
        echo "<h3>Data Pencarian : <i>" . $data . "</i></h3><hr/>";
        foreach ($dPost['data'] as $rPost) {
            $postID = $rPost->post_id;
            $postTitle = $rPost->post_title;
            $postContent = $rPost->post_content;
            $link = permalinkPost($postID);
            ?>
		<a href="<?php 
            echo $link;
            ?>
"><strong><?php 
            echo $postTitle;
            ?>
</strong></a><hr/>
		<?php 
        }
    } else {
        echo "<h3>Data Pencarian : <i>" . $data . "</i> Kosong</h3><hr/>";
    }
} else {
    echo "Tidak ada kata kunci pencarian";
}