| 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 | |