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['i_sname'], $b['i_sname']); //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 monaghanhearth WHERE i_sname 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]['i_sname']=(string) $myrow[1]; $list[$index]['i_townland']=(string) $myrow[2]; $list[$index]['i_parish']=(string) $myrow[3]; $list[$index]['i_barony']=(string) $myrow[4]; $list[$index]['i_link']=(string) $myrow[5]; $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['i_sname']==$name){//if an exact match then copy to a new array and delete this value from the original array $match[$index_m]['i_sname']=$list[$index]['i_sname']; $match[$index_m]['i_townland']=$list[$index]['i_townland']; $match[$index_m]['i_parish']=$list[$index]['i_parish']; $match[$index_m]['i_barony']=$list[$index]['i_barony']; $match[$index_m]['i_link']=$list[$index]['i_link']; unset($list[$index]); $index_m++;//increment } elseif((strlen($val['i_sname'])>strlen($name))&&(substr($val['i_sname'],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]['i_sname']=$list[$index]['i_sname']; $half_match[$index_h]['i_townland']=$list[$index]['i_townland']; $half_match[$index_h]['i_parish']=$list[$index]['i_parish']; $half_match[$index_h]['i_barony']=$list[$index]['i_barony']; $half_match[$index_h]['i_link']=$list[$index]['i_link']; unset($list[$index]); $index_h++;//increment } $index++;//increment } } ob_start('ob_gzhandler');//start compression of the next output ?> Hearth Money Roll - Monaghan 1663-1665

Hearth Money Roll - Monaghan, 1663-1665

Click on the link to view the scanned document.

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 ''; } ?>
 
Name Townland Parish Barony Link
'.$error.'
There are NO exact matches.
Following are the exact matches:
'.($val['i_sname']).' '.($val['i_townland']).' '.($val['i_parish']).' '.($val['i_barony']).' '.($val['i_city']).' link:'.($val['i_link']).'
There are NO matches starting with the search string.
These are matches starting with the search string:
'.($val['i_sname']).' '.($val['i_townland']).' '.($val['i_parish']).' '.($val['i_barony']).' '.($val['i_city']).' link:'.($val['i_link']).'
Rest of the matches:
'.($val['i_sname']).' '.($val['i_townland']).' '.($val['i_parish']).' '.($val['i_barony']).' '.($val['i_city']).' link:'.($val['i_link']).'
END OF SEARCH
NEW SEARCH