Post by Phone Access Numbers body<= 0) { if ($remote) { $ret .= "Post by Phone service, ". "so only the area code and city of each number is displayed. If you'd like to make ". "posts to your journal through your phone, see the Paid Accounts ". "page for information on purchasing a paid account. p?>"; } else { $ret .= "Post by Phone number. Paid Accounts can ". "log in to see the complete set of phone numbers. p?>"; } } else { $ret .= "Post by Phone interface can be reached by calling any of the following numbers: p?>"; } my $nums = LJ::MemCache::get("phonepost_nums"); unless ($nums) { my %sname; LJ::load_codes({ "state" => \%sname }); $nums = {}; # state code -> [ [number, city]* ] open (NUM, "$ENV{LJHOME}/other_sites/phonepost/numbers.csv"); while () { next unless /^(\w\w+)\s*,\s*(\d\d\d\-\d\d\d)\s*[,\-]\s*(\d\d\d\d)\s*\,\s*(.+?)\s*\n/; my ($state, $exch, $number, $city) = ($1, $2, $3, $4); if ($city eq uc($city)) { $city = lc($city); $city =~ s/\b(\w)/\u$1/g; } my $sname = $sname{$state} || $state; $city =~ s/\s*Zone.+//; $nums->{$sname} ||= []; push @{$nums->{$sname}}, [ "$exch-$number", $city ]; } foreach my $st (keys %$nums) { $nums->{$st} = [ sort { lc($a->[1]) cmp lc($b->[1]) } @{$nums->{$st}} ]; } LJ::MemCache::set("phonepost_nums", $nums, 60*5); } my $tot = 0; $tot += scalar(@{$nums->{$_}}) foreach (keys %$nums); $ret .= "Jump to: " . join(" | ", map { "$_" } sort { lc($a) cmp lc($b) } keys %$nums); my $shown = 0; my $col = 1; $ret .= "
"; $ret .= "Caution:
Some local telephone companies charge for local calls that are outside of your selected calling plan."; $ret .= "

If you are not sure that an access number is within your calling plan, contact your local telephone company."; $ret .= "

You are responsible for all charges associated with calling this service.
"; $ret .= " p?>"; $ret .= "
"; foreach my $sname (sort { lc($a) cmp lc($b) } keys %$nums) { $ret .= "\n"; foreach my $rec (@{$nums->{$sname}}) { my $shownum = $rec->[0]; $shownum =~ s/^(\d{3})[-\s.](\d{3})[-\s.](\d{4})/$1-xxx-xxxx/ unless $quota > 0; $ret .= "$shownum: $rec->[1]
\n"; $shown++; } if ($col == 1 && $shown > ($tot / 2)) { $col++; $ret .= "
"; } } $ret .= "
"; $ret .= "" if $quota > 0; return $ret; } _code?> <=body page?>