MyBB Codes

Full Version: Add [Select All] into your quote, php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
First of all, you have to put this code into headerinclude:
PHP Code:[Highlight]
<script type="text/javascript">
function 
selectCode(a)
{
   var 
a.parentNode.parentNode.getElementsByTagName('CODE')[0];
   if (
window.getSelection)
   {
      var 
window.getSelection();
       if (
s.setBaseAndExtent)
      {
         
s.setBaseAndExtent(e0ee.innerText.length 1);
      }
      else
      {
         var 
document.createRange();
         
r.selectNodeContents(e);
         
s.removeAllRanges();
         
s.addRange(r);
      }
   }
   else if (
document.getSelection)
   {
      var 
document.getSelection();
      var 
document.createRange();
      
r.selectNodeContents(e);
      
s.removeAllRanges();
      
s.addRange(r);
   }
   else if (
document.selection)
   {
      var 
document.body.createTextRange();
      
r.moveToElementText(e);
      
r.select();
   }
}
</script> 

Next, go to ACP > Configuration > Languages > select your language > global.lang.php and search:
Quote:[Highlight] php_code
Then you add this code after the lang value of php_code:
<a href="#" onclick="selectCode(this); return false;">(SELECT ALL)</a>

Do the same thing with code.

I don't think we need a demo here, good luck.

< link removed >
Thank you Joey_Pham423 for this nice tutorial, it will be quite instructive for our members. Smile

But you should have read the rules, mostly this one about the tutorials :

4. No links to external sites would be tolerated.

The rules for the tutorial section are here :

Serving the community through tutorial (Rules)

Your link was then removed... Wink
Reference URL's