MyBB Codes
Add [Select All] into your quote, php - Printable Version

+- MyBB Codes (http://www.mybbcodes.com)
+-- Forum: Mods Database (/forumdisplay.php?fid=4)
+--- Forum: Tutorials for 1.4.x (/forumdisplay.php?fid=29)
+--- Thread: Add [Select All] into your quote, php (/showthread.php?tid=1647)


Add [Select All] into your quote, php - Joey_Pham423 - 08-17-2010 05:30 AM

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 >


RE: Add [Select All] into your quote, php - exdiogene - 08-17-2010 12:59 PM

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