"; $ret=str_replace('�' . $myvar, $vardata[$myvar], $ret); } return $ret; } $dbh=mysql_pconnect($server,$login,$password); $db=$mydatabase; if(mysql_select_db($db)==FALSE) { if($mydatabase=="") { $mydatabase="test"; } $dbh=mysql_connect(); $db=$mydatabase; if(mysql_select_db($db)==FALSE) { if($server=="" && $login=="" && $password=="" && $mydatabase=="") { display_lng_text("LIB_INC_NO_PARAM"); exit; } else { display_lng_text("LIB_INC_BAD_PARAM"); exit; } } } function affiche_pied_page($MainLink) { global $dbh; /* global $FAMILY; if($MainLink==true) { echo "

 

"; display_lng_text("LIB_INC_MAIN"); echo "
"; }*/ mysql_close($dbh); echo "

 

"; display_lng_text("LIB_INC_OXG"); echo "
"; } function affiche_pied_page_admin($MainLink) { if($MainLink==true) { echo "

 

"; display_lng_text("LIB_INC_LNK_ADMIN"); echo ""; } echo "

"; display_lng_text("LIB_INC_OXG"); } function affiche_lien_individu($id_family, $id_individual, $bAffichePatronyme=true, $bAfficheDate=false) { global $bSosa, $bEvntShort; if($id_family!=-1) { $sReqFam="and id_family=$id_family"; } else { $sReqFam=""; } if($bEvntShort==false) { $sReqCont=" and contemporary=1 "; } else { $sReqCont=""; $sReqCont=" and contemporary=1 "; } $sInd=""; $sReq = "select first_name, libelle "; if($bSosa==true) { $sReq .= ", sosa "; } $sReq .= ", date_naissance, date_deces, contemporary "; $sReq .= " from oxg_individuals, oxg_patronyms "; $sReq .= "where id_individual='$id_individual' "; $sReq .= "and oxg_individuals.id_patronym=oxg_patronyms.id_patronym "; $sReq .= $sReqFam; $result = mysql_query( $sReq ) or mysql_die(); if($row = mysql_fetch_array($result)); { $sInd.=""; if($row['first_name']=="") { $sInd.="?"; } else { $sInd.=$row['first_name']; } if($bAffichePatronyme==true) { $sInd.=" $row[libelle]"; } $sInd.=""; if($bSosa==true && $row['sosa']!='-1') { $sInd=$sInd." $row[sosa]"; } if($bAfficheDate==true && ($row['date_naissance']!="" || $row['date_deces']!="")) { $sInd.=" ("; if($row['date_naissance']!="") { $sInd.="$row[date_naissance]"; } else { $sInd.="?"; } if($row['date_deces']!="") { $sInd.=" - "; $sInd.="$row[date_deces]"; } $sInd.=")"; } } if ($row['first_name']=="" AND $row[libelle]=="") { return "?"; } else { if ($bEvntShort==false and $row['contemporary']==0) {return decode_lng_text('PRIVATE_MSG');} else {return $sInd;} } } function affiche_lien_arbre($id_family, $id_individual) { if($id_family!=-1) { $sReqFam="and id_family=$id_family"; } else { $sReqFam=""; } $sReq = "select id_father, id_mother from oxg_individuals where id_individual=$id_individual $sReqFam"; $result = mysql_query( $sReq ) or mysql_die(); $sLink=""; if($row = mysql_fetch_array($result)) { if($row['id_father']!=-1 || $row['id_mother']!=-1) { $sLink ="\""; "; $sLink.="\"";"; } } return $sLink; } function mysql_die($error = "") { global $strError, $strMySQLSaid, $strBack, $sql_query; echo " $strError

"; if(isset($sql_query) && !empty($sql_query)) { display_lng_text("ERR_MYSQL"); echo " : $sql_query

"; } if(!empty($error)) { echo $strMySQLSaid.$error; echo "

"; } echo $strMySQLSaid.mysql_error(); echo "

"; // echo "

