alf (red_alf) wrote in changelog,
alf
red_alf
changelog

[ljcom] r9895: LJSUP-7702: Add template for htdocs/inde...

Committer: afedorov
LJSUP-7702: Add template for htdocs/index.bml.sup
A   trunk/cgi-bin/LJ/Widget/HomepageRU.pm
U   trunk/htdocs/index.bml.sup
A   trunk/templates/Homepage/index_ru.tmpl
Added: trunk/cgi-bin/LJ/Widget/HomepageRU.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/HomepageRU.pm	                        (rev 0)
+++ trunk/cgi-bin/LJ/Widget/HomepageRU.pm	2011-01-13 04:23:39 UTC (rev 9895)
@@ -0,0 +1,137 @@
+package LJ::Widget::HomepageRU;
+
+use strict;
+use base qw(LJ::Widget);
+use Carp qw(croak);
+
+use LJ::Widget::RatingTop10;
+use LJ::PersonalStats;
+use LJ::TimeUtil;
+
+sub get_page_params {
+    my $class = shift;
+    my %opts = @_;
+
+    my $GET = $opts{GET};
+
+    LJ::need_res('stc/lj_base.css', 'stc/home.css', 'stc/lanzelot/css/index.bml.sup.css'); 
+    LJ::need_res('stc/widgets/index-stats.css') unless LJ::is_enabled('personal_stats_ratings');
+    LJ::need_res('stc/statistics/statistics.css') if LJ::is_enabled('personal_stats_ratings');
+    LJ::need_res('js/stats.js') if LJ::is_enabled('personal_stats_ratings');
+    LJ::need_res({condition => 'IE'}, "stc/lanzelot/css/index.bml.sup.ie.css");
+    LJ::need_res({condition => 'IE'}, 'stc/statistics/ie.css') if LJ::is_enabled('personal_stats_ratings');
+
+    my %result = (
+        domain        => $LJ::DOMAIN,
+        siteroot      => $LJ::SITEROOT,
+        sitenameshort => $LJ::SITENAMESHORT,
+        rndkey        => int(rand(1e9)),
+    );
+    
+    ## Remote user
+    my $remote = LJ::get_remote();
+    if ( $remote ) {
+        $result{remote} = 1;
+        $result{remote_display_username} = $remote->display_username;
+        
+        ## Get the last updated time of $remote
+        my $secondsago = time() - $remote->timeupdate;
+        $result{lastupdated} = LJ::TimeUtil->ago_text($secondsago);
+    }
+    
+    ## Meta tags
+    $result{meta} = '
+        <meta name="description" content="' . LJ::ehtml(BML::ml('.meta.desc')) . '" />
+        <meta name="keywords" content="' . LJ::ehtml(BML::ml('.meta.keywords')) . '" />
+        <meta name="rating" content="General" />
+        <meta name="ROBOTS" content="All" />
+        <meta name="revisit-after" content="14 days" />
+    ';
+
+    ## Window Title
+    $result{windowtitle} = $remote ?
+        BML::ml('.windowtitle.loggedin', {'sitename' => $LJ::SITENAME}) :
+        BML::ml('.windowtitle', {'sitename' => $LJ::SITENAME});
+
+    ## Title
+    $result{title} = $remote ? 
+        BML::ml('.loggedin.heading2', {'user' => $remote->display_username}) :
+        BML::ml('.loggedout.heading', { 'sitename' => "$LJ::SITENAMESHORT" });
+
+    ## Country blocks
+    $result{country} = LJ::GeoLocation->get_country_info_by_ip;
+
+    ## ADS
+    $result{adt} = LJ::get_ads({ location => 'bml.homepage.top', nowrap => 1 });
+    $result{ad}  = LJ::get_ads({ location => 'bml.homepage', ljadwrapper => 1 }) .
+                   LJ::get_ads({ location => 'bml.homepage.test.top', nowrap => 1 })
+                    if !$remote || !$remote->in_class('paid') || $remote->in_class('force_ads');
+
+    ## Info box
+    $result{info_box} = (!LJ::SUP->is_sup_ip_class || ($remote and $remote->get_cap('paid'))) ? 
+                            '' : 
+                            LJ::Widget::ExtBlock->render(id=>'homepage.gazeta');
+
+    ## Realtime SMS
+    $result{real_time_sms} = LJ::Widget::ExtBlock->render(id=>'realtime.sms');
+
+    ## Ratings
+    if (LJ::is_enabled('personal_stats_ratings')) {
+        $result{personalstats} = LJ::PersonalStats->get_result_html($remote, { widget => 1, unique_journals => 1 }, '/ratings/posts/');
+    }
+    
+    ## Widget SUP1MillionPromo
+    $result{widget_sup1millionpromo} = LJ::Widget::SUP1MillionPromo->render;
+    
+    ## Widget PromoText
+    my $promos = LJ::SUP->sup_promos('App-Home', 4);
+    if ($promos) {
+        $result{widget_promotext} = "<div class='homepage-promo pkg'><div class='appwidget appwidget-promotext'>$promos</div></div>";
+    } 
+    else {
+        $result{widget_promotext} = LJ::Widget::PromoText->render( domain => "main", small_version => 1 );
+    }
+
+    ## Widget recent posts
+    $result{widget_recent_posts} = LJ::Widget::RecentPosts->render;
+    
+    ## Widget QotD
+    $result{widget_qotd} = LJ::Widget::QotD->render(domain => "homepage");
+    
+    ## Widget GameList
+    $result{widget_gamelist} = LJ::Widget::GameList->render 
+        if LJ::is_enabled('userapps');
+    
+    ## Widget RecentComments
+    $result{widget_recentcomments} = LJ::Widget::RecentComments->render;
+    
+    ## Widget JournalSpotlight
+    $result{widget_journalspotlight} = LJ::Widget::JournalSpotlight->render( stylesheet_override => 'stc/widgets/journalspotlight-home.css' );
+    
+    ## Widget FriendBirthdays
+    $result{widget_friendbirthdays} = LJ::Widget::FriendBirthdays->render(get => $GET);
+    
+    ## Widget VGifts
+    $result{widget_vgifts} = LJ::Widget::VGifts->render(get => $GET)
+        if $remote || LJ::is_enabled('vgift_on_homepage_unlogged_sup');
+
+    ## Widget FeaturedStyles
+    $result{widget_featuredstyles} = LJ::Widget::FeaturedStyles->render(get => $GET) 
+        if LJ::is_enabled('featured_styles');
+
+    ## Widget FriendUpdates
+    $result{widget_friendupdates} = LJ::Widget::FriendUpdates->render;
+
+    ## Widget RatingTop10
+    $result{widget_ratingtop10} = LJ::Widget::RatingTop10->render;
+    
+    ## Widget SettingProdDisplay
+    $result{widget_settingproddisplay} = LJ::Widget::SettingProdDisplay->render;
+    
+    ## Strings
+    $result{string_join_lj_url} = LJ::run_hook('construct_adcall', orient => "App-Join-Livejournal");
+
+    return %result;
+}
+
+1;

