2011-01-07, 06:52 PM
As I tried to use existing one code I failed, I made a decision to help other users.
So, Go to ACP -> Templates -> Header Templates -> Header
Add this code on the bottom of header:
Then go to your default forum language, if is english, go to english and go to global.lang.php which is in public_html/inc/languages/english/global.lang.php and search for php_code
Now instead of:
Add:
And instead of:
Now save the file and overwrite it, if (editor ask for it).
And you're done.
Hope this helps.
So, Go to ACP -> Templates -> Header Templates -> Header
Add this code on the bottom of header:
<script type="text/javascript">
function selectCode(a)
{
var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
if (window.getSelection)
{
var s = window.getSelection();
if (s.setBaseAndExtent)
{
s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
}
else
{
var r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
}
else if (document.getSelection)
{
var s = document.getSelection();
var r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
else if (document.selection)
{
var r = document.body.createTextRange();
r.moveToElementText(e);
r.select();
}
}
</script>
Then go to your default forum language, if is english, go to english and go to global.lang.php which is in public_html/inc/languages/english/global.lang.php and search for php_code
Now instead of:
$l['php_code'] = "PHP Code: ";
Add:
$l['php_code'] = "PHP Code: <a href='#' onclick='selectCode(this); return false;'>(Select All)</a>";
And instead of:
$l['code'] = "Code: ";
add this:$l['code'] = "Code: <a href='#' onclick='selectCode(this); return false;'>(SELECT ALL)</a>";
Now save the file and overwrite it, if (editor ask for it).
And you're done.
Hope this helps.