Committer: akanashin
U trunk/bin/upgrading/en_LJ.dat U trunk/cgi-bin/LJ/Widget/HomepageEN.pm
Modified: trunk/bin/upgrading/en_LJ.dat =================================================================== --- trunk/bin/upgrading/en_LJ.dat 2011-11-30 11:01:43 UTC (rev 11228) +++ trunk/bin/upgrading/en_LJ.dat 2011-12-01 06:49:15 UTC (rev 11229) @@ -13341,6 +13341,8 @@ widget.selecttags.tags|staleness=1 widget.selecttags.tags=Tags: +widget.sgmessages.text=<a href=[[url]]>Turn off</a> redirect to livejournal.sg + widget.shoppingcartstatus.btn.proceedtocheckout=View cart widget.shoppingcartstatus.cart.empty|staleness=1 Modified: trunk/cgi-bin/LJ/Widget/HomepageEN.pm =================================================================== --- trunk/cgi-bin/LJ/Widget/HomepageEN.pm 2011-11-30 11:01:43 UTC (rev 11228) +++ trunk/cgi-bin/LJ/Widget/HomepageEN.pm 2011-12-01 06:49:15 UTC (rev 11229) @@ -37,6 +37,24 @@ $result{lastupdated} = LJ::TimeUtil->ago_text($secondsago); } + ## Country blocks + $result{country} = LJ::GeoLocation->get_country_info_by_ip; + if ($GET->{sgredirect} eq 'off') { + LJ::Request->set_cookie('non-sg-redirect' => '1', 'expires' => time + 86400); + } + if ($result{country} eq 'SG' && !(LJ::Request->cookie('non-sg-redirect'))) { + LJ::Request->redirect('http://www.livejournal.sg'); + LJ::Request->set_cookie('sg-redirect' => '1', 'expires' => time + 86400); + } + $result{uk_block} = + ( + ## viewer is from UK + ($result{country} eq 'UK' || $result{country} eq 'GB') && + ## and viewer is either anonymous, or plus (non-paid/perm/sponsored and non-basic) account + (!$remote || $remote->in_class('force_ads') || !$remote->get_cap('paid') && $remote->in_class('plus')) + ) ? + LJ::Widget::ExtBlock->render(id=>'homepage.uk') : ''; + ## Error Bar if ($GET->{returnto} || $GET->{errmsg}) { $result{errorbar} = ''; @@ -81,7 +99,6 @@ } ## Country blocks - $result{country} = LJ::GeoLocation->get_country_info_by_ip; $result{uk_block} = ( ## viewer is from UK