Modified: trunk/htdocs/index.bml.sup
===================================================================
--- trunk/htdocs/index.bml.sup	2011-01-12 11:08:57 UTC (rev 9894)
+++ trunk/htdocs/index.bml.sup	2011-01-13 04:23:39 UTC (rev 9895)
@@ -3,365 +3,28 @@
 <?_code
 {
     use strict;
-    use vars qw(%GET %POST $title $headextra $meta @errors @warnings);
+    use LJ::HTML::Template;
 
-    use LJ::Widget::RatingTop10;
-    use LJ::PersonalStats;
-    use LJ::TimeUtil;
+    use vars qw(%GET %POST %result);
 
-	LJ::need_res('stc/lj_base.css', 'stc/home.css', 'stc/lanzelot/css/index.bml.sup.css'); 
-    LJ::need_res('stc/widgets/index-stats.css') unless LJ::is_enabled('personal_stats_ratings');
-	LJ::need_res('stc/statistics/statistics.css') if LJ::is_enabled('personal_stats_ratings');
-	LJ::need_res('js/stats.js') if LJ::is_enabled('personal_stats_ratings');
-   	$meta = qq{
-    <meta name="description" content="$ML{'.meta.desc'}" />
-    <meta name="keywords" content="$ML{'.meta.keywords'}" />
-    <meta name="rating" content="General" />
-    <meta name="ROBOTS" content="All" />
-    <meta name="revisit-after" content="14 days" />
-    };
+    %result = LJ::Widget::HomepageRU->get_page_params( GET => \%GET );
+    
+    my $template = LJ::HTML::Template->new(
+	{ use_expr => 1 }, # force HTML::Template::Pro with Expr support
+        filename => "$ENV{'LJHOME'}/templates/Homepage/index_ru.tmpl",
+        die_on_bad_params => 0,
+        case_sensitive    => 1,
+    ) or die "Can't open template: $!";
 
-    my $remote = LJ::get_remote();
-    my $ad = LJ::get_ads({ location => 'bml.homepage', ljadwrapper => 1 }) .
-             LJ::get_ads({ location => 'bml.homepage.test.top', nowrap => 1 });
-    my $adt = LJ::get_ads({ location => 'bml.homepage.top', nowrap => 1 }); 
-    my $goat_img = $GET{'frank'} eq "urinate" ? "pee" : "hover";
-    my $news = LJ::load_user('news');
-    my $ret = "";
-    my $country = LJ::GeoLocation->get_country_info_by_ip;
-    if ($country eq 'US') {
-        $ret .= "<div id='adnectar_container'></div>
-<script type='text/javascript' src='http://goods.adnectar.com/analytics/get_avia_js?api_version=3.0.0&site_key=a9aa425c93ef5dff380c&avia_version=0.8.16'></script>";
-    }
-    my $promos = LJ::SUP->sup_promos('App-Home', 4);
-    if ($promos) {
-        $promos = "<div class='homepage-promo pkg'><div class='appwidget appwidget-promotext'>$promos</div></div><!-- / lj-facts -->";
-    } 
-    else {
-        $promos = LJ::Widget::PromoText->render( domain => "main", small_version => 1 );
-    }
-    LJ::need_res({condition => 'IE'}, "stc/lanzelot/css/index.bml.sup.ie.css");
-    LJ::need_res({condition => 'IE'}, 'stc/statistics/ie.css') if LJ::is_enabled('personal_stats_ratings');
-
-    my $rating_posts; $rating_posts = LJ::Widget::ExtBlock->render(id=>'rating.posts') unless LJ::is_enabled('personal_stats_ratings');
-    my $rating_users; $rating_users = LJ::Widget::ExtBlock->render(id=>'rating.users') unless LJ::is_enabled('personal_stats_ratings');
-    my $real_time_sms= LJ::Widget::ExtBlock->render(id=>'realtime.sms');
-    my $info_box     = (!LJ::SUP->is_sup_ip_class || ($remote and $remote->get_cap('paid'))) 
-                    ? ''
-                    : LJ::Widget::ExtBlock->render(id=>'homepage.gazeta');
-
-    ### Logged-in Homepage ###
-    if ($remote) {
-    	$ret .= $adt;
-		$ret .= "<div class='homepage-loggedin pkg' style='padding-right: 320px;padding-left:0px;'>";
-        $ret .= "<div style='float: left; position: relative; width: 100%;'>";
-        $ret .= LJ::Widget::SUP1MillionPromo->render;
-        $title = BML::ml('.loggedin.heading2', {'user' => $remote->display_username});
-        # get the last updated time of $remote
-        my $secondsago = time() - $remote->timeupdate;
-        my $lastupdated = LJ::TimeUtil->ago_text($secondsago);
-
-        $ret .= "<div class='homepage-account appwidget pkg b-qotd'>";
-        $ret .= "<h2><span>" . BML::ml('.loggedin.qotd.title') . "</span></h2>";
-		$ret .= qq[<ul class="i-qotd-menu"><li><a href="$LJ::SITEROOT/misc/qotdarchive.bml">$ML{'widget.qotd.archivelink'}</a></li><li><a href="$LJ::SITEROOT/misc/suggest_qotd.bml">$ML{'widget.qotd.suggestions'}</a></li><li><a href="$LJ::SITEROOT/friends/add.bml?user=writersblock">$ML{'widget.qotd.subscribe'}</a></li><li><a href="http://community.livejournal.com/wb_unplugged_ru/">$ML{'widget.qotd.unplugged'}</a></li></ul>];
-        #$ret .= "<a href='http://community.livejournal.com/".(LJ::Widget::QotD->community_name($remote))."/' class='more-link'>" . BML::ml('.loggedin.qotd.journal') . "</a>";
-        #Quick links were removed and QOTD became larger
-#        $ret .= "<div class='homepage-account-inner pkg'>";
-#        $ret .= "<div class='homepage-account-left'>";
-#        $ret .= "<ul class='nostyle'>";
-#        $ret .= "<li class='post'><a href='$LJ::SITEROOT/update.bml'>$ML{'.loggedin.greeting.post'}</a>";
-#        $ret .= "<br /><span class='detail'>";
-#        $ret .= defined $remote->timeupdate ?
-#                BML::ml('.loggedin.greeting.lastupdated', {'timeago' => $lastupdated}) :
-#                $ML{'.loggedin.greeting.neverupdated'};
-#        $ret .= "</span></li>";
-#        $ret .= "<li class='inbox'><a href='$LJ::SITEROOT/inbox/'>$ML{'.loggedin.greeting.inbox'}</a>";
-#        my $inbox = $remote->notification_inbox;
-#        $ret .= "<br /><span class='detail'>" . BML::ml('.loggedin.greeting.inboxcount', {'num' => $inbox->unread_count}) . "</span>"
-#            if $inbox && $inbox->unread_count;
-#        $ret .= "</li>";
-#        $ret .= "<li class='friends'><a href='" . $remote->journal_base . "/friends/'>$ML{'.loggedin.greeting.friendspage'}</a></li>";
-         # display an alert if there was a post to news in the past three days
-#        if ($news) {
-#            my $delta = time() - $news->timeupdate;
-#            if ($delta < 86400 * 3) {
-#                $ret .= "<li class='news'>" . BML::ml('.loggedin.greeting.alert', {'user' => $news->ljuser_display}) . "</li>";
-#            }
-#        }
-#        $ret .= "</ul>";
-#        $ret .= "</div><!-- end .homepage-account-left -->";
-        $ret .= "<div class='homepage-account-right'>";
-
-        $ret .= LJ::Widget::QotD->render(domain => "homepage");
-        $ret .= LJ::Widget::GameList->render unless $LJ::DISABLED{'userapps'};
-
-        $ret .= "</div><!-- end .homepage-account-right -->\n";
-#        $ret .= "</div><!-- end .homepage-account-inner -->\n";
-        $ret .= "</div><!-- end .homepage-account -->\n";
-        $ret .= LJ::Widget::RecentComments->render;
-        $ret .= LJ::Widget::JournalSpotlight->render( stylesheet_override => 'stc/widgets/journalspotlight-home.css' );
-
-        # $ret .= "<div class='homepage-explore pkg'>";
-        # $ret .= "<h2><span>$ML{'.loggedin.explore'}</span></h2>";
-        # $ret .= "<ul class='explore-links nostyle'>";
-        # $ret .= "<li><a href='$LJ::SITEROOT/syn/'>$ML{'.loggedin.explore.feeds'}</a></li>";
-        # $ret .= "<li><a href='$LJ::SITEROOT/stats/latest.bml'>$ML{'.loggedin.explore.latestposts'}</a></li>";
-        # $ret .= "<li><a href='$LJ::SITEROOT/random.bml'>$ML{'.loggedin.explore.random'}</a></li>";
-        # $ret .= "</ul>";
-        # $ret .= "<form method='get' action='/interests.bml'>";
-        # $ret .= "Find people and communities interested in:<br />";
-        # $ret .= "<input type='text' class='text' name='int' id='interest-search' /> <input type='submit' value='Go' />";
-        # $ret .= "</form>";
-        # $ret .= "</div>";
-
-        unless (LJ::is_enabled('personal_stats_ratings')) {
-            $ret .= "       
-                        <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>
-                        <div style='margin-left: 30px;'>$rating_posts</div>
-                        <p class='rate-list-more'><a href='http://www.livejournal.ru/ratings/' class='more'>Весь рейтинг</a></p>
-                        <div class='hr-solid'></div>
-                ";
-        }
-        if ($remote) {
-            $ret .= LJ::PersonalStats->get_result_html($remote, { widget => 1, unique_journals => 1 }, '/ratings/posts/') if LJ::is_enabled('personal_stats_ratings');
-        }
-		
-        $ret .= "<div class='homepage-insidelj pkg'>";
-        $ret .= "<h2><span>" . BML::ml('.loggedout.facts', {'sitename' => $LJ::SITENAMESHORT}) . "</span></h2>";
-        $ret .= $promos;
-        $ret .= "</div>";
-
-
-        $ret .= "</div>";
-        $ret .= "<div style='float: left; position: relative; width: 300px; padding-left: 20px; margin-right: -320px;'>";
-
-        
-        # if (!$remote->in_class('paid') || $remote->in_class('force_ads')) {
-        #     my $uaw = $LJ::DISABLED{'upgrade_account'} ? '' : LJ::Widget::UpgradeAccount->render;
-        #     $ret .= (LJ::GeoLocation->ip_class() eq 'russia') ? ( $uaw . $ad ) : ( $ad . $uaw );
-        # }
-
-        $ret .= $ad if !$remote->in_class('paid') || $remote->in_class('force_ads');
-
-       # unless ($remote->get_cap('paid')) {
-        #    $ret .= "<div class='sponsored_upg'>";
-        #    $ret .= BML::ml('.loggedin.promo_sponsored', {'aopts' => "href='$LJ::SITEROOT/sponsors/choose_sponsor.bml'" } );
-        #    $ret .= "</div>";
-        # }
-
-        $ret .= $info_box;
-            
-        $ret .= LJ::Widget::FriendBirthdays->render(get => \%GET);
-
-        $ret .= LJ::Widget::VGifts->render(get => \%GET);
-
-        $ret .= LJ::Widget::FeaturedStyles->render(get => \%GET) unless $LJ::DISABLED{'featured_styles'};
-            
-        $ret .= LJ::Widget::FriendUpdates->render;
-
-       
-        $ret .= $real_time_sms;
-
-        unless (LJ::is_enabled('personal_stats_ratings')) {
-            $ret .= "<div class='promo-block no-widget-div'>
-                        <span class='header'>Рейтинги</span>
-                        <div>
-                                                        <table class='small-stat'>
-                                                        <tr class='first'>
-                                                                <th colspan='2'>№</th>
-                                                                <th>Пользователи</th>
-                                                                <th></th>
-                                                                <th>Сообщества</th>
-                                                        </tr>
-                                                        $rating_users
-                                                        <tr class='last'>
-                                                                <td colspan='2'></td>
-                                                                <td class='half'><a href='http://www.livejournal.ru/ratings/users' class='more'>Все&nbsp;пользователи</a></td>
-                                                                <td></td>
-                                                                <td class='half'><a href='http://www.livejournal.ru/ratings/communities' class='more'>Все&nbsp;сообщества</a></td>
-                                                        </tr>
-                                                        </table>
-                        </div>
-                </div>";
-         } else { # enabled
-             $ret .= LJ::Widget::RatingTop10->render;
-         }
-
-#        $ret .= LJ::Widget::OfficialJournals->render;
-        
-#        $ret .= LJ::CProd->full_box_for($remote, width => 300);
-
-        $ret .= "</div>";
-        $ret .= "</div><!-- end .homepage-loggedin  -->";
-
-#        $ret .= "<div class='homepage-loggedin-frank'>";
-#        $ret .= LJ::Widget::Frank->render( image => $goat_img );
-#        $ret .= "</div><!-- end .homepage-loggedin-frank -->";
-
-        # Display settings that need to be set by user
-        $ret .= LJ::Widget::SettingProdDisplay->render();
-
-    ### Logged-out Homepage ##
-    } else {
-        $title = BML::ml('.loggedout.heading', { 'sitename' => "$LJ::SITENAMESHORT" });
-        
-    my $recent_posts = LJ::Widget::RecentPosts->render();
-        my $join_lj_url = LJ::run_hook('construct_adcall', orient => "App-Join-Livejournal");   
-        if ($adt) {
-            $ret .= $adt;
-        }
-        my $promos_head = "<h2><span style='font-weight: bold;'>" . BML::ml('.loggedout.facts', {'sitename' => $LJ::SITENAMESHORT}) . "</span></h2>";
-        my $rndkey = int(rand(1e9));
-        $ret .= << "END_OF_HTML";
-        <div class="lz-body">
-                <div id="lz-wrapper">
-                        <div id="lz-content">
-                
-                                <div class="join">
-                                        <div class="new_acc">
-                                                <iframe id="areyou_$rndkey" frameborder="0" scrolling="no" src="$join_lj_url" style="width:230px;height:120px;"></iframe>
-                                        </div>
-                                        
-                                        <h1>Живой Журнал &mdash;</h1> это возможность выразить себя, поделиться своей жизнью и связаться с друзьями в сети.
-                                </div>
-                
-                                <p>Вы можете использовать LiveJournal разными способами: как личный дневник, блог, дискуссионный форум, социальную сеть и так далее.</p>
-
-                                                                <div class="actions">
-                                        <ul>
-                                                <li class="first"><a href="<?siteroot?>/tour_rus/about_lj.bml"><span class="first"><span class="tl-w"><span class="beyou"><span class="txt">Живой журнал</span><span class="sml-txt">что это такое?</span></span></span></span></a></li>
-                                                <li><a href="<?siteroot?>/tour_rus/about_lj.bml#write"><span><span class="delis"><span class="txt">Пишите</span><span class="sml-txt">делитесь мыслями</span></span></span></a></li>
-                                                <li><a href="http://www.livejournal.com/ljtimes/" onclick="ljtimes_outbound_links(event, this, 'inline')"><span><span class="read"><span class="txt">Читайте</span><span class="sml-txt">свежие новости</span></span></span></a></li>
-                                                <li><a href="<?siteroot?>/tour_rus/about_lj.bml#community"><span><span class="commun"><span class="txt">Общайтесь</span><span class="sml-txt">в сообществе</span></span></span></a></li>
-                                                <li class="last"><a href="<?siteroot?>/tour_rus/about_lj.bml#mobile"><span class="last"><span class="tr-w"><span class="write"><span class="txt">Мобильный ЖЖ</span><span class="sml-txt">пишите отовсюду</span></span></span></span></a></li>
-                                        </ul>
-                                        </div>
-
-<!--Google Analytics for LJTimes -->
-<script type="text/javascript">
-    var _gaq = _gaq || [];
-    _gaq.push(['ljtimes._setAccount', 'UA-18672965-1']);
-    (function() {
-        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-    })();
-
-    function ljtimes_outbound_links(e, node, category)
-    {
-        // inline on index.bml, if cyr user not logged in
-        jQuery.event.fix(e);
-
-        _gaq.push(['ljtimes._trackEvent', 'Service page', 'click', category]);
-        // if no new tab
-        if (node.target !== '_blank' && !(e.metaKey || e.altKey || e.shiftKey || e.ctrlKey) && e.which === 1) {
-            setTimeout('top.location="' + node.href + '"', 100);
-            e.preventDefault();
-        }
-    }
-</script>
-
-END_OF_HTML
-# LJSUP-4718
-#         unless (LJ::is_enabled('personal_stats_ratings')) {
-#             $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>
-                            $promos
-                        </div>
-END_OF_HTML
-        $ret .= qq[<div class="homepage-account appwidget pkg b-qotd">];
-        $ret .= "<h2><span>" . BML::ml('.loggedin.qotd.title') . "</span></h2>";
-		$ret .= qq[<ul class="i-qotd-menu"><li><a href="$LJ::SITEROOT/misc/qotdarchive.bml">$ML{'widget.qotd.archivelink'}</a></li><li><a href="$LJ::SITEROOT/misc/suggest_qotd.bml">$ML{'widget.qotd.suggestions'}</a></li><li><a href="$LJ::SITEROOT/friends/add.bml?user=writersblock">$ML{'widget.qotd.subscribe'}</a></li><li><a href="http://community.livejournal.com/wb_unplugged_ru/">$ML{'widget.qotd.unplugged'}</a></li></ul>];
-        $ret .= LJ::Widget::QotD->render(domain => "homepage");
-        $ret .= "</div>";
-
-             $ret .= LJ::PersonalStats->get_result_html($remote, { widget => 1, unique_journals => 1 }, '/ratings/posts/') if LJ::is_enabled('personal_stats_ratings');
-
-              $ret .= << "END_OF_HTML"; 
-          
-                        </div> <!-- / content -->
-                </div> <!-- / wrapper -->
-                
-                <div id="lz-side">
-
-                        <div class="adv-block"><div>$ad</div></div>             
-
-                $info_box       
-
-                $real_time_sms
-
-END_OF_HTML
-
-        $ret .= LJ::Widget::VGifts->render(get => \%GET) if LJ::is_enabled('vgift_on_homepage_unlogged_sup');
-
-         unless (LJ::is_enabled('personal_stats_ratings')) {
-             $ret .= << "END_OF_HTML";
-                        <div class="promo-block no-widget-div">
-                                <span class="header">Рейтинги</span>
-                                <div>
-                                                                <table class="small-stat">
-                                                                <tr class="first">
-                                                                        <th colspan="2">№</th>
-                                                                        <th>Пользователи</th>
-                                                                        <th></th>
-                                                                        <th>Сообщества</th>
-                                                                </tr>
-                                                                $rating_users
-                                                                <tr class="last">
-                                                                        <td colspan="2"></td>
-                                                                        <td class="half"><a href="http://www.livejournal.ru/ratings/users" class="more">Все&nbsp;пользователи</a></td>
-                                                                        <td></td>
-                                                                        <td class="half"><a href="http://www.livejournal.ru/ratings/communities" class="more">Все&nbsp;сообщества</a></td>
-                                                                </tr>
-                                                                </table>
-
-                                </div>
-                        </div>
-END_OF_HTML
-         } else { # enabled
-             $ret .= LJ::Widget::RatingTop10->render;
-         }
-             $ret .= '</div> <!-- / side -->';
-          ###   $ret .= LJ::PersonalStats->get_result_html($remote, { widget => 1 }, '/ratings/posts/') if LJ::is_enabled('personal_stats_ratings');
-             $ret .= '</div><!--body-->';
-    }
-
-    return $ret;
+    $template->param( %result );
+    
+    return $template->output;
 }
 _code?>
 <=body
