Committer: mchernyshev
LJSUP-4718: Restrict an access to ratings for non Cyr users- Don't show posts ratings at main lj page silently.
U trunk/htdocs/index.bml U trunk/htdocs/index.bml.sup
Modified: trunk/htdocs/index.bml =================================================================== --- trunk/htdocs/index.bml 2009-08-13 11:20:15 UTC (rev 7568) +++ trunk/htdocs/index.bml 2009-08-14 08:31:06 UTC (rev 7569) @@ -138,7 +138,10 @@ $ret .= LJ::Widget::PromoText->render( domain => "main" ); $ret .= "</div>"; - $ret .= LJ::PersonalStats->get_result_html($remote, { widget => 1 }, '/ratings/posts/') unless $LJ::DISABLED{'personal_stats'}; + # Access only Cyr users who logged in. + if ($remote && LJ::SUP->is_remote_sup()) { + $ret .= LJ::PersonalStats->get_result_html($remote, { widget => 1 }, '/ratings/posts/') unless $LJ::DISABLED{'personal_stats'}; + } $ret .= "</div>"; @@ -309,23 +312,24 @@ } - unless ($LJ::DISABLED{'personal_stats'}) { +# Don't show posts ratings for logged out users. +# (This is under construction feature, it can be back in future) +# unless ($LJ::DISABLED{'personal_stats'}) { +# +# $ret .= "<div class='homepage-ratepost'>"; +# $ret .= "<div class='rounded-box'><div class='rounded-box-tr'><div class='rounded-box-bl'><div class='rounded-box-br'>"; +# $ret .= "<div class='rounded-box'><div class='rounded-box-tr'><div class='rounded-box-bl'><div class='rounded-box-br'>"; +# +# $ret .= "<div class='rounded-box-content'>"; +# $ret .= LJ::PersonalStats->get_result_html($remote, { widget => 1 }, '/ratings/posts/'); +# $ret .= "</div>"; +# +# $ret .= "</div></div></div></div>"; +# $ret .= "</div></div></div></div>"; +# $ret .= "</div><!-- end ratepost -->"; +# } - $ret .= "<div class='homepage-ratepost'>"; - $ret .= "<div class='rounded-box'><div class='rounded-box-tr'><div class='rounded-box-bl'><div class='rounded-box-br'>"; - $ret .= "<div class='rounded-box'><div class='rounded-box-tr'><div class='rounded-box-bl'><div class='rounded-box-br'>"; - $ret .= "<div class='rounded-box-content'>"; - $ret .= LJ::PersonalStats->get_result_html($remote, { widget => 1 }, '/ratings/posts/'); - $ret .= "</div>"; - - $ret .= "</div></div></div></div>"; - $ret .= "</div></div></div></div>"; - $ret .= "</div><!-- end ratepost -->"; - } - - - $ret .= "</div><!-- end .homepage-loggedout -->\n"; } Modified: trunk/htdocs/index.bml.sup =================================================================== --- trunk/htdocs/index.bml.sup 2009-08-13 11:20:15 UTC (rev 7568) +++ trunk/htdocs/index.bml.sup 2009-08-14 08:31:06 UTC (rev 7569) @@ -118,9 +118,11 @@ <div class='hr-solid'></div> "; } + # Access only Cyr users who logged in. + if ($remote && LJ::SUP->is_remote_sup()) { + $ret .= LJ::PersonalStats->get_result_html($remote, { widget => 1 }, '/ratings/posts/') unless $LJ::DISABLED{'personal_stats'}; + } - $ret .= LJ::PersonalStats->get_result_html($remote, { widget => 1 }, '/ratings/posts/') unless $LJ::DISABLED{'personal_stats'}; - $ret .= "<div class='homepage-insidelj pkg'>"; $ret .= "<h2><span>" . BML::ml('.loggedout.facts', {'sitename' => $LJ::SITENAMESHORT}) . "</span></h2>"; $ret .= $promos; @@ -222,17 +224,18 @@ END_OF_HTML - if ($LJ::DISABLED{'personal_stats'}) { +# LJSUP-4718 +# if ($LJ::DISABLED{'personal_stats'}) { +# $ret .= << "END_OF_HTML"; +# <div class="canyon head-opts"> +# <h3 class="canyon-section">Самые популярные записи</h3> +# <p class="canyon-side opt-list"><strong>по посетителям</strong> <a href="http://www.livejournal.ru/ratings/posts/hits" sp_eventwasset="on">по хитам</a> <a href="http://www.livejournal.ru/ratings/posts/diggs" sp_eventwasset="on">по оценке</a></p> +# </div> +# $rating_posts +# <p class="rate-list-more"><a href="http://www.livejournal.ru/ratings/" class="more">Весь рейтинг</a></p> +#END_OF_HTML +# } $ret .= << "END_OF_HTML"; - <div class="canyon head-opts"> - <h3 class="canyon-section">Самые популярные записи</h3> - <p class="canyon-side opt-list"><strong>по посетителям</strong> <a href="http://www.livejournal.ru/ratings/posts/hits" sp_eventwasset="on">по хитам</a> <a href="http://www.livejournal.ru/ratings/posts/diggs" sp_eventwasset="on">по оценке</a></p> - </div> - $rating_posts - <p class="rate-list-more"><a href="http://www.livejournal.ru/ratings/" class="more">Весь рейтинг</a></p> -END_OF_HTML - } - $ret .= << "END_OF_HTML"; <div class="hr-solid"></div> <div class='homepage-loggedin' style='font-size: .85em;'> <div class='homepage-insidelj pkg'>$promos_head</div> @@ -240,7 +243,7 @@ </div> END_OF_HTML - $ret .= LJ::PersonalStats->get_result_html($remote, { widget => 1 }, '/ratings/posts/') unless $LJ::DISABLED{'personal_stats'}; + $ret .= LJ::PersonalStats->get_result_html($remote, { widget => 1 }, '/ratings/posts/') unless $LJ::DISABLED{'personal_stats'}; $ret .= << "END_OF_HTML";