& /include/header_google.imhtml, lnavtype=>'regular', title=>$title, ssl=>1, oas_pop=>0, oas_positions=>"Top1,Middle1" &>
% if( ref $doc && length $doc->getD_blurb() ) {
<& "$_basedir/include/doctypes/$doctype/$subtype.imhtml", doc=>$doc &>
% if( $doc->getOrigin() eq 'print' ) {
Post date <& "$_basedir/include/nicedate.imhtml", date=>$doc->getStart() &> | Issue date <& "$_basedir/include/nicedate.imhtml", date=>$i &>
% } else {
Only at TNR Online | Post date <& "$_basedir/include/nicedate.imhtml", date=>$doc->getStart() &>
% }
|
|
<& "$_basedir/reg/include/ad/300x250.imhtml", targets=>$targets, showdiv=>0 &><%$doc->getD_blurb()%>...
|
% } elsif( $uri =~ m#/current.pdf# ) {
<& "$_basedir/include/subservices_sub.imhtml", uri=>$uri &>
% }
<%$subform%>
<& /include/footer-wide.imhtml &>
%#-------------------------------------------------------------------
<%once>
my $coma = undef;
<%args>
$f => undef
$bl => undef
$i => undef
$s => undef
$uri => 'http://www.tnr.com/'
$n => undef
<%init>
if( ! defined $coma ) { $coma = $m->comp("$_basedir/admin/include/getComa.imhtml"); }
my( $doc, $subdoneurl, $doctype, $subtype );
if( $i && $s ) {
$doc = $coma->getDoc($i, $s);
#old articles become suscriber
my( $olddd, $oldmm, $oldyyyy ) = (localtime(time - (86400*14)))[3..5];
my $olddate = sprintf("%4d-%02d-%02d", $oldyyyy+1900, $oldmm+1, $olddd);
if( $doc->getPrivilege() ne 'subscriber' && $doc->getStart() lt $olddate ) {
$doc->setPrivilege('subscriber');
}
if( $doc->getPrivilege() eq 'free'
|| ( fresh::user::web::isSub() && ! $ENV{'REMOTE_EXPIRED'} ))
{
$m->comp("$_genbase/action/redirect.mhtml", url=>"http://www.tnr.com/doc.mhtml?i=$i&s=$s");
return;
}
$subdoneurl = fresh::util::utils::encode($ENV{'REQUEST_URI'});
$doctype = $coma->getDocTypeSnameByTid($doc->getType);
$subtype = $coma->getDocTypeSnameByTid($doc->getSubtype);
} else {
if( fresh::user::web::isSub() && ! $ENV{'REMOTE_EXPIRED'}) {
$m->comp("$_genbase/action/redirect.mhtml", url=>"$uri");
return;
}
$subdoneurl = fresh::util::utils::encode($uri);
}
my $title = ref $doc ? $doc->getTitle() : "";
my $targets = ref $doc ? [ $doc->getType(), $doc->getSubtype() ] : [];
my $subform = $m->scomp( "$_basedir/sumo/dhandler",
campname=>'doc_sub',
embedded=>1,
referer => $ARGS{'referer'} || "https://$ENV{'SERVER_NAME'}$ENV{'REQUEST_URI'}",
%ARGS
);
my @missed;
if( $f =~ /^m:(.*)/ ) { @missed = split /,/, $1 }
<%filter>
#s#img([^>]+)src="(?!http)/?#img$1src="https://ssl.tnr.com/#g;
#s#script([^>]+)src="(?!http)/?#script$1src="https://ssl.tnr.com/#g;
#s#link ([^>]+)href="(?!http)/?#link $1href="https://ssl.tnr.com/#g;
#s#type="?image"?([^>]+)src="(?!http)/?#type="image"$1src="https://ssl.tnr.com/#g;
s#a ([^>]*)href="(?!http)/?#a $1href="http://www.tnr.com/#g;