Show
Ignore:
Timestamp:
09/01/10 16:47:43 (21 months ago)
Author:
gnum
Message:

References #100, done some changes, all small versions of posts and comments content get tags stripped, plus some more changes to nicer code

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/views/default/edufeedr/singles/educourse_comment.php

    r155 r156  
    3333                // Content 
    3434                $body .= '<div class="edufeedr_comment_content">'; 
     35                // Getting comment content plaintext 
     36                $comment_content = strip_tags($vars['comment']['content']); 
    3537                if ($type == 'coursefeed') { 
    36                         if (strlen($vars['comment']['content'])>200) { 
    37                                 $last_space = strrpos(substr($vars['comment']['content'], 0, 200), ' '); 
    38                                 $body .= substr($vars['comment']['content'], 0, $last_space); 
     38                        if (strlen($comment_content)>200) { 
     39                                $last_space = strrpos(substr($comment_content, 0, 200), ' '); 
     40                                $body .= substr($comment_content, 0, $last_space); 
    3941                        } else { 
    40                                 $body .= $vars['comment']['content']; 
     42                                $body .= $comment_content; 
    4143                        } 
    4244                } else if ($type == 'viewpost'){ 
     
    4850                        if ($vars['comment']['post_id']) { 
    4951                                /*translation:read more*/ 
    50                                 $body .= '<a href="'.$vars['url'].'pg/edufeedr/view_post/'.$vars['educourse']->getGUID().'/'.$comment['post_id'].'">' . elgg_echo('edufeedr:read:more') . '</a>'; 
     52                                $body .= '<a href="'.$vars['url'].'pg/edufeedr/view_post/'.$vars['educourse']->getGUID().'/'.$vars['comment']['post_id'].'">' . elgg_echo('edufeedr:read:more') . '</a>'; 
    5153                                if ($can_edit) { 
    5254                                        $body .= ' | ';