3){ $num_of_dashes=substr_count($bdate, '-'); if($num_of_dashes==2){ $bdate_type="month"; $bdatedisplay=getMonthName(str_replace("-","", $bdate)); }else if($num_of_dashes==1){ $bdate_type="day"; $bdatedisplay=getMonthName(substr($bdate, 0, 2))." ".substr($bdate,-2)."."; }else{ $bdate_type="year"; } $bdatebornin=""; if($lng=="hun"){ $bdatebornin=", akik ekkor születtek"; }else{ $bdatebornin=" who were born"; if($bdate_type=="year"){ $bdatebornin.=" in"; }else{ $bdatebornin.=" on"; } } if($bdate_type=="year"){ $bdatedisplay=$bdate; } } function getMonthName($month){ GLOBAL $txt; switch ($month) { case 01: $release_month=$txt["january"]; break; case 02: $release_month=$txt["february"]; break; case 03: $release_month=$txt["march"]; break; case 04: $release_month=$txt["april"]; break; case 05: $release_month=$txt["may"]; break; case 06: $release_month=$txt["june"]; break; case 07: $release_month=$txt["july"]; break; case 8: $release_month=$txt["august"]; break; case 9: $release_month=$txt["september"]; break; case 10: $release_month=$txt["october"]; break; case 11: $release_month=$txt["november"]; break; case 12: $release_month=$txt["december"]; break; } return $release_month; } if (isset($_GET['loc_id'])){ $loc_id=$_GET['loc_id']; }else{ $loc_id=12; } $loc_type=""; if (isset($_GET['loc_type'])){ if($_GET['loc_type']=="sub" || $_GET['loc_type']=="con"){ $loc_type=$_GET['loc_type']; }else{ $loc_type="sta"; } }else{ $loc_type="sta"; } $birthplace=""; if($loc_type=="con"){ $pagerquery = "SELECT id FROM loc_sub WHERE con_id='".$loc_id."' ORDER BY id ASC "; $waneresult = mysql_query($pagerquery) or die(mysql_error()); while($sor = mysql_fetch_array($waneresult)){ $pagerquery2 = "SELECT id FROM loc_sta WHERE sub_id='".$sor['id']."' ORDER BY id ASC "; $waneresult2 = mysql_query($pagerquery2) or die(mysql_error()); while($sor2 = mysql_fetch_array($waneresult2)){ if(strlen($birthplace)>0){ $birthplace.=","; } $birthplace.=$sor2['id']; } } }else if($loc_type=="sub"){ $pagerquery2 = "SELECT id FROM loc_sta WHERE sub_id='".$loc_id."' ORDER BY id ASC "; $waneresult2 = mysql_query($pagerquery2) or die(mysql_error()); while($sor = mysql_fetch_array($waneresult2)){ if(strlen($birthplace)>0){ $birthplace.=","; } $birthplace.=$sor['id']; } }else{ $birthplace=$loc_id; } /*kell egy query ami megadja a sorok számát*/ $counted="DISTINCT name"; if(strlen($bdate)<4){ if($cat=="dir"){ $pagerquery = "SELECT COUNT(" . $counted . ") FROM persons szemelyek, director rendezo WHERE (birthplace IN (".$birthplace.") AND szemelyek.person_id=rendezo.person_id)"; }else if($cat=="act"){ $pagerquery = "SELECT COUNT(" . $counted . ") FROM persons szemelyek, actor szinesz WHERE (birthplace IN (".$birthplace.") AND szemelyek.person_id=szinesz.person_id)"; }else if($cat=="wri"){ $pagerquery = "SELECT COUNT(" . $counted . ") FROM persons szemelyek, writer iro WHERE (birthplace IN (".$birthplace.") AND szemelyek.person_id=iro.person_id)"; }else if($cat=="com"){ $pagerquery = "SELECT COUNT(" . $counted . ") FROM persons szemelyek, composer zeneszerzo WHERE (birthplace IN (".$birthplace.") AND szemelyek.person_id=zeneszerzo.person_id)"; }else{ $pagerquery = "SELECT COUNT(" . $counted . ") FROM persons WHERE birthplace IN (".$birthplace.") "; } }else{ if($cat=="dir"){ $pagerquery = "SELECT COUNT(" . $counted . ") FROM persons szemelyek, director rendezo WHERE (dob LIKE '%".$bdate."%' AND szemelyek.person_id=rendezo.person_id)"; }else if($cat=="act"){ $pagerquery = "SELECT COUNT(" . $counted . ") FROM persons szemelyek, actor szinesz WHERE (dob LIKE '%".$bdate."%' AND szemelyek.person_id=szinesz.person_id)"; }else if($cat=="wri"){ $pagerquery = "SELECT COUNT(" . $counted . ") FROM persons szemelyek, writer iro WHERE (dob LIKE '%".$bdate."%' AND szemelyek.person_id=iro.person_id)"; }else if($cat=="com"){ $pagerquery = "SELECT COUNT(" . $counted . ") FROM persons szemelyek, composer zeneszerzo WHERE (dob LIKE '%".$bdate."%' AND szemelyek.person_id=zeneszerzo.person_id)"; }else{ $pagerquery = "SELECT COUNT(" . $counted . ") FROM persons WHERE dob LIKE '%".$bdate."%' "; } } /* majd a pager.php-ban számolódik ki */ $waneresult = mysql_query($pagerquery) or die(mysql_error()); while($row = mysql_fetch_array($waneresult)){ $wane=$row['COUNT('.$counted.')']; } /* if ($wane==1) { if($cat=="dir"){ $oneparancs = "SELECT szemelyek.person_id, name, dob FROM persons szemelyek, director rendezo WHERE (birthplace IN (".$birthplace.") AND szemelyek.person_id=rendezo.person_id) GROUP BY name ORDER BY dob DESC" ; }else if($cat=="act"){ $oneparancs = "SELECT szemelyek.person_id, name, dob FROM persons szemelyek, actor szinesz WHERE (birthplace IN (".$birthplace.") AND szemelyek.person_id=szinesz.person_id) GROUP BY name ORDER BY dob DESC" ; }else if($cat=="wri"){ $oneparancs = "SELECT szemelyek.person_id, name, dob FROM persons szemelyek, writer iro WHERE (birthplace IN (".$birthplace.") AND szemelyek.person_id=iro.person_id) GROUP BY name ORDER BY dob DESC" ; }else if($cat=="com"){ $oneparancs = "SELECT szemelyek.person_id, name, dob FROM persons szemelyek, composer zeneszerzo WHERE (birthplace IN (".$birthplace.") AND szemelyek.person_id=zeneszerzo.person_id) GROUP BY name ORDER BY dob DESC" ; }else{ $oneparancs = "SELECT person_id, name FROM persons WHERE birthplace IN (".$birthplace.") GROUP BY name ORDER BY dob DESC" ; } $oneeredmeny = mysql_query($oneparancs, $conn) or die("Nem tudtam az adatokat lekérni. A hiba oka: ".mysql_error()); while ( $sor = mysql_fetch_array($oneeredmeny)){ $oneperson_id="person.php?id=".$sor["person_id"]; } header("location: $oneperson_id"); echo ""; }*/ $lngsta=$lng."_sta"; $lngsub=$lng."_sub"; $lngcon=$lng."_con"; if ($loc_type=="sta"){ $sta_id = $loc_id; $con_id; } else if ($loc_type=="con"){ $con_id= $loc_id; } else if ($loc_type=="sub"){ $sub_id= $loc_id; } $sta_id; $sub_id; $con_id; $sta_name; $sub_name; $con_name; $locationsor=""; if ($loc_type=="sta"){ $parancs3 = "SELECT id, ".$lngsta.", sub_id FROM loc_sta WHERE id ='" .$sta_id."' "; $eredmeny3 = mysql_query($parancs3, $conn) or die("Nem tudtam az adatokat lekérni. A hiba oka: ".mysql_error()); while ( $sor3 = mysql_fetch_array($eredmeny3)) { $sta_link = "".$sor3[$lngsta]."  "; $sta_name =$sor3[$lngsta]; $sub_id = $sor3['sub_id']; } } if ($loc_type=="sub" || $loc_type=="sta"){ $parancs3 = "SELECT id, ".$lngsub.", con_id FROM loc_sub WHERE id ='" .$sub_id."&cat=".$cat."' "; $eredmeny3 = mysql_query($parancs3, $conn) or die("Nem tudtam az adatokat lekérni. A hiba oka: ".mysql_error()); while ( $sor3 = mysql_fetch_array($eredmeny3)) { $sub_link = "".$sor3[$lngsub].""; $sub_name=$sor3[$lngsub]; $con_id = $sor3['con_id']; } } $parancs4 = "SELECT id, ".$lngcon." FROM loc_con WHERE id ='" .$con_id."' "; $eredmeny4 = mysql_query($parancs4, $conn) or die("Nem tudtam az adatokat lekérni. A hiba oka: ".mysql_error()); while ( $sor4 = mysql_fetch_array($eredmeny4)) { /* $locationsor .= "  ".$sor4[$lngcon]." <<  "; */ $con_link = "".$sor4[$lngcon].""; $con_name=$sor4[$lngcon]; } ?> <?php if($cat=="dir"){ echo $txt["directors"]; }else if($cat=="act"){ echo $txt["actors"]; }else if($cat=="wri"){ echo $txt["writers"]; }else if($cat=="com"){ echo $txt["composers"]; }else{ print $txt["persons"]; } if(strlen($bdate)<4){ echo " ". $txt['from'].": "; if($loc_type=="con"){ echo $con_name; }else if($loc_type=="sub"){ echo $sub_name; }else{ echo $sta; } }else{ echo $bdatebornin.": ". $bdatedisplay; } ?> - FilmO
"; echo " 
"; //CAT holder if($cat!="com"){ echo "
"; } if($cat!="act"){ echo "
"; } if($cat!="wri"){ echo "
"; } if($cat!="dir"){ echo "
"; } if(strlen($cat)>0){ echo "
"; } echo "
"; //end CAT holder echo ""; ?>