$strBack"; // exit; } function decode_date($sValDate) { $pos = strpos($sValDate, ":"); $sDate = substr($sValDate,0,$pos); list($year, $month, $day) = split('[/.-]', $sDate); if($month!="?") { $month=decode_lng_text("MONTH$month"); } else { $month=""; } if($day=="?") { $day=""; } return "$day $month $year"; } function donne_ind_evnt($id_family, $id_evnt) { if($id_family!=-1) { $sReqFam="and id_family=$id_family"; } else { $sReqFam=""; } $sRes=""; $sql_query = "select id_father, type_father from oxg_events where id_event=$id_evnt $sReqFam"; $result_ind = mysql_query( $sql_query ) or mysql_die(); $row_ind = mysql_fetch_array($result_ind); if($row_ind['type_father']==0) { $sRes=$row_ind['id_father']; } else { $sRes=donne_ind_evnt($id_family, $row_ind['id_father']); } return $sRes; } function display_country_flags($path, $file) { global $sLang; if($sLang!="fra") { echo ""; echo "   "; } if($sLang!="eng") { echo ""; echo "   "; } if($sLang!="nld") { echo ""; echo "   "; } if($sLang!="cro") { echo ""; echo "   "; } if($sLang!="pol") { echo ""; echo "   "; } if($sLang!="rus") { echo ""; echo "   "; } if($sLang!="deu") { echo ""; echo "   "; } if($sLang!="spa") { echo ""; echo "   "; } if($sLang!="prt") { echo ""; echo "   "; } if($sLang!="tur") { echo ""; echo "   "; } } ?> $titre"; echo ""; } // fonction testant si un critere a deja ete // insere dans la requete (avec un flag) function test_where($req_select) { GLOBAL $flag_where; //on test si il y a deja eu un where if ($flag_where) { $req_select = $req_select." WHERE"; $flag_where=0; } else { $req_select = $req_select." AND"; } return $req_select; } // fonction pour l'affichage des pages supp' // parametres nb max de resultat par page, nb max de liens numerotes, nb resultats total, liens a afficher, limite en cours function aff_numeros_pages($nb_res_max,$nb_aff_page,$reponses,$lien_aff,$limite) { if ($reponses>$nb_res_max) { //echo "parametres : aff_numeros_pages($nb_res_max,$nb_aff_page,$reponses,$lien_aff,$limite)
"; //echo "Il y a $reponses résultats, veuillez cliquez ci desous pour accéder aux pages suivantes :
"; if ($reponses>$nb_aff_page) // si on doit afficher les << 1 2 3 >> { $flag_fleches=1; // on calcule les limites de la boucle $debut_boucle=intval($limite-($nb_aff_page/2)+1); $fin_boucle=intval($limite+($nb_aff_page/2)+1); //echo "
DEBUG : limite = $limite | limite req : $limite_req | debut : $debut_boucle | fin : $fin_boucle
"; // on teste les limites pour qu'elles soient correctes // on recupere la != if ($debut_boucle<0) //($limite>($nb_aff_page/2)) { //echo "le debut est avant..."; $difference = intval($debut_boucle*-1); $fin_boucle = intval($fin_boucle+$difference); // au cas ou ! $debut_boucle=0; } // on calcule le nb max de liens en fct du nombre de reponses $max_liens = intval(($reponses/$nb_res_max)+1); //echo "
DEBUG : max_liens : $max_liens
"; // on test et recupere la != entre la fin et le max de numeros de pages if ($fin_boucle>$max_liens) { //echo "
trop grand : if ($fin_boucle>$max_liens)
"; $difference = intval(($fin_boucle-$max_liens)); //echo "
difference : $difference | intval(($nb_aff_page)-($fin_boucle-$max_liens))
"; $debut_boucle = intval($debut_boucle-$difference); if ($debut_boucle<0) $debut_boucle=0; $fin_boucle=$max_liens; } } if (($flag_fleches) && ($limite>($nb_aff_page/2)) && ($max_liens>$nb_aff_page) ) // on test s'il faut des fleches avant { echo " <<"; $lien=intval($debut_boucle-1); echo " < "; } for ($cpt=$debut_boucle;$cpt<$fin_boucle;$cpt++) { $cpt_aff = intval($cpt+1); if ($limite==$cpt) echo "$cpt_aff "; else echo "$cpt_aff "; } if (($flag_fleches) && ($limite<($max_liens-($nb_aff_page/2)-1)) && ($max_liens>$nb_aff_page) ) // on test s'il faut des fleches apres { $lien=intval($fin_boucle); echo " >"; $lien=intval($max_liens-1); echo " >>"; } } //-------------------------------------------------- }// fin de fonction // definitions des tables $table_cities="oxg_cities"; $table_countries="oxg_countries"; $table_events="oxg_events"; $table_events_type="oxg_events_type"; $table_individuals="oxg_individuals"; $table_patronyms="oxg_patronyms"; $table_zones="oxg_zones"; ?>