Esempio n. 1
0
 function update()
 {
     $this->load->library('m_database');
     $did = $this->input->post('id');
     $title = $this->input->post('title');
     $name = dbField('terms', 'term_id', $did, 'name');
     $slug = dbField('terms', 'term_id', $did, 'slug');
     $parent = dbField('terms', 'term_id', $did, 'term_parent');
     $json = json_encode(array('prefix' => 'event', 'title' => $title));
     updateTerms($did, "sidebar", $name, $slug, "", $parent, $json);
     echo json_encode('ok');
 }
Esempio n. 2
0
 function media($s1 = '')
 {
     $d['data']['route'] = "media";
     $d['data']['data'] = $s1;
     $title = "";
     $CatName = dbField('album', "album_id", $s1, "album_title");
     if (!empty($CatName)) {
         $title = $CatName;
     } else {
         $title = optionGet('site_title');
     }
     $d['title'] = $title;
     $this->load->view('templateloader', $d);
 }
Esempio n. 3
0
 function update()
 {
     $this->load->library('m_database');
     $this->load->helper('file_helper');
     $did = $this->input->post('id');
     $source = $this->input->post('source');
     $title = $this->input->post('title');
     $img = $this->input->post('img');
     $name = dbField('terms', 'term_id', $did, 'name');
     $slug = dbField('terms', 'term_id', $did, 'slug');
     $imgX = $img;
     $parent = dbField('terms', 'term_id', $did, 'term_parent');
     $json = json_encode(array('prefix' => 'images', 'title' => $title, 'source' => $source, 'image' => $imgX));
     updateTerms($did, "sidebar", $name, $slug, "", $parent, $json);
     echo json_encode('ok');
 }
Esempio n. 4
0
 function galleryAlbum($galleryID)
 {
     $CI =& get_instance();
     $s = array('term_key' => 'gallery_list', 'term_value' => $galleryID);
     $p = '';
     $c = $CI->m_database->countData('albumtaxonomy', $s);
     if ($c > 0) {
         $d = $CI->m_database->fetchData('albumtaxonomy', $s, 'album_id ASC');
         foreach ($d as $r) {
             $albumTitle = dbField('album', 'album_id', $r->album_id, 'album_title');
             $slug = stringCreateSlug($albumTitle);
             $url = base_url() . 'media/album/' . $slug;
             $p .= '<a target="_blank" href="' . $url . '" class="btn btn-xs btn-success btn-flat">' . $albumTitle . '</a> ';
         }
     } else {
         $p .= '';
     }
     return $p;
 }
Esempio n. 5
0
    <div class="form-horizontal">
    <label>Label</label>
    <input type="text" id="categorytitle<?php 
echo $widgetid;
?>
" class="form-control" value="<?php 
echo $wdTitle;
?>
"/>
    <label>Category</label>    
    <select id="categorysource<?php 
echo $widgetid;
?>
" class="form-control">    			
		<?php 
$gb = dbField('terms', 'term_id', $wdSource, "name");
echo '<option value="' . $wdSource . '">' . $gb . '</option>';
$p = '';
$db = getCategory('0', '', $wdSource);
if (!empty($db)) {
    foreach ($db as $rParent) {
        $p .= '<option value="' . $rParent->term_id . '">' . $rParent->name . '</option>';
        $dChild = getCategory($rParent->term_id);
        if (!empty($dChild)) {
            foreach ($dChild as $rChild) {
                $p .= '<option value="' . $rChild->term_id . '">&#8212; ' . $rChild->name . '</option>';
            }
        }
    }
}
echo $p;
Esempio n. 6
0
 function mc_gallery($id, $thumbsize = 200)
 {
     $CI =& get_instance();
     $s = array('album_id' => $id, 'term_key' => "gallery_list");
     $item = $CI->m_database->fieldRow('albumtaxonomy', $s, 'term_value');
     $s2 = array('gallery_id' => $item);
     $dG = $CI->m_database->fetchData('gallery_images', $s2);
     $j = array();
     $galName = dbField('gallery', 'gallery_id', $item, 'gallery_title');
     foreach ($dG as $rG) {
         $j[] = array('image_id' => $rG->gallery_images_id, 'image_file' => locationUpload('url') . 'gallery/' . $galName . '/' . $rG->gallery_file, 'image_file_thumb' => locationUpload('url') . 'gallery/' . $galName . '/thumbs/' . $thumbsize . '/' . $rG->gallery_file);
     }
     return $j;
 }
Esempio n. 7
0
 function commentPostAction($commentID)
 {
     $p = '';
     $rolename = roleURIUser();
     $status = dbField('postcomment', 'post_comment_id', $commentID, 'comment_status');
     if ($status == "publish") {
         $p .= '<a class="btn btn-xs btn-warning" href="' . base_url($rolename . 'comments/spamthis') . '?id=' . $commentID . '&token=' . tokenGenerate() . '">Spam</a> ';
     } elseif ($status == "spam") {
         $p .= '<a class="btn btn-xs btn-info" href="' . base_url($rolename . 'comments/approve') . '?id=' . $commentID . '&token=' . tokenGenerate() . '">Publish</a> ';
     } elseif ($status == "pending") {
         $p .= '<a class="btn btn-xs btn-info" href="' . base_url($rolename . 'comments/approve') . '?id=' . $commentID . '&token=' . tokenGenerate() . '">Publish</a> ';
     }
     $p .= '<a onclick="return confirm(\'Yakin ingin menghapus komentar ini?\');" class="btn btn-xs btn-danger" href="' . base_url($rolename . 'comments/delete') . '?id=' . $commentID . '&token=' . tokenGenerate() . '">Delete</a>&nbsp;';
     return $p;
 }
