"; $create_month.= ""; $create_month.= ""; $create_month.= "
\n"; $create_month.= ""; $create_month.= "$formatted_day"; $create_month.= "
\n"; $create_month.= "\n"; if($ticker == 6) { $create_month.= "\n"; $ticker = 0; } else { $ticker++; } } $themonth.= "
  $month, $year
"; $themonth.= ""; $themonth.= ""; $themonth.= ""; $themonth.= ""; $themonth.= ""; $themonth.= ""; $themonth.= ""; $themonth.= ""; $themonth.= ""; $themonth.= ""; $themonth.= $create_month; $themonth.= "
SMTWTFS
"; return $themonth; } function return_mon_abree($selected_day = "01",$selected_month,$selected_year,$bgcolormain, $bgcolorsecond, $plannermain_id, $link1,$link2) { if(!$selected_month) { $select_month = date("m"); $select_year = date("Y"); } else { $select_month = $selected_month; $select_year = $selected_year; } $create_month.= "\n"; $tic = 0; for($i=1;$i<=12;$i++) { $str = mktime(0, 0, 0, $i, 1, $select_year); $nextmonth = date("M",$str); $formatmonth = date("m",$str); if($tic == 0) { $create_month.="\n"; } $create_month.="\n"; $tic++; if($tic == 3) { $create_month.="\n"; $tic = 0; } } $create_month.= "
$nextmonth
\n"; return $create_month; } function return_calendar_text ($str, $num = 15) { if(strlen($str) > $num) { $str = substr($str,0,$num); $str = "$str"; } return $str; } function return_calendar_hour($hour,$per="") { if($hour < 12) { $hour = "$hour"; $temp_per = "am"; } else { $temp_per = "pm"; } $temp_time = $hour; if($hour == "00") { $temp_per = "am"; $temp_time = "12"; } if($hour > 12) { $temp_time = $hour-12; } if($per == "per") return $temp_per; else return $temp_time; } function return_shorter_copy ($str, $num = 12) { if(strlen($str) > $num) { $str = substr($str,0,$num); $str = "$str..."; } return $str; } function return_shorter_text($str,$num = 10) { $str = strip_tags($str); $bits = array(); $bits = explode(" ",$str); for($i=0;$i<=$num;$i++) { $tmp = $bits[$i]; $newstring = "$newstring $tmp"; } return $newstring; } function rotateImage($src, $degrees) { $source = imagecreatefromjpeg($src); $rotate = imagerotate($source, $degrees, 0); imagejpeg($rotate,$src,100); } function format_the_blogdate($date) { if($date) { $bits = array(); $bits = explode('-',$date); $y = $bits[0]; $m = $bits[1]; $d = $bits[2]; $bits = array(); $bits = explode(" ",$d); if($d[1]) $d = $bits[0]; $time = mktime(0, 0, 0, date($m), date($d), date($y)); $date = date("j M", $time); } $date = str_replace(" ","
",$date); return $date; } function validEmail($email) { $isValid = true; $atIndex = strrpos($email, "@"); if (is_bool($atIndex) && !$atIndex) { $isValid = false; } else { $domain = substr($email, $atIndex+1); $local = substr($email, 0, $atIndex); $localLen = strlen($local); $domainLen = strlen($domain); if ($localLen < 1 || $localLen > 64) { // local part length exceeded $isValid = false; } else if ($domainLen < 1 || $domainLen > 255) { // domain part length exceeded $isValid = false; } else if ($local[0] == '.' || $local[$localLen-1] == '.') { // local part starts or ends with '.' $isValid = false; } else if (preg_match('/\\.\\./', $local)) { // local part has two consecutive dots $isValid = false; } else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain)) { // character not valid in domain part $isValid = false; } else if (preg_match('/\\.\\./', $domain)) { // domain part has two consecutive dots $isValid = false; } else if (!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace("\\\\","",$local))) { // character not valid in local part unless // local part is quoted if (!preg_match('/^"(\\\\"|[^"])+"$/', str_replace("\\\\","",$local))) { $isValid = false; } } if ($isValid && !(checkdnsrr($domain,"MX") || checkdnsrr($domain,"A"))) { // domain not found in DNS $isValid = false; } } return $isValid; } ?>