Let's do another chip-IN! Pitch-IN, whatever you call it! I know we've all been extremely busy, but let's take a couple of hours soon to relax and enjoy all the great food everyone can bring!  I hear that the weather is supposed to cool off after this weekend, so if we choose a day next week we might be in good shape.
Date: 2006-06-12 Note: Feel free to use this script however you like. If you like it or have made improvements to it please don't hesitate to drop me a line. */ require $_SERVER["DOCUMENT_ROOT"].DIRECTORY_SEPARATOR.'poll'.DIRECTORY_SEPARATOR.'settings.php'; require $_SERVER["DOCUMENT_ROOT"].DIRECTORY_SEPARATOR.'poll'.DIRECTORY_SEPARATOR.'functions.php'; function get_client_ip () { $client_ip = ( !empty($_SERVER['REMOTE_ADDR']) ) ? $_SERVER['REMOTE_ADDR'] : ( ( !empty($_ENV['REMOTE_ADDR']) ) ? $_ENV['REMOTE_ADDR'] : $REMOTE_ADDR ); if ($_SERVER["HTTP_CLIENT_IP"]) $proxy_ip = $_SERVER["HTTP_CLIENT_IP"]; elseif ($_SERVER["HTTP_X_FORWARDED_FOR"]) $proxy_ip = $_SERVER["HTTP_X_FORWARDED_FOR"]; if ($proxy_ip) { if ( preg_match("/^([0-9]+.[0-9]+.[0-9]+.[0-9]+)/", $proxy_ip, $ip_list) ) { $private_ip = array('/^0./', '/^127.0.0.1/', '/^192.168..*/', '/^172.16..*/', '/^10..*/', '/^224..*/', '/^240..*/'); $client_ip = preg_replace($private_ip, $client_ip, $ip_list[1]); } } return $client_ip; } /* Own implementation of in_array() since it didn't seem to work for some people */ function find_in_array ($value, $array) { for ($i=0; $i$arrPoll[2]\n"; echo "
    \n"; // Read log file $arrIps = ReadLogFile(); // Get user IP $userIP = get_client_ip(); if (find_in_array($userIP, $arrIps)) { for ($i=0; $i < count($arrPoll[0]); $i++) { if ($total_votes>0) { echo '
  • '.$arrPoll[0][$i].'
    '.round(($arrPoll[1][$i]/$total_votes*100),0).'%
  • '."\n"; } else { echo '
  • '.$arrPoll[0][$i].'
    0%
  • '."\n"; } } } else { for ($i=0; $i < count($arrPoll[0]); $i++) { if ($total_votes>0) { echo '
  • '.$arrPoll[0][$i].'
    '.round(($arrPoll[1][$i]/$total_votes*100),0).'%
  • '."\n"; } else { echo '
  • '.$arrPoll[0][$i].'
    0%
  • '."\n"; } } } echo "
\n"; // Print total votes echo "Total votes: $total_votes\n"; ?>
Thanks! We'll have the results soon and let you know which day is determined to be the best for everyone!