read('kidID = ?', 'i', "$kidID"); if (!is_object($kistmt)) $error_message .= 'Unable to read KidInfo'; elseif (!($kistmt->fetch())) $error_message .= "Unable to fetch Kid Info id = $kidID"; $ki->conn->close(); $kistmt->close(); $next = FALSE; $kinext = new KidInfo(); $active = KIDINFO_STATUS_ACTIVE; $state = $ki->State; $kinextstmt = $kinext->read('kidID > ? AND status = ? AND state = ? AND is_public = ? AND NOT EXISTS (SELECT * FROM KidDocs WHERE foreignaddr = TRUE AND KidInfo.kidID = KidDocs.kidID) ORDER BY kidID ASC', 'issi', "$kidID", "$active", "$state", TRUE); if (!is_object($kinextstmt)) $next = ''; elseif (!($kinextstmt->fetch())) $next = ''; else $next = $kinext->kidID; if (is_object($kinext) && is_object($kinext->conn)) $kinext->conn->close(); if (is_object($kinextstmt)) $kinextstmt->close(); $prev = FALSE; $kiprev = new KidInfo(); $state = $ki->State; $active = KIDINFO_STATUS_ACTIVE; $kiprevstmt = $kiprev->read('kidID < ? AND status = ? AND state = ? AND is_public = ? AND NOT EXISTS (SELECT * FROM KidDocs WHERE foreignaddr = TRUE AND KidInfo.kidID = KidDocs.kidID) ORDER BY kidID DESC', 'issi', "$kidID", "$active", "$state", TRUE); if (!is_object($kiprevstmt)) $prev = ''; elseif (!($kiprevstmt->fetch())) $prev = ''; else $prev = $kiprev->kidID; if (is_object($kiprev) && is_object($kiprev->conn)) $kiprev->conn->close(); if (is_object($kiprevstmt)) $kiprevstmt->close(); if (isset($_SERVER['HTTP_REFERER']) && isnotme($_SERVER['HTTP_REFERER'])) { $pastpage = $_SERVER['HTTP_REFERER']; $_SESSION['ViewKid'] = $pastpage; } elseif (isset($_SESSION['ViewKid'])) { $pastpage = $_SESSION['ViewKid']; $_SESSION['ViewKid'] = $pastpage; } else $pastpage = FALSE; $kd = new KidDocs(); $kid_docs = array(); $kdstmt = $kd->read('kidID = ? ORDER BY DocumentOrder', 'i', "$kidID"); if (!is_object($kdstmt)) $error_message .= $kdstmt; else { while ($kdstmt->fetch()) { $kid_docs[] = $kd->copy(); } $kd->conn->close(); $kdstmt->close(); } $haslinks = false; $haspods = false; $haspics = false; $ages = ''; $kid_docs_count = count($kid_docs); $text_found = -1; $embed_found = -1; $npics_found = 0; $video_found = -1; $nlinks_found = 0; $links_found = array(); $npods_found = 0; $pods_found = array(); /* Prevent rendering (at all) when the kid is not active) */ if ($ki->status == KIDINFO_STATUS_ACTIVE || is_internal_login()) { for ($k = 0; $k < $kid_docs_count; $k++) { $kd = $kid_docs[$k]; switch ($kd->DocumentType) { case KIDDOCSTYPE_TEXT: $text_found = $k; break; case KIDDOCSTYPE_EMBED: $embed_found = $k; break; case KIDDOCSTYPE_PORTRAIT: $npics_found++; break; case KIDDOCSTYPE_VIDEO: $video_found = $k; break; case KIDDOCSTYPE_LINK: $links_found[$nlinks_found++] = $k; break; case KIDDOCSTYPE_PODCAST: $pods_found[$npods_found++] = $k; break; } } } if ($text_found == -1) { print('' . "\r\n"); print('' . "\r\n"); print('' . "\r\n"); print(''); require_once($_SERVER['DOCUMENT_ROOT'] . '/Templates/responsive2015.php'); print('' . "\r\n"); print("A Family For Every Child - No Longer Listed\r\n"); responsive_head(); responsive_leftcolumn(3, 'head'); print(''); print('
'); responsive_rootmenu1('body', 4); print('
'); responsive_heading(3); print('
'); responsive_leftcolumn(4); print('
'); responsive_centercontent(6); print('

'); print("

Thank you for your interest in these children...

"); print('

They are not currently listed for adoption! Please check back later!

'); print('This can happen for many reasons; we may need to approve their listing; perhaps their family has been picked; or perhaps their worker is taking time to read through the studies submitted.'); print('If you have submitted and not heard from their worker, please contact your adoption worker to follow up for you.'); print('We understand that this can be a long, difficult process and appreciate your interest in all the children on our web site.'); print('Below are some other options that are available to you as a waiting family.'); print('
'); print('

Take a minute to check out our free Matching Assistance Program.'); print('
This program is designed to assist home study ready families nationwide with the matching process.

'); print('

Perhaps you would like to Participate in a Matching Event. Check out how to feature your family.
matching event

'); print('

Sign up for our Newsletter

Join Our Mailing List'); print('

Like our Facebook page

Become A Fan'); print('

Contact Us
Email: info@afamilyforeverychild.org
Phone: 541-343-2856
Toll-Free: 877-343-2856
Mail: 1675 West 11th Avenue Eugene, Oregon, 97402

'); print('

Follow us on Twitter

Follow Us On Twitter'); print('

Sign up for text messaging

Text Me'); print('
'); print('
'); print('
'); print('
'); print('
'); responsive_footer(3); print('
'); exit(); } function resize_image($path, $width = 0, $height = 0) { if(trim($path) == '') return ''; $path = urldecode($path); $imagename = $path; $pi = pathinfo($imagename); if (isset($pi['extension'])) { $suffix = strtolower($pi['extension']); $basename = $pi['basename']; switch($suffix) { case 'jpg': case 'jpeg': if ($width == 0 && $height == 0) return 'data:image/jpg;base64,' . base64_encode(file_get_contents($imagename)); else { $sourceImage = imagecreatefromjpeg($imagename); $origx = imagesx($sourceImage); $origy = imagesy($sourceImage); if ($width != 0) { $destwidth = $width; $destheight = ($destwidth / $origx) * $origy; } else { $destheight = $height; $destwidth = ($destheight / $origy) * $origx; } $destinationImage = imagecreatetruecolor($destwidth, $destheight); imagecopyresampled($destinationImage, $sourceImage, 0, 0, 0, 0, $destwidth, $destheight, $origx, $origy); ob_start(); imagejpeg($destinationImage); return 'data:image/jpg;base64,' . base64_encode(ob_get_clean()); } break; case 'png': if ($width == 0 && $height == 0) return 'data:image/png;base64,' . base64_encode(file_get_contents($imagename)); else { $sourceImage = imagecreatefrompng($imagename); $origx = imagesx($sourceImage); $origy = imagesy($sourceImage); if ($width != 0) { $destwidth = $width; $destheight = ($destwidth / $origx) * $origy; } else { $destheight = $height; $destwidth = ($destheight / $origy) * $origx; } $destinationImage = imagecreatetruecolor($destwidth, $destheight); imagecopyresampled($destinationImage, $sourceImage, 0, 0, 0, 0, $destwidth, $destheight, $origx, $origy); ob_start(); imagepng($destinationImage); return 'data:image/png;base64,' . base64_encode(ob_get_clean()); } break; case 'gif': if ($width == 0 && $height == 0) return 'data:image/gif;base64,' . base64_encode(file_get_contents($imagename)); else { $sourceImage = imagecreatefromgif($imagename); $origx = imagesx($sourceImage); $origy = imagesy($sourceImage); if ($width != 0) { $destwidth = $width; $destheight = ($destwidth / $origx) * $origy; } else { $destheight = $height; $destwidth = ($destheight / $origy) * $origx; } $destinationImage = imagecreatetruecolor($destwidth, $destheight); imagecopyresampled($destinationImage, $sourceImage, 0, 0, 0, 0, $destwidth, $destheight, $origx, $origy); ob_start(); imagegif($destinationImage); return 'data:image/gif;base64,' . base64_encode(ob_get_clean()); } break; } } } function isnotme($url) { if ($url == '') return FALSE; $u = parse_url($url); if (!isset($u['path'])) return TRUE; $p = pathinfo($u['path']); if ($p['basename'] == 'ViewKid.php') return FALSE; return TRUE; } function print_video($kd3) { $flvpath = secure_path_kid2($kd3->Path); $matches = array(); if (!preg_match('/(.*)\.flv/i', $flvpath, $matches)) return; if (!is_array($matches)) return; $video = $matches[1]; print(''); print('"); return TRUE; } function is_internal_login() { if (!isset($_SESSION['Session'])) return FALSE; $session = $_SESSION['Session']; if (is_null($session) || !is_string($session)) return FALSE; $session = unserialize($session); if (!is_object($session) || !is_object($session->logged_in) || !($session->logged_in instanceof UserLogin)) return FALSE; if ($session->logged_in->get_userkind() != USERLOGIN_USERKIND_AFFEC) return FALSE; if ($session->logged_in->get_status() != USERLOGIN_STATUS_VERIFIED) return FALSE; return TRUE; } ?> Child Detail > A Family For Every Child ' . "\r\n"); ?>

A Family For Every Child

A Family For Every Child is dedicated to finding loving, permanent families for every waiting foster child.
All Kids Previous Child Next Child

Birthdates); $sibs = false; if(count($birthdates) > 1) $sibs = true; foreach($birthdates as $b) { if(trim($b) != '') { $b = check_optional_date($b); $age = strtotime(date('Y-m-d')) - strtotime($b); $age = floor($age / 31556926); $ages .= ', ' . $age; } } if($ages != '') { $ages = substr($ages, 2); $ages = ', Age' . $ages; } print($ki->Names . $ages);?>

DocumentType == KIDDOCSTYPE_PORTRAIT) { $kd2 = $kid_docs[$pici]; break; } } if ($kd2 == NULL) { /* No pictures, just text. */ } else { $imagepath = KID_DATA_DISK_PATH($kd2->kidID, basename($kd2->Path)); $pos = strrpos($imagepath, '.'); $origx = 0; $origy = 0; switch(substr($imagepath, $pos)) { case '.jpg': $sourceImage = imagecreatefromjpeg($imagepath); $origx = imagesx($sourceImage); $origy = imagesy($sourceImage); break; case '.png': $sourceImage = imagecreatefrompng($imagepath); $origx = imagesx($sourceImage); $origy = imagesy($sourceImage); break; case '.gif': $sourceImage = imagecreatefromgif($imagepath); $origx = imagesx($sourceImage); $origy = imagesy($sourceImage); break; } if($origy > 1600 || $origx >= 1600) { print(''); } else printf('%s', secure_path_kid2($imagepath), str_replace('"', '', $ki->Names), str_replace('"', '', $ki->Names)); } ?>

kidID, basename($kid_docs[$text_found]->Path)))) : ''; ?>

'); print_video($kid_docs[$video_found]); print('
'); } ?>
    DocumentType == KIDDOCSTYPE_PORTRAIT) { $kd2 = $kid_docs[$pici]; printf('
  • %s
  • ', secure_path_kid2($kd2->Path), $kd2->kidID, resize_image(KID_DATA_DISK_PATH($ki->kidID, basename($kd2->Path)), 200), str_replace('"', '', $ki->Names), str_replace('"', '', $ki->Names)); } } } ?>