Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Forum: Hacks
    In reply to: Replace function

    Hi 13rust,
    Unless you rewrite the function in si-captcha.php, which is a bad idea, it is not possible to do this since si_captcha_comment_form_wp3() does not implement any filters.

    Good luck!
    -Max

    Well the next step is to set up a crontab to run uptime periodically and record the results of top when the load average spikes…

    Again — it sounds like it could be a locking issue on the tables. Set up your slow query log to look for any abnormally lengthy MySQL queries, and check your crontabs to make sure there isn’t some maintenance process doing analytical crunching on the database, or interrupting the server.

    Have you checked your Apache error logs, MySQL error logs, and set up slow query logging?

    Sounds like a table locking / data processing issue.

    Here’s a simple solution based on the page URL + parameters:

    <?php
    
    // First convert the request URI to a hexadecimal number, via the md5 hash
    $num = md5($_SERVER['REQUEST_URI']);
    
    // Next, shorten it so the number isn't too big, and convert it to decimal
    $num = hexdec(substr($num, 27));  // this gives us a number between 0 and 65,535
    
    // Now, convert it to a range between 0 and 5 by taking the modulus
    $num = $num % 6;
    
    // Add one...
    $num++;
    
    // And use the same switch statement we used before to achieve our desired result...
    switch ($num) {
      case 1:
        echo "Time is money";
        break;
      case 2:
        echo "An apple a day keeps the doctor away";
        break;
      case 3:
        echo "Elmo loves dorthy";
        break;
      case 4:
        echo "Off to see the wizard";
        break;
      case 5:
        echo "Tomorrow is another day";
        break;
      case 6:
        echo "PHP is cool!";
    }
    ?>

    This will be different from page to page, but stay the same on the same page.

Viewing 5 replies - 1 through 5 (of 5 total)