Beispiel #1
0
 /**
  */
 public function next()
 {
     $type = 'news';
     $pagination = $this->input->post('page', TRUE);
     $ulclass = $this->input->post('ulclass', TRUE);
     if (isset($ulclass) && $ulclass == 'true') {
         $sponserList = 'style="display:none"';
         $description = 'style="display:block"';
     } else {
         $sponserList = 'style="display:block"';
         $description = 'style="display:none"';
     }
     if (isset($pagination) && $pagination != '') {
         $next_set = $pagination;
     } else {
         $next_set = $this->uri->segment(3) ? $this->uri->segment(3) : 0;
     }
     $count = $this->feedModel->getAllDataCount($type);
     $config = array();
     $config["base_url"] = base_url() . "home/next";
     $config["total_rows"] = $count;
     $config["per_page"] = 22;
     $config['use_page_numbers'] = true;
     $config["uri_segment"] = 3;
     $config['num_links'] = '10';
     $config['last_link'] = '';
     $this->pagination->initialize($config);
     $page = $next_set;
     $limit = $config["per_page"];
     $offset = $limit * ($page - 1);
     $feeds_list = $this->getAllData($limit, $offset, $type);
     $pagination_links = $this->pagination->create_links();
     $postsdata = '';
     $countForAd = 1;
     if (!empty($feeds_list)) {
         $default_image = getDefaultImage();
         $default_url = 'javascript:void(0)';
         foreach ($feeds_list as $feed) {
             $feed_url = isset($feed->feed_url) ? $feed->feed_url : $default_url;
             $feed_title = isset($feed->feed_title) ? $feed->feed_title : 'title';
             //                Get the title
             $feed_image_title = isset($feed->feed_user_title) ? $feed->feed_user_title : 'Admin';
             $feed_title_truncated = substr($feed_image_title, 0, 40);
             $alt_image = isset($feed->feed_image_title) ? $feed->feed_image_title : '';
             // Feed content to remove the html tags and get the first image
             $html = $feed->feed_content;
             preg_match_all('/<img[^>]+>/i', $html, $result);
             $feed_image = $result;
             $date = isset($feed->feed_date) ? $feed->feed_date : date('Y-m-d');
             $feed_image = isset($feed_image[0][0]) ? $feed_image[0][0] : $default_image;
             //                $avater = isset($feed->feed_image_urls) ? $feed->feed_image_urls : site_url('assets/img/avatar.jpg');
             $avatar = feedIconByUrl($feed->feed_admin_url);
             if (!empty($avatar)) {
                 $favicon = site_url() . 'uploads/feed/' . $avatar;
             } else {
                 $favicon = site_url('assets/img/avatar.jpg');
             }
             $postsdata .= '<li>';
             $postsdata .= '<div class="item video clear_fix">';
             $postsdata .= '<div class="img fl_left">';
             $postsdata .= '<a href="' . site_url() . 'feeds/preview/' . $feed->feed_content_hash . '">';
             if (file_exists($feed_image)) {
                 $feed_image;
             } else {
                 $default_image;
             }
             $postsdata .= '</a>';
             $postsdata .= '</div>';
             $postsdata .= '<div class="info">';
             $postsdata .= '<div class="name">';
             $postsdata .= '<a href="' . site_url() . 'feeds/preview/' . $feed->feed_content_hash . '">' . $feed->feed_title . '</a>';
             $postsdata .= '</div>';
             $postsdata .= '<div class = "text">' . strip_tags(substr($html, 0, 800)) . '</div>';
             $postsdata .= '<div class="bottom table clear_fix">';
             $postsdata .= ' <div class="author clear_fix">';
             $postsdata .= '<div class="author_img fl_left">';
             $postsdata .= '<a href="#">';
             $postsdata .= '<img alt="Ashley Clements" src="' . site_url() . '/assets/img/avatar.jpg' . '">';
             $postsdata .= '</a>';
             $postsdata .= '</div>';
             $postsdata .= '<div>';
             $postsdata .= '<div class="author_name">';
             $postsdata .= '<a href="#">' . $feed_title . '</a>';
             $postsdata .= '</div>';
             $postsdata .= '<div class="date">' . nicetime($date) . '</div>';
             $postsdata .= '</div>';
             $postsdata .= '</div>';
             $postsdata .= '<div class="icon">';
             $postsdata .= '<a href="#"></a>';
             $postsdata .= '</div>';
             $postsdata .= '</div>';
             $postsdata .= '</div>';
             $postsdata .= '</div>';
             $postsdata .= '</li>';
             $countForAd++;
         }
         echo $postsdata;
         return;
     } else {
         return;
     }
 }
