Title: maxk's Replies | WordPress.org

---

# maxk

  [  ](https://wordpress.org/support/users/maxk/)

 *   [Profile](https://wordpress.org/support/users/maxk/)
 *   [Topics Started](https://wordpress.org/support/users/maxk/topics/)
 *   [Replies Created](https://wordpress.org/support/users/maxk/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/maxk/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/maxk/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/maxk/engagements/)
 *   [Favorites](https://wordpress.org/support/users/maxk/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Replace function](https://wordpress.org/support/topic/replace-function/)
 *  [maxk](https://wordpress.org/support/users/maxk/)
 * (@maxk)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/replace-function/#post-1854513)
 * 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
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Load spikes – any ideas?](https://wordpress.org/support/topic/load-spikes-any-ideas/)
 *  [maxk](https://wordpress.org/support/users/maxk/)
 * (@maxk)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/load-spikes-any-ideas/#post-1771456)
 * 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…
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Load spikes – any ideas?](https://wordpress.org/support/topic/load-spikes-any-ideas/)
 *  [maxk](https://wordpress.org/support/users/maxk/)
 * (@maxk)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/load-spikes-any-ideas/#post-1771443)
 * 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.
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Load spikes – any ideas?](https://wordpress.org/support/topic/load-spikes-any-ideas/)
 *  [maxk](https://wordpress.org/support/users/maxk/)
 * (@maxk)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/load-spikes-any-ideas/#post-1771287)
 * Have you checked your Apache error logs, MySQL error logs, and set up slow query
   logging?
 * Sounds like a table locking / data processing issue.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Randomized, but static, output on every page? Possible? How?](https://wordpress.org/support/topic/randomized-but-static-output-on-every-page-possible-how/)
 *  [maxk](https://wordpress.org/support/users/maxk/)
 * (@maxk)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/randomized-but-static-output-on-every-page-possible-how/#post-1745913)
 * 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)