Changeset 2463
- Timestamp:
- 05/30/08 02:23:26 (6 months ago)
- Files:
-
- branches/release-39/default_templates/search_results.mtml (modified) (1 diff)
- branches/release-39/lib/MT/App.pm (modified) (2 diffs)
- branches/release-39/lib/MT/App/Comments.pm (modified) (6 diffs)
- branches/release-39/lib/MT/App/Search.pm (modified) (1 diff)
- branches/release-39/lib/MT/ObjectDriver/Driver/DBI.pm (modified) (2 diffs)
- branches/release-39/lib/MT/Template/ContextHandlers.pm (modified) (113 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/release-39/default_templates/search_results.mtml
r2310 r2463 3 3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard"> 4 4 <head> 5 <script type="text/javascript"> 6 /* <![CDATA[ */ 7 var user = <$MTUserSessionState$>; 8 /* ]]> */ 9 </script> 5 10 <$mt:include module="<__trans phrase="HTML Head">"$> 6 11 <title><$MTBlogName encode_html="1"$>: <__trans phrase="Search Results"></title> branches/release-39/lib/MT/App.pm
r2425 r2463 955 955 } 956 956 957 sub 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 957 1016 sub session { 958 1017 my $app = shift; … … 1014 1073 return undef; 1015 1074 } 1075 } 1076 1077 sub 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 ); 1016 1123 } 1017 1124 branches/release-39/lib/MT/App/Comments.pm
r2425 r2463 24 24 $app->SUPER::init(@_) or return; 25 25 $app->add_methods( 26 login => \&login ,26 login => \&login_form, 27 27 login_external => \&login_external, 28 28 do_login => \&do_login, … … 91 91 92 92 sub load_core_tags { 93 return { 94 function => { 95 UserSessionState => \&_hdlr_user_session_state, 96 }, 97 }; 93 return {}; 98 94 } 99 95 … … 109 105 sub _get_commenter_session { 110 106 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 110 sub login_form { 158 111 my $app = shift; 159 112 my %param = @_; … … 1422 1375 my $static = $q->param('static') || $q->param('return_url') || ''; 1423 1376 1424 if ( ($static eq '') || ($static eq 1) ) {1377 if ( ($static eq '') || ($static eq '1') ) { 1425 1378 require MT::Entry; 1426 1379 my $entry = MT::Entry->load( $q->param('entry_id') || 0 ) 1427 1380 or return $app->error($app->translate('Can\'t load entry #[_1].', $q->param('entry_id'))); 1428 1381 $target = $entry->archive_url; 1429 my $blog = MT::Blog->load( $entry->blog_id );1430 $target = MT::Util::strip_index( $target, $blog );1431 1382 } 1432 1383 elsif ($static ne '') { … … 1447 1398 } 1448 1399 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 timeout1468 $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 url1482 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 posts1500 can_comment => $can_comment,1501 is_banned => "0",1502 };1503 }1504 1505 return $c;1506 }1507 1508 1400 sub session_js { 1509 1401 my $app = shift; … … 1520 1412 $app->print("$jsonp(" . $json . ");\n"); 1521 1413 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;1530 1414 } 1531 1415 branches/release-39/lib/MT/App/Search.pm
r2438 r2463 496 496 my $blog_id = $app->first_blog_id(); 497 497 if ( $blog_id ) { 498 my $blog = $app->model('blog')->load($blog_id); 499 $app->blog( $blog ); 498 500 $ctx->stash('blog_id', $blog_id); 499 $ctx->stash('blog', $ app->model('blog')->load($blog_id));501 $ctx->stash('blog', $blog); 500 502 } 501 503 $ctx; branches/release-39/lib/MT/ObjectDriver/Driver/DBI.pm
r2459 r2463 160 160 $stmt->group([ map { { column => $_ } } @group ]); 161 161 162 ## Ugly.163 my $sql = $stmt->as_sql;164 165 162 ## Set statement's ORDER clause if any. 166 163 if ($order) { 167 164 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 } ] ); 172 168 } else { 173 169 my @order; … … 179 175 } 180 176 $stmt->order(\@order); 181 $sql .= "\n" . $stmt->as_aggregate('order'); 182 } 183 } 177 } 178 } 179 180 my $sql = $stmt->as_sql; 184 181 185 182 my $dbh = $driver->r_handle; branches/release-39/lib/MT/Template/ContextHandlers.pm
r2448 r2463 512 512 SearchTemplateID => sub { 0 }, 513 513 514 UserSessionState => sub { 'null' },514 UserSessionState => \&_hdlr_user_session_state, 515 515 516 516 BuildTemplateID => \&_hdlr_build_template_id, … … 1573 1573 =back 1574 1574 1575 =for tags application 1576 1575 1577 =cut 1576 1578 … … 1697 1699 which will encode these to HTML entities. 1698 1700 1701 =for tags application 1702 1699 1703 =cut 1700 1704 … … 1753 1757 1754 1758 =back 1759 1760 =for tags application 1755 1761 1756 1762 =cut … … 1830 1836 (contents of widget go here) 1831 1837 </mtapp:Widget> 1838 1839 =for tags application 1832 1840 1833 1841 =cut … … 1935 1943 1936 1944 =back 1945 1946 =for tags application 1937 1947 1938 1948 =cut … … 2010 2020 2011 2021 <$mtapp:PageActions$> 2022 2023 =for tags application 2012 2024 2013 2025 =cut … … 2109 2121 <input type="submit" /> 2110 2122 </form> 2123 2124 =for tags application 2111 2125 2112 2126 =cut … … 2184 2198 </MTApp:SettingGroup> 2185 2199 2200 =for tags application 2201 2186 2202 =cut 2187 2203 … … 2298 2314 </div> 2299 2315 </div> 2316 2317 =for tags application 2300 2318 2301 2319 =cut … … 2459 2477 2,4,6,8,10 2460 2478 2461 =for tags loop 2479 =for tags loop, templating 2462 2480 2463 2481 =cut … … 2519 2537 </mt:If> 2520 2538 2539 =for tags templating 2540 2521 2541 =cut 2522 2542 … … 2547 2567 2548 2568 An alias for the 'Else' tag. 2569 2570 =for tags templating 2549 2571 2550 2572 =cut … … 2771 2793 '<$mt:Var name="some_variable"$>' is 11 characters or longer 2772 2794 </mt:If> 2795 2796 =for tags templating 2773 2797 2774 2798 =cut … … 3016 3040 =back 3017 3041 3018 =for tags loop 3042 =for tags loop, templating 3019 3043 3020 3044 =cut … … 3120 3144 =head2 Var 3121 3145 3122 Retrieves a template variable and outputs it's value.3146 A B<function tag> used to store and later output data in a template. 3123 3147 3124 3148 B<Attributes:> … … 3126 3150 =over 4 3127 3151 3128 =item var or name3152 =item name (or var) 3129 3153 3130 3154 Identifies the template variable. The 'name' attribute supports a variety … … 3223 3247 3224 3248 =back 3249 3250 =for tags templating 3225 3251 3226 3252 =cut … … 3418 3444 =back 3419 3445 3446 =for tags tags, entries 3447 3420 3448 =cut 3421 3449 … … 3595 3623 </ul> 3596 3624 3597 =for tags multiblog, loop3625 =for tags tags, multiblog, loop 3598 3626 3599 3627 =cut … … 3734 3762 this into a request to mt-search.cgi. 3735 3763 3736 =for tags multiblog3764 =for tags tags, multiblog 3737 3765 3738 3766 =cut … … 3808 3836 3809 3837 =for tags multiblog 3838 3839 =for tags tags 3810 3840 3811 3841 =cut … … 3930 3960 </mt:If> 3931 3961 3962 =for tags tags, entries 3963 3932 3964 =cut 3933 3965 … … 3986 4018 =back 3987 4019 4020 =for tags tags 4021 3988 4022 =cut 3989 4023 … … 4007 4041 Outputs the numeric ID of the tag currently in context. 4008 4042 4043 =for tags tags 4044 4009 4045 =cut 4010 4046 … … 4023 4059 in context. 4024 4060 4025 =for tags count4061 =for tags tags, count 4026 4062 4027 4063 =cut … … 4056 4092 configured with a TypeKey token. 4057 4093 4094 =for tags comments, typekey 4095 4058 4096 =cut 4059 4097 … … 4070 4108 A conditional tag that is true when the blog is configured to moderate 4071 4109 incoming comments from anonymous commenters. 4110 4111 =for tags comments 4072 4112 4073 4113 =cut … … 4090 4130 permit user registration. 4091 4131 4132 =for tags comments 4133 4092 4134 =cut 4093 4135 … … 4108 4150 A conditional tag that is true when the blog has been configured to 4109 4151 require user registration. 4152 4153 =for tags comments 4110 4154 4111 4155 =cut … … 4129 4173 permit anonymous comments. 4130 4174 4175 =for tags comments 4176 4131 4177 =cut 4132 4178 … … 4154 4200 allow comments and the blog is configured to accept comments in some 4155 4201 fashion. 4202 4203 =for tags comments 4156 4204 4157 4205 =cut … … 4205 4253 </mt:IfArchiveType> 4206 4254 4255 =for tags archives 4256 4207 4257 =cut 4208 4258 … … 4242 4292 <!-- do something else --> 4243 4293 </mt:IfArchiveTypeEnabled> 4294 4295 =for tags archives 4244 4296 4245 4297 =cut … … 4308 4360 4309 4361 =back 4362 4363 =for tags templating 4310 4364 4311 4365 =cut … … 4431 4485 4432 4486 <h2><$mt:Var name="title"$></h2> 4487 4488 =for tags templating 4433 4489 4434 4490 =cut … … 4866 4922 4867 4923 <$mt:FileTemplate format="%y/%m/%f"$> 4924 4925 =for tags archives 4868 4926 4869 4927 =cut … … 4947 5005 =for tags date 4948 5006 5007 =for tags templates 5008 4949 5009 =cut 4950 5010 … … 4995 5055 <a href="<mt:Link identifier="main_index">">Home</a> 4996 5056 5057 =for tags archives 4997 5058 =cut 4998 5059 … … 5038 5099 <mt:Version /> 5039 5100 5101 =for tags configuration 5102 5040 5103 =cut 5041 5104 … … 5068 5131 5069 5132 Movable Type Open Source 5133 5134 =for tags configuration 5070 5135 5071 5136 =cut … … 5092 5157 <$mt:PublishCharset$> 5093 5158 5159 =for tags configuration 5160 5094 5161 =cut 5095 5162 … … 5112 5179 other installed language. 5113 5180 5181 =for tags configuration 5182 5114 5183 =cut 5115 5184 … … 5124 5193 5125 5194 The value of the C<SignOnURL> configuration setting. 5195 5196 =for tags comments 5126 5197 5127 5198 =cut … … 5239 5310 message. Used in system templates, such as the 'Comment Response' template. 5240 5311 5312 =for tags templating 5313 5241 5314 =cut 5242 5315 … … 5266 5339 5267 5340 <ul><li><$mt:Var name="color"$></li></ul> 5341 5342 =for tags templating 5268 5343 5269 5344 =cut … … 5306 5381 foo is assigned: <$mt:Var name="my_hash{foo}"$> 5307 5382 5383 =for tags templating 5384 5308 5385 =cut 5309 5386 … … 5373 5450 =back 5374 5451 5452 =for tags templating 5453 5375 5454 =cut 5376 5455 … … 5407 5486 5408 5487 =back 5488 5489 =for tags templating 5409 5490 5410 5491 =cut … … 5439 5520 <$mt:Var name="entry_title"$> 5440 5521 </mt:Entries> 5522 5523 =for tags templating 5441 5524 5442 5525 =cut … … 5581 5664 <a href="<$mt:CGIPath$>some-cgi-script.cgi"> 5582 5665 5666 =for tags configuration 5667 5583 5668 =cut 5584 5669 … … 5611 5696 <$mt:AdminCGIPath$> 5612 5697 5613 =for tags path, system5698 =for tags path, configuration 5614 5699 5615 5700 =cut … … 5636 5721 (mt-config.cgi). 5637 5722 5723 =for tags configuration 5724 5638 5725 =cut 5639 5726 … … 5648 5735 Returns the file path to the directory where Movable Type has been 5649 5736 installed. Any trailing "/" character is removed. 5737 5738 =for tags configuration 5650 5739 5651 5740 =cut … … 5664 5753 mt-config.cgi. This is the same as L<CGIPath>, but without any 5665 5754 domain name. This value is guaranteed to end with a "/" character. 5755 5756 =for tags configuration 5666 5757 5667 5758 =cut … … 5685 5776 the location of the MT application files alone). This value is 5686 5777 guaranteed to end with a "/" character. 5778 5779 =for tags configuration 5687 5780 5688 5781 =cut … … 5714 5807 alt="Powered by MT" /> 5715 5808 5809 =for tags configuration 5810 5716 5811 =cut 5717 5812 … … 5744 5839 for this setting if unassigned is "mt.cgi". 5745 5840 5841 =for tags configuration 5842 5746 5843 =cut 5747 5844 … … 5758 5855 default for this setting if unassigned is "mt-comments.cgi". 5759 5856 5857 =for tags configuration 5858 5760 5859 =cut 5761 5860 … … 5772 5871 default for this setting if unassigned is "mt-tb.cgi". 5773 5872 5873 =for tags configuration 5874 5774 5875 =cut 5775 5876 … … 5786 5887 default for this setting if unassigned is "mt-search.cgi". 5787 5888 5889 =for tags configuration 5890 5788 5891 =cut 5789 5892 … … 5802 5905 setting. Use C<SearchMaxResults> because MaxResults is considered deprecated. 5803 5906 5804 =for tags search 5907 =for tags search, configuration 5805 5908 5806 5909 =cut … … 5818 5921 default for this setting if unassigned is "mt-xmlrpc.cgi". 5819 5922 5923 =for tags configuration 5924 5820 5925 =cut 5821 5926 … … 5832 5937 default for this setting if unassigned is "mt-atom.cgi". 5833 5938 5939 =for tags configuration 5940 5834 5941 =cut 5835 5942 … … 5846 5953 default for this setting if unassigned is "mt-add-notify.cgi". 5847 5954 5955 =for tags configuration 5956 5848 5957 =cut 5849 5958 … … 5863 5972 </mt:IfAuthor> 5864 5973 5974 =for tags authors 5975 5865 5976 =cut 5866 5977 … … 5880 5991 <a href="<$mt:ArchiveLink type="Author">">Archive for this author</a> 5881 5992 </mt:AuthorHasEntry> 5993 5994 =for tags authors, entries 5882 5995 5883 5996 =cut … … 5905 6018 has written one or more pages that have been published. 5906 6019 6020 =for tags authors, pages 6021 5907 6022 =cut 5908 6023 … … 6018 6133 </mt:Authors> 6019 6134 6020 =for tags multiblog, loop, scoring 6135 =for tags multiblog, loop, scoring, authors 6021 6136 6022 6137 =cut … … 6249 6364 =head2 AuthorID 6250 6365 6251 Outputs the numeric ID of the author currently in context. 6366 Outputs the numeric ID of the author currently in context. If no author 6367 is in context, it will use the author of the entry or page in context. 6368 6369 =for tags authors 6252 6370 6253 6371 =cut … … 6268 6386 =head2 AuthorName 6269 6387 6270 Outputs the username of the author currently in context. 6388 Outputs the username of the author currently in context. If no author 6389 is in context, it will use the author of the entry or page in context. 6271 6390 6272 6391 B<NOTE:> it is not recommended to publish the author's username. 6392 6393 =for tags authors 6273 6394 6274 6395 =cut … … 6289 6410 =head2 AuthorDisplayName 6290 6411 6291 Outputs the display name of the author currently in context. 6412 Outputs the display name of the author currently in context. If no author 6413 is in context, it will use the author of the entry or page in context. 6414 6415 =for tags authors 6292 6416 6293 6417 =cut … … 6308 6432 =head2 AuthorEmail 6309 6433 6310 Outputs the email address of the author currently in context. 6434 Outputs the email address of the author currently in context. If no author 6435 is in context, it will use the author of the entry or page in context. 6311 6436 6312 6437 B<NOTE:> it is not recommended to publish the author's email address. 6438 6439 =for tags authors 6313 6440 6314 6441 =cut … … 6331 6458 =head2 AuthorURL 6332 6459 6333 Outputs the URL field of the author currently in context. 6460 Outputs the URL field of the author currently in context. If no author 6461 is in context, it will use the author of the entry or page in context. 6462 6463 =for tags authors 6334 6464 6335 6465 =cut … … 6354 6484 in context. For Movable Type registered users, this is "MT". 6355 6485 6486 =for tags authors 6487 6356 6488 =cut 6357 6489 … … 6397 6529 </mt:Authors> 6398 6530 6531 =for tags authors 6532 6399 6533 =cut 6400 6534 … … 6421 6555 width="100" height="100" /> 6422 6556 6557 =for tags authors, userpics 6558 6423 6559 =cut 6424 6560 … … 6442 6578 6443 6579 If the author has no userpic, this will output an empty string. 6580 6581 =for tags authors, userpics 6444 6582 6445 6583 =cut … … 6474 6612 </mt:Authors></ul> 6475 6613 6614 =for tags authors, userpics, assets 6615 6476 6616 =cut 6477 6617 … … 6499 6639 6500 6640 Outputs the 'Basename' field of the author currently in context. 6641 6642 =for tags authors 6501 6643 6502 6644 =cut … … 6535 6677 =back 6536 6678 6537 =for tags multiblog, loop 6679 =for tags multiblog, loop, blogs 6538 6680 6539 6681 =cut … … 6592 6734 Outputs the numeric ID of the blog currently in context. 6593 6735 6736 =for tags blogs 6737 6594 6738 =cut 6595 6739 … … 6605 6749 6606 6750 Outputs the name of the blog currently in context. 6751 6752 =for tags blogs 6607 6753 6608 6754 =cut … … 6622 6768 Outputs the description field of the blog currently in context. 6623 6769 6770 =for tags blogs 6771 6624 6772 =cut 6625 6773 … … 6636 6784 =head2 BlogURL 6637 6785 6638 Outputs the Site URL field of the blog currently in context. 6786 Outputs the Site URL field of the blog currently in context. An ending 6787 '/' character is guaranteed. 6788 6789 =for tags blogs 6639 6790 6640 6791 =cut … … 6654 6805 =head2 BlogSitePath 6655 6806 6656 Outputs the Site Root field of the blog currently in context. 6807 Outputs the Site Root field of the blog currently in context. An ending 6808 '/' character is guaranteed. 6809 6810 =for tags blogs 6657 6811 6658 6812 =cut … … 6672 6826 =head2 BlogArchiveURL 6673 6827 6674 Outputs the Archive URL of the blog currently in context. 6828 Outputs the Archive URL of the blog currently in context. An ending 6829 '/' character is guaranteed. 6830 6831 =for tags blogs 6675 6832 6676 6833 =cut … … 6691 6848 6692 6849 Similar to the L<BlogURL> tag, but removes any domain name from the URL. 6850 6851 =for tags blogs 6693 6852 6694 6853 =cut … … 6715 6874 General settings screen. 6716 6875 6876 B<Attributes:> 6877 6878 =over 4 6879 6880 =item no_colon (optional; default "0") 6881 6882 If specified, will produce the timezone without the ":" character 6883 ("+|-hhmm" only). 6884 6885 =back 6886 6887 =for tags blogs 6888 6717 6889 =cut 6718 6890 … … 6753 6925 =back 6754 6926 6927 =for tags blogs 6928 6755 6929 =cut 6756 6930 … … 6793 6967 6794 6968 =back 6969 6970 =for tags blogs 6795 6971 6796 6972 =cut … … 6833 7009 =back 6834 7010 7011 =for tags configuration 7012 6835 7013 =cut 6836 7014 … … 6849 7027 =head2 BlogCategoryCount 6850 7028 6851 =for tags multiblog, count 7029 =for tags multiblog, count, blogs 6852 7030 6853 7031 =cut … … 6869 7047 currently in context. 6870 7048 6871 =for tags multiblog, count 7049 =for tags multiblog, count, blogs, entries 6872 7050 6873 7051 =cut … … 6892 7070 currently in context. 6893 7071 6894 =for tags multiblog, count 7072 =for tags multiblog, count, blogs, comments 6895 7073 6896 7074 =cut … … 6914 7092 currently in context. 6915 7093 6916 =for tags multiblog, count 7094 =for tags multiblog, count, blogs, pings 6917 7095 6918 7096 =cut … … 6939 7117 have a Creative Commons license, this tag returns an empty string. 6940 7118 7119 =for tags blogs, creativecommons 7120 6941 7121 =cut 6942 7122 … … 6961 7141 <img src="<$MTBlogCCLicenseImage$>" alt="Creative Commons" /> 6962 7142 </MTIf> 7143 7144 =for tags blogs, creativecommons 6963 7145 6964 7146 =cut … … 6990 7172 If specified, forces the trailing "index" filename to be left on any 6991 7173 entry permalink published in the RDF block. 7174 7175 =for tags blogs, creativecommons 6992 7176 6993 7177 =cut … … 7045 7229 been assigned a Creative Commons License. 7046 7230 7231 =for tags blogs, creativecommons 7232 7047 7233 =cut 7048 7234 … … 7061 7247 '.' character. If no extension is assigned, this returns an empty 7062 7248 string. 7249 7250 =for tags blogs 7063 7251 7064 7252 =cut … … 7081 7269 changed to dashes. In the MT template sets, this identifier is assigned 7082 7270 to the "id" attribute of the C<body> HTML tag. 7271 7272 =for tags blogs 7083 7273 7084 7274 =cut … … 7457 7647 my %map; 7458 7648 require MT::Placement; 7649 my @cat_ids; 7459 7650 for my $cat (@$cats) { 7651 push @cat_ids, $cat->id; 7460 7652 my $iter = MT::Placement->load_iter({ category_id => $cat->id }); 7461 7653 while (my $p = $iter->()) { 7462 7654 $map{$p->entry_id}{$cat->id}++; 7463 7655 } 7656 &nbs
