0, 'dog' => 1, 'cat' => 2, 'rabbit' => 3, 'horse' => 4, 'small&furry' => 5, 'pig' => 6, 'reptile' => 7, 'bird' => 8, 'barnyard' => 9, 'other' => 1003); // other than dog or cat if (isset($sid_map[strtolower("$species")])) { $sid = $sid_map[strtolower("$species")]; } else { $sid = 0; } $url ="http://www.petango.com/webservices/wsadoption.asmx/AdoptableSearch?authkey={$authkey}&speciesID={$sid}&sex=A&ageGroup=All&location={$location}&site=&onHold=A&orderBy=Name&primaryBreed=&secondaryBreed=&specialNeeds=&noDogs=&noCats=&noKids="; $xml = simplexml_load_file($url); if (!$xml) { return FALSE; } else { if ($debug) { echo "
"; var_dump($xml); echo "
"; } return $xml; } } function get_pet_details_xml($id) { global $authkey; $url ="http://www.petango.com//webservices/wsadoption.asmx/AdoptableDetails?animalID={$id}&authkey={$authkey}"; $xml = simplexml_load_file($url); if (!$xml) { return FALSE; } else { if ($debug) { echo "
"; var_dump($xml); echo "
"; } return $xml; } } function get_found_list_xml() { global $authkey; // searchOption: 0=All, 1=Reported, 2=In-custody $url ="http://www.petango.com/webservices/wsadoption.asmx/foundSearch?authkey={$authkey}&speciesID=0&sex=A&ageGroup=All&orderBy=ID&searchOption=2"; $xml = simplexml_load_file($url); if (!$xml) { return FALSE; } else { if ($debug) { echo "
"; var_dump($xml); echo "
"; } return $xml; } } function get_found_details_xml($id) { global $authkey; $url ="http://www.petango.com//webservices/wsadoption.asmx/foundDetails?animalID={$id}&authkey={$authkey}"; $xml = simplexml_load_file($url); if (!$xml) { return FALSE; } else { if ($debug) { echo "
"; var_dump($xml); echo "
"; } return $xml; } } function get_age_string($months) { if ($months < 12) { $age = $months . " month" . ($months > 1 ? "s" : ""); } else { $years = floor($months / 12); if ($months < 24) { $age = $years . " year" . ($years > 1 ? "s " : " ") . $months % 12 . " month" . (($months % 12) > 1 ? "s" : ""); } else { $age = $years . " years"; } } return $age; } function get_housetrained_string($species, $htrained) { // For cats: // If Housetrained field shows "No" or "Partially" - return a value of No. // If Housetrained field shows "Yes" or "Unknown" - return a value of Yes. if ($species == "Cat") { if ($htrained == 'Partially') return 'No'; if ($htrained == 'Unknown') return 'Yes'; } return $htrained; } function get_size_string($size) { $size_map = array('S' => 'Small', 'M' => 'Medium', 'L' => 'Large', 'XL' => 'Extra Large'); if (isset($size_map["$size"])) { return $size_map["$size"]; } return $size; } function replace_cartoons($img, $species, $breed, $age, $small) { global $up; $cartoon_pics_lg = array( "cat" => "cat.png", "dog" => "dog.png", "rabbit" => "rabbit.png", "puppy" => "puppy.png", "kitten" => "kitten.png", "bird" => "cartoon-bird.jpg", "cockatiel" => "cockatiel.png", "canary" => "canary.png", "ferret" => "ferret.png", "guinea pig" => "guineapig.png", "rat" => "cartoon-rat.jpg", "mouse" => "mouse.png", "gerbil" => "gerbil.png", "hamster" => "hamster.png" ); $cartoon_pics_sm = array( "cat" => "cat_sm.png", "dog" => "dog_sm.png", "rabbit" => "rabbit_sm.png", "puppy" => "puppy_sm.png", "kitten" => "kitten_sm.png", "bird" => "cartoon-bird-sm.jpg", "cockatiel" => "cockatiel_sm.png", "canary" => "canary_sm.png", "ferret" => "ferret_sm.png", "guinea pig" => "guineapig_sm.png", "rat" => "cartoon-rat-sm.jpg", "mouse" => "mouse_sm.png", "gerbil" => "gerbil_sm.png", "hamster" => "hamster_sm.png" ); if ($small) $cartoon_pics = $cartoon_pics_sm; else $cartoon_pics = $cartoon_pics_lg; $breed = strtolower($breed); $species = strtolower($species); // replace no-photo pix w/ ours // PetPoint has 3: Photo-Not-Available-{dog,cat,other}.gif if (strstr($img, 'Photo-Not-Available-other')) { // we have some breed-specific pictures (canary, cockatiel) if (!isset($cartoon_pics["$breed"])) $breed = $species; if ($debug) { echo "breed is $breed => {$cartoon_pics[(string)$breed]}
"; } if (isset($cartoon_pics["$breed"])) { $img = preg_replace('/[^"]*Photo-Not-Available-other.gif/', "{$up}../images/cartoon/{$cartoon_pics[$breed]}", $img); } // else don't change pic } else { $dogpic = $cartoon_pics['dog']; $catpic = $cartoon_pics['cat']; if ($age < 6) { $dogpic = $cartoon_pics['puppy']; $catpic = $cartoon_pics['kitten']; } $img = preg_replace('/[^"]*Photo-Not-Available-dog.gif/', "{$up}../images/cartoon/{$dogpic}", $img); $img = preg_replace('/[^"]*Photo-Not-Available-cat.gif/', "{$up}../images/cartoon/{$catpic}", $img); } return $img; } function get_random_pet($species) { // don't re-query PetPoint if asking for same parameters, and // remove chosen random entries to avoid duplicates global $randpets, $last_rand_species; if (!isset($randpets) || $species != $last_rand_species) { $xml = get_pet_list_xml($species, ''); if (!$xml) { $name = 'Data unavailable'; $url = 'adopt.php'; $img = $up.'images/cartoon/cat_sm.png'; return compact('name', 'url', 'img'); } else { $last_rand_species = $species; $count = 0; foreach ($xml->XmlNode as $animal) { if (ltrim($animal->adoptableSearch->Name) != "" && // remove pets with no photo !strstr($animal->adoptableSearch->Photo, 'Photo-Not-Available')) { $randpets[$count] = $animal; $count++; } } } } $pick = rand(0, count($randpets)-1); if ($debug) { $max = count($randpets) - 1; echo "range 0..$max, pick=$pick
"; } $keys = array_keys($randpets); $animal = $randpets[$keys[$pick]]; $name = $animal->adoptableSearch->Name; $url = 'adopt.php?id='.$animal->adoptableSearch->ID; $img = $animal->adoptableSearch->Photo; // now remove so no dups in future unset($randpets[$keys[$pick]]); if ($debug) echo "for $keys[$pick] got $name, $url, $img
"; return compact('name', 'url', 'img'); } function top_banner_random_pet($species, $location, $width) { global $up; extract(get_random_pet($species, $location)); return '
Adopt me!
'; } function home_random_pet($species, $location, $width, $height) { extract(get_random_pet($species, $location)); return '
'.$name.'
'; } ?> MHRHS: Special Events
3 Oakland Ave, Menands, NY 12204     518.434.8128
Make a Donation
 
Special Events
Home
About Us
Adopt
Lost & Found
Donate
Volunteer
Foster
Event Calendar
   Special Events
   Dog Training
Shelter Services
Newsletters
Director's Blog
Join Our E-mail List
Community Support
Employment
Pet Tips
Other Agencies









Protect your pet with ShelterCare Pet Insurance programs.
A $25 donation is made to MHRHS when you enroll in a ShelterCare pet insurance program via this link.





Donate a Bed

Special Events

See our event calendar for adoption clinics and other events we are attending around the community.


Mon 6/27 to
Wed 8/10
5th Annual
Cutest Pets Calendar Photo Contest
Info
Thu 10/6/11
5:30pm
7th Annual
Art Saves Animals Art Auction and Reception
Arts Center of the Capital Region - 265 River Street, Troy
Info


Please call (518) 434-8128 ext. 206 for more information on any of these events.