$value) { $_GET[$key] = trim($value); } # Set up our constants define('ZOAS_PER_PAGE', 12); define('MAX_PAGES', 100); if (empty($_GET['page']) || !is_numeric($_GET['page'])) { define('PAGE_NUM', 1); } else { define('PAGE_NUM', intval(trim($_GET['page']))); } # Set up our search parameters // The params string looks like this: // red-green-skirt-blue-inner-purple-outer-yellow-ring-zoas.htm $sParams = $_GET['params'] . '-'; preg_match('|([^-.]*)-skirt|', $sParams, $aMatches); $_GET['skirt-color'] = $aMatches[1]; $sParams = str_replace($_GET['skirt-color'].'-skirt', '', $sParams); preg_match('|([^-.]*)-inner|', $sParams, $aMatches); $_GET['inner-color'] = $aMatches[1]; $sParams = str_replace($_GET['inner-color'].'-inner', '', $sParams); preg_match('|([^-.]*)-outer|', $sParams, $aMatches); $_GET['outer-color'] = $aMatches[1]; $sParams = str_replace($_GET['outer-color'].'-outer', '', $sParams); preg_match('|([^-.]*)-ring|', $sParams, $aMatches); $_GET['ring-color'] = $aMatches[1]; $sParams = str_replace($_GET['ring-color'].'-ring', '', $sParams); preg_match('|([^-.]*)-|', $sParams, $aMatches); $_GET['primary-color'] = $aMatches[1]; //print_r($aMatches); //echo "\n$sParams\n\n"; //print_r($_GET); die(); if (!LCL_ConvertURLParamsToFriendlyNames()) { header('HTTP/1.1 404 Not Found'); $aPageElements = array( 'content_group' => 'zoas', 'page_id' => 'four-oh-four', 'page_title' => 'No Zoas Found :(' ); _ShowHeader($aPageElements); ?>

We’re sorry, but we don’t currently have any zoas indexed that match that criteria. Would you like to start a new search?

\n\n"; # Make sure we only serve results under the canonical URL $sCanonicalURL = UTL_GetURL($_GET['primary-color'], $_GET['skirt-color'], $_GET['inner-color'], $_GET['outer-color'], $_GET['ring-color']); if ($sCanonicalURL=='/') { // This is the list of *all* zoas with no filters $bIsFullList = true; } if (ISME) echo "\n"; if (PAGE_NUM != '1') $sCanonicalURL = UTL_AppendQuerystringParameter($sCanonicalURL, 'page='.PAGE_NUM); # Strip any querystring vars that we're fine being there // - Google Analytics $_SERVER['REQUEST_URI'] = preg_replace('|utm_source=[\w\+]*&?|i', '', $_SERVER['REQUEST_URI']); $_SERVER['REQUEST_URI'] = preg_replace('|utm_medium=[\w\+]*&?|i', '', $_SERVER['REQUEST_URI']); $_SERVER['REQUEST_URI'] = preg_replace('|utm_campaign=[\w\+]*&?|i', '', $_SERVER['REQUEST_URI']); $_SERVER['REQUEST_URI'] = preg_replace('|utm_term=[\w\+]*&?|i', '', $_SERVER['REQUEST_URI']); # Now clean up the URL if (substr($_SERVER['REQUEST_URI'], -1) == '?') $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'], 0, strlen($_SERVER['REQUEST_URI'])-1); if (substr($_SERVER['REQUEST_URI'], -1) == '&') $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'], 0, strlen($_SERVER['REQUEST_URI'])-1); # Now 301 if we need to if ($_SERVER['REQUEST_URI'] <> $sCanonicalURL) { UTL_Redirect($sCanonicalURL, 301); die(); } # Determine how many total zoas match the search $db = &UTL_GetDBConnection(); if (ZOAS_GetZoas($aZoaResults, $aColors, $bIsFullList, $sErrMsg, $iTotalMatchingCount, $db)) { //print_r($aZoaResults); # Make sure they're not requesting a page number that is past the last page of jobs $iTotalPages = ceil($iTotalMatchingCount/ZOAS_PER_PAGE); //die("$iTotalPages|$iTotalMatchingCount|".ZOAS_PER_PAGE); $iTotalPages = min($iTotalPages, MAX_PAGES); if ($iTotalPages > 0 && PAGE_NUM > $iTotalPages) { # Redirect to the last page of zoas if ($iTotalPages == '1') { $sRedirectURL = UTL_GetURL($_GET['primary-color'], $_GET['skirt-color'], $_GET['inner-color'], $_GET['outer-color'], $_GET['ring-color']); } else { $sRedirectURL = str_replace('page=' . PAGE_NUM, 'page=' . $iTotalPages, $_SERVER['REQUEST_URI']); } UTL_Redirect($sRedirectURL, 301); } else { $sPageTitle = LCL_GetPageDescription(); if ($sPageTitle == 'Zoas') $sPageTitle = 'Zoa Identifier | ZoaID.org'; # This is the homepage $aPageElements = array( 'content_group' => 'zoas', 'page_id' => 'results', 'page_title' => $sPageTitle, 'featured_img' => 'https://www.zoaid.org/img/featured-img.jpg' ); # Return a 404 if this a combination that doesn't have any matches if ($iTotalMatchingCount < 1) { header('HTTP/1.1 404 Not Found'); } _ShowHeader($aPageElements); LCL_ShowFilters($aZoaResults, $aColors); ?>

