{ 'des'=>'Personal Information: name, biography, friend groups\' names', 'browse'=>\&browse_personals, 'save'=>\&save_personals, }, 'interests'=>{ 'des'=>'Personal information: interests', 'browse'=>\&browse_interests, 'save'=>\&save_interests, }, 'keywords'=>{ 'des'=>'Picture keywords', 'browse'=>\&browse_pickwd, 'save'=>\&save_pickwd, }, 'memories'=>{ 'des'=>'Text of memory descriptions', 'browse'=>\&browse_memories, 'save'=>\&save_memories, }, 'polls'=>{ 'des'=>'Text of questions/answers for polls you created', 'browse'=>\&browse_polls, 'save'=>\&save_polls, }, 'styles'=>{ 'des'=>'Text of styles and overrides belonging to you', 'browse'=>\&browse_styles, 'save'=>\&save_styles, }, ); unless ($LJ::UNICODE) { $body .= ""; return; } my $remote = LJ::get_remote(); unless ($remote) { $body .= "login. p?>"; return; } my $authas = $GET{'authas'} || $remote->{'user'}; my $u = LJ::get_authas_user($authas); unless ($u) { $body .= LJ::bad_input($ML{'error.invalidauth'}); return; } # extra arguments for get requests my $getextra = $authas ne $remote->{'user'} ? "?authas=$authas" : ''; my $getextra_amp = $getextra ? "&authas=$authas" : ''; my $dbcm = LJ::get_cluster_master($u); my $dbh = LJ::get_db_writer(); my $sth; # avva, kinda improper usage of load_codes, but works i guess -brad LJ::load_codes({ "encname" => \%LJ::CACHE_ENCNAMES } ) unless %LJ::CACHE_ENCNAMES; LJ::load_codes({ "encoding" => \%LJ::CACHE_ENCODINGS } ) unless %LJ::CACHE_ENCODINGS; # check arguments. There are three: mode, area, encid my $mode = $POST{'mode'} || $GET{'mode'}; my $area = $POST{'area'} || $GET{'area'}; my $encid = ($POST{'encid'} || $GET{'encid'}) + 0; # authas switcher form $body .= "
\n\n"; $mode = 'overview' unless defined $mode; if ( ($mode =~ m/^save.*/) && !$encid) { $body .= ""; return; } if ($mode eq 'overview') { $body .= ""; $body .= ""; $body .= "Personal Info page. However, various types of miscellaneous information, such as picture keywords, your name, names of your friend groups, your interests, etc. must be explicitly converted. And this is the purpose of this page. p?>"; $body .= "If your journal is written in English, you always use English for communication in LiveJournal and never use even accent symbols of other West European languages, you do not need to use this page. p?>"; $body .= ""; if ($u->{'oldenc'}) { $body .= "$LJ::CACHE_ENCNAMES{$u->{'oldenc'}} on your personal info page. You can choose to mass-convert all your miscellaneous information to UTF-8 under the assumption that it is all stored in this encoding. Do not choose this option if you might have used some other encoding in the past (anywhere besides your entries and comments) while using LiveJournal. If you are not sure, use the Conversion by Area option below. p?>"; $body .= "\n"; $body .= "\n"; $body .= "\n"; $body .= ""; $body .= " p?>"; } $body .= ""; $body .= ""; unless ($encid) { $encid = ($u->{'oldenc'} ? $u->{'oldenc'} : '1'); }; foreach (@areanames) { $body .= "$areas{$_}->{'des'} p?>"; } } if ($mode eq 'browse') { # need to display the data in given encoding, if it is not UTF-8 $body .= "$areas{$area}->{'des'}: p?>"; my $browse = $areas{$area}->{'browse'}; my ($valid, $disp) = $browse->($u, $encid); if ($valid && !defined($GET{'forceview'})) { $body .= ""; $body .= "return to the area list or force the information to be shown anyway. p?>"; } else { $body .= ""; $body .= "$LJ::CACHE_ENCNAMES{$encid}. If it appears correct, press Save to convert and store it in the database. If some or all characters are displayed corrupted, you probably should choose another encoding from the list below and press Browse to see it displayed in that encoding. p?>"; $body .= ""; $body .= $disp; $body .= ""; $body .= "\n"; $body .= "\n"; $body .= "\n"; $body .= "\n"; $body .= ""; $body .= " p?>"; $body .= "\n"; $body .= "\n"; $body .= "\n"; $body .= LJ::html_select({'name'=>'encid', 'selected'=>$encid}, %LJ::CACHE_ENCNAMES); $body .= ""; $body .= " p?>"; $body .= "go back to the area list. p?>"; }; } if ($mode eq 'save') { $body .= "$areas{$area}->{'des'}
$LJ::CACHE_ENCNAMES{$encid}. p?>"; $body .= "$LJ::CACHE_ENCNAMES{$encid} (the technical name of which is $LJ::CACHE_ENCODINGS{$encid}). If you chose a wrong encoding, the text will display incorrectly after the conversion. p?>"; $body .= ""; $body .= "\n"; $body .= "\n"; $body .= "\n"; $body .= "\n"; $body .= ""; $body .= ""; $body .= " p?>"; } if ($mode eq 'saveall') { $body .= "$LJ::CACHE_ENCNAMES{$encid}. p?>"; $body .= "$LJ::CACHE_ENCNAMES{$encid} (the technical name of which is $LJ::CACHE_ENCODINGS{$encid}). If you chose a wrong encoding, the text will display incorrectly after the conversion. p?>"; $body .= ""; $body .= "\n"; $body .= "\n"; $body .= "\n"; $body .= "\n"; $body .= ""; $body .= ""; $body .= " p?>"; } if ($mode eq 'save_do') { $body .= "$areas{$area}->{'des'}... p?>"; my $save = $areas{$area}->{'save'}; my ($success, $message) = $save->($u, $encid); if ($success) { $body .= ""; $body .= $message; } else { $body .= ""; } } if ($mode eq 'saveall_do') { $body .= ""; foreach (@areanames) { $body .= "$areas{$_}->{'des'}... p?>"; my $save = $areas{$_}->{'save'}; my ($success, $message) = $save->($u, $encid); if ($success) { $body .= ""; $body .= $message; } else { $body .= ""; } } } return; sub browse_personals { my ($u, $encid) = @_; my $ret = ""; my ($name, $bio, $groups); LJ::load_user_props($u, qw(url urlname)); $name = $u->{'name'}; if ($u->{'has_bio'} eq "Y") { $bio = $dbcm->selectrow_array("SELECT bio FROM userbio WHERE userid=$u->{'userid'}"); }; $groups = ""; $sth = $dbh->prepare("SELECT groupname FROM friendgroup WHERE userid=$u->{'userid'}"); $sth->execute; while (($_) = $sth->fetchrow_array) { $groups .= $_ . ' '; }; my $valid = LJ::is_utf8($name . ' ' . $u->{'url'} . ' ' . $u->{'urlname'} . ' ' . $bio . ' ' . $groups); convert(\$name, $encid); convert(\$u->{'url'}, $encid); convert(\$u->{'urlname'}, $encid); convert(\$bio, $encid) if $bio; convert(\$groups, $encid); $ret = "Name: $name