Advertisement
Guest User

Untitled

a guest
Jul 30th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. // Hashtags and @Mentions
  2. $str = preg_replace_callback('~([#@])([^s#@]+)~',
  3. create_function('$m', '$dir = $m[1] == "#" ? "search/?q=%23" : "./";' .
  4. 'return "<a href="$dir$m[2]">$m[0]</a>";' ),
  5. $str );
  6. /* Link text */
  7. $str = self :: linkText( $str );
  8. /* Emoticons */
  9. $str = self :: emoticons( $str );
  10. $str = stripslashes( $str );
  11. //$str = str_replace( '<br />', '<br />', $str );
  12.  
  13. //return wordwrap( $str, 60, "rn", TRUE );
  14. return $str;
  15. }
  16.  
  17. // Hashtags and @Mentions
  18. $str = preg_replace_callback('~([#@$])([^s#@$]+)~',
  19. create_function('$m', '$dir = $m[1] == "#" ? "search/?q=%23,%24" : "./";' .
  20. 'return "<a href="$dir$m[2]">$m[0]</a>";' ),
  21. $str );
  22. /* Link text */
  23. $str = self :: linkText( $str );
  24. /* Emoticons */
  25. $str = self :: emoticons( $str );
  26. $str = stripslashes( $str );
  27. //$str = str_replace( '<br />', '<br />', $str );
  28.  
  29. //return wordwrap( $str, 60, "rn", TRUE );
  30. return $str;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement