Example #1
0
 function addPage()
 {
     $kat = $this->input->post('page');
     $menu = $this->input->post('menu');
     if (!empty($kat) && !empty($menu)) {
         $output = '';
         foreach ($kat as $k => $v) {
             $json = json_encode(array('create' => dateNow(TRUE), 'relasi' => 'page', 'pageid' => $v, 'theme' => getThemeActive()));
             $postTitle = postInfo($v, "post_title");
             $postSlug = postInfo($v, "post_slug");
             insertTerms("menu_" . $menu . "_" . getThemeActive(), $postTitle, $postSlug . "-" . getThemeActive() . "-menu", "", "", $json);
             $output .= $postSlug;
         }
         echo json_encode('ok');
         //echo json_encode($output);
     } else {
         echo json_encode('no');
     }
 }
Example #2
0
 function mc_imagepost($postid)
 {
     $CI =& get_instance();
     $CI->load->helper('posts_helper');
     $feature = postTaxonomy($postid, "feature_image");
     $sanite = imagePath($feature);
     $path = "./" . $sanite;
     if (file_exists($path)) {
         return base_url() . $sanite;
     } else {
         $konten = postInfo($postid, 'post_content');
         $img = searchImageString($konten);
         return $img;
     }
 }
Example #3
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;
 }
Example #4
0
 function generateKeyword($route, $data)
 {
     $output = '';
     $desc = '';
     $key = '';
     $titleDefault = strtolower(optionGet('site_title'));
     if ($route == "post") {
         $postid = $this->CI->m_database->fieldRow('posts', $data, 'post_id');
         $desc = postInfo($postid, 'post_title');
         $customKey = postTaxonomy($postid, 'keyword_custom');
         if (!empty($customKey)) {
             $key = $customKey . "," . $titleDefault;
         } else {
             $key = strtoupper($title) . "," . $titleDefault;
         }
     } else {
         $desc = optionGet('site_description');
         $key = $titleDefault;
     }
     $output .= '<meta name="description" content="' . $desc . '"/><meta name="keywords" content="' . $key . '"/>';
     return $output;
 }
Example #5
0
function prev_post($return_data = false)
{
    global $clerk, $blog;
    $post_list = array();
    $current_post = postInfo(selectedPost());
    $current_index = 0;
    $count = 0;
    $page = pageInfo(currentPage());
    $options = prepare_settings($page['content_options']);
    $defaults = array('order' => 'date', 'orderHow' => 'desc');
    $options = merge_settings($options, $defaults);
    $posts = $clerk->query_select("secretary_blog", "", "WHERE status= 1 ORDER BY {$options['order']} {$options['orderHow']}");
    while ($post = $clerk->query_fetchArray($posts)) {
        $post_list[] = $post;
        if ($post['id'] == $current_post['id']) {
            $current_index = $count;
        }
        $count++;
    }
    if ($current_index == 0) {
        $prev_post = $post_list[count($post_list) - 1];
    } else {
        $prev_post = $post_list[$current_index - 1];
    }
    if ($return_data) {
        $prev_post['link'] = post_link(false, $prev_post['id']);
        return $prev_post;
    }
    return post_link(false, $prev_post['id']);
}