Beispiel #1
0
debug_timestamp();

// Limit to specific types of representatives
$fyr_all_url = null;
if ($area_types) {
    $a = array();
    foreach (array_keys($area_types) as $t) {
        if (array_key_exists($t, $voting_areas))
            $a[$t] = $voting_areas[$t];
        if (array_key_exists($t, $va_inside)
            && array_key_exists($va_inside[$t], $voting_areas))
            $a[$va_inside[$t]] = $voting_areas[$va_inside[$t]];
    }
    $voting_areas = $a;
    $fyr_all_url = '';
    $cobrand_all_url = cobrand_main_write_url($cobrand, $fyr_postcode, $cocode, fyr_external_referrer());
    if ($cobrand_all_url != '') {
        $fyr_all_url = $cobrand_all_url;
    } else {
        $fyr_all_url = htmlspecialchars(url_new('who', false,
                        'pc', $fyr_postcode,
                        'fyr_extref', fyr_external_referrer(),
                        'cocode', $cocode));
    }
}

// If in a county, but not a county electoral division, display explanation
// (which is lack of data from Ordnance Survey)
$fyr_county_note = false;
if (array_key_exists('CTY', $voting_areas) && !array_key_exists('CED', $voting_areas)) {
    $fyr_county_note = true; 
Beispiel #2
0
function limit_areas($area_types, &$voting_areas)
{
    global $va_inside;
    if (!$area_types) {
        return null;
    }
    $a = array();
    foreach (array_keys($area_types) as $t) {
        if (array_key_exists($t, $voting_areas)) {
            $a[$t] = $voting_areas[$t];
        }
        if (array_key_exists($t, $va_inside) && array_key_exists($va_inside[$t], $voting_areas)) {
            $a[$va_inside[$t]] = $voting_areas[$va_inside[$t]];
        }
    }
    $voting_areas = $a;
    global $cobrand, $fyr_postcode, $cocode;
    if ($cobrand_all_url = cobrand_main_write_url($cobrand, $fyr_postcode, $cocode, fyr_external_referrer())) {
        return $cobrand_all_url;
    }
    return htmlspecialchars(url_new('who', false, 'pc', $fyr_postcode, 'fyr_extref', fyr_external_referrer(), 'cocode', $cocode));
}