9,11d8 < $backsome=-3; < $bckbit=''; < $forbit=''; 16,25c13 < if (strtolower(substr($intrm,($backsome - 1),4)) == ' of ') { < if (strtolower(substr($intrm,($backsome - 2),5)) >= '0 of ' && strtolower(substr($intrm,($backsome - 2),5)) <= '9 of ') { < $isordinal=true; < $bckbit=' '; < } else { < $forbit=substr($intrm,$backsome,3); < $backsome-=3; < } < } < if (substr($intrm,($backsome - 1),1) >= '0' && substr($intrm,($backsome - 1),1) <= '9') { --- > if (substr($intrm,-4,1) >= '0' && substr($intrm,-4,1) <= '9') { 27c15 < switch (strtolower(substr($intrm,$backsome,2))) { --- > switch (strtolower(substr($intrm,-3,2))) { 43,44c31 < //return str_replace($bckbit . substr($intrm,$backsome,3) . $forbit, ' ', str_replace($bckbit . substr($intrm,$backsome,3) . $forbit . $needle . ',', substr($intrm,$backsome,3) . $needle . ' ', str_replace($bckbit . substr($intrm,$backsome,3) . $forbit . $needle . ', ', substr($intrm,$backsome,3) . $needle . ' ', $haystack))); < return str_replace($bckbit . substr($intrm,$backsome,3) . $forbit, ' ', str_replace($bckbit . substr($intrm,$backsome,3) . $forbit . $needle . ',', ' ' . $needle . ' ', str_replace($bckbit . substr($intrm,$backsome,3) . $forbit . $needle . ', ', ' ' . $needle . ' ', $haystack))); --- > return str_replace(substr($intrm,-3,3), ' ', str_replace(substr($intrm,-3,3) . $needle . ',', substr($intrm,-3,3) . $needle . ' ', $haystack)); 51,56d37 < $origviapm=$viapm; < $orthere=false; < $andthere=false; < $ors=[]; < $ands=[]; < $orands=[]; 64,80d44 < $andors=explode('&&',str_replace('||', '&&', $viapm)); < for ($ii=0; $ii 0) { < if (strpos($origviapm, '&&' . $andors[$ii]) !== false) { < array_push($ands, $orands[-1 + $ii]); < $andthere=true; < } else if (strpos($origviapm, '||' . $andors[$ii]) !== false) { < array_push($ors, $orands[-1 + $ii]); < $orthere=true; < } < } < if (sizeof($andors) > 1) { < $viapm=trim($andors[$ii]); < } else { < $viapm=$andors[$ii]; < } 299,300d262 < array_push($orands, $previa . $viapm); < } 304,320c266 < $worryaboutlast=true; < $worryless=false; < if ($andthere) { < for ($ijk=0; $ijk if (preg_match('/' . $previa . $viapm . '/i', $title)) {