Exemple #1
0
 function add()
 {
     $this->load->library('m_security');
     $this->m_security->filterPost('addname', 'required');
     if ($this->m_security->startPost() == TRUE) {
         $name = $this->input->post('addname', TRUE);
         $slug = "";
         $slugX = $this->input->post('addslug', TRUE);
         if (!empty($slugX)) {
             $slug = $slugX;
         } else {
             $slug = stringCreateSlug($name);
         }
         $parent = $this->input->post('addparent', TRUE);
         $desc = $this->input->post('adddescription', TRUE);
         $proses = insertTerms("category", $name, $slug, $desc, $parent);
         if ($proses == TRUE) {
             echo json_encode("ok");
         } else {
             echo json_encode("no");
         }
     } else {
         echo json_encode("no");
     }
 }
 function widgetAdd($name, $description = '')
 {
     $CI =& get_instance();
     $CI->load->helper('posts_helper');
     $ssName = $name . "_widget";
     $nameWidget = $name . "-widget";
     $slugname = stringCreateSlug($name);
     $jsonData = json_encode(array('service' => strtolower($name), 'description' => $description));
     insertTerms($ssName, $slugname, $slugname);
 }
Exemple #3
0
 function postTags($postid)
 {
     $CI =& get_instance();
     $uriCat = optionGet('permalink_tags');
     $s = array('post_id' => $postid, 'term_type' => 'tag');
     $p = '';
     $c = $CI->m_database->countData('poststaxonomy', $s);
     if ($c > 0) {
         $d = $CI->m_database->fetchData('poststaxonomy', $s);
         foreach ($d as $r) {
             $slug = stringCreateSlug($r->term_value);
             $uri = base_url() . $uriCat . '/' . $slug;
             $p .= '<a href="' . $uri . '" class="btn btn-xs btn-flat btn-success" target="_blank">' . $r->term_value . '</a> ';
         }
     }
     return $p;
 }
Exemple #4
0
 function createslug()
 {
     $str = $this->input->get('title');
     $slug = stringCreateSlug($str);
     echo json_encode($slug);
 }
Exemple #5
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');
 }
Exemple #6
0
 function insertTagPost($postid, $tags = '')
 {
     $p = '';
     if (!empty($tags)) {
         foreach ($tags as $row) {
             $p .= $row['text'] . ",";
             $slug = stringCreateSlug($row['text']);
             $s = array('term_type' => 'tag', 'term_value' => $row['text']);
             if ($this->m_database->isBOF('poststaxonomy', $s) == TRUE) {
                 $d = array('post_id' => $postid, 'term_type' => 'tag', 'term_value' => $row['text']);
                 $this->m_database->addRow('poststaxonomy', $d);
                 insertTags($row['text'], $slug, "", "0");
             }
         }
     }
 }
Exemple #7
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;
     }
 }
Exemple #8
0
 function updateTerms($termid, $type, $name, $slugx, $description = '', $parent = '0', $termdata = '')
 {
     $CI =& get_instance();
     $slug = "";
     if (empty($slugx)) {
         $slug = stringCreateSlug($name);
     } else {
         $slug = $slugx;
     }
     $s = array('term_id' => $termid);
     if ($CI->m_database->isBOF('terms', $s) == FALSE) {
         $d = array('name' => $name, 'slug' => $slug, 'term_parent' => $parent, 'term_data' => $termdata);
         $s1 = array('term_id' => $termid);
         if ($CI->m_database->editRow('terms', $d, $s1) == TRUE) {
             $d2 = array('term_type' => $type, 'description' => $description, 'parent' => $parent);
             if ($CI->m_database->editRow('termstaxonomy', $d2, $s1) == TRUE) {
                 return true;
             } else {
                 return false;
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
Exemple #9
0
<table class="table table-bordered table-hover data-render">
<thead>
	<th>File</th>
	<th>Tanggal</th>
	<th>Alt</th>
	<th>Tipe</th>
	<th>#</th>
</thead>
<tbody>
<?php 
$s = array('gallery_id' => $galleryID);
$c = $this->m_database->countData('gallery_images', $s);
if ($c > 0) {
    $d = $this->m_database->fetchData('gallery_images', $s, 'gallery_date DESC');
    foreach ($d as $r) {
        $slugFolder = stringCreateSlug($row->gallery_title);
        $path = locationUpload('url') . 'gallery/' . $slugFolder . '/' . $r->gallery_file;
        $pathX = locationUpload('path') . 'gallery/' . $slugFolder . '/' . $r->gallery_file;
        $url = locationUpload('url') . 'gallery/' . $slugFolder . '/thumbs/64/' . $r->gallery_file;
        ?>
		<tr>
			<td width="64px">
			<a href="<?php 
        echo $path;
        ?>
" rel="prettyPhoto[<?php 
        echo $r->gallery_images_id;
        ?>
]">
			<img class="lazy" data-original="<?php 
        echo $url;