Esempio n. 1
0
 function render_item_status($activity, $data)
 {
     $has_url = property_exists($data, 'url');
     $has_title = property_exists($data, 'title');
     $has_new = property_exists($data, 'new');
     $has_status = property_exists($data, 'status');
     // Status
     if ($activity->type == 'status') {
         return item_linkify($this->get_content($activity->content_id)->content);
     }
     // Has Status
     if ($has_status) {
         return $object->status;
     } else {
         $verb = item_verb($this->ci->lang->line('verbs'), $activity->verb);
         $article = item_type($this->ci->lang->line('object_articles'), $activity->type);
         $type = item_type($this->ci->lang->line('object_types'), $activity->type);
         // Has Title
         if ($has_title && $data->title) {
             if ($has_url) {
                 $title_link = $type . ' <a href="' . $data->url . '">' . character_limiter($data->title, 22) . '</a>';
             } else {
                 $title_link = $data->title;
             }
         } else {
             if ($has_url) {
                 $title_link = ' <a href="' . $data->url . '">' . $type . '</a>';
             } else {
                 $title_link = $type;
             }
         }
         return '<span class="item_verb">' . $verb . ' ' . $article . ' ' . $title_link . '</span>';
     }
 }
Esempio n. 2
0
 function comments()
 {
     $this->data['page_title'] = "Comments";
     $this->data['sub_title'] = "Recent";
     $this->data['navigation'] = $this->load->view(config_item('dashboard_theme') . '/partials/navigation_comments.php', $this->data, true);
     $comments = $this->social_tools->get_comments(config_item('site_id'), $this->session->userdata('user_id'), $this->uri->segment(3));
     $comments_view = NULL;
     $this->data['feed_type'] = 'comments';
     $this->data['item_verb'] = item_type($this->lang->line('object_types'), 'comment');
     if (empty($comments)) {
         $comments_view = '<li>No comments to show!</li>';
     } else {
         foreach ($comments as $comment) {
             // Item
             $this->data['item_id'] = $comment->comment_id;
             $this->data['item_type'] = item_type_class($comment->type);
             $this->data['item_viewed'] = item_viewed('item', $comment->viewed);
             // Contributor
             $this->data['item_avatar'] = $this->social_igniter->profile_image($comment->user_id, $comment->image, $comment->gravatar);
             $this->data['item_contributor'] = $comment->name;
             $this->data['item_profile'] = base_url() . 'profile/' . $comment->username;
             // Activity
             if ($comment->title) {
                 $this->data['item_article'] = '';
                 $this->data['item_object'] = $comment->title;
             } else {
                 $this->data['item_article'] = item_type($this->lang->line('object_articles'), $comment->type);
                 $this->data['item_object'] = $comment->type;
             }
             $this->data['item_text'] = item_linkify($comment->comment);
             $this->data['item_date'] = format_datetime(config_item('comments_date_style'), $comment->created_at);
             $this->data['item_approval'] = $comment->approval;
             // Alerts
             $this->data['item_alerts'] = item_alerts_comment($comment);
             // Actions
             $this->data['item_view'] = base_url() . $comment->module . '/view/' . $comment->content_id . '/' . $comment->comment_id;
             $this->data['item_reply'] = base_url() . $comment->module . '/reply/id/' . $comment->content_id . '/' . $comment->comment_id;
             $this->data['item_approve'] = base_url() . 'api/comments/approve/id/' . $comment->comment_id;
             $this->data['item_delete'] = base_url() . 'api/comments/destroy/id/' . $comment->comment_id;
             // Load Partial For Items
             $comments_view .= $this->load->view(config_item('dashboard_theme') . '/partials/item_comments.php', $this->data, true);
         }
     }
     $this->data['comments_view'] = $comments_view;
     $this->render();
 }