Source for file monostochastic.php

Documentation is available at monostochastic.php

  1. <?php
  2.  
  3. /**
  4.  * monostochastic.php
  5.  * Name:    Monostochastic
  6.  * Date:    October 20, 2001
  7.  * Comment: Generates random two-color frames, featuring either
  8.  *          a dark or light background.
  9.  *
  10.  * @author Jorey Bump
  11.  * @copyright &copy; 2000-2006 The SquirrelMail Project Team
  12.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  13.  * @version $Id: monostochastic.php,v 1.13 2006/07/15 12:01:31 tokul Exp $
  14.  * @package squirrelmail
  15.  * @subpackage themes
  16.  */
  17.  
  18. /** Prevent direct script loading */
  19. if ((isset($_SERVER['SCRIPT_FILENAME']&& $_SERVER['SCRIPT_FILENAME'== __FILE__||
  20.     (isset($HTTP_SERVER_SERVER['SCRIPT_FILENAME']&& $HTTP_SERVER_SERVER['SCRIPT_FILENAME'== __FILE__) ) {
  21.     die();
  22. }
  23.  
  24. /** load sq_mt_randomize() */
  25. include_once(SM_PATH 'functions/strings.php');
  26.  
  27. /** seed the random number generator */
  28.  
  29. /** light(1) or dark(0) background toggle **/
  30. $bg mt_rand(0,1);
  31.  
  32. /** range delimiter **/
  33. $bgrd $bg 128;
  34.  
  35. /** background **/
  36. $cmin_b $bgrd;
  37. $cmax_b 127 $bgrd;
  38.  
  39. /** generate random color **/
  40. $rb mt_rand($cmin_b,$cmax_b);
  41. $gb mt_rand($cmin_b,$cmax_b);
  42. $bb mt_rand($cmin_b,$cmax_b);
  43.  
  44. /** text **/
  45. $cmin_t 128 $bgrd;
  46. $cmax_t 255 $bgrd;
  47.  
  48. /** generate random color **/
  49. $rt mt_rand($cmin_t,$cmax_t);
  50. $gt mt_rand($cmin_t,$cmax_t);
  51. $bt mt_rand($cmin_t,$cmax_t);
  52.  
  53. /** set array element as hex string with hashmark (for HTML output) **/
  54. for ($i 0$i <= 15$i++{
  55.     if ($i == or $i == or $i == or $i == or $i == or $i == 10 or $i == 12{
  56.         $color[$isprintf('#%02X%02X%02X',$rb,$gb,$bb);
  57.     else {
  58.         $color[$isprintf('#%02X%02X%02X',$rt,$gt,$bt);
  59.     }
  60. }

Documentation generated on Sat, 07 Oct 2006 16:12:38 +0300 by phpDocumentor 1.3.0RC6