wp hacks

you like my new code button?

updated
– old comments are deleted because i have improved my script. so far i haven’t seen any errors. feel free to test more

check out my new code button in the comments field.. it actually replaces my other “better handle <code>” hack – test it out in the comments area by click on the “code” button 🙂 and let me know how you like it. if it’s worthwhile to release it as a hack.

16 thoughts on “you like my new code button?

  1. <?php
    function add_magic_quotes($array) {
    foreach ($array as $k => $v) {
    if (is_array($v)) {
    $array[$k] = add_magic_quotes($v);
    } else {
    $array[$k] = addslashes($v);
    }
    }
    return $array;
    }
    ?>

  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD>
    <BODY>
    test
    </BODY>
    </HTML>

  3. <p>testing the CODE: by LORIE.</p>
    <p>leaving on a jet plane<br>
    <b>don't know <span style="font-weight: 400">when I'll be back again</span></b></p>

  4. let’s try some java 😀
    import javax.swing.JOptionPane; // import class JOPtionPane
    public class SimpleGame03
    {
    public static void main (String args[])
    {
    int num1, num2, org, sum, addnum, compwin = 0, userwin = 0, tries = 0, start, cont = 0;
    String input_addnum;
    Object[] options = {"START", "CANCEL"};
    start = JOptionPane.showOptionDialog (null, "Game: Twenty One\nPlayers: Computer & User\nOverview: The Computer will deal 2 random numbers between 2-11.\nIf the sum of the two numbers is between 12-21 User wins;\nIf the sum is not, then User can choose the computer to deal\n1 or 2 more numbers.\nIf the new total is between 12-21 User wins, if not, the Computer wins\n\n Have Fun!", " INFORMATION",
    JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options [0]);
    while ((cont != 1) && (start == 0))
    {
    num1 = (int) (Math.random () * 9) + 2;
    num2 = (int) (Math.random () * 9) + 2;
    sum = num1 + num2;
    if ((sum >= 18) && (sum <= 21))
    userwin = userwin + 1;
    else
    {
    compwin = compwin + 1;
    org = sum;
    if (sum < 18)
    {
    input_addnum = JOptionPane.showInputDialog (num1 + " + " + num2 + " = " + sum + "\nTo little, do you want to add 1, or 2 more numbers?");
    addnum = Integer.parseInt (input_addnum);
    if (addnum == 1)
    {
    num1 = (int) (Math.random () * 9) + 2;
    sum = sum + num1;
    if ((sum >= 18) && (sum <= 21))
    {
    userwin = userwin + 1;
    JOptionPane.showMessageDialog (null, org + " + " + num1 + " = " + sum + "\nYou WIN!");
    }
    else
    {
    JOptionPane.showMessageDialog (null, org + " + " + num1 + " = " + sum + "\nYou LOSE!");
    }
    }
    else
    {
    num1 = (int) (Math.random () * 9) + 2;
    num2 = (int) (Math.random () * 9) + 2;
    sum = sum + num1 + num2;
    if ((sum >= 18) && (sum <= 21))
    {
    userwin = userwin + 1;
    JOptionPane.showMessageDialog (null, org + " + " + num1 + " + " + num2 + " = " + sum + "\nYou WIN!");
    }
    else
    {
    JOptionPane.showMessageDialog (null, org + " + " + num1 + " + " + num2 + " = " + sum + "\nYou LOSE!");
    }
    }
    }
    }
    cont = JOptionPane.showConfirmDialog (null, "Do you want to continue?", " CONTINUE?", JOptionPane.YES_NO_OPTION);
    }
    if (start == 0)
    JOptionPane.showMessageDialog (null, "User wins: " + userwin + "\nComputer wins: " + compwin);
    else
    JOptionPane.showMessageDialog (null, " END OF PROGRAM", "PROGRAM TERMINATED", JOptionPane.INFORMATION_MESSAGE); // if program never ran
    System.exit (0);
    } // ends main class
    }

  5. <style>
    <style type="text/css">
    body {
    background-color: #FFFFFF;
    scrollbar-arrow-color: #000000;
    scrollbar-track-color: white;
    scrollbar-shadow-color: #F1BEF9;
    scrollbar-face-color: #F1BEF9;
    scrollbar-highlight-color: #F1BEF9;
    scrollbar-darkshadow-color: #F1BEF9;
    scrollbar-3dlight-color: #F1BEF9;
    }
    .left, .blogbody, table.footer, .standard, .leftmodulefontcolor, td, p {
    font: normal 9pt Tahoma;
    line-height: 10pt;
    color: #000000;
    letter-spacing: 0px;
    text-align: justify;
    }
    </style>

  6. <html>
    <head>
    <title>OMG</title>
    </head>
    <body>
    <font style="text-transform: uppercase">DODO LINKED ME!! XD</font>
    </body>
    </html>

    You rock Dodo 😉

  7. i have a question dodo 🙂 this new code hack… when you are posting code in an entry, will it too have a new textarea JUST to type in code? and will convert the slashes, and pointy brackets to the & – type code? 🙂

  8. What I want to know is how you were able to get the comment. gif as a link in the comment link. That has bedeviled me from Day One! Thanks!

    Great site, BTW, surfed in here from Jenny’s “Adoption” link!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s