Changeset 156
- Timestamp:
- 09/01/10 16:47:43 (17 months ago)
- Location:
- trunk/views/default/edufeedr
- Files:
-
- 2 modified
-
educourse_blog.php (modified) (4 diffs)
-
singles/educourse_comment.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/views/default/edufeedr/educourse_blog.php
r155 r156 24 24 if ($posts) { 25 25 $phtml = ''; 26 $c = 1;27 26 $post_date = ""; 28 27 foreach ($posts as $post) { … … 36 35 /*translation:%s by %s*/ 37 36 $phtml .= "<em>".sprintf(elgg_echo('edufeedr:blog:by'), date("d.m.Y G:i",$post['date']), $post['author'])."</em>"; 38 $phtml .= "<div>"; 39 if (strlen($post['content'])>250) { 40 $last_space = strrpos(substr($post['content'], 0, 250), ' '); 41 $content_piece = substr($post['content'], 0, $last_space); 42 $phtml .= '<div id="post_intro_'.$c.'">'.$content_piece.'...</div>'; 43 /*translation:read more*/ 44 $phtml .= '<a href="'.$vars['url'].'pg/edufeedr/view_post/'.$vars['entity']->getGUID().'/'.$post['id'].'">' . elgg_echo('edufeedr:read:more') . '</a>'; 45 // Hide post 46 if ($vars['entity']->canEdit() && edufeedrCanEditEducourse($vars['entity'])) { 47 /*translation:hide*/ 48 $phtml .= ' | <a href="'.$vars['url'].'action/edufeedr/hide_post?post_id='.$post['id'].'&educourse='.$vars['entity']->getGUID().'&__elgg_ts='.$ts.'&__elgg_token='.$token.'">' . elgg_echo('edufeedr:action:hide') . '</a>'; 49 } 50 } else { 51 $phtml .= $post['content']; 52 } 37 $phtml .= "<div>"; 38 $phtml .= '<div class="edufeedr_post_content">'; 39 // Getting post content plaintext 40 $post_content = strip_tags($post['content']); 41 if (strlen($post_content)>250) { 42 $last_space = strrpos(substr($post_content, 0, 250), ' '); 43 $content_piece = substr($post_content, 0, $last_space); 44 $phtml .= $content_piece; 45 } else { 46 $phtml .= $post_content; 47 } 48 $phtml .= '</div>';// post content end 49 // Actions 50 /*translation:read more*/ 51 $phtml .= '<a href="'.$vars['url'].'pg/edufeedr/view_post/'.$vars['entity']->getGUID().'/'.$post['id'].'">' . elgg_echo('edufeedr:read:more') . '</a>'; 52 // Hide post 53 if ($vars['entity']->canEdit() && edufeedrCanEditEducourse($vars['entity'])) { 54 /*translation:hide*/ 55 $phtml .= ' | <a href="'.$vars['url'].'action/edufeedr/hide_post?post_id='.$post['id'].'&educourse='.$vars['entity']->getGUID().'&__elgg_ts='.$ts.'&__elgg_token='.$token.'">' . elgg_echo('edufeedr:action:hide') . '</a>'; 56 } 57 53 58 $phtml .= "</div>"; 54 $c++;55 59 } 56 60 $body .= $phtml; … … 60 64 if ($comments) { 61 65 $chtml = ''; 62 $c = 1;63 66 $comm_date = ""; 64 67 foreach ($comments as $comment) { … … 69 72 } 70 73 $chtml .= elgg_view('edufeedr/singles/educourse_comment', array('educourse' => $vars['entity'], 'comment' => $comment, 'type' => 'coursefeed')); 71 $c++;72 74 } 73 75 $body .= $chtml; -
trunk/views/default/edufeedr/singles/educourse_comment.php
r155 r156 33 33 // Content 34 34 $body .= '<div class="edufeedr_comment_content">'; 35 // Getting comment content plaintext 36 $comment_content = strip_tags($vars['comment']['content']); 35 37 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); 39 41 } else { 40 $body .= $ vars['comment']['content'];42 $body .= $comment_content; 41 43 } 42 44 } else if ($type == 'viewpost'){ … … 48 50 if ($vars['comment']['post_id']) { 49 51 /*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>'; 51 53 if ($can_edit) { 52 54 $body .= ' | ';
