Assuming you've got MT configured to create PHP files

If you

  1. save these lines
    <?php
    $fortuneFilename = 'fortunecookie.txt';
    $wisecracks = file($fortuneFilename);
    $wisecrackCount = count($wisecracks);
    echo $wisecracks[rand(0, $wisecrackCount - 1)]
    ?>

    in a file named fortunecookie.php,
  2. save a list of wisecracks, one per line, in a file named fortunecookie.txt
  3. FTP both files to your site
  4. add
    <?php include '[path]/fortunecookie.php'; ?>
    somewhere in your template (I put it in <DIV class="description">)
You'll have the random quote thingie I just added to the page banner. It might stay, I dunno yet.

Posted by Prometheus 6 on April 18, 2004 - 8:42am :: Tech