wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[ljcom] r13101: LJCOMCOMREAD-381: Smart App Banners

Committer: wisest-owl
LJCOMCOMREAD-381: Smart App Banners

U   trunk/bin/upgrading/proplists-local.dat
U   trunk/cgi-bin/LJ/Hooks/S2Styles.pm
Modified: trunk/bin/upgrading/proplists-local.dat
===================================================================
--- trunk/bin/upgrading/proplists-local.dat	2013-01-11 12:23:39 UTC (rev 13100)
+++ trunk/bin/upgrading/proplists-local.dat	2013-01-14 07:45:49 UTC (rev 13101)
@@ -86,6 +86,14 @@
   multihomed: 0
   prettyname: Check non White List
 
+userproplist.community_reader_ids:
+  cldversion: 8
+  datatype: char
+  des: AppStoreID and AndroidID of Community Reader
+  indexed: 0
+  multihomed: 0
+  prettyname: AppStoreID and AndroidID of Community Reader
+
 userproplist.control_strip_forced:
   cldversion: 4
   datatype: num

Modified: trunk/cgi-bin/LJ/Hooks/S2Styles.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/S2Styles.pm	2013-01-11 12:23:39 UTC (rev 13100)
+++ trunk/cgi-bin/LJ/Hooks/S2Styles.pm	2013-01-14 07:45:49 UTC (rev 13101)
@@ -16,6 +16,25 @@
     }
 });
 
+LJ::register_hook('s2_head_content_extra_2', sub {
+    my ($str_ref, $u, $r) = @_;
+
+    return unless $u;
+    return unless $r;
+    return unless LJ::Request->header_in('User-Agent') =~ /iPhone/;
+
+    my $ids = $u->prop ('community_reader_ids');
+    return unless $ids;
+
+    my ($app_store_id, $android_id) = split ("|", $ids);
+#$app_store_id = "333903271";
+    if ($app_store_id) {
+        my $uri = $r->hostname.$r->uri;
+        my $head_meta = qq{<meta name="apple-itunes-app" content="app-id=$app_store_id, app-argument=http://$uri">};
+        $$str_ref .= $head_meta;
+    }
+});
+
 LJ::register_hook('s2_can_use_layer', sub {
     my $opts = shift;
     my $u    = delete $opts->{u};

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