Типа я (zilogic) wrote in changelog,
Типа я
zilogic
changelog

[livejournal] r20388: LJSUP-10191: Render S2 from BML

Committer: amyshkin
LJSUP-10191: Render S2 from BML
U   trunk/cgi-bin/Apache/LiveJournal.pm
U   trunk/cgi-bin/LJ/Hooks/PingBack.pm
Modified: trunk/cgi-bin/Apache/LiveJournal.pm
===================================================================
--- trunk/cgi-bin/Apache/LiveJournal.pm	2011-10-20 07:25:29 UTC (rev 20387)
+++ trunk/cgi-bin/Apache/LiveJournal.pm	2011-10-20 07:59:19 UTC (rev 20388)
@@ -1809,10 +1809,9 @@
     LJ::Request->notes("view" => $RQ{'mode'});
     my $user = $RQ{'user'};
 
-# Task not ready yet
-#    my $return;
-#    my $ret = LJ::run_hooks("before_journal_content_created", $opts, %RQ, \$return);
-#    return $ret if $return;
+    my $return;
+    my $ret = LJ::run_hooks("before_journal_content_created", $opts, %RQ, \$return);
+    return $ret if $return;
 
     my $html = LJ::make_journal($user, $RQ{'mode'}, $remote, $opts);
 

Modified: trunk/cgi-bin/LJ/Hooks/PingBack.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/PingBack.pm	2011-10-20 07:25:29 UTC (rev 20387)
+++ trunk/cgi-bin/LJ/Hooks/PingBack.pm	2011-10-20 07:59:19 UTC (rev 20388)
@@ -191,5 +191,26 @@
     
 });
 
+LJ::register_hook("before_journal_content_created", sub {
+    my $return = pop;
+    my ( $opts, %RQ ) = @_;
 
+    return if $RQ{'pathextra'} eq '/rss';
+
+    # check if special journal
+    if ( exists $LJ::DOMAIN_SUBST->{$RQ{'user'}}  ) {
+        $return = 1;
+
+        my $filename = "$LJ::HOME/htdocs/" . $LJ::DOMAIN_SUBST->{$RQ{'user'}};
+        LJ::Request->notes("_journal" => $RQ{'user'});
+        LJ::Request->notes("bml_filename" => $filename);
+        LJ::Request->notes("RQ" => \%RQ);
+        LJ::Request->notes("opts" => $opts);
+        return Apache::BML::handler();
+    }
+
+    return;
+});
+
+
 1;

Tags: amyshkin, livejournal, pm, zilogic
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