Beispiel #2
0
                                            <table id="example" class="table table-bordered table-hover dataTable" aria-describedby="example_info">
                                                <thead>
                                                    <tr>
                                                        <th>#</th>
                                                        <th>Url</th>
                                                        <th>Favicon</th>
                                                        <th>Edit</th>
                                                        <th>Delete</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <?php 
    $count = 1;
    foreach ($feeds_list as $feed) {
        $feedId = feedIdByUrl($feed->feed_admin_url);
        $feed_favicon = feedIconByUrl($feed->feed_admin_url);
        $concate = 'uploads/feed/';
        if ($feed_favicon != '') {
            $image = '<img class="categoryClass" src="' . site_url() . $concate . $feed_favicon . '"/>';
        } else {
            $image = getCategoryDefaultImage();
        }
        ?>
                                                        <tr>
                                                            <td><?php 
        echo $count;
        ?>
 </td>
                                                            <td> <?php 
        echo $feed->feed_admin_url;
        ?>
Beispiel #3
0
 /**
  */
 public function next()
 {
     $type = 'picture';
     $pagination = $this->input->post('page', TRUE);
     $ulclass = $this->input->post('ulclass', TRUE);
     if (isset($ulclass) && $ulclass == 'true') {
         $sponserList = 'style="display:none"';
         $description = 'style="display:block"';
     } else {
         $sponserList = 'style="display:block"';
         $description = 'style="display:none"';
     }
     if (isset($pagination) && $pagination != '') {
         $next_set = $pagination;
     } else {
         $next_set = $this->uri->segment(3) ? $this->uri->segment(3) : 0;
     }
     $count = $this->feedModel->getAllDataCount($type);
     $config = array();
     $config["base_url"] = base_url() . "home/next";
     $config["total_rows"] = $count;
     $config["per_page"] = 22;
     $config['use_page_numbers'] = true;
     $config["uri_segment"] = 3;
     $config['num_links'] = '10';
     $config['last_link'] = '';
     $this->pagination->initialize($config);
     $page = $next_set;
     $limit = $config["per_page"];
     $offset = $limit * ($page - 1);
     $feeds_list = $this->getAllData($limit, $offset, $type);
     $pagination_links = $this->pagination->create_links();
     $postsdata = '';
     $countForAd = 1;
     if (!empty($feeds_list)) {
         $default_image = getDefaultImage();
         $default_url = 'javascript:void(0)';
         foreach ($feeds_list as $feed) {
             $feed_url = isset($feed->feed_url) ? $feed->feed_url : $default_url;
             $feed_title = isset($feed->feed_title) ? $feed->feed_title : 'title';
             //                Get the title
             $feed_image_title = isset($feed->feed_user_title) ? $feed->feed_user_title : 'Admin';
             $feed_title_truncated = substr($feed_image_title, 0, 40);
             $alt_image = isset($feed->feed_image_title) ? $feed->feed_image_title : '';
             // Feed content to remove the html tags and get the first image
             $html = $feed->feed_content;
             preg_match_all('/<img[^>]+>/i', $html, $result);
             $feed_image = $result;
             $date = isset($feed->feed_date) ? $feed->feed_date : date('Y-m-d');
             $feed_image = isset($feed_image[0][0]) ? $feed_image[0][0] : $default_image;
             //                $avater = isset($feed->feed_image_urls) ? $feed->feed_image_urls : site_url('assets/img/avatar.jpg');
             $avatar = feedIconByUrl($feed->feed_admin_url);
             if (!empty($avatar)) {
                 $favicon = site_url() . 'uploads/feed/' . $avatar;
             } else {
                 $favicon = site_url('assets/img/avatar.jpg');
             }
             if ($countForAd == 4) {
                 $postsdata .= '<li class="sponserList"' . $sponserList . '>';
                 $postsdata .= '<div class="item sponsor">';
                 $postsdata .= '<div class="img">';
                 $postsdata .= '<a href="javascript:void(0)">' . sidebarAd() . '</a>';
                 $postsdata .= '</div>';
                 $postsdata .= '<div class="ads text_center">';
                 $postsdata .= '<a href="javascript:void(0)">SPONSOR ADS</a>';
                 $postsdata .= '</div>';
                 $postsdata .= '</div>';
                 $postsdata .= '</li>';
             }
             if ($countForAd == 13) {
                 $postsdata .= '<li class="sponserList"' . $sponserList . '>';
                 $postsdata .= '<div class="small_height">';
                 $postsdata .= '<div class="item">';
                 $postsdata .= '<div class="img_class">';
                 $postsdata .= '<a href="javascript:void(0)">' . pageinsideAd() . '</a>';
                 $postsdata .= '</div>';
                 $postsdata .= '</div>';
                 $postsdata .= '</div>';
                 $postsdata .= '<div class="small_height">';
                 $postsdata .= '<div class="item">';
                 $postsdata .= '<div class="img_class">';
                 $postsdata .= '<a href="javascript:void(0)">' . pageinsideTwo() . '</a>';
                 $postsdata .= '</div>';
                 $postsdata .= '</div>';
                 $postsdata .= '</div>';
                 $postsdata .= '</li>';
             }
             $postsdata .= '<li>';
             $postsdata .= '<div class="item">';
             $postsdata .= '<div class="img getImage">';
             $postsdata .= '<a href ="' . $feed_url . '">' . $feed_image . '</a>';
             $postsdata .= ' </div>';
             $postsdata .= '<div class="rightSide">';
             $postsdata .= '<div class="name">';
             $postsdata .= '<a href="' . $feed_url . '">' . $feed_title . '</a>';
             $postsdata .= '</div>';
             $postsdata .= '<div class="description textStyle" ' . $description . '>' . strip_tags(substr($html, 0, 800)) . '</div>';
             $postsdata .= '</div>';
             $postsdata .= '<div class="bottom table wd100_wd clear_fix">';
             $postsdata .= '<div class="author wd80_wd clear_fix">';
             $postsdata .= '<div class="author_img fl_left">';
             $postsdata .= '<a href="' . $feed_url . '">';
             $postsdata .= '<img class="avatar_class" src = "' . $favicon . '" alt = "' . $alt_image . '">';
             $postsdata .= '</a>';
             $postsdata .= '</div>';
             $postsdata .= '<div>';
             $postsdata .= '<div class="author_name">';
             $postsdata .= '<a href="' . $default_url . '">' . $feed_title_truncated . '</a>';
             $postsdata .= '</div>';
             $postsdata .= '<div class="date">' . date("d-M-y", strtotime($date)) . '</div>';
             $postsdata .= '</div>';
             $postsdata .= ' </div>';
             $postsdata .= '<div class="main_content_share_button wd20_wd" style="">
                             <script type="text/javascript">var switchTo5x = true;</script>
                             <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
                             <script type="text/javascript">stLight.options({publisher: "d661bce1-3df6-41f2-a167-27cb74203fc1", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script>
                             <div id="slideToggleParent_' . $feed->id . '" class="main_content_share" style="display: none">
                                 <span class="st_facebook_large" displayText="Facebook"></span>
                                 <span class="st_twitter_large" displayText="Tweet"></span>
                                 <span class="st_email_large" displayText="Email"></span>
                                 <span class="st_plusone_large" displayText="Google +1"></span>
                             </div>
                             <div id="slideToggle_' . $feed->id . '" onclick="javascript:getShareDiv(' . $feed->id . ')" class="icon slideToggle">
                                 <a href="javascript:void(0)"></a>
                             </div>
                         </div>';
             $postsdata .= '</div>';
             $postsdata .= '</li>';
             $countForAd++;
         }
         echo $postsdata;
         return;
     } else {
         return;
     }
 }
Beispiel #4
0
die;
?>
    <ul class="clear_fix items_list" id="feed_content" style="position: relative;">
        <?php 
$default_image = getDefaultImage();
$count = 1;
if (!empty($feeds_list)) {
    foreach ($feeds_list as $feed) {
        $html = $feed->feed_content;
        preg_match_all('/<img[^>]+>/i', $html, $result);
        $feed_image = $result;
        $date = isset($feed->feed_date) ? $feed->feed_date : date('Y-m-d');
        $feed_image = isset($feed_image[0][0]) ? $feed_image[0][0] : $default_image;
        $feed_title_title = isset($feed->feed_user_title) ? $feed->feed_user_title : '';
        $feed_title = substr($feed_title_title, 0, 40);
        $avatar = feedIconByUrl($feed->feed_admin_url);
        if (!empty($avatar)) {
            $favicon = site_url() . $avatar;
        } else {
            $favicon = site_url('assets/img/avatar.jpg');
        }
        if ($count == 4) {
            ?>
                    <li>
                        <div class="item sponsor">
                            <div class="img">
                                <a href="#">
                                    <img src="<?php 
            echo site_url('/assets/img/img_4.jpg');
            ?>
" alt="SPONSOR ADS">