Untitled


SUBMITTED BY: Guest

DATE: Nov. 13, 2013, 9:09 a.m.

FORMAT: Text only

SIZE: 1.6 kB

HITS: 6459

  1. function my_tags($text = null) {
  2. $text = preg_replace('/\[b\](.*?)\[\/b\]/s', '<b>$1</b>', $text);
  3. $text = preg_replace('/\[i\](.*?)\[\/i\]/s', '<i>$1</i>', $text);
  4. $text = preg_replace('/\[u\](.*?)\[\/u\]/s', '<u>$1</u>', $text);
  5. $text = preg_replace('/\[ul\]/s', '<ul>', $text);
  6. $text = preg_replace('/\[\/ul\]/s', '</ul>', $text);
  7. $text = preg_replace('/\[li\](.*?)\[\/li\]/s', '<li>$1</li>', $text);
  8. $text = preg_replace('/\[h1\](.*?)\[\/h1\]/s', '<h1>$1</h1>', $text);
  9. $text = preg_replace('/\[h2\](.*?)\[\/h2\]/s', '<h2>$1</h2>', $text);
  10. $text = preg_replace('/\[h3\](.*?)\[\/h3\]/s', '<h3>$1</h3>', $text);
  11. $text = preg_replace('/\[center\](.*?)\[\/center\]/s', '<div class="position_center">$1</div>', $text);
  12. $text = preg_replace('/\[left\](.*?)\[\/left\]/s', '<div class="position_left">$1</div>', $text);
  13. $text = preg_replace('/\[right\](.*?)\[\/right\]/s', '<div class="position_right">$1</div>', $text);
  14. $text = preg_replace('/\[blockquote\](.*?)\[\/blockquote\]/s', '<blockquote>$1</blockquote>', $text);
  15. $text = preg_replace('/\[url=(.*?)\](.*?)\[\/url\]/s', '<a href="$1" target="_blank">$2</a>', $text);
  16. $text = preg_replace('/\[img\](.*?)\[\/img\]/s', '<img src="$1">', $text);
  17. $text = preg_replace('/\[\^\](.*?)\[\/\^\]/s', '<div class="chat_li"><div class="chat_li_point"></div>$1</div>', $text);
  18. return $text;
  19. }

comments powered by Disqus