Page 1 of 1

[HELP] Syntax colored code:

PostPosted: Mon Aug 06, 2007 7:15 pm
by lmame
If you want to insert (and see) syntaxed colored code, use "code" bbcode:

Example for C / C++ code:
  1.  
  2. [code=c]
  3. int main(int argc, char *argv[])
  4. {
  5.     srand( (unsigned)time(NULL) );
  6.     srand( rand()*time(NULL) );        
  7.     StartSignal( );
  8. }
  9. [/code]
  10.  


Gives:
  1.  
  2. int main(int argc, char *argv[])
  3. {
  4.     srand( (unsigned)time(NULL) );
  5.     srand( rand()*time(NULL) );        
  6.     StartSignal( );
  7. }
  8.  



For PHP:
  1.  
  2. [code=php]
  3. <?php
  4. /**
  5.  * test
  6.  *
  7.  */
  8. define('DIR_AUTH', dirname(__FILE__));
  9. echo("this is a test");
  10. ?>
  11. [/code]
  12.  


Gives:
  1.  
  2. <?php
  3. /**
  4.  * test
  5.  *
  6.  */
  7. define('DIR_AUTH', dirname(__FILE__));
  8. echo("this is a test");
  9. ?>
  10.