".$con_link." >> ".$sub_link."

"; $location=$sta_name; }else if($loc_type=="sub"){ $preloc="

".$con_link."

"; $location=$sub_name; }else{ $preloc=""; $location=$con_name; } $locationtext=" ".$txt['from'].":

".$preloc."

".$location; if(strlen($bdate)<4){ if($cat=="dir"){ echo $txt["directors"]; echo $locationtext."

"; }else if($cat=="act"){ echo $txt["actors"]; echo $locationtext."

"; }else if($cat=="wri"){ echo $txt["writers"]; echo $locationtext."

"; }else if($cat=="com"){ echo $txt["composers"]; echo $locationtext."

"; }else{ print $txt["persons"]; echo $locationtext."

"; } }else{ $locationtext="".$bdatebornin.":

".$bdatedisplay; if($cat=="dir"){ echo $txt["directors"]; echo $locationtext."

"; }else if($cat=="act"){ echo $txt["actors"]; echo $locationtext."

"; }else if($cat=="wri"){ echo $txt["writers"]; echo $locationtext."

"; }else if($cat=="com"){ echo $txt["composers"]; echo $locationtext."

"; }else{ print $txt["persons"]; echo $locationtext."

"; } } ?>

".$txt["no_matches_found_for_this_condition"]."

