Advertisement
nlozovan

Untitled

May 22nd, 2014
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. <div class="excerpt">
  2. <p>
  3. <?php
  4. $ln = 180;
  5. if ( is_user_logged_in() ) {
  6. if (!empty($post->post_excerpt)) {
  7. if (strlen(strip_tags(strip_shortcodes($post->post_excerpt))) > $ln) {
  8. echo mb_substr(strip_tags(strip_shortcodes($post->post_excerpt)), 0, $ln) . '[...]';
  9. } else {
  10. echo strip_tags(strip_shortcodes($post->post_excerpt));
  11. }
  12. } else {
  13. if (strlen(strip_tags(strip_shortcodes($post->post_content))) > $ln) {
  14. echo mb_substr(strip_tags(strip_shortcodes($post->post_content)), 0, $ln) . '[...]';
  15. } else {
  16. echo strip_tags(strip_shortcodes($post->post_content));
  17. }
  18. }
  19. }else{
  20. if ( !tools::is_nsfw( $post -> ID ) ) {
  21. if (!empty($post->post_excerpt)) {
  22. if (strlen(strip_tags(strip_shortcodes($post->post_excerpt))) > $ln) {
  23. echo mb_substr(strip_tags(strip_shortcodes($post->post_excerpt)), 0, $ln) . '[...]';
  24. } else {
  25. echo strip_tags(strip_shortcodes($post->post_excerpt));
  26. }
  27. } else {
  28. if (strlen(strip_tags(strip_shortcodes($post->post_content))) > $ln) {
  29. echo mb_substr(strip_tags(strip_shortcodes($post->post_content)), 0, $ln) . '[...]';
  30. } else {
  31. echo strip_tags(strip_shortcodes($post->post_content));
  32. }
  33. }
  34. }else{
  35. echo options::get_value( 'general' , 'nsfw_content' );
  36. }
  37. }
  38. ?>
  39. </p>
  40. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement