Fáilte Romhat

The site is back online but there are issues with some search pages and the gallery. I am working on correcting these.

  $var) $_POST[$key]=str_replace('`','',$_POST[$key]); //This function gets text from _POST and tweaks it to our needs then returns modified text function safe($text){ $text=(string) $text; //make sure it is a string $text=utf8_decode($text); //decode to a normal char set $text=stripslashes($text);//remove any slashes inputted by POST $text=strip_tags($text); //remove any tags that might high-jack the script $text=strtolower($text);//make letters of small case (esspecially the REGIONS that come capitalized) $text=ucwords($text);// make first letter of each word capital $text=trim($text);//remove any white space on the sides return $text; //return string } //This function is for ordering and sorting the array function comp($a, $b) { return strnatcasecmp($a['lastname'], $b['lastname']); //returns a value based on the sort decision } //declare our arrays $list_array=array(); //these will hold the output values $list=array(); $match=array(); $half_match=array(); $user_errors=array(); //start testing input if (count($_POST)==0) $user_errors[]='No search string received.'; //POST is empty, nothing is passed if (count($user_errors)==0) //see if there are no previous errors in our error array if ($db===FALSE) $user_errors[]='Database ERROR, please try again later.';//Stop processing because of a database connection failure if (count($user_errors)==0){ //see if there are no previous errors in our error array if (strlen($_POST['surname']) ==0) $user_errors[]='No "Surname" was specified.'; //Surname is not passed with POST elseif (strlen(trim(stripslashes($_POST['surname']))) <3) $user_errors[]='There should be at least three letters in "Surname".'; //Surname is too short (too many matches will be produced killing performance) elseif (strlen(trim(stripslashes($_POST['surname']))) >20) $user_errors[]='"Surname" is over limit of 20 characters.'; //Way to big a string, will overload a database as well } if (count($user_errors)==0){ //see if there are no previous errors in our error array $name=safe($_POST['surname']); //process POST value $index=0;//reset $list=array();//reset array for RE-USE $result = mysql_query('SELECT * FROM rosstithe WHERE lastname LIKE "%'.trim($name).'%"'); if ((mysql_num_rows($result)>0) || ($result ===FALSE)) { //see if anything was returned while ($myrow = mysql_fetch_row($result)){ //walk through the returned values $list[$index]['lastname']=(string) $myrow[1]; $list[$index]['forename']=(string) $myrow[2]; $list[$index]['townland1']=(string) $myrow[3]; $list[$index]['townland2']=(string) $myrow[4]; $list[$index]['townland3']=(string) $myrow[5]; $list[$index]['townland4']=(string) $myrow[6]; $index++;//increment } } mysql_free_result($result);//free memory usort($list, 'comp'); //sort array based on the last name (see function 'comp()' ) $index=0;//reset $index_m=0;//new index $index_h=0;//new index foreach ($list as $val){//walk through the array that has all the values with the "like" surnames if ($val['lastname']==$name){//if an exact match then copy to a new array and delete this value from the original array $match[$index_m]['lastname']=$list[$index]['lastname']; $match[$index_m]['forename']=$list[$index]['forename']; $match[$index_m]['townland1']=$list[$index]['townland1']; $match[$index_m]['townland2']=$list[$index]['townland2']; $match[$index_m]['townland3']=$list[$index]['townland3']; $match[$index_m]['townland4']=$list[$index]['townland4']; unset($list[$index]); $index_m++;//increment } elseif((strlen($val['lastname'])>strlen($name))&&(substr($val['lastname'],0,strlen($name))==$name)){ //if starts with the search string then copy to a new array and delete this value from the original array $half_match[$index_h]['lastname']=$list[$index]['lastname']; $half_match[$index_h]['forename']=$list[$index]['forename']; $half_match[$index_h]['townland1']=$list[$index]['townland1']; $half_match[$index_h]['townland2']=$list[$index]['townland2']; $half_match[$index_h]['townland3']=$list[$index]['townland3']; $half_match[$index_h]['townland4']=$list[$index]['townland4']; unset($list[$index]); $index_h++;//increment } $index++;//increment } } ob_start('ob_gzhandler');//start compression of the next output ?> Search Results:

1830 - Rosscarbery Tithe Applotment

If you would like to view all the records in one file click here

0){ //If there were errors then output them foreach ($user_errors as $error){ echo ''; } } else {//No errors, then we can output our search if (count($match)==0){ //There were no exact matches echo ''; }else{//There were exact matches echo ''; foreach ($match as $val){ //walk through the array outputting values to a table echo ''; } } if (count($half_match)==0){//there were no half matches echo ''; }else{//there were half matches echo ''; foreach ($half_match as $val){//walk through the array outputting values to a table echo ''; } } if (count($list)>0){ //There are other matches echo ''; foreach ($list as $val){//walk through the array outputting values to a table echo ''; } } //END OF SEARCH echo ''; } ?>
 
Surname Forename Townland Townland Townland Townland
'.$error.'
There are NO exact matches.
Following are the exact matches:
'.($val['lastname']).''.($val['forename']).''.($val['townland1']).''.($val['townland2']).''.($val['townland3']).''.($val['townland4']).'
There are NO matches starting with the search string.
These are matches starting with the search string:
'.($val['lastname']).''.($val['forename']).''.($val['townland1']).''.($val['townland2']).''.($val['townland3']).''.($val['townland4']).'
Rest of the matches:
'.($val['lastname']).''.($val['forename']).''.($val['townland1']).''.($val['townland2']).''.($val['townland3']).''.($val['townland4']).'
END OF SEARCH
NEW SEARCH