"; print "

".$txt["all_persons_from_this location"]."

"; } else { ?> "; echo ""; $count=0; $numofrows=mysql_num_rows($eredmeny); $eredmeny = mysql_query($parancs, $conn) or die("Nem tudtam az adatokat lekérni. A hiba oka: ".mysql_error()); while ( $sor = mysql_fetch_array($eredmeny)){ //echo "
".$i.": ".$keys[$i] ." >> ".$values[$i]."db"; $person_id=$sor['person_id']; $name=$sor['name']; $dob=$sor['dob']; echo ""; echo ""; $nickcheckquery= "SELECT person_id FROM favpersons WHERE person_id='" . $person_id . "' AND nick='" . $_SESSION['nick'] . "' " ; $nickcheckresult = mysql_query($nickcheckquery) or die(mysql_error()); $nickfav=0; $nickfav= mysql_num_rows($nickcheckresult); if($_SESSION['belepett'] == true){ if($nickfav>0){ $isFavPerson="favPersonActive"; $favPersonTitle=$txt['delete_from_favourites']; }else{ $isFavPerson=""; $favPersonTitle=$txt['add_to_favourites']; } $favpersonajaxbutton="favPersonAjaxButton"; $numberOfFavPersonsId="numberOfFavPersons"; }else{ $favpersonajaxbutton="favPersonAjaxButtonNo"; $favPersonTitle=$txt['add_to_favourites']; $numberOfFavPersonsId="numberOfFavPersonsNo"; } echo "
"; print "
"; print "
"; //"
". $numberOfFavPersons." ".$txt['members']." ".$txt['marked_as_favourite']."\" class='hastipButton'>".ucfirst(strtolower($txt['favourite']))." [".$numberOfFavPersons."]
"; print "
"; if(strlen($bdate)>3){ $dobdisplay=$dob; if($bdate_type=="year"){ if($lng=="hun"){ $dobdisplay=getMonthName(substr($sor['dob'],5,2))." ".substr($dob,8,12)."."; }else{ $dobdisplay=substr($sor['dob'],8,12)." ".getMonthName(substr($dob,5,2)); } } if($bdate_type=="month"){ if($lng=="hun"){ $dobdisplay=substr($sor['dob'],0,4).". ".getMonthName(substr($dob,5,2))." ".substr($dob,8,12)."."; }else{ $dobdisplay=substr($sor['dob'],8,12)." ".getMonthName(substr($dob,5,2))." ".substr($dob,0,4).""; } } if($bdate_type=="day"){ $dobdisplay=substr($dob,0,4); } echo "
$dobdisplay
"; } echo "
"; echo ""; if($count%3==2){ echo ""; } $count++; } if($numofrows%3!=2){ echo ""; } echo ""; } ?>