Esempio n. 8
0
 function editlink()
 {
     $title = $this->input->post('title');
     $url = $this->input->post('url');
     $menu = $this->input->post('menu');
     $pos = $this->input->post('pos');
     $parent = $this->input->post('parent');
     $slug = stringCreateSlug($title);
     $jsondata = json_encode(array('create' => dateNow(TRUE), 'relasi' => 'link', 'value' => $url));
     //updateTerms($menu,'menu_'.$pos,$title,$slug."_menu","",$parent,$jsondata);
     $tipe = "menu_" . $pos . "_" . getThemeActive();
     $catSlug = dbField('terms', 'term_id', $menu, 'slug');
     updateTerms($menu, $tipe, $title, $catSlug, "", $parent, $jsondata);
     echo json_encode('ok');
 }
Esempio n. 9
0
<div class="panel-group" id="accordion">
<?php 
$this->load->library('m_net');
$data = getTerms("sidebar", $termid, "order_term ASC");
if (!empty($data)) {
    foreach ($data as $row) {
        $wi = $row->term_id;
        $prefix = menuInfoJSON($wi, 'prefix');
        $jsondata = dbField('terms', 'term_id', $wi, 'term_data');
        $sb = $this->m_database->fetchData('terms', array('term_id' => $wi));
        $param = array('data' => $jsondata, 'widgetdata' => $sb, 'parentid' => $termid);
        $j = $this->m_net->curlNet("get", base_url() . 'service/widget/' . $prefix . '/configwidget', $param);
        echo $j;
    }
} else {
    echo "Tidak ada widget";
}
?>
</div>
<input type="hidden" id="widgetpos" value="<?php 
echo $pos;
?>
"/>
<input type="hidden" id="widgetid" value="<?php 
echo $termid;
?>
"/>
Esempio n. 10
0
 function insertCategoryPost($postid, $category = '')
 {
     if (!empty($category)) {
         foreach ($category as $k => $v) {
             $slug = dbField('terms', 'term_id', $v, 'slug');
             $d = array('post_id' => $postid, 'term_type' => 'category', 'term_value' => $v);
             if ($this->m_database->isBOF('poststaxonomy', $d) == TRUE) {
                 $this->m_database->addRow('poststaxonomy', $d);
                 insertCategory($v, $slug, "", "0");
             }
         }
     } else {
         $d = array('post_id' => $postid, 'term_type' => 'category', 'term_value' => '1');
         if ($this->m_database->isBOF('poststaxonomy', $d) == TRUE) {
             $this->m_database->addRow('poststaxonomy', $d);
         }
     }
 }
Esempio n. 11
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);
 }
Esempio n. 12
0
 function deleteGalleryFile($imgID, $galleryID)
 {
     $s = array('gallery_images_id' => $imgID, 'gallery_id' => $galleryID);
     if ($this->m_database->isBOF('gallery_images', $s) == TRUE) {
         return false;
     } else {
         $img = $this->m_database->fieldRow('gallery_images', $s, 'gallery_file');
         $galleryName = dbField('gallery', 'gallery_id', $galleryID, 'gallery_title');
         $slug = stringCreateSlug($galleryName);
         $this->load->library('m_file');
         $path = locationUpload('path') . 'gallery/' . $slug . '/';
         $this->m_file->deleteImage($path, $img);
         $this->m_database->deleteRow('gallery_images', $s);
         return true;
     }
 }
Esempio n. 13
0
 function GalleryContent($GalerryID, $menuID, $menuTitle)
 {
     $p = '';
     $uriCat = "media";
     $galleryName = dbField('album', 'album_id', $GalerryID, 'album_title');
     $urlPage = base_url() . $uriCat . '/' . $GalerryID;
     $p .= '<i>Navigation Label</i><br>';
     $p .= '<input type="text" class="form-control" id="gallery_' . $menuID . '" value="' . $menuTitle . '"/>';
     $p .= '<small class="form-control">';
     $p .= '<i>Original</i> : ';
     $p .= '<a href="' . $urlPage . '" target="_blank">' . $galleryName . '</a>';
     $p .= '</small>';
     return $p;
 }
Esempio n. 14
0
 function menuInfoJSON($menuID, $key)
 {
     $json = dbField('terms', 'term_id', $menuID, 'term_data');
     $dec = jsonDataDecode($json, $key);
     return $dec;
 }
Esempio n. 15
0
 function roleURIUser()
 {
     $CI =& get_instance();
     $CI->load->helper('db_helper');
     $CI->load->library('session');
     $opt = optionGet('session_role');
     $item = $CI->session->userdata($opt);
     if (!empty($item)) {
         $rolename = dbField('userrole', 'role_id', $item, 'role_module');
         if (!empty($rolename)) {
             return str_replace("dashboard", "", $rolename);
         } else {
             return "";
         }
     } else {
         return "";
     }
 }
Esempio n. 16
0
	<label for="addslug" style="cursor: pointer;">Slug</label>
	<input type="text" class="form-control" name="editslug" id="editslug" value="<?php 
echo $row->slug;
?>
"/>
</div>
<div class="form-group">
	<label for="addparent" style="cursor: pointer;">Parent</label>
	<select name="editparent" class="form-control">
	<?php 
$parent = $row->term_parent;
$nameParent = '';
if ($parent == "0") {
    $nameParent = "None";
} else {
    $nameParent = dbField('terms', 'term_id', $parent, 'name');
}
?>
	<option value="<?php 
echo $parent;
?>
"><?php 
echo $nameParent;
?>
</option>
	<?php 
$p = '';
$dParent = getCategory('0', 'name ASC', $parent);
if (!empty($dParent)) {
    foreach ($dParent as $rParent) {
        $p .= '<option value="' . $rParent->term_id . '">' . $rParent->name . '</option>';