Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[ljcom] r8124: LJSV-878: overhaul of ESN

Committer: ailyin
LJSV-878: overhaul of ESN

See http://community.livejournal.com/changelog/8052313.html (livejournal 16116) for more elaborate commit notes.

U   trunk/bin/upgrading/en_LJ.dat
U   trunk/cgi-bin/LJ/Event/NewVGift.pm
U   trunk/cgi-bin/LJ/Event/SupOfficialPost.pm
U   trunk/cgi-bin/LJ/Hooks/ESN.pm
U   trunk/cgi-bin/redirect-local.dat
Modified: trunk/bin/upgrading/en_LJ.dat
===================================================================
--- trunk/bin/upgrading/en_LJ.dat	2010-01-21 12:01:53 UTC (rev 8123)
+++ trunk/bin/upgrading/en_LJ.dat	2010-01-21 12:42:34 UTC (rev 8124)
@@ -1724,6 +1724,8 @@
 
 esn.vgift.xtra=[[openlink]]Wake them up with a FREE virtual gift[[closelink]], brought to you by [[sponsorlink]][[sponsor]][[closelink]]
 
+esn.error.quota.upgrade=Alternatively, you can <a[[aopts]]>purchase a Paid Account</a>, which allows to track up to 1000 events.
+
 event.perm_sale=A permanent account sale has begun
 
 event.sup_official_post=LJ-Russia makes a new announcement

Modified: trunk/cgi-bin/LJ/Event/NewVGift.pm
===================================================================
--- trunk/cgi-bin/LJ/Event/NewVGift.pm	2010-01-21 12:01:53 UTC (rev 8123)
+++ trunk/cgi-bin/LJ/Event/NewVGift.pm	2010-01-21 12:42:34 UTC (rev 8124)
@@ -182,4 +182,10 @@
         BML::ml('event.vgift.me');
 }
 
+sub is_tracking {
+    my ($self) = @_;
+
+    return $self->{'userid'} ? 1 : 0;
+}
+
 1;

Modified: trunk/cgi-bin/LJ/Event/SupOfficialPost.pm
===================================================================
--- trunk/cgi-bin/LJ/Event/SupOfficialPost.pm	2010-01-21 12:01:53 UTC (rev 8123)
+++ trunk/cgi-bin/LJ/Event/SupOfficialPost.pm	2010-01-21 12:42:34 UTC (rev 8124)
@@ -18,4 +18,10 @@
     return BML::ml('event.sup_official_post'); # "LJ-Russia makes a new announcement";
 }
 
+sub is_subscription_visible_to {
+    my ($self, $u) = @_;
+
+    return LJ::SUP->is_sup_enabled($u);
+}
+
 1;

Modified: trunk/cgi-bin/LJ/Hooks/ESN.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/ESN.pm	2010-01-21 12:01:53 UTC (rev 8123)
+++ trunk/cgi-bin/LJ/Hooks/ESN.pm	2010-01-21 12:42:34 UTC (rev 8124)
@@ -78,6 +78,20 @@
     return LJ::run_hook("upgrade_link", $u) . " ";
 });
 
+LJ::register_hook("esn_community_comments_track_upgrade", sub {
+    my ($u, $journal) = @_;
+
+    if (LJ::can_manage($u, $journal)) {
+        return LJ::run_hook("upgrade_link", $journal) . " ";
+    } else {
+        return qq{
+            <a href="$LJ::SITEROOT/support/faqbrowse.bml?faqid=225">
+                <img src="$LJ::STATPREFIX/img/help.gif">
+            </a>
+        };
+    }
+});
+
 LJ::register_hook('esn_email_html_footer', sub {
     my %opts = @_;
 
@@ -121,4 +135,35 @@
         });
 });
 
+LJ::register_hook('esn_settings_my_account', sub {
+    [
+        'SupOfficialPost',
+        'OfficialPost',
+        'JournalNewComment-u',
+        'CommunityEntryReply',
+        'CommentReply',
+        'PollVote',
+        'Befriended-u',
+        'Defriended-u',
+        'UserMessageRecvd-u',
+    ];
+});
+
+LJ::register_hook('esn_quota_error', sub {
+    my ($u) = @_;
+
+    my $ret = LJ::Lang::ml('esn.error.quota', {
+        'quota' => LJ::get_cap($u, 'subscriptions'),
+        'aopts' => qq{ href="$LJ::SITEROOT/manage/settings/?cat=notifications"},
+    });
+
+    unless ($u->in_class('paid')) {
+        $ret .= ' ' . LJ::Lang::ml('esn.error.quota.upgrade', {
+            'aopts' => qq{ href="$LJ::SITEROOT/manage/account/"},
+        });
+    }
+
+    return $ret;
+});
+
 1;

Modified: trunk/cgi-bin/redirect-local.dat
===================================================================
--- trunk/cgi-bin/redirect-local.dat	2010-01-21 12:01:53 UTC (rev 8123)
+++ trunk/cgi-bin/redirect-local.dat	2010-01-21 12:42:34 UTC (rev 8124)
@@ -95,9 +95,6 @@
 /manage/comments/index.bml       /manage/settings/?cat=privacy
 /manage/horizon.bml              /manage/settings/
 /manage/mobile.bml               /manage/settings/?cat=mobile
-/manage/subscriptions            /manage/settings/?cat=notifications
-/manage/subscriptions/           /manage/settings/?cat=notifications
-/manage/subscriptions/index.bml  /manage/settings/?cat=notifications
 /manage/settings/index2.bml      /manage/settings/
 
 

Tags: andy, dat, ljcom, pm
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