Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Addons/Mods Graveyard

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-10-2009, 07:39 PM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 8,196
Fireballchad
Default BBCode

Ok well I managed to get Bloodrun's forum to allow bbcode in post also.
PHP Code:
$a_answer=$_POST['a_answer'];
     
// CONVERT ALL HTML SPECIAL CHARS TO THERE ENTITIES
        
$a_answer htmlentities($a_answerENT_QUOTES);
        
        
// PARSE BB CODE
        
$a_answer preg_replace('|\[b\](.+?)\[\/b\]|i''<strong>$1</strong>'$a_answer);
        
$a_answer preg_replace('|\[i\](.+?)\[\/i\]|i''<em>$1</em>'$a_answer);
        
$a_answer preg_replace('|\[u\](.+?)\[\/u\]|i''<u>$1</u>'$a_answer);
        
$a_answer preg_replace('|\[img\](.+?)\[\/img\]|i''<img src=$1>'$a_answer);
        
$a_answer preg_replace('|\[url=(.+?)\](.+?)\[\/url\]|i''<a href=$1>$2</a>'$a_answer);
        
$a_answer preg_replace('|\[color=(.+?[^;])\](.+?)\[\/color\]|i''<span style="color:$1;">$2</span>'$a_answer);
        
$a_answer preg_replace('|\[size=(.+?[^;])\](.+?)\[\/size\]|i''<span style="font-size:$1;">$2</span>'$a_answer);
        
$a_answer preg_replace('|\[left\](.+?)\[\/left\]|i''<span style="text-align: left;">$1</span>'$a_answer);
        
$a_answer preg_replace('|\[right\](.+?)\[\/right\]|i''<span style="text-align: right;">$1</span>'$a_answer);
        
$a_answer preg_replace('|\[center\](.+?)\[\/center\]|i''<center>$1</center>'$a_answer);
        
$a_answer mysql_real_escape_string($a_answer); 
Thats how I managed to do it. First of all is it secure, secondly how do I make it change back to bbcode when you want to edit it? Right now it converts it to HTML and then when you go to edit your post or sig it is now HTML and not BBCode that you originally typed it in.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Support for BBCode jason1234h Questions and Supports 2 07-21-2013 11:46 PM
Messed up BBCode SilverDragonTears Questions and Supports 19 02-13-2012 10:50 AM
Extra BBcode AlexC Mys v1.2.x Mods 0 04-14-2011 12:48 PM
HTML instead of BBCODE PokePets Questions and Supports 3 08-09-2010 05:36 AM
BBCode doesn't show Killgore Questions and Supports 9 02-26-2009 08:40 PM


All times are GMT -5. The time now is 05:18 AM.

Currently Active Users: 9733 (0 members and 9733 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636