/** * If we define this funciton it will simply be used by the people_lib to * allow us to print more details about a person when that person is * identified as a new person. */ function shouldAddDetailsFunction($name) { // For now I will just print the people that I already know are in this // college. Maybe in the future this method should be fancier? // What is the college that this guy is running for? $s = mysql_query("SELECT cand.college, parties.name " . "FROM results_2008_candidates AS cand " . "LEFT JOIN results_2008_parties AS parties " . "ON parties.id = cand.idpartid " . "WHERE nume = '{$name}'"); $r = mysql_fetch_array($s); list($cod, $judet) = split(" ", $r['college']); $college = "{$judet}-{$cod}"; $jsel = mysql_query("SELECT id FROM counties WHERE name='{$judet}'"); if ($rsel = mysql_fetch_array($jsel)) { $url = "http://alegeri-2008.ro/candidati/x-{$rsel['id']}/"; } info(" ({$r['name']})"); info(" În colegiul <a href={$url}>{$college}</a>"); $s = mysql_query("SELECT people.name, people.display_name " . "FROM alegeri_2008_candidates AS cand " . "LEFT JOIN alegeri_2008_colleges AS colleges " . "ON colleges.id = cand.college_id " . "LEFT JOIN people ON people.id = cand.idperson " . "WHERE colleges.url LIKE '%/{$college}'"); while ($r = mysql_fetch_array($s)) { info(" " . $r['display_name'] . " " . getResolveString($name, $r['name'], "<=")); } }
/** * Prints the matching decision between a name and a person. The method * attempts to print extra information about the person that we thing this * matches so we can make a good decision about whether this is the right * match. */ function printMatchDecision($name, $person) { info(getResolveString($name, $person->name) . " " . $person->toString()); info(" " . getHistoryString($person)); }