Heys guys silverbrick here ^^
Today i will guide you how to put a responsive and secured editor for your private message system
Step 1
Go
here and download the zip of the editor ^^
Step 2
Make a folder in your directory with name assets and extract that zip there and you will find a folder in assets and move all file of that folder to assets and delete that folder and zip ^^
Step 3
Add this to template.tpl of the theme that you use and make sure it should be in <body> tag
and remember to replace that yoursite.com with your site name ^^
Quote:
<script src="/assets/lib/js/wysihtml5-0.3.0.js"></script>
<script src="/assets/lib/js/jquery-1.7.2.min.js"></script>
<script src="/assets/lib/js/prettify.js"></script>
<script src="/assets/lib/js/bootstrap.min.js"></script>
<script src="/assets/src/bootstrap-wysihtml5.js"></script>
|
Step 4
Add this also in template.tpl inside <body> tag and remember to change yoursite.com with your site address and do not be over smart and directly link it like "/assets/prettify.css" or it will spoil things ^^
Quote:
<link rel="stylesheet" type="text/css" href="/assets/lib/css/bootstrap.min.css"></link>
<link rel="stylesheet" type="text/css" href="/assets/lib/css/prettify.css"></link>
<link rel="stylesheet" type="text/css" href="/assets/src/bootstrap-wysihtml5.css"></link>
|
Step 5
Add this also to template.tpl
Quote:
<script>
$('textarea.edit-text').wysihtml5();
</script>
|
Step 6
Now go to messageview.php in view folder and change -
Quote:
$pmForm->add(new Comment($editor->editor("mtext", "Enter your message here.")));
|
To
Quote:
$pmForm->add(new Comment("<textarea name='mtext' class='form-control edit-text' placeholder='Enter your message here.'></textarea>"));
|
Hopes you like the mod and be sure to comment out if you liked it