0) { if ($iTotalMatchingCount > 1) $sS = 's'; echo $iTotalMatchingCount; if ($bIsFullList) echo " different zoa$sS"; else echo ' photos'; echo " indexed so far"; } else { ?> We haven’t indexed any zoas like that yet, but stay tuned! We’re still busy working on it.Filters

Photo of  <?if (substr($row['name'], -6) != ' Palys') echo 'Zoas'; else echo 'Palys'?> from
'; debugemail("Error getting zoas: $sErrMsg", 'SQL error in zoas.php'); $sErrorMessage = $sErrMsg; $sErrMsg = ''; } } function LCL_ConvertURLParamsToFriendlyNames() { # Could probably just roll through all the $_GET[] vars, but this is short enough and way more foolproof $_GET['primary-color'] = ucfirst($_GET['primary-color']); $_GET['skirt-color'] = ucfirst($_GET['skirt-color']); $_GET['inner-color'] = ucfirst($_GET['inner-color']); $_GET['outer-color'] = ucfirst($_GET['outer-color']); $_GET['ring-color'] = ucfirst($_GET['ring-color']); return true; } function LCL_GetPageDescription($sLongOrShort='short', $bLowerCase=false) { if ($_GET['primary-color']) { $sPageDescription .= $_GET['primary-color']; if ($_GET['inner-color']) $sPageDescription .= ' & ' . $_GET['inner-color']; if ($_GET['outer-color']) $sPageDescription .= ' & ' . $_GET['outer-color']; } elseif ($_GET['inner-color']) { $sPageDescription .= $_GET['inner-color']; if ($_GET['outer-color'] && $_GET['outer-color'] <> $_GET['inner-color']) $sPageDescription .= ' & ' . $_GET['outer-color']; } elseif ($_GET['outer-color']) { $sPageDescription .= $_GET['outer-color']; } $sPageDescription .= ' Zoas'; if ($_GET['ring-color']) { if (in_array(strtolower($_GET['ring-color']{0}), ['a','e','i','o','u'])) $sAorAn = 'n'; else $sAorAn = ''; $sPageDescription .= " with a$sAorAn " . $_GET['ring-color'] . ' Ring'; if ($_GET['skirt-color']) $sPageDescription .= ' & ' . $_GET['skirt-color'] . ' Skirt/Lashes'; } elseif ($_GET['skirt-color']) { $sPageDescription .= ' with ' . $_GET['skirt-color'] . ' Skirt/Lashes'; } $sPageDescription = trim($sPageDescription); if ($bLowerCase) $sPageDescription = strtolower($sPageDescription); while (strpos($sPageDescription, ' ') !== false) { $sPageDescription = str_replace(' ', ' ', $sPageDescription); } return trim($sPageDescription); } function LCL_ShowFilters($aZoaResults, $aColors) { global $bIsFullList; //$sColors = 'black,blue,brown,gray,green,orange,pink,purple,red,white,yellow'; //$aColors = explode(',', $sColors); //print_r($aColors); //$aSkirtColors = explode(',', $sColors); //$aRingColors = explode(',', $sColors); //array_splice($aRingColors, 7, 1); //$aInnerColors = explode(',', $sColors); #array_splice($aInnerColors, 2, 1); //$aOuterColors = explode(',', $sColors); //array_splice($aOuterColors, 0, 1); //array_splice($aOuterColors, 1, 1); //array_splice($aOuterColors, 6, 1); ?>

Solid Color Zoas
?
Zoas that are primarily a single color

Skirt/Lashes