Committer: ailyin
LJSUP-8584 (ONTD: Top tags for month)U trunk/bin/upgrading/proplists.dat U trunk/bin/upgrading/s2layers/core1.s2 U trunk/cgi-bin/LJ/S2.pm U trunk/cgi-bin/taglib.pl
Modified: trunk/bin/upgrading/proplists.dat =================================================================== --- trunk/bin/upgrading/proplists.dat 2011-06-15 07:07:17 UTC (rev 19285) +++ trunk/bin/upgrading/proplists.dat 2011-06-15 08:04:51 UTC (rev 19286) @@ -1662,3 +1662,11 @@ datatype: char prettyname: Reposted from des: In case this entry is a repost, the URL of the original entry that was reposted + +userproplist.recent_logtags: + datatype: blobchar + prettyname: Recently used tags + des: Recently used tags, a compressed JSON structure with its format similar to the output of LJ::Tags::get_usertags + indexed: 0 + multihomed: 0 + cldversion: 8 Modified: trunk/bin/upgrading/s2layers/core1.s2 =================================================================== --- trunk/bin/upgrading/s2layers/core1.s2 2011-06-15 07:07:17 UTC (rev 19285) +++ trunk/bin/upgrading/s2layers/core1.s2 2011-06-15 08:04:51 UTC (rev 19286) @@ -1944,6 +1944,12 @@ } set text_i_like_this = "Please click Track this if you want to receive all comments to this entry"; +property string tag_cloud_tags { + des = "Tags shown in the tag cloud"; + values = "recent|recently-used|all|all"; +} +set tag_cloud_tags = "all"; + ###[ global function implementations ] function prop_init () Modified: trunk/cgi-bin/LJ/S2.pm =================================================================== --- trunk/cgi-bin/LJ/S2.pm 2011-06-15 07:07:17 UTC (rev 19285) +++ trunk/cgi-bin/LJ/S2.pm 2011-06-15 08:04:51 UTC (rev 19286) @@ -4271,6 +4271,7 @@ sub Page__visible_tag_list { my ($ctx, $this) = @_; + return $this->{'_visible_tag_list'} if defined $this->{'_visible_tag_list'}; @@ -4278,7 +4279,24 @@ my $u = $LJ::S2::CURR_PAGE->{'_u'}; return [] unless $u; - my $tags = LJ::Tags::get_usertags($u, { remote => $remote }); + my $tags; + + my $tag_cloud_tags = $ctx->[S2::PROPS]->{'tag_cloud_tags'}; + if ( $tag_cloud_tags eq 'all' ) { + $tags = LJ::Tags::get_usertags($u, { remote => $remote }); + } else { + my $propval = $u->prop('recent_logtags'); + return [] unless $propval; + + my $parse_result = eval { + $tags = LJ::JSON->from_json( LJ::text_uncompress($propval) ); + LJ::Tags::filter_accessible_tags( $u, $remote, $tags ); + 1; + }; + + return [] unless $parse_result; + } + return [] unless $tags; my @taglist; Modified: trunk/cgi-bin/taglib.pl =================================================================== --- trunk/cgi-bin/taglib.pl 2011-06-15 07:07:17 UTC (rev 19285) +++ trunk/cgi-bin/taglib.pl 2011-06-15 08:04:51 UTC (rev 19286) @@ -410,6 +410,7 @@ }, 'security_level' => 'private', 'uses' => 0, + 'display' => 1, }; }