Changeset 2463

Show
Ignore:
Timestamp:
05/30/08 02:23:26 (6 months ago)
Author:
bchoate
Message:

Updates to optimize recently_commented_on, category and tag attributes for Entries tag - BugId:79914. Search app can now supply user state - BugId:79906. Fix for 2-digit year bug - BugId:79924

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-39/default_templates/search_results.mtml

    r2310 r2463  
    33<html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard"> 
    44<head> 
     5    <script type="text/javascript"> 
     6    /* <![CDATA[ */ 
     7    var user = <$MTUserSessionState$>; 
     8    /* ]]> */ 
     9    </script> 
    510    <$mt:include module="<__trans phrase="HTML Head">"$> 
    611    <title><$MTBlogName encode_html="1"$>: <__trans phrase="Search Results"></title> 
  • branches/release-39/lib/MT/App.pm

    r2425 r2463  
    955955} 
    956956 
     957sub session_state { 
     958    my $app = shift; 
     959    my $blog = $app->blog; 
     960    my $blog_id = $blog->id if $blog; 
     961 
     962    my $c; 
     963    if ( $blog_id && $blog ) { 
     964        my ( $sessobj, $commenter ) = $app->get_commenter_session(); 
     965        if ( $sessobj && $commenter ) { 
     966            my $blog_perms = $commenter->blog_perm($blog_id); 
     967            my $banned = $commenter->is_banned($blog_id) ? "1" : "0"; 
     968            $banned = 0 if $blog_perms && $blog_perms->can_administer; 
     969            $banned ||= 1 if $commenter->status == MT::Author::BANNED(); 
     970 
     971            if ($banned) { 
     972                $sessobj->remove; 
     973            } else { 
     974                $sessobj->start( time + 
     975                    $app->config->CommentSessionTimeout); # extend by timeout 
     976                $sessobj->save(); 
     977            } 
     978 
     979            # FIXME: These may not be accurate in 'SingleCommunity' mode... 
     980            my $can_comment = $banned ? 0 : 1; 
     981            $can_comment = 0 unless $blog->allow_unreg_comments || $blog->allow_reg_comments; 
     982            my $can_post = ($blog_perms && $blog_perms->can_create_post) ? "1" : "0"; 
     983            $c = { 
     984                sid => $sessobj->id, 
     985                name => $commenter->nickname, 
     986                url => $commenter->url, 
     987                email => $commenter->email, 
     988                userpic => scalar $commenter->userpic_url, 
     989                profile => "", # profile link url 
     990                is_authenticated => "1", 
     991                is_trusted => ($commenter->is_trusted($blog_id) ? "1" : "0"), 
     992                is_author => ($commenter->type == MT::Author::AUTHOR() ? "1" : "0"), 
     993                is_anonymous => "0", 
     994                is_banned => $banned, 
     995                can_comment => $can_comment, 
     996                can_post => $can_post, 
     997            }; 
     998        } 
     999    } 
     1000 
     1001    unless ($c) { 
     1002        my $can_comment = $blog && $blog->allow_anon_comments ? "1" : "0"; 
     1003        $c = { 
     1004            is_authenticated => "0", 
     1005            is_trusted => "0", 
     1006            is_anonymous => "1", 
     1007            can_post => "0", # no anonymous posts 
     1008            can_comment => $can_comment, 
     1009            is_banned => "0", 
     1010        }; 
     1011    } 
     1012 
     1013    return $c; 
     1014} 
     1015 
    9571016sub session { 
    9581017    my $app = shift; 
     
    10141073        return undef; 
    10151074    } 
     1075} 
     1076 
     1077sub get_commenter_session { 
     1078    my $app = shift; 
     1079    my $q   = $app->param; 
     1080 
     1081    my $session_key; 
     1082 
     1083    my $blog = $app->blog; 
     1084    if ($blog) { 
     1085        my $auths = $blog->commenter_authenticators || ''; 
     1086        if ( $auths =~ /MovableType/ ) { 
     1087            # First, check for a real MT user login. If one exists, 
     1088            # return that as the commenter identity 
     1089            my ($user, $first_time) = $app->login(); 
     1090            if ( $user ) { 
     1091                my $sess = $app->session; 
     1092                return ( $sess, $user ); 
     1093            } 
     1094        } 
     1095    } 
     1096 
     1097    my %cookies = $app->cookies(); 
     1098    my $cookie_name = $app->commenter_cookie; 
     1099    if ( !$cookies{$cookie_name} ) { 
     1100        return ( undef, undef ); 
     1101    } 
     1102    $session_key = $cookies{$cookie_name}->value() || ""; 
     1103    $session_key =~ y/+/ /; 
     1104    my $cfg = $app->config; 
     1105    require MT::Session; 
     1106    my $sess_obj = MT::Session->load( { id => $session_key, kind => 'SI' } ); 
     1107    my $timeout = $cfg->CommentSessionTimeout; 
     1108    my $user_id = $sess_obj->get('author_id') if $sess_obj; 
     1109    my $user = MT::Author->load( $user_id ) if $user_id; 
     1110 
     1111    if (   !$sess_obj 
     1112        || ( $sess_obj->start() + $timeout < time ) 
     1113        || ( !$user_id ) 
     1114        || ( !$user ) 
     1115      ) 
     1116    { 
     1117        $app->_invalidate_commenter_session( \%cookies ); 
     1118        return ( undef, undef ); 
     1119    } 
     1120 
     1121    # session is valid! 
     1122    return ( $sess_obj, $user ); 
    10161123} 
    10171124 
  • branches/release-39/lib/MT/App/Comments.pm

    r2425 r2463  
    2424    $app->SUPER::init(@_) or return; 
    2525    $app->add_methods( 
    26         login            => \&login
     26        login            => \&login_form
    2727        login_external   => \&login_external, 
    2828        do_login         => \&do_login, 
     
    9191 
    9292sub load_core_tags { 
    93     return { 
    94         function => { 
    95             UserSessionState => \&_hdlr_user_session_state, 
    96         }, 
    97     }; 
     93    return {}; 
    9894} 
    9995 
     
    109105sub _get_commenter_session { 
    110106    my $app = shift; 
    111     my $q   = $app->param; 
    112  
    113     my $session_key; 
    114  
    115     my $blog = $app->blog; 
    116     if ($blog) { 
    117         my $auths = $blog->commenter_authenticators || ''; 
    118         if ( $auths =~ /MovableType/ ) { 
    119             # First, check for a real MT user login. If one exists, 
    120             # return that as the commenter identity 
    121             my ($user, $first_time) = $app->SUPER::login(); 
    122             if ( $user ) { 
    123                 my $sess = $app->session; 
    124                 return ( $sess, $user ); 
    125             } 
    126         } 
    127     } 
    128  
    129     my %cookies = $app->cookies(); 
    130     my $cookie_name = $app->commenter_cookie; 
    131     if ( !$cookies{$cookie_name} ) { 
    132         return ( undef, undef ); 
    133     } 
    134     $session_key = $cookies{$cookie_name}->value() || ""; 
    135     $session_key =~ y/+/ /; 
    136     my $cfg = $app->config; 
    137     require MT::Session; 
    138     my $sess_obj = MT::Session->load( { id => $session_key, kind => 'SI' } ); 
    139     my $timeout = $cfg->CommentSessionTimeout; 
    140     my $user_id = $sess_obj->get('author_id') if $sess_obj; 
    141     my $user = MT::Author->load( $user_id ) if $user_id; 
    142  
    143     if (   !$sess_obj 
    144         || ( $sess_obj->start() + $timeout < time ) 
    145         || ( !$user_id ) 
    146         || ( !$user ) 
    147       ) 
    148     { 
    149         $app->_invalidate_commenter_session( \%cookies ); 
    150         return ( undef, undef ); 
    151     } 
    152  
    153     # session is valid! 
    154     return ( $sess_obj, $user ); 
    155 
    156  
    157 sub login { 
     107    return $app->get_commenter_session(); 
     108
     109 
     110sub login_form { 
    158111    my $app   = shift; 
    159112    my %param = @_; 
     
    14221375    my $static = $q->param('static') || $q->param('return_url') || ''; 
    14231376 
    1424     if ( ($static eq '') || ($static eq 1) ) { 
     1377    if ( ($static eq '') || ($static eq '1') ) { 
    14251378        require MT::Entry; 
    14261379        my $entry = MT::Entry->load( $q->param('entry_id') || 0 ) 
    14271380            or return $app->error($app->translate('Can\'t load entry #[_1].', $q->param('entry_id'))); 
    14281381        $target = $entry->archive_url; 
    1429         my $blog = MT::Blog->load( $entry->blog_id ); 
    1430         $target = MT::Util::strip_index( $target, $blog ); 
    14311382    } 
    14321383    elsif ($static ne '') { 
     
    14471398} 
    14481399 
    1449 sub session_state { 
    1450     my $app = shift; 
    1451     my $blog = $app->blog; 
    1452     my $blog_id = $blog->id if $blog; 
    1453  
    1454     my $c; 
    1455     if ( $blog_id && $blog ) { 
    1456         my ( $sessobj, $commenter ) = $app->_get_commenter_session(); 
    1457         if ( $sessobj && $commenter ) { 
    1458             my $blog_perms = $commenter->blog_perm($blog_id); 
    1459             my $banned = $commenter->is_banned($blog_id) ? "1" : "0"; 
    1460             $banned = 0 if $blog_perms && $blog_perms->can_administer; 
    1461             $banned ||= 1 if $commenter->status == MT::Author::BANNED(); 
    1462  
    1463             if ($banned) { 
    1464                 $sessobj->remove; 
    1465             } else { 
    1466                 $sessobj->start( time + 
    1467                     $app->config->CommentSessionTimeout); # extend by timeout 
    1468                 $sessobj->save(); 
    1469             } 
    1470  
    1471             # FIXME: These may not be accurate in 'SingleCommunity' mode... 
    1472             my $can_comment = $banned ? 0 : 1; 
    1473             $can_comment = 0 unless $blog->allow_unreg_comments || $blog->allow_reg_comments; 
    1474             my $can_post = ($blog_perms && $blog_perms->can_create_post) ? "1" : "0"; 
    1475             $c = { 
    1476                 sid => $sessobj->id, 
    1477                 name => $commenter->nickname, 
    1478                 url => $commenter->url, 
    1479                 email => $commenter->email, 
    1480                 userpic => scalar $commenter->userpic_url, 
    1481                 profile => "", # profile link url 
    1482                 is_authenticated => "1", 
    1483                 is_trusted => ($commenter->is_trusted($blog_id) ? "1" : "0"), 
    1484                 is_author => ($commenter->type == MT::Author::AUTHOR() ? "1" : "0"), 
    1485                 is_anonymous => "0", 
    1486                 is_banned => $banned, 
    1487                 can_comment => $can_comment, 
    1488                 can_post => $can_post, 
    1489             }; 
    1490         } 
    1491     } 
    1492  
    1493     unless ($c) { 
    1494         my $can_comment = $blog && $blog->allow_anon_comments ? "1" : "0"; 
    1495         $c = { 
    1496             is_authenticated => "0", 
    1497             is_trusted => "0", 
    1498             is_anonymous => "1", 
    1499             can_post => "0", # no anonymous posts 
    1500             can_comment => $can_comment, 
    1501             is_banned => "0", 
    1502         }; 
    1503     } 
    1504  
    1505     return $c; 
    1506 } 
    1507  
    15081400sub session_js { 
    15091401    my $app = shift; 
     
    15201412    $app->print("$jsonp(" . $json . ");\n"); 
    15211413    return undef; 
    1522 } 
    1523  
    1524 sub _hdlr_user_session_state { 
    1525     my ($ctx, $args, $cond) = @_; 
    1526     my $state = MT->app->session_state(); 
    1527     require JSON; 
    1528     my $json = JSON::objToJson($state); 
    1529     return $json; 
    15301414} 
    15311415 
  • branches/release-39/lib/MT/App/Search.pm

    r2438 r2463  
    496496    my $blog_id = $app->first_blog_id(); 
    497497    if ( $blog_id ) { 
     498        my $blog = $app->model('blog')->load($blog_id); 
     499        $app->blog( $blog ); 
    498500        $ctx->stash('blog_id', $blog_id); 
    499         $ctx->stash('blog',    $app->model('blog')->load($blog_id)); 
     501        $ctx->stash('blog',    $blog); 
    500502    } 
    501503    $ctx; 
  • branches/release-39/lib/MT/ObjectDriver/Driver/DBI.pm

    r2459 r2463  
    160160    $stmt->group([ map { { column => $_ } } @group ]); 
    161161 
    162     ## Ugly. 
    163     my $sql = $stmt->as_sql; 
    164  
    165162    ## Set statement's ORDER clause if any. 
    166163    if ($order) { 
    167164        if (! ref($order)) { 
    168             $sql .= "\nORDER BY " . $decorate->($order); 
    169             if ($direction) { 
    170                 $sql .= $direction eq 'descend' ? ' DESC' : ' ASC'; 
    171             } 
     165            $stmt->order( [ { column => $decorate->($order), 
     166                desc => $direction eq 'descend' ? 'DESC' : 'ASC' 
     167            } ] ); 
    172168        } else { 
    173169            my @order; 
     
    179175            } 
    180176            $stmt->order(\@order); 
    181             $sql .= "\n" . $stmt->as_aggregate('order'); 
    182         } 
    183     } 
     177        } 
     178    } 
     179 
     180    my $sql = $stmt->as_sql; 
    184181 
    185182    my $dbh = $driver->r_handle; 
  • branches/release-39/lib/MT/Template/ContextHandlers.pm

    r2448 r2463  
    512512            SearchTemplateID => sub { 0 }, 
    513513 
    514             UserSessionState => sub { 'null' }
     514            UserSessionState => \&_hdlr_user_session_state
    515515 
    516516            BuildTemplateID => \&_hdlr_build_template_id, 
     
    15731573=back 
    15741574 
     1575=for tags application 
     1576 
    15751577=cut 
    15761578 
     
    16971699which will encode these to HTML entities. 
    16981700 
     1701=for tags application 
     1702 
    16991703=cut 
    17001704 
     
    17531757 
    17541758=back 
     1759 
     1760=for tags application 
    17551761 
    17561762=cut 
     
    18301836        (contents of widget go here) 
    18311837    </mtapp:Widget> 
     1838 
     1839=for tags application 
    18321840 
    18331841=cut 
     
    19351943 
    19361944=back 
     1945 
     1946=for tags application 
    19371947 
    19381948=cut 
     
    20102020 
    20112021    <$mtapp:PageActions$> 
     2022 
     2023=for tags application 
    20122024 
    20132025=cut 
     
    21092121        <input type="submit" /> 
    21102122    </form> 
     2123 
     2124=for tags application 
    21112125 
    21122126=cut 
     
    21842198    </MTApp:SettingGroup> 
    21852199 
     2200=for tags application 
     2201 
    21862202=cut 
    21872203 
     
    22982314        </div> 
    22992315    </div> 
     2316 
     2317=for tags application 
    23002318 
    23012319=cut 
     
    24592477    2,4,6,8,10 
    24602478 
    2461 =for tags loop 
     2479=for tags loop, templating 
    24622480 
    24632481=cut 
     
    25192537    </mt:If> 
    25202538 
     2539=for tags templating 
     2540 
    25212541=cut 
    25222542 
     
    25472567 
    25482568An alias for the 'Else' tag. 
     2569 
     2570=for tags templating 
    25492571 
    25502572=cut 
     
    27712793        '<$mt:Var name="some_variable"$>' is 11 characters or longer 
    27722794    </mt:If> 
     2795 
     2796=for tags templating 
    27732797 
    27742798=cut 
     
    30163040=back 
    30173041 
    3018 =for tags loop 
     3042=for tags loop, templating 
    30193043 
    30203044=cut 
     
    31203144=head2 Var 
    31213145 
    3122 Retrieves a template variable and outputs it's value. 
     3146A B<function tag> used to store and later output data in a template. 
    31233147 
    31243148B<Attributes:> 
     
    31263150=over 4 
    31273151 
    3128 =item var or name 
     3152=item name (or var) 
    31293153 
    31303154Identifies the template variable. The 'name' attribute supports a variety 
     
    32233247 
    32243248=back 
     3249 
     3250=for tags templating 
    32253251 
    32263252=cut 
     
    34183444=back 
    34193445 
     3446=for tags tags, entries 
     3447 
    34203448=cut 
    34213449 
     
    35953623    </ul> 
    35963624 
    3597 =for tags multiblog, loop 
     3625=for tags tags, multiblog, loop 
    35983626 
    35993627=cut 
     
    37343762this into a request to mt-search.cgi. 
    37353763 
    3736 =for tags multiblog 
     3764=for tags tags, multiblog 
    37373765 
    37383766=cut 
     
    38083836 
    38093837=for tags multiblog 
     3838 
     3839=for tags tags 
    38103840 
    38113841=cut 
     
    39303960    </mt:If> 
    39313961 
     3962=for tags tags, entries 
     3963 
    39323964=cut 
    39333965 
     
    39864018=back 
    39874019 
     4020=for tags tags 
     4021 
    39884022=cut 
    39894023 
     
    40074041Outputs the numeric ID of the tag currently in context. 
    40084042 
     4043=for tags tags 
     4044 
    40094045=cut 
    40104046 
     
    40234059in context. 
    40244060 
    4025 =for tags count 
     4061=for tags tags, count 
    40264062 
    40274063=cut 
     
    40564092configured with a TypeKey token. 
    40574093 
     4094=for tags comments, typekey 
     4095 
    40584096=cut 
    40594097 
     
    40704108A conditional tag that is true when the blog is configured to moderate 
    40714109incoming comments from anonymous commenters. 
     4110 
     4111=for tags comments 
    40724112 
    40734113=cut 
     
    40904130permit user registration. 
    40914131 
     4132=for tags comments 
     4133 
    40924134=cut 
    40934135 
     
    41084150A conditional tag that is true when the blog has been configured to 
    41094151require user registration. 
     4152 
     4153=for tags comments 
    41104154 
    41114155=cut 
     
    41294173permit anonymous comments. 
    41304174 
     4175=for tags comments 
     4176 
    41314177=cut 
    41324178 
     
    41544200allow comments and the blog is configured to accept comments in some 
    41554201fashion. 
     4202 
     4203=for tags comments 
    41564204 
    41574205=cut 
     
    42054253    </mt:IfArchiveType> 
    42064254 
     4255=for tags archives 
     4256 
    42074257=cut 
    42084258 
     
    42424292        <!-- do something else --> 
    42434293    </mt:IfArchiveTypeEnabled> 
     4294 
     4295=for tags archives 
    42444296 
    42454297=cut 
     
    43084360 
    43094361=back 
     4362 
     4363=for tags templating 
    43104364 
    43114365=cut 
     
    44314485 
    44324486    <h2><$mt:Var name="title"$></h2> 
     4487 
     4488=for tags templating 
    44334489 
    44344490=cut 
     
    48664922 
    48674923    <$mt:FileTemplate format="%y/%m/%f"$> 
     4924 
     4925=for tags archives 
    48684926 
    48694927=cut 
     
    49475005=for tags date 
    49485006 
     5007=for tags templates 
     5008 
    49495009=cut 
    49505010 
     
    49955055    <a href="<mt:Link identifier="main_index">">Home</a> 
    49965056 
     5057=for tags archives 
    49975058=cut 
    49985059 
     
    50385099    <mt:Version /> 
    50395100 
     5101=for tags configuration 
     5102 
    50405103=cut 
    50415104 
     
    50685131 
    50695132    Movable Type Open Source 
     5133 
     5134=for tags configuration 
    50705135 
    50715136=cut 
     
    50925157    <$mt:PublishCharset$> 
    50935158 
     5159=for tags configuration 
     5160 
    50945161=cut 
    50955162 
     
    51125179other installed language. 
    51135180 
     5181=for tags configuration 
     5182 
    51145183=cut 
    51155184 
     
    51245193 
    51255194The value of the C<SignOnURL> configuration setting. 
     5195 
     5196=for tags comments 
    51265197 
    51275198=cut 
     
    52395310message. Used in system templates, such as the 'Comment Response' template. 
    52405311 
     5312=for tags templating 
     5313 
    52415314=cut 
    52425315 
     
    52665339 
    52675340    <ul><li><$mt:Var name="color"$></li></ul> 
     5341 
     5342=for tags templating 
    52685343 
    52695344=cut 
     
    53065381    foo is assigned: <$mt:Var name="my_hash{foo}"$> 
    53075382 
     5383=for tags templating 
     5384 
    53085385=cut 
    53095386 
     
    53735450=back 
    53745451 
     5452=for tags templating 
     5453 
    53755454=cut 
    53765455 
     
    54075486 
    54085487=back 
     5488 
     5489=for tags templating 
    54095490 
    54105491=cut 
     
    54395520        <$mt:Var name="entry_title"$> 
    54405521    </mt:Entries> 
     5522 
     5523=for tags templating 
    54415524 
    54425525=cut 
     
    55815664    <a href="<$mt:CGIPath$>some-cgi-script.cgi"> 
    55825665 
     5666=for tags configuration 
     5667 
    55835668=cut 
    55845669 
     
    56115696    <$mt:AdminCGIPath$> 
    56125697 
    5613 =for tags path, system 
     5698=for tags path, configuration 
    56145699 
    56155700=cut 
     
    56365721(mt-config.cgi). 
    56375722 
     5723=for tags configuration 
     5724 
    56385725=cut 
    56395726 
     
    56485735Returns the file path to the directory where Movable Type has been 
    56495736installed. Any trailing "/" character is removed. 
     5737 
     5738=for tags configuration 
    56505739 
    56515740=cut 
     
    56645753mt-config.cgi. This is the same as L<CGIPath>, but without any 
    56655754domain name. This value is guaranteed to end with a "/" character. 
     5755 
     5756=for tags configuration 
    56665757 
    56675758=cut 
     
    56855776the location of the MT application files alone). This value is 
    56865777guaranteed to end with a "/" character. 
     5778 
     5779=for tags configuration 
    56875780 
    56885781=cut 
     
    57145807        alt="Powered by MT" /> 
    57155808 
     5809=for tags configuration 
     5810 
    57165811=cut 
    57175812 
     
    57445839for this setting if unassigned is "mt.cgi". 
    57455840 
     5841=for tags configuration 
     5842 
    57465843=cut 
    57475844 
     
    57585855default for this setting if unassigned is "mt-comments.cgi". 
    57595856 
     5857=for tags configuration 
     5858 
    57605859=cut 
    57615860 
     
    57725871default for this setting if unassigned is "mt-tb.cgi". 
    57735872 
     5873=for tags configuration 
     5874 
    57745875=cut 
    57755876 
     
    57865887default for this setting if unassigned is "mt-search.cgi". 
    57875888 
     5889=for tags configuration 
     5890 
    57885891=cut 
    57895892 
     
    58025905setting.  Use C<SearchMaxResults> because MaxResults is considered deprecated. 
    58035906 
    5804 =for tags search 
     5907=for tags search, configuration 
    58055908 
    58065909=cut 
     
    58185921default for this setting if unassigned is "mt-xmlrpc.cgi". 
    58195922 
     5923=for tags configuration 
     5924 
    58205925=cut 
    58215926 
     
    58325937default for this setting if unassigned is "mt-atom.cgi". 
    58335938 
     5939=for tags configuration 
     5940 
    58345941=cut 
    58355942 
     
    58465953default for this setting if unassigned is "mt-add-notify.cgi". 
    58475954 
     5955=for tags configuration 
     5956 
    58485957=cut 
    58495958 
     
    58635972    </mt:IfAuthor> 
    58645973 
     5974=for tags authors 
     5975 
    58655976=cut 
    58665977 
     
    58805991    <a href="<$mt:ArchiveLink type="Author">">Archive for this author</a> 
    58815992    </mt:AuthorHasEntry> 
     5993 
     5994=for tags authors, entries 
    58825995 
    58835996=cut 
     
    59056018has written one or more pages that have been published. 
    59066019 
     6020=for tags authors, pages 
     6021 
    59076022=cut 
    59086023 
     
    60186133    </mt:Authors> 
    60196134 
    6020 =for tags multiblog, loop, scoring 
     6135=for tags multiblog, loop, scoring, authors 
    60216136 
    60226137=cut 
     
    62496364=head2 AuthorID 
    62506365 
    6251 Outputs the numeric ID of the author currently in context. 
     6366Outputs the numeric ID of the author currently in context. If no author 
     6367is in context, it will use the author of the entry or page in context. 
     6368 
     6369=for tags authors 
    62526370 
    62536371=cut 
     
    62686386=head2 AuthorName 
    62696387 
    6270 Outputs the username of the author currently in context. 
     6388Outputs the username of the author currently in context. If no author 
     6389is in context, it will use the author of the entry or page in context. 
    62716390 
    62726391B<NOTE:> it is not recommended to publish the author's username. 
     6392 
     6393=for tags authors 
    62736394 
    62746395=cut 
     
    62896410=head2 AuthorDisplayName 
    62906411 
    6291 Outputs the display name of the author currently in context. 
     6412Outputs the display name of the author currently in context. If no author 
     6413is in context, it will use the author of the entry or page in context. 
     6414 
     6415=for tags authors 
    62926416 
    62936417=cut 
     
    63086432=head2 AuthorEmail 
    63096433 
    6310 Outputs the email address of the author currently in context. 
     6434Outputs the email address of the author currently in context. If no author 
     6435is in context, it will use the author of the entry or page in context. 
    63116436 
    63126437B<NOTE:> it is not recommended to publish the author's email address. 
     6438 
     6439=for tags authors 
    63136440 
    63146441=cut 
     
    63316458=head2 AuthorURL 
    63326459 
    6333 Outputs the URL field of the author currently in context. 
     6460Outputs the URL field of the author currently in context. If no author 
     6461is in context, it will use the author of the entry or page in context. 
     6462 
     6463=for tags authors 
    63346464 
    63356465=cut 
     
    63546484in context. For Movable Type registered users, this is "MT". 
    63556485 
     6486=for tags authors 
     6487 
    63566488=cut 
    63576489 
     
    63976529    </mt:Authors> 
    63986530 
     6531=for tags authors 
     6532 
    63996533=cut 
    64006534 
     
    64216555        width="100" height="100" /> 
    64226556 
     6557=for tags authors, userpics 
     6558 
    64236559=cut 
    64246560 
     
    64426578 
    64436579If the author has no userpic, this will output an empty string. 
     6580 
     6581=for tags authors, userpics 
    64446582 
    64456583=cut 
     
    64746612    </mt:Authors></ul> 
    64756613 
     6614=for tags authors, userpics, assets 
     6615 
    64766616=cut 
    64776617 
     
    64996639 
    65006640Outputs the 'Basename' field of the author currently in context. 
     6641 
     6642=for tags authors 
    65016643 
    65026644=cut 
     
    65356677=back 
    65366678 
    6537 =for tags multiblog, loop 
     6679=for tags multiblog, loop, blogs 
    65386680 
    65396681=cut 
     
    65926734Outputs the numeric ID of the blog currently in context. 
    65936735 
     6736=for tags blogs 
     6737 
    65946738=cut 
    65956739 
     
    66056749 
    66066750Outputs the name of the blog currently in context. 
     6751 
     6752=for tags blogs 
    66076753 
    66086754=cut 
     
    66226768Outputs the description field of the blog currently in context. 
    66236769 
     6770=for tags blogs 
     6771 
    66246772=cut 
    66256773 
     
    66366784=head2 BlogURL 
    66376785 
    6638 Outputs the Site URL field of the blog currently in context. 
     6786Outputs the Site URL field of the blog currently in context. An ending 
     6787'/' character is guaranteed. 
     6788 
     6789=for tags blogs 
    66396790 
    66406791=cut 
     
    66546805=head2 BlogSitePath 
    66556806 
    6656 Outputs the Site Root field of the blog currently in context. 
     6807Outputs the Site Root field of the blog currently in context. An ending 
     6808'/' character is guaranteed. 
     6809 
     6810=for tags blogs 
    66576811 
    66586812=cut 
     
    66726826=head2 BlogArchiveURL 
    66736827 
    6674 Outputs the Archive URL of the blog currently in context. 
     6828Outputs the Archive URL of the blog currently in context. An ending 
     6829'/' character is guaranteed. 
     6830 
     6831=for tags blogs 
    66756832 
    66766833=cut 
     
    66916848 
    66926849Similar to the L<BlogURL> tag, but removes any domain name from the URL. 
     6850 
     6851=for tags blogs 
    66936852 
    66946853=cut 
     
    67156874General settings screen. 
    67166875 
     6876B<Attributes:> 
     6877 
     6878=over 4 
     6879 
     6880=item no_colon (optional; default "0") 
     6881 
     6882If specified, will produce the timezone without the ":" character 
     6883("+|-hhmm" only). 
     6884 
     6885=back 
     6886 
     6887=for tags blogs 
     6888 
    67176889=cut 
    67186890 
     
    67536925=back 
    67546926 
     6927=for tags blogs 
     6928 
    67556929=cut 
    67566930 
     
    67936967 
    67946968=back 
     6969 
     6970=for tags blogs 
    67956971 
    67966972=cut 
     
    68337009=back 
    68347010 
     7011=for tags configuration 
     7012 
    68357013=cut 
    68367014 
     
    68497027=head2 BlogCategoryCount 
    68507028 
    6851 =for tags multiblog, count 
     7029=for tags multiblog, count, blogs 
    68527030 
    68537031=cut 
     
    68697047currently in context. 
    68707048 
    6871 =for tags multiblog, count 
     7049=for tags multiblog, count, blogs, entries 
    68727050 
    68737051=cut 
     
    68927070currently in context. 
    68937071 
    6894 =for tags multiblog, count 
     7072=for tags multiblog, count, blogs, comments 
    68957073 
    68967074=cut 
     
    69147092currently in context. 
    69157093 
    6916 =for tags multiblog, count 
     7094=for tags multiblog, count, blogs, pings 
    69177095 
    69187096=cut 
     
    69397117have a Creative Commons license, this tag returns an empty string. 
    69407118 
     7119=for tags blogs, creativecommons 
     7120 
    69417121=cut 
    69427122 
     
    69617141    <img src="<$MTBlogCCLicenseImage$>" alt="Creative Commons" /> 
    69627142    </MTIf> 
     7143 
     7144=for tags blogs, creativecommons 
    69637145 
    69647146=cut 
     
    69907172If specified, forces the trailing "index" filename to be left on any 
    69917173entry permalink published in the RDF block. 
     7174 
     7175=for tags blogs, creativecommons 
    69927176 
    69937177=cut 
     
    70457229been assigned a Creative Commons License. 
    70467230 
     7231=for tags blogs, creativecommons 
     7232 
    70477233=cut 
    70487234 
     
    70617247'.' character. If no extension is assigned, this returns an empty 
    70627248string. 
     7249 
     7250=for tags blogs 
    70637251 
    70647252=cut 
     
    70817269changed to dashes. In the MT template sets, this identifier is assigned 
    70827270to the "id" attribute of the C<body> HTML tag. 
     7271 
     7272=for tags blogs 
    70837273 
    70847274=cut 
     
    74577647            my %map; 
    74587648            require MT::Placement; 
     7649            my @cat_ids; 
    74597650            for my $cat (@$cats) { 
     7651                push @cat_ids, $cat->id; 
    74607652                my $iter = MT::Placement->load_iter({ category_id => $cat->id }); 
    74617653                while (my $p = $iter->()) { 
    74627654                    $map{$p->entry_id}{$cat->id}++; 
    74637655                } 
     7656  &nbs