29JulFinished preliminary work on the [code] tag

0xtc source codeFinished most of the [code] tag. Everytime I tested it by posting here, the site sent an email to me….I hope my email box won’t be full when i get home…It’s not perfect yet. It still needs some work so html and not only php segments are highlighted and it “cheats” a bit for now, but I got the basics to work and this time without any blood flowing and that’s all that counts.


  1. 1 Shade30 Jul 2004


    Testing…

    http://www.randomoutburst.com/shade/

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    function RandomChars($number)
     {
      list($usec, $sec) = explode(’ ‘, microtime());
      $sdnum = (float) $sec + ((float) $usec * 100000);
      mt_srand($sdnum);
      while (strlen($ret) < $number)
      {
       $letter = chr(  mt_rand(48, 123) );
       if (preg_match(”/w/”, $letter) && $letter != “_”) $ret .= $letter;
      }
      return $ret;
     }

    http://magnablog.0xtc.com/

    This will determine my next comment.

    -Shade

  2. 2 Shade30 Jul 2004


    Well fawk me like a donkey…

    IT WORKS!

    I dunno what you did sir, but I tip my hat to you.

    -Shade

  3. 3 Wendy30 Jul 2004


    I don’t know what the first post says but I’m laughing my ass off at the second one.

  4. 4 TCorp30 Jul 2004


    It’s just some php code, wendy =)

    btw, If you had added the PHP begin and end tags, it would have even been in color, like so:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    <?
    function RandomChars($number)
     {
      list($usec, $sec) = explode(‘ ‘, microtime());
      $sdnum = (float) $sec + ((float) $usec * 100000);
      mt_srand($sdnum);
      while (strlen($ret) < $number)
      {
       $letter = chr(  mt_rand(48, 123) );
       if (preg_match(“/w/”, $letter) && $letter != “_”) $ret .= $letter;
      }
      return $ret;
     }
    ?>
  5. 5 TCorp30 Jul 2004


    update: PHP open/close tags are optional when using the [PHP] tag. They are added if missing. Next on to-do list: auto-parse inline php code.

Leave a Reply




flickr stream

california ufo / drone (raw picture) 4California ufo / drone 4california ufo / drone (raw picture) 3Drone 2 - blurryCalifornia ufo / dronecalifornia ufo / drone (raw picture) 5california ufo / drone (raw picture) 220012008046

Random Gallery Image

Camel in black and white Youngling More Lake Ontario Between Sittard and Geleen Pier at lake Ontario A Farm Moving bridge Pond at MesseTurm

Most Recent

lego-mohammed.jpg mbaside.jpg macessity-laptop-stand.jpg macessity-laptop-stand-messy.jpg

Calendar

May 2008
M T W T F S S
« Apr «-»  
 1234
567891011
12131415161718
19202122232425
262728293031