-windowtitle<=
-<?_code
-{
-    if (LJ::get_remote()) {
-        return BML::ml('.windowtitle.loggedin', {'sitename' => $LJ::SITENAME});
-    } else {
-        return BML::ml('.windowtitle', {'sitename' => $LJ::SITENAME});
-    }
-}
-_code?>
-<=windowtitle
-title=><?_code return $title; _code?>
-head<=
-<?_code return $headextra; _code?>
-<=head
-meta<=
-<?_code return $meta; _code?>
-<=meta
+windowtitle=><?_code return $result{windowtitle}; _code?>
+title=><?_code return $result{title}; _code?>
+head=><?_code return $result{headextra}; _code?>
+meta=><?_code return $result{meta}; _code?>
 <=body
 page?>
-

Added: trunk/templates/Homepage/index_ru.tmpl
===================================================================
--- trunk/templates/Homepage/index_ru.tmpl	                        (rev 0)
+++ trunk/templates/Homepage/index_ru.tmpl	2011-01-13 04:23:39 UTC (rev 9895)
@@ -0,0 +1,165 @@
+<tmpl_if expr="country eq 'US'">
+    <div id="adnectar_container"></div>
+    <script type="text/javascript" src="http://goods.adnectar.com/analytics/get_avia_js?api_version=3.0.0&site_key=a9aa425c93ef5dff380c&avia_version=0.8.16"></script>
+</tmpl_if>
+
+<tmpl_if remote>
+
+    <!-- ### Logged-in Homepage ### -->
+
+    <tmpl_var adt>
+    
+    <div class="homepage-loggedin pkg" style="padding-right: 320px;padding-left:0px;">
+        <div style="float: left; position: relative; width: 100%;">
+        
+            <tmpl_var widget_sup1millionpromo>
+
+            <div class="homepage-account appwidget pkg b-qotd">
+                <h2><span><tmpl_var expr="ml('.loggedin.qotd.title')"></span></h2>
+		<ul class="i-qotd-menu">
+        	    <li><a href="<tmpl_var siteroot>/misc/qotdarchive.bml"><tmpl_var expr="ml('widget.qotd.archivelink')"></a></li>
+        	    <li><a href="<tmpl_var siteroot>/misc/suggest_qotd.bml"><tmpl_var expr="ml('widget.qotd.suggestions')"></a></li>
+        	    <li><a href="<tmpl_var siteroot>/friends/add.bml?user=writersblock"><tmpl_var expr="ml('widget.qotd.subscribe')"></a></li>
+        	    <li><a href="http://community.livejournal.com/wb_unplugged_ru/"><tmpl_var expr="ml('widget.qotd.unplugged')"></a></li>
+		</ul>
+                <div class="homepage-account-right">
+                    <tmpl_var widget_qotd>
+                    <tmpl_var widget_gamelist>
+                </div><!-- end .homepage-account-right -->
+            </div><!-- end .homepage-account -->
+            
+            <tmpl_var widget_recentcomments>
+
+            <tmpl_var widget_journalspotlight>
+
+            <tmpl_var personalstats>
+		
+            <div class="homepage-insidelj pkg">
+                <h2><span><tmpl_var expr="ml('.loggedout.facts', 'sitename', sitenameshort)"></span></h2>
+                <tmpl_var widget_promotext>
+            </div>
+        
+        </div>
+        
+        <div style="float: left; position: relative; width: 300px; padding-left: 20px; margin-right: -320px;">
+
+            <tmpl_var ad>
+
+            <tmpl_var info_box>
+            
+            <tmpl_var widget_friendbirthdays>
+
+            <tmpl_var widget_vgifts>
+
+            <tmpl_var widget_featuredstyles>
+
+            <tmpl_var widget_friendupdates>
+
+            <tmpl_var real_time_sms>       
+
+            <tmpl_var widget_ratingtop10>
+
+        </div>
+    </div>
+    
+    <tmpl_var widget_settingproddisplay>
+    
+    <!-- end .homepage-loggedin  -->
+
+<tmpl_else>
+
+    <!-- ### Logged-out Homepage ## -->
+        
+    <tmpl_var adt>
+    
+    <div class="lz-body">
+        <div id="lz-wrapper">
+            <div id="lz-content">
+                
+                <div class="join">
+                    <div class="new_acc">
+                        <iframe id="areyou_<tmpl_var rndkey>" frameborder="0" scrolling="no" src="<tmpl_var string_join_lj_url>" style="width:230px;height:120px;"></iframe>
+                    </div>
+                                        
+                    <h1>Живой Журнал &mdash;</h1> это возможность выразить себя, поделиться своей жизнью и связаться с друзьями в сети.</h1>
+                </div>
+                
+                <p>Вы можете использовать LiveJournal разными способами: как личный дневник, блог, дискуссионный форум, социальную сеть и так далее.</p>
+
+                <div class="actions">
+                    <ul>
+                        <li class="first"><a href="<tmpl_var siteroot>/tour_rus/about_lj.bml"><span class="first"><span class="tl-w"><span class="beyou"><span class="txt">Живой журнал</span><span class="sml-txt">что это такое?</span></span></span></span></a></li>
+                        <li><a href="<tmpl_var siteroot>/tour_rus/about_lj.bml#write"><span><span class="delis"><span class="txt">Пишите</span><span class="sml-txt">делитесь мыслями</span></span></span></a></li>
+                        <li><a href="http://www.livejournal.com/ljtimes/" onclick="ljtimes_outbound_links(event, this, 'inline')"><span><span class="read"><span class="txt">Читайте</span><span class="sml-txt">свежие новости</span></span></span></a></li>
+                        <li><a href="<tmpl_var siteroot>/tour_rus/about_lj.bml#community"><span><span class="commun"><span class="txt">Общайтесь</span><span class="sml-txt">в сообществе</span></span></span></a></li>
+                        <li class="last"><a href="<tmpl_var siteroot>/tour_rus/about_lj.bml#mobile"><span class="last"><span class="tr-w"><span class="write"><span class="txt">Мобильный ЖЖ</span><span class="sml-txt">пишите отовсюду</span></span></span></span></a></li>
+                    </ul>
+                </div>
+
+                <!--Google Analytics for LJTimes -->
+                <script type="text/javascript">
+                    var _gaq = _gaq || [];
+                    _gaq.push(['ljtimes._setAccount', 'UA-18672965-1']);
+                    _gaq.push(['ljtimes._trackPageview']);
+                    (function() {
+                        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+                        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+                        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+                    })();
+
+                    function ljtimes_outbound_links(e, node, category)
+                    {
+                        // inline on index.bml, if cyr user not logged in
+                        jQuery.event.fix(e);
+
+                        _gaq.push(['ljtimes._trackEvent', 'Service page', 'click', category]);
+                        // if no new tab
+                        if (node.target !== '_blank' && !(e.metaKey || e.altKey || e.shiftKey || e.ctrlKey) && e.which === 1) {
+                            setTimeout('top.location="' + node.href + '"', 100);
+                            e.preventDefault();
+                        }
+                    }
+                </script>
+
+                <div class="hr-solid"></div>
+                    <div class="homepage-loggedin" style="font-size: .85em;">
+                        <div class="homepage-insidelj pkg">
+                            <h2><span style="font-weight: bold;"><tmpl_var expr="ml('.loggedout.facts', 'sitename', sitenameshort)"></span></h2>
+                        </div>
+                        <tmpl_var widget_promotext>
+                    </div>
+
+                    <div class="homepage-account appwidget pkg b-qotd">
+                    
+                    <h2><span><tmpl_var expr="ml('.loggedin.qotd.title')"></span></h2>
+		    
+		    <ul class="i-qotd-menu">
+        	        <li><a href="<tmpl_var siteroot>/misc/qotdarchive.bml"><tmpl_var expr="ml('widget.qotd.archivelink')"></a></li>
+        	        <li><a href="<tmpl_var siteroot>/misc/suggest_qotd.bml"><tmpl_var expr="ml('widget.qotd.suggestions')"></a></li>
+        	        <li><a href="<tmpl_var siteroot>/friends/add.bml?user=writersblock"><tmpl_var expr="ml('widget.qotd.subscribe')"></a></li>
+        	        <li><a href="http://community.livejournal.com/wb_unplugged_ru/"><tmpl_var expr="ml('widget.qotd.unplugged')"></a></li>
+		    </ul>
+
+                    <tmpl_var widget_qotd>		    
+                </div>
+
+                <tmpl_var personalstats>
+                
+            </div> <!-- / content -->
+        </div> <!-- / wrapper -->
+                
+        <div id="lz-side">
+
+            <div class="adv-block"><div><tmpl_var ad></div></div>             
+
+            <tmpl_var info_box>
+
+            <tmpl_var real_time_sms>
+
+            <tmpl_var widget_vgifts>
+
+            <tmpl_var widget_ratingtop10>
+
+        </div> <!-- / side -->
+    </div><!--body-->
+</tmpl_if>

Tags: ljcom, pm, red_alf, sup, tmpl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments