This BBCode generator PHP HTML decoder script has the following features.
Any web server which has PHP installed can handle this script. Even if your system doesn't have PHP installed you can use the JavaScript BBCode generator to generate BBCode.
This script is of plug and play type and hence doesn't require any installation. To use this script,
Now the editor is ready for use.
As I said you can add this wysiwyg BBCode editor to WebPages of any extension. Here is the guideline to add this script.
<script type="text/javascript">
<!--
addBBcode("division",680,150);
-->
</script>
In the above code
You can use AJAX or conventional form submit method to send BBCode text to your server. To generate preview I use AJAX post submit method to recover HTML from BBCode text. The id and name value of the editor textarea is "fw_editor". You can change the editor name value and id by editing the first two lines of the JavaScript file "script/bbcode.js".
The BBCode text as received by the server can be decoded to HTML by a series of PHP functions included in the file include/functions.php. To decode BBCode you have to include this file and call the function fw_format_text(). This function takes to mandatory arguments BBCode text and auto link. The argument auto link is of Boolean type and when set converts all the URL text into clickable links. Below, I give the PHP code example to demonstrate how to handle this BBCode text at the server end.
Receive data from user: <?php $comment=stripslashes(trim($_POST['fw_editor'])); //Other post vriables. //Verify data whether they obey proper guideline as set by you. //Store data into database. ?> Reconstruct HTML code. <?php include "BBCode/include/functions.php"; //Call data from database as $comment. $comment=fw_format_text($comment,true); //Second argument is set to automatically convert URLs to clickable links. //Display comment. ?>
This product is protected by copyright and distributed under licenses restricting copying, distribution. Permission is granted to the public to download and use this script provided that this Notice and any statement of authorship are reproduced in every page on all copies of the script.
THIS SCRIPT PRODUCT IS PROVIDED "AS-IS". NO WARRANTY OF ANY KIND IS EXPRESSED OR IMPLIED. YOU (RECIPIENT) USE THIS SCRIPT AT YOUR (RECIPIENTS) OWN RISK. TO THE MAXIMUM EXTENT PERMITTED UNDER APPLICABLE LAWS, AUTHOR EXPRESSLY DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. AUTHOR DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE SCRIPT WILL MEET YOUR REQUIREMENTS, OR THAT THE OPERATION OF THE SCRIPT WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS IN THE SCRIPT WILL BE CORRECTED. FURTHERMORE, AUTHOR DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE OR THE RESULTS OF THE USE OF THE SCRIPT IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY AUTHOR OR RAMUI.COM SHALL CREATE A WARRANTY OR IN ANY WAY INCREASE THE SCOPE OF ANY WARRANTY.
| Download: |
| php-bbcode-html-generator-editor-v2.0.tar.gz |