--- lib/MT/App.pm.orig Fri Aug 27 08:53:35 2004 +++ lib/MT/App.pm Fri Aug 27 09:00:36 2004 @@ -71,6 +71,9 @@ sub send_http_header { my $app = shift; my($type) = @_; + if ($ENV{'HTTP_CONTENT_TYPE'}){ + $type= $ENV{'HTTP_CONTENT_TYPE'}; + } $type ||= 'text/html'; if (my $charset = $app->{charset}) { $type .= "; charset=$charset" @@ -278,7 +281,7 @@ my($error) = @_; my $tmpl; $error = encode_html($error); - $error =~ s!(http://\S+)!$1!g; + $error =~ s!(http://\S+)!$1!g; $tmpl = $app->load_tmpl('error.tmpl') or return "Can't load error template; got error '" . $app->errstr . "'. Giving up. Original error was
$error
"; --- lib/MT.pm.orig Fri Aug 27 09:05:58 2004 +++ lib/MT.pm Fri Aug 27 09:19:17 2004 @@ -386,7 +386,13 @@ } } unless ($param{NoIndexes}) { - $mt->rebuild_indexes( Blog => $blog ) or return; + ## + # sean willson - http://www.seanwillson.com/ + # added a rebuild type parameter so that it would only rebuild + # the indexes that i designated appropriate. + # + $mt->rebuild_indexes( Blog => $blog, RebuildType => 'In' ) or return; + ## } my $identity_link_image = $blog->site_path . "/nav-commenters.gif"; # TBD: Use StaticWebPath version unless mt.cfg says use this. @@ -486,7 +492,14 @@ } ## Rebuild all indexes, in case this entry is on an index. - $mt->rebuild_indexes( Blog => $blog ) or return; + + ## + # sean willson - http://www.seanwillson.com/ + # added a rebuild type parameter so that it would only rebuild + # the indexes that i designated appropriate. + # + $mt->rebuild_indexes( Blog => $blog, RebuildType => 'En' ) or return; + ## ## Rebuild previous and next daily, weekly, and monthly archives; ## adding a new entry could cause changes to the intra-archive @@ -845,9 +858,30 @@ ## before that time, the rebuild_me flag will be undefined. But ## we assume that these templates should be rebuilt, since that ## was the previous behavior. - next if !$param{Force} && ( - (defined $tmpl->rebuild_me && !$tmpl->rebuild_me) - && !$tmpl->build_dynamic); + + ## + # sean willson - http://www.seanwillson.com/ + # commented this code out because the new rebuild type code overrides this. + # + #next if !$param{Force} && ( + # (defined $tmpl->rebuild_me && !$tmpl->rebuild_me) + # && !$tmpl->build_dynamic); + ## + + ## + # sean willson - http://www.seanwillson.com/ + # made it so that it doesn't rebuild unless it is supposed to. + # + my $tmplRebuildType = defined $tmpl->rebuild_type ? $tmpl->rebuild_type: 'EnCo'; + my $rebuildType = $param{RebuildType}; + + next if ((! $param{Force}) && ($tmplRebuildType =~ /ne/gi) && !$tmpl->build_dynamic); + + next if ((! $param{Force}) && + ($rebuildType !~ /in/gi) && + ($tmplRebuildType !~ /$rebuildType|all/gi) && + !$tmpl->build_dynamic); + ## my $index = $tmpl->outfile or return $mt->error($mt->translate( --- lib/MT/Template.pm.orig Fri Aug 27 09:20:04 2004 +++ lib/MT/Template.pm Fri Aug 27 09:20:46 2004 @@ -26,7 +26,7 @@ columns => [ 'id', 'blog_id', 'name', 'type', 'outfile', 'text', 'linked_file', 'linked_file_mtime', 'linked_file_size', - 'rebuild_me', 'build_dynamic' + 'rebuild_me', 'rebuild_type', 'build_dynamic' ], indexes => { blog_id => 1, --- tmpl/email/new-comment.tmpl.orig Fri Aug 27 09:21:44 2004 +++ tmpl/email/new-comment.tmpl Fri Aug 27 09:22:26 2004 @@ -12,6 +12,7 @@ + --- lib/MT/Comment.pm.orig Fri Aug 27 09:23:26 2004 +++ lib/MT/Comment.pm Fri Aug 27 09:24:53 2004 @@ -11,13 +11,14 @@ __PACKAGE__->install_properties({ columns => [ 'id', 'blog_id', 'entry_id', 'author', 'commenter_id', - 'visible', 'email', 'url', 'text', 'ip', + 'visible', 'email', 'url', 'text', 'ip','subject', 'parent_id', 'convert_breaks' ], indexes => { ip => 1, created_on => 1, entry_id => 1, blog_id => 1, + parent_id => 1, email => 1, commenter_id => 1, visible => 1, --- styles.css.orig Fri Aug 27 09:43:07 2004 +++ styles.css Fri Aug 27 09:43:36 2004 @@ -1093,7 +1093,7 @@ } #edit-entry #trackback-box { - margin-left: 400px; + margin-left: 415px; width: 190px; padding: 10px; } --- lib/MT/App/Search.pm.orig Thu Aug 26 15:54:15 2004 +++ lib/MT/App/Search.pm Sat Sep 4 09:52:23 2004 @@ -34,6 +34,12 @@ my $file = File::Spec->catfile($cfg->TempDir, 'mt-throttle.db'); my $DB = tie my %db, 'DB_File', $file; if ($DB) { + #throttle total number of searches + my $max_searches = 5; + if (scalar(keys %db) > $max_searches ) { + return $app->error($app->translate( + "Too many searches are ongoing. Please try yours again later.")); + } my $ip = $app->remote_ip; if (my $time = $db{$ip}) { if ($time > time - 60) { ## Within the last minute. --- lib/MT/TBPing.pm.orig Tue Feb 15 15:25:30 2005 +++ lib/MT/TBPing.pm Tue Feb 15 18:13:11 2005 @@ -11,7 +11,7 @@ __PACKAGE__->install_properties({ columns => [ 'id', 'blog_id', 'tb_id', 'title', 'excerpt', 'source_url', 'ip', - 'blog_name', + 'blog_name', 'tb_charset', ], indexes => { created_on => 1, --- schemas/mysql.dump.orig Wed Aug 18 19:39:33 2004 +++ schemas/mysql.dump Tue Feb 15 18:15:25 2005 @@ -96,6 +96,9 @@ comment_commenter_id integer, comment_visible tinyint, comment_text text, + comment_subject text, + comment_parent_id integer, + comment_convert_breaks varchar(30), comment_created_on datetime not null, comment_modified_on timestamp not null, comment_created_by integer, @@ -215,6 +218,7 @@ template_created_by integer, template_modified_by integer, template_build_dynamic tinyint, + template_rebuild_type text, unique (template_blog_id, template_name), index (template_type) ); @@ -262,6 +266,7 @@ tbping_source_url varchar(255), tbping_ip varchar(15) not null, tbping_blog_name varchar(255), + tbping_tb_charset varchar(255), tbping_created_on datetime not null, tbping_modified_on timestamp not null, tbping_created_by integer, --- lib/MT/App/Trackback.pm.orig Mon Jan 24 18:40:31 2005 +++ lib/MT/App/Trackback.pm Sat Apr 9 15:45:50 2005 @@ -125,7 +125,7 @@ return 0; } - @ts = offset_time_list(time - $app->{cfg}->ThrottleSeconds*4000 - 1, + @ts = offset_time_list(time - 86400, $tb->blog_id); $from = sprintf("%04d%02d%02d%02d%02d%02d", $ts[5]+1900, $ts[4]+1, @ts[3,2,1,0]); @@ -219,7 +219,7 @@ my($title, $excerpt, $url, $blog_name) = map scalar $q->param($_), qw( title excerpt url blog_name); - no_utf8($tb_id, $title, $excerpt, $url, $blog_name); +# no_utf8($tb_id, $title, $excerpt, $url, $blog_name); return $app->_response(Error=> $app->translate("Need a Source URL (url).")) unless $url; @@ -247,6 +247,9 @@ $ping->tb_id($tb_id); $ping->source_url($url); $ping->ip($app->remote_ip || ''); + if ($ENV{'CONTENT_TYPE'} =~ /[Cc]harset=([a-zA-Z0-9-]+)/) { + $ping->tb_charset($1); + } if ($excerpt) { if (length($excerpt) > 255) { $excerpt = substr($excerpt, 0, 252) . '...'; @@ -257,6 +260,30 @@ } $ping->title(defined $title && $title ne '' ? $title : $url); $ping->blog_name($blog_name); + ## BEGIN HACK Avoid Duplicate Trackback Pings + ## http://www.nonplus.net/software/mt/AvoidingDuplicateTrackbackPings.htm + my $duplicate_ping = 0; + if(my @existing_pings = MT::TBPing->load({ + blog_id => $ping->blog_id, + tb_id => $ping->tb_id })) { + foreach my $p (@existing_pings) { + next unless ($p->source_url eq $ping->source_url && $p->ip eq $ping->ip); + # If everything is the same, simply return + return $app->_response if ( ($p->title eq $ping->title) + && ($p->blog_name eq $ping->blog_name) + && ($p->excerpt eq $ping->excerpt)); + # If something is different, copy new values to old ping + $p->title($ping->title); + $p->blog_name($ping->blog_name); + $p->excerpt($ping->excerpt); + # and replace new ping with old ping + $ping = $p; + $duplicate_ping = 1; + last; + } + } + ## END HACK Avoid Duplicate Trackback Pings + if (!MT->run_callbacks('TBPingFilter', $app, $ping)) { return $app->_response(Error => "", Code => 403); } @@ -282,7 +309,13 @@ $cat = MT::Category->load($tb->category_id); $blog_id = $cat->blog_id; } - $app->rebuild_indexes( Blog => $blog ) + ## + # sean willson - http://www.seanwillson.com/ + # added a rebuild type parameter so that it would only rebuild + # the indexes that i designated appropriate. + # + $app->rebuild_indexes( Blog => $blog, RebuildType => 'Tb' ) + ## or return $app->_response(Error => $app->translate("Rebuild failed: [_1]", $app->errstr)); @@ -309,7 +342,7 @@ $fmgr->errstr)); } - if ($blog->email_new_pings) { + if ($blog->email_new_pings && !$duplicate_ping ) { ## HACK Avoid Duplicate Trackback Pings $app->_send_ping_notification($blog, $entry, $cat, $ping); } }); @@ -362,11 +395,12 @@ sub rss { my $app = shift; my($tb_id, $pass) = $app->_get_params; - my $tb = MT::Trackback->load($tb_id) - or return $app->_response(Error => - $app->translate("Invalid TrackBack ID '[_1]'", $tb_id)); - my $rss = _generate_rss($tb); - $app->_response(RSS => $rss); +# my $tb = MT::Trackback->load($tb_id) or + return $app->_response(Error => + $app->translate("RSS disabled because of Trackback Spam")); +# $app->translate("Invalid TrackBack ID '[_1]'", $tb_id)); +# my $rss = _generate_rss($tb); +# $app->_response(RSS => $rss); } sub _generate_rss { --- lib/MT/App/Comments.pm.orig Tue Mar 22 14:39:23 2005 +++ lib/MT/App/Comments.pm Mon Apr 18 22:42:36 2005 @@ -100,9 +100,11 @@ or return $app->error("No such comment"); my $uri = encode_html($comment->url); return < -Redirecting... - + + + +Redirecting... + @@ -243,6 +245,34 @@ if (!$q->param('text')) { return $app->handle_error($app->translate("Comment text is required.")); } + require Digest::SHA1; + my $sha1 = Digest::SHA1->new; + + $sha1->add($q->param('text') . $q->param('entry_id') . $app->remote_ip + . $q->param('author') . $q->param('email') . $q->param('url') + . $q->param('subject') . $q->param('convert_breaks')); + my $salt_file = MT::ConfigMgr->instance->PluginPath .'/salt.txt'; + my $FH; + open($FH, $salt_file) or die "cannot open file <$salt_file> ($!)"; + $sha1->addfile($FH); + close $FH; + + my $digest = $sha1->b64digest . "="; + + if (!$q->param('validated') ) { + my $ban = MT::IPBanList->new; + $ban->blog_id($entry->blog_id); + $ban->ip($app->remote_ip); + $ban->save + or die $ban->errstr; + return $app->handle_error($app->translate("You are not allowed to post comments.")); + } + + if ($q->param('validated') ne $digest) { + return $app->handle_error($app->translate( + "Please preview your modified entry before posting it.")); + } + my ($comment, $commenter) = _make_comment($app, $entry); if (!$blog->allow_unreg_comments) { if (!$commenter) { @@ -357,7 +387,7 @@ # Index rebuilds and notifications are done in the background. MT::Util::start_background_task(sub { if ($comment->visible) { - $app->rebuild_indexes( Blog => $blog ) + $app->rebuild_indexes( Blog => $blog, RebuildType => 'Co' ) or return $app->errtrans("Rebuild failed: [_1]", $app->errstr); } @@ -413,6 +443,7 @@ $email = $commenter->email(); } my $url = $q->param('url') || ($commenter ? $commenter->url() : ''); + my $subject = $q->param('subject') ? $q->param('subject') : ' '; my $comment = MT::Comment->new; if ($commenter) { $comment->commenter_id($commenter->id); @@ -424,6 +455,10 @@ $comment->email(remove_html($email)); $comment->url(MT::Util::is_valid_url($url, 'stringent')); $comment->text($q->param('text')); + $comment->subject($subject); + $comment->parent_id($q->param('parent_id')); + $comment->convert_breaks($q->param('convert_breaks')); + return ($comment, $commenter); } @@ -451,7 +486,10 @@ ); my $charset = $app->{cfg}->PublishCharset || 'iso-8859-1'; $head{'Content-Type'} = qq(text/plain; charset="$charset"); - my $base = $app->base . $app->path . $app->{cfg}->AdminScript; + my $AdminScript = $app->{cfg}->AdminScript; + my $base = $app->{cfg}->AdminCGIPath; + $base =~ s#([^/])$#$1/$AdminScript#; + my %param = ( blog_name => $blog->name, entry_id => $entry->id, @@ -467,6 +505,7 @@ (comment_email => $comment->email):()), comment_url => $comment->url, comment_text => $comment->text, + comment_subject => $comment->subject, unapproved => !$comment->visible(), ); my $body = MT->build_email('new-comment.tmpl', \%param); @@ -831,6 +870,8 @@ $ctx->stash('entry', $entry); $ctx->stash('commenter', $cmntr) if ($cmntr); $ctx->{current_timestamp} = $entry->created_on; + $ctx->stash('comment_parent_id', $q->param('parent_id')); + $ctx->stash('convert_breaks', $q->param('convert_breaks')); my %cond = ( EntryIfExtended => $entry->text_more ? 1 : 0, EntryIfAllowComments => $entry->allow_comments, --- lib/MT/Template/Context.pm.orig Wed Mar 23 19:32:02 2005 +++ lib/MT/Template/Context.pm Mon Apr 18 22:49:36 2005 @@ -26,6 +26,9 @@ @EXPORT = qw( FALSE ); use vars qw( %Global_handlers %Global_filters ); + +my $publish_charset = _hdlr_publish_charset(); + sub add_tag { my $class = shift; my($name, $code) = @_; @@ -1678,11 +1681,14 @@ my $blog = $ctx->stash('blog'); my $t = defined $c->text ? $c->text : ''; $t = munge_comment($t, $blog); + my $filter = defined $c->convert_breaks ? + [$c->convert_breaks] : + $blog->comment_text_filters; my $convert_breaks = exists $arg->{convert_breaks} ? $arg->{convert_breaks} : $blog->convert_paras_comments; return $convert_breaks ? - MT->apply_text_filters($t, $blog->comment_text_filters, $ctx) : + MT->apply_text_filters($t, $filter, $ctx) : $t; } sub _hdlr_comment_order_num { $_[0]->stash('comment_order_num') } @@ -2484,7 +2490,8 @@ sanitize_on($_[1]); my $ping = $_[0]->stash('ping') or return $_[0]->_no_ping_error('MTPingTitle'); - defined $ping->title ? $ping->title : ''; + my $title = defined $ping->title ? $ping->title : ''; + return _transcode_text($ping->tb_charset, $title); } sub _hdlr_ping_url { sanitize_on($_[1]); @@ -2496,7 +2503,8 @@ sanitize_on($_[1]); my $ping = $_[0]->stash('ping') or return $_[0]->_no_ping_error('MTPingExcerpt'); - defined $ping->excerpt ? $ping->excerpt : ''; + my $excerpt = defined $ping->excerpt ? $ping->excerpt : ''; + return _transcode_text($ping->tb_charset, $excerpt); } sub _hdlr_ping_ip { my $ping = $_[0]->stash('ping') @@ -2507,7 +2515,20 @@ sanitize_on($_[1]); my $ping = $_[0]->stash('ping') or return $_[0]->_no_ping_error('MTPingBlogName'); - defined $ping->blog_name ? $ping->blog_name : ''; + my $blog_name = defined $ping->blog_name ? $ping->blog_name : ''; + return _transcode_text($ping->tb_charset, $blog_name); +} + +sub _transcode_text { + my ($text_charset, $text) = @_; + require Text::Iconv; + use Encode; + if (defined $text_charset && $text_charset ne $publish_charset ) { + $text = Text::Iconv->new($text_charset,'utf-8')->convert($text) unless $text_charset eq 'utf-8'; + $text = encode($publish_charset, decode('utf-8',$text), Encode::FB_XMLCREF) unless $publish_charset eq 'utf-8'; + } + $text =~ s/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/&/g; + return $text; } package MTPlugins::SubCategories; --- mt.js.orig Sat Apr 30 00:21:21 2005 +++ mt.js Sat Apr 30 02:40:34 2005 @@ -203,3 +203,92 @@ for (i=0; i -

[]

+

[]

@@ -52,7 +52,7 @@ -

[]

+

[]

@@ -76,7 +76,7 @@

-

+

@@ -85,7 +85,7 @@
:
-
+
--- tmpl/cms/edit_entry.tmpl.orig Thu Apr 21 01:15:51 2005 +++ tmpl/cms/edit_entry.tmpl Sat Apr 30 00:58:53 2005 @@ -3,24 +3,23 @@
@@ -179,20 +177,6 @@
-
@@ -203,20 +187,6 @@
?
-
@@ -401,7 +371,7 @@
-" /> +" />
--- tmpl/cms/header-popup.tmpl.orig Thu Apr 21 01:24:11 2005 +++ tmpl/cms/header-popup.tmpl Thu Apr 21 01:25:03 2005 @@ -1,6 +1,6 @@ - + <TMPL_LOOP NAME=PAGE_TITLES><TMPL_VAR NAME=BC_NAME> | </TMPL_LOOP><MT_TRANS phrase="Movable Type Publishing Platform"> --- tmpl/cms/header.tmpl.orig Thu Apr 21 01:01:12 2005 +++ tmpl/cms/header.tmpl Thu Apr 21 01:07:14 2005 @@ -1,6 +1,7 @@ - + + - + <TMPL_LOOP NAME=PAGE_TITLES><TMPL_VAR NAME=BC_NAME ESCAPE=HTML> | </TMPL_LOOP><MT_TRANS phrase="Movable Type Publishing Platform"> --- tmpl/cms/list_comment.tmpl.orig Sat Apr 30 02:47:42 2005 +++ tmpl/cms/list_comment.tmpl Sat Apr 30 02:48:18 2005 @@ -3,14 +3,12 @@

--- tmpl/cms/list_notification.tmpl.orig Sat Apr 30 02:59:21 2005 +++ tmpl/cms/list_notification.tmpl Sat Apr 30 03:03:42 2005 @@ -22,10 +22,10 @@

- +   - +   " />

@@ -66,7 +66,7 @@
-" /> +" />
--- tmpl/cms/list_commenters.tmpl.orig Thu Apr 21 02:24:44 2005 +++ tmpl/cms/list_commenters.tmpl Thu Apr 21 02:26:41 2005 @@ -60,10 +60,10 @@ " /> " /> --- tmpl/cms/search_replace.tmpl.orig Thu Apr 21 02:28:50 2005 +++ tmpl/cms/search_replace.tmpl Thu Apr 21 02:30:50 2005 @@ -15,15 +15,15 @@ " />

- ?   - ? + ?   + ?

?
- - - - + + + +

--- tmpl/cms/edit_categories.tmpl.orig Thu Apr 21 02:16:33 2005 +++ tmpl/cms/edit_categories.tmpl Sat Apr 30 12:46:32 2005 @@ -3,7 +3,7 @@

@@ -83,7 +83,7 @@
-
+ @@ -146,7 +146,7 @@   - " /> " onclick="cancelCreateMode(); return false" /> + " /> " onclick="cancelCreateMode(); return false" /> --- tmpl/cms/reload_opener.tmpl.orig Sat Apr 30 04:15:01 2005 +++ tmpl/cms/reload_opener.tmpl Sat Apr 30 13:04:28 2005 @@ -1,12 +1,14 @@ - + --- tmpl/cms/rebuild_confirm.tmpl.orig Sat Apr 30 13:37:32 2005 +++ tmpl/cms/rebuild_confirm.tmpl Sat Apr 30 13:37:50 2005 @@ -27,7 +27,7 @@

-" /> +" /> " />
--- tmpl/cms/list_template.tmpl.orig Wed Apr 6 09:20:53 2005 +++ tmpl/cms/list_template.tmpl Sat Apr 30 13:39:46 2005 @@ -3,28 +3,27 @@

@@ -63,7 +61,7 @@
- + @@ -75,7 +73,7 @@ checked="checked" />
checked="checked" />

-"> +" />
@@ -96,15 +94,15 @@ - + - + - + @@ -113,7 +111,7 @@
-" /> +" />
@@ -143,11 +141,11 @@
-" /> +" />
- +
@@ -209,7 +207,7 @@ - + @@ -218,7 +216,7 @@
-" /> +" />
--- tmpl/cms/list_ping.tmpl.orig Thu Apr 21 01:28:51 2005 +++ tmpl/cms/list_ping.tmpl Sat Apr 30 13:44:04 2005 @@ -1,14 +1,12 @@

@@ -27,9 +25,9 @@
- - - + + +   @@ -81,11 +79,11 @@
-" /> +" /> -" /> -" /> -" /> +" /> +" /> +" />

@@ -94,7 +92,7 @@ " /> - --- tmpl/cms/edit_template.tmpl.orig Wed Mar 16 20:30:51 2005 +++ tmpl/cms/edit_template.tmpl Sat Apr 30 13:46:07 2005 @@ -3,10 +3,9 @@
@@ -35,7 +33,7 @@ -" /> +" /> @@ -117,6 +115,17 @@
checked="checked" />

?

+

+

--- tmpl/cms/edit_comment.tmpl.orig Sat Apr 30 03:33:03 2005 +++ tmpl/cms/edit_comment.tmpl Sat Apr 30 13:48:11 2005 @@ -111,7 +111,7 @@


-?__mode=approve_comment&blog_id=&id=&magic_token='" value=""> +?__mode=approve_comment&blog_id=&id=&magic_token='" value="">
" /> " /> --- tmpl/cms/edit_placements.tmpl.orig Sat Apr 30 02:50:18 2005 +++ tmpl/cms/edit_placements.tmpl Sat Apr 30 13:49:48 2005 @@ -1,8 +1,7 @@

@@ -92,7 +90,7 @@

-" /> +" /> " />

--- tmpl/cms/cfg_prefs.tmpl.orig Thu Apr 21 13:40:54 2005 +++ tmpl/cms/cfg_prefs.tmpl Sat Apr 30 13:51:37 2005 @@ -3,7 +3,6 @@
@@ -292,7 +290,7 @@
style="display: block;">
-

checked="checked" /> ?

+

checked="checked" /> ?

--- tmpl/cms/cfg_archives_add.tmpl.orig Sat Apr 30 13:54:01 2005 +++ tmpl/cms/cfg_archives_add.tmpl Sat Apr 30 13:54:29 2005 @@ -28,7 +28,7 @@

-" /> +" /> " />
--- tmpl/cms/category_add.tmpl.orig Sat Apr 30 13:55:31 2005 +++ tmpl/cms/category_add.tmpl Sat Apr 30 13:55:46 2005 @@ -27,7 +27,7 @@

-" /> +" /> " />
--- tmpl/cms/bm_posted.tmpl.orig Sat Apr 30 13:56:38 2005 +++ tmpl/cms/bm_posted.tmpl Sat Apr 30 13:57:02 2005 @@ -6,7 +6,7 @@
-" /> +" />
--- tmpl/cms/bm_entry.tmpl.orig Thu Apr 21 10:54:10 2005 +++ tmpl/cms/bm_entry.tmpl Sat Apr 30 13:58:07 2005 @@ -1,7 +1,7 @@
@@ -184,21 +184,8 @@ +

-

@@ -225,7 +212,7 @@
-" /> +" /> " />
--- tmpl/cms/view_log.tmpl.orig Sat Apr 30 22:59:57 2005 +++ tmpl/cms/view_log.tmpl Sat Apr 30 23:01:43 2005 @@ -28,7 +28,7 @@
-"> +" />
--- tmpl/cms/upload_complete.tmpl.orig Thu Apr 21 02:59:30 2005 +++ tmpl/cms/upload_complete.tmpl Sat Apr 30 23:07:04 2005 @@ -10,7 +10,7 @@ } function doShowHTML (f, mode) { - var url = '?__mode=show_upload_html&blog_id=&url=&site_path=&fname=&' + mode; + var url = '?__mode=show_upload_html&blog_id=&url=&site_path=&fname=&' + mode; if (f.thumb.checked) url += '&thumb=1&' + calcGeometry(f); @@ -19,7 +19,7 @@ } function doStartEntry (f, mode) { - var url = '?__mode=start_upload_entry&blog_id=&url=&site_path=&fname=&' + mode; + var url = '?__mode=start_upload_entry&blog_id=&url=&site_path=&fname=&' + mode; if (f.thumb.checked) url += '&thumb=1&' + calcGeometry(f); @@ -90,12 +90,12 @@ -

+

- +

@@ -141,7 +141,7 @@
" /> -" /> +" /> " /> --- tmpl/cms/login.tmpl.orig Wed May 4 10:09:13 2005 +++ tmpl/cms/login.tmpl Wed May 4 10:09:44 2005 @@ -1,7 +1,6 @@ - - + --- tmpl/cms/preview_entry.tmpl.orig 2005-05-05 07:35:27.000000000 -0500 +++ tmpl/cms/preview_entry.tmpl 2005-05-05 07:39:45.000000000 -0500 @@ -7,7 +7,7 @@ - + --- tmpl/cms/pinging.tmpl.orig 2005-04-21 23:31:32.000000000 -0500 +++ tmpl/cms/pinging.tmpl 2005-05-23 03:03:18.000000000 -0500 @@ -1,16 +1,13 @@ - - + --- tmpl/cms/rebuilding.tmpl.orig 2005-04-21 23:35:22.000000000 -0500 +++ tmpl/cms/rebuilding.tmpl 2005-05-23 03:16:46.000000000 -0500 @@ -1,16 +1,12 @@ - - - - + + --- tmpl/cms/list_entry.tmpl.orig 2005-04-21 01:11:57.000000000 -0500 +++ tmpl/cms/list_entry.tmpl 2005-05-23 10:11:17.000000000 -0500 @@ -1,14 +1,11 @@ - - - - + +

@@ -71,7 +67,7 @@   - @@ -176,7 +172,7 @@

" /> " /> -" /> +" />
--- lib/MT/App/CMS.pm.orig 2005-04-13 19:12:37.000000000 -0500 +++ lib/MT/App/CMS.pm 2005-05-23 11:07:18.000000000 -0500 @@ -386,7 +386,7 @@ sub _bm_js { my($uri, $show, $height) = @_; - qq!javascript:d=document;w=window;t='';if(d.selection)t=d.selection.createRange().text;else{if(d.getSelection)t=d.getSelection();else{if(w.getSelection)t=w.getSelection()}}void(w.open('$uri?is_bm=1&bm_show=$show&__mode=view&_type=entry&link_title='+escape(d.title)+'&link_href='+escape(d.location.href)+'&text='+escape(t),'_blank','scrollbars=yes,width=400,height=$height,status=yes,resizable=yes,scrollbars=yes'))!; + qq!javascript:d=document;w=window;t='';if(d.selection)t=d.selection.createRange().text;else{if(d.getSelection)t=d.getSelection();else{if(w.getSelection)t=w.getSelection()}}void(w.open('$uri?is_bm=1&bm_show=$show&__mode=view&_type=entry&link_title='+escape(d.title)+'&link_href='+escape(d.location.href)+'&text='+escape(t),'_blank','scrollbars=yes,width=400,height=$height,status=yes,resizable=yes,scrollbars=yes'))!; } sub view_log { @@ -420,7 +420,7 @@ $app->validate_magic() or return; require MT::Log; MT::Log->remove_all; - $app->redirect($app->uri . '?__mode=view_log&reset=1'); + $app->redirect($app->uri . '?__mode=view_log&reset=1'); } sub start_import { @@ -438,7 +438,7 @@ @data; $param{category_loop} = \@data; my $blog = MT::Blog->load($blog_id); - $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); + $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); $app->add_breadcrumb($app->translate('Import/Export')); $param{nav_import} = 1; $app->build_page('import.tmpl', \%param); @@ -602,7 +602,7 @@ if ($blog_id) { $blog = MT::Blog->load($blog_id); $app->add_breadcrumb($blog->name, - $app->uri.'?__mode=menu&blog_id='.$blog->id); + $app->uri.'?__mode=menu&blog_id='.$blog->id); } if ($id) { # object exists, we're just editing it. @@ -627,7 +627,7 @@ if ($type eq 'entry') { $app->add_breadcrumb($app->translate('Entries'), $app->uri . - '?__mode=list_entries&blog_id=' . $blog_id); + '?__mode=list_entries&blog_id=' . $blog_id); $app->add_breadcrumb($obj->title || $app->translate('(untitled)')); ## Don't pass in author_id, because it will clash with the ## author_id parameter of the author currently logged in. @@ -699,7 +699,7 @@ $param{entry_permalink} = $obj->permalink; } elsif ($type eq 'category') { $app->add_breadcrumb($app->translate('Categories'), - $app->uri . '?__mode=list_cat&blog_id=' . + $app->uri . '?__mode=list_cat&blog_id=' . $obj->blog_id); $app->add_breadcrumb($obj->label); require MT::Trackback; @@ -716,7 +716,7 @@ } } elsif ($type eq 'template') { $app->add_breadcrumb($app->translate('Templates'), - $app->uri . '?__mode=list&_type=template&blog_id=' . + $app->uri . '?__mode=list&_type=template&blog_id=' . $obj->blog_id); $app->add_breadcrumb($obj->name); $blog_id = $obj->blog_id; @@ -740,10 +740,16 @@ && ! $param{is_special}; $param{rebuild_me} = defined $obj->rebuild_me ? $obj->rebuild_me : 1; + ## + # sean willson - http://www.seanwillson.com/ + # + $param{rebuild_type} = defined $obj->rebuild_type ? $obj->rebuild_type : 'EnCo'; + $param{'rebuild_type_'.$param{rebuild_type}} = 1; + ## } elsif ($type eq 'blog') { $app->add_breadcrumb($app->translate('Configuration'), - $app->uri . '?__mode=view&_type=blog&id=' . - $obj->id . '&blog_id=' . $obj->id); + $app->uri . '?__mode=view&_type=blog&id=' . + $obj->id . '&blog_id=' . $obj->id); if (($param{output}||"") eq 'cfg_prefs.tmpl') { $app->add_breadcrumb($app->translate('Preferences')); } else { @@ -822,7 +828,7 @@ }; } elsif ($type eq 'comment') { $app->add_breadcrumb($app->translate('Comments'), - $app->uri . '?__mode=list_comments&blog_id=' . $obj->blog_id); + $app->uri . '?__mode=list_comments&blog_id=' . $obj->blog_id); $app->add_breadcrumb($app->translate('Edit Comment')); require MT::Entry; if (my $entry = MT::Entry->load($obj->entry_id)) { @@ -866,7 +872,7 @@ if ($type eq 'entry') { if ($blog_id) { $app->add_breadcrumb($app->translate('Entries'), - $app->uri . '?__mode=list_entries&blog_id=' . $blog_id); + $app->uri . '?__mode=list_entries&blog_id=' . $blog_id); $app->add_breadcrumb($app->translate('New Entry')); $param{nav_new_entry} = 1; } @@ -945,7 +951,7 @@ $param{blog_loop} = \@data; } } elsif ($type eq 'template') { - $app->add_breadcrumb($app->translate('Templates'), $app->uri . '?__mode=list&_type=template&blog_id=' . $blog->id); + $app->add_breadcrumb($app->translate('Templates'), $app->uri . '?__mode=list&_type=template&blog_id=' . $blog->id); $app->add_breadcrumb($app->translate('New Template')); my $template_type = $q->param('type') || return $app->errtrans("Create template requires type"); @@ -969,6 +975,12 @@ && !$param{is_special};; $param{rebuild_me} = 1; + ## + # sean willson - http://www.seanwillson.com/ + # + $param{rebuild_type} = 'EnCo'; + $param{'rebuild_type_enco'} = 1; + ## } elsif ($type eq 'blog') { $app->add_breadcrumb($app->translate('New Weblog')); $param{server_offset_0} = 1; @@ -1541,37 +1553,37 @@ } if ($type eq 'author' && !$id) { return $app->redirect($app->uri . - '?__mode=edit_permissions&author_id=' . + '?__mode=edit_permissions&author_id=' . $obj->id); } elsif ($type eq 'notification') { return $app->redirect($app->uri . - '?__mode=list&_type=notification&blog_id=' . $blog_id . - '&saved=' . $obj->email); + '?__mode=list&_type=notification&blog_id=' . $blog_id . + '&saved=' . $obj->email); } elsif ($type eq 'comment') { if ($q->param('_return') eq 'edit_entry') { return $app->redirect($app->uri . - '?__mode=view&_type=entry&id=' . $obj->entry_id . - '&blog_id=' . $blog_id . '&saved_comment=1'); + '?__mode=view&_type=entry&id=' . $obj->entry_id . + '&blog_id=' . $blog_id . '&saved_comment=1'); } elsif ($q->param('_return') eq 'list_comments') { return $app->redirect($app->uri . - '?__mode=list_comments&id=' . $obj->entry_id . - '&blog_id=' . $blog_id . '&saved_comment=1'); + '?__mode=list_comments&id=' . $obj->entry_id . + '&blog_id=' . $blog_id . '&saved_comment=1'); } elsif ($q->param('_return') eq 'edit_comment') { return $app->redirect($app->uri . - '?__mode=view&_type=comment&id=' . $obj->id . - '&blog_id=' . $blog_id . '&saved_comment=1'); + '?__mode=view&_type=comment&id=' . $obj->id . + '&blog_id=' . $blog_id . '&saved_comment=1'); } } elsif (my $cfg_screen = $q->param('cfg_screen')) { return $app->redirect($app->uri . - "?__mode=$cfg_screen&blog_id=" . $obj->id . '&saved=1'); + "?__mode=$cfg_screen&blog_id=" . $obj->id . '&saved=1'); } elsif ($type eq 'banlist') { return $app->redirect($app->uri . - '?__mode=list&_type=banlist&blog_id=' . $blog_id . - '&saved=' . $obj->ip); + '?__mode=list&_type=banlist&blog_id=' . $blog_id . + '&saved=' . $obj->ip); } else { return $app->redirect($app->uri . - '?__mode=view&_type=' . $type . '&id=' . $obj->id . - '&blog_id=' . $blog_id . '&saved=1'); + '?__mode=view&_type=' . $type . '&id=' . $obj->id . + '&blog_id=' . $blog_id . '&saved=1'); } } @@ -1655,7 +1667,7 @@ if ($type eq 'notification') { my $blog = MT::Blog->load(scalar $q->param('blog_id')); $app->add_breadcrumb($blog->name, $app->uri . - '?__mode=menu&blog_id=' . $blog->id); + '?__mode=menu&blog_id=' . $blog->id); $app->add_breadcrumb($app->translate('Notification List')); $param{nav_notifications} = 1; @data = sort { $a->{email} cmp $b->{email} } @data; @@ -1666,7 +1678,7 @@ if ($type eq 'template') { my $blog = MT::Blog->load(scalar $q->param('blog_id')); $app->add_breadcrumb($blog->name, $app->uri - . '?__mode=menu&blog_id=' . $blog->id); + . '?__mode=menu&blog_id=' . $blog->id); $app->add_breadcrumb($app->translate('Templates')); $param{dynamic_none} = $blog->custom_dynamic_templates eq 'none'; $param{dynamic_archives} = @@ -1678,6 +1690,12 @@ @$ref = sort { $a->{name} cmp $b->{name} } @$ref; for my $i (0..$#$ref) { $ref->[$i]{is_odd} = $i % 2 ? 0 : 1; + ## + # sean willson - http://www.seanwillson.com/ + # + $ref->[$i]{rebuild_type} = defined $ref->[$i]{rebuild_type} ? $ref->[$i]{rebuild_type} : 'EnCo'; + $ref->[$i]{'rebuild_type_'.$ref->[$i]{rebuild_type}} = 1; + ## } } $param{object_index_loop} = \@index_data; @@ -1689,16 +1707,16 @@ if ($type eq 'banlist') { my $blog = MT::Blog->load($blog_id); $app->add_breadcrumb($blog->name, - $app->uri . '?__mode=menu&blog_id=' .$blog->id); + $app->uri . '?__mode=menu&blog_id=' .$blog->id); $app->add_breadcrumb($app->translate('Configuration'), - $app->uri . '?__mode=view&_type=blog&id=' . - $blog->id . '&blog_id=' . $blog->id); + $app->uri . '?__mode=view&_type=blog&id=' . + $blog->id . '&blog_id=' . $blog->id); $app->add_breadcrumb($app->translate('IP Banning')); $param{nav_config} = 1; } elsif ($type eq 'ping') { my $blog = MT::Blog->load($blog_id); $app->add_breadcrumb($blog->name, $app->uri . - '?__mode=menu&blog_id=' . $blog->id); + '?__mode=menu&blog_id=' . $blog->id); $app->add_breadcrumb($app->translate('TrackBack Pings')); $param{nav_trackbacks} = 1; } @@ -1845,21 +1863,21 @@ my $_return = $q->param('_return') || ""; my %types = ( comment => ($_return eq 'edit_entry' - ? "__mode=view&_type=entry" : "__mode=list_comments") - . "&blog_id=$blog_id&id=$entry_id&", + ? "__mode=view&_type=entry" : "__mode=list_comments") + . "&blog_id=$blog_id&id=$entry_id&", ping => ($_return eq 'edit_entry' - ? "__mode=view&_type=entry&id=$entry_id&" - : "__mode=list_pings&") - . "blog_id=$blog_id&", - ping_cat => "__mode=tb_cat_pings&blog_id=$blog_id&category_id=$cat_id&", - entry => "__mode=list_entries&blog_id=$blog_id&", - notification => "__mode=list&_type=notification&blog_id=$blog_id&", - template => "__mode=list&_type=template&blog_id=$blog_id&", + ? "__mode=view&_type=entry&id=$entry_id&" + : "__mode=list_pings&") + . "blog_id=$blog_id&", + ping_cat => "__mode=tb_cat_pings&blog_id=$blog_id&category_id=$cat_id&", + entry => "__mode=list_entries&blog_id=$blog_id&", + notification => "__mode=list&_type=notification&blog_id=$blog_id&", + template => "__mode=list&_type=template&blog_id=$blog_id&", blog => "", - author => "__mode=list&_type=author&", - category => "__mode=list_cat&blog_id=$blog_id&", - templatemap => "__mode=cfg_archives&id=$blog_id&blog_id=$blog_id&", - banlist => "__mode=list&_type=banlist&blog_id=$blog_id&", + author => "__mode=list&_type=author&", + category => "__mode=list_cat&blog_id=$blog_id&", + templatemap => "__mode=cfg_archives&id=$blog_id&blog_id=$blog_id&", + banlist => "__mode=list&_type=banlist&blog_id=$blog_id&", ); my $url = $app->uri . '?' . $types{$type} . ($type eq 'ping' ? 'saved_deleted_ping=1' : 'saved_deleted=1'); @@ -2050,22 +2068,22 @@ } if ($q->param('_return') eq 'list_commenters') { - return $app->redirect($app->uri."?__mode=list_commenters&blog_id=" . - $blog_id . ($msg?'&msg='. $msg:"")); + return $app->redirect($app->uri."?__mode=list_commenters&blog_id=" . + $blog_id . ($msg?'&msg='. $msg:"")); } elsif ($q->param('_return') eq 'list_comments') { - return $app->redirect($app->uri."?__mode=list_comments&blog_id=" . - $blog_id . ($msg?'&msg='. $msg:"")); + return $app->redirect($app->uri."?__mode=list_comments&blog_id=" . + $blog_id . ($msg?'&msg='. $msg:"")); } else { if ($old_status == PENDING && $cmntr->status($blog_id) == BLOCKED) { # In this case, we've removed the comment, so we go to the # comment list instead of to the individual comment. - return $app->redirect($app->uri."?__mode=list_comments&blog_id=" . - $blog_id . ($msg?'&msg='. $msg:"")); + return $app->redirect($app->uri."?__mode=list_comments&blog_id=" . + $blog_id . ($msg?'&msg='. $msg:"")); } - return $app->redirect($app->uri."?__mode=view&_type=comment&blog_id=" . + return $app->redirect($app->uri."?__mode=view&_type=comment&blog_id=" . $blog_id . - "&id=" . $q->param('comment_id') . - ($msg?'&msg='. $msg : "")); + "&id=" . $q->param('comment_id') . + ($msg?'&msg='. $msg : "")); } } @@ -2093,12 +2111,12 @@ $app->rebuild_entry(Entry => $comment->entry_id, BuildDependencies => 1) }); if ($q->param('_return') eq 'list_comments') { - return $app->redirect($app->uri . "?__mode=list_comments&blog_id=" . - $blog_id . "&approved=1"); + return $app->redirect($app->uri . "?__mode=list_comments&blog_id=" . + $blog_id . "&approved=1"); } else { - return $app->redirect($app->uri . "?__mode=view&_type=comment&blog_id=" . - $blog_id . "&id=" . $comment_id . - "&approved=1"); + return $app->redirect($app->uri . "?__mode=view&_type=comment&blog_id=" . + $blog_id . "&id=" . $comment_id . + "&approved=1"); } } @@ -2148,7 +2166,7 @@ $param{filter} = $filter_col; $param{filter_val} = $val; my $url_val = encode_url($val); - $param{filter_args} = "&filter=$filter_col&filter_val=$url_val"; + $param{filter_args} = "&filter=$filter_col&filter_val=$url_val"; } } my $iter1 = MT::Author->load_iter(\%terms); #, \%arg); @@ -2209,7 +2227,7 @@ if ref $MT::PluginActions{'list_commenters'}; my $blog = MT::Blog->load(scalar $q->param('blog_id')); - $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); + $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); $app->add_breadcrumb($app->translate('Registered Commenters')); $param{nav_commenters} = 1; return $app->build_page('list_commenters.tmpl', \%param); @@ -2266,7 +2284,7 @@ my $url_val = encode_url($val); $param{filter} = $q->param('filter'); $param{filter_val} = $q->param('filter_val');; - $param{filter_args} = "&filter=$filter_col&filter_val=$url_val"; + $param{filter_args} = "&filter=$filter_col&filter_val=$url_val"; $param{is_filtered} = 1; } } @@ -2346,7 +2364,7 @@ $param{plugin_action_loop} = $MT::PluginActions{'list_comments'} if ref $MT::PluginActions{'list_comments'}; $app->add_breadcrumb($blog->name, - $app->uri . '?__mode=menu&blog_id=' . $blog->id); + $app->uri . '?__mode=menu&blog_id=' . $blog->id); $app->add_breadcrumb($app->translate('Comments')); $param{nav_comments} = 1; $app->build_page("list_comment.tmpl", \%param); @@ -2394,7 +2412,7 @@ } (my $url_val = $val) =~ s!([^a-zA-Z0-9_.-])!uc sprintf "%%%02x", ord($1)!eg; - $param{filter_args} = "&filter=$filter_col&filter_val=$url_val"; + $param{filter_args} = "&filter=$filter_col&filter_val=$url_val"; $param{filter} = $filter_col; $param{filter_val} = $val; $param{is_filtered} = 1; @@ -2459,7 +2477,7 @@ $param{saved} = $q->param('saved'); $param{saved_deleted} = $q->param('saved_deleted'); $param{plugin_action_loop} = $MT::PluginActions{'list_ping'} || []; - $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); + $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); $app->add_breadcrumb($app->translate('TrackBack Pings')); $param{nav_trackbacks} = 1; $app->build_page("list_ping.tmpl", \%param); @@ -2512,7 +2530,7 @@ } (my $url_val = $val) =~ s!([^a-zA-Z0-9_.-])!uc sprintf "%%%02x", ord($1)!eg; - $param{filter_args} = "&filter=$filter_col&filter_val=$url_val"; + $param{filter_args} = "&filter=$filter_col&filter_val=$url_val"; my ($filter_name, $filter_value); if ($filter_col eq 'category_id') { @@ -2654,7 +2672,7 @@ $param{limit} = $limit; $param{offset} = $offset; my $blog = MT::Blog->load($blog_id); - $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); + $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); $app->add_breadcrumb($app->translate('Entries')); $param{nav_entries} = 1; $app->build_page("list_entry.tmpl", \%param); @@ -2720,15 +2738,15 @@ "Saving placement failed: [_1]", $place->errstr)); } } - my $url = $app->uri . '?__mode=list_entries&blog_id=' . $blog_id . - '&is_power_edit=1' . $q->param('filter_args'); + my $url = $app->uri . '?__mode=list_entries&blog_id=' . $blog_id . + '&is_power_edit=1' . $q->param('filter_args'); if (my $o = $q->param('offset')) { - $url .= '&offset=' . $o; + $url .= '&offset=' . $o; } if (my $l = $q->param('limit')) { - $url .= '&limit=' . $l; + $url .= '&limit=' . $l; } - $app->redirect($url . '&saved=1'); + $app->redirect($url . '&saved=1'); } sub save_entry { @@ -2740,7 +2758,7 @@ $q->param('_type', 'entry'); return $app->edit_object; } elsif ($q->param('cancel')) { - return $app->redirect($app->uri . '?__mode=list_entries&blog_id=' . + return $app->redirect($app->uri . '?__mode=list_entries&blog_id=' . $app->param('blog_id')); } my $perms = $app->{perms} @@ -2856,12 +2874,12 @@ IsNew => $is_new, IsBM => $q->param('is_bm')||0); } else { - return $app->redirect($app->uri.'?__mode=start_rebuild&blog_id='. - $obj->blog_id . '&next=0&type=entry-' . $obj->id . - '&entry_id=' . $obj->id . '&is_bm=' . $q->param('is_bm') . - '&is_new=' . $is_new . '&old_status=' . $status_old . - ($previous_old ? '&old_previous=' . $previous_old->id:''). - ($next_old ? '&old_next=' . $next_old->id : '')); + return $app->redirect($app->uri.'?__mode=start_rebuild&blog_id='. + $obj->blog_id . '&next=0&type=entry-' . $obj->id . + '&entry_id=' . $obj->id . '&is_bm=' . $q->param('is_bm') . + '&is_new=' . $is_new . '&old_status=' . $status_old . + ($previous_old ? '&old_previous=' . $previous_old->id:''). + ($next_old ? '&old_next=' . $next_old->id : '')); } } $app->_finish_rebuild_ping($obj, !$id); @@ -2899,10 +2917,10 @@ $entry->status == MT::Entry::RELEASE() ); $app->build_page("bm_posted.tmpl", \%param); } else { - $app->redirect($app->uri . '?__mode=view&_type=entry&blog_id=' . - $entry->blog_id . '&id=' . $entry->id . - ($is_new ? '&saved_added=1' : '&saved_changes=1') . - ($ping_errors ? '&ping_errors=1' : '')); + $app->redirect($app->uri . '?__mode=view&_type=entry&blog_id=' . + $entry->blog_id . '&id=' . $entry->id . + ($is_new ? '&saved_added=1' : '&saved_changes=1') . + ($ping_errors ? '&ping_errors=1' : '')); } } @@ -2987,8 +3005,8 @@ or return $app->error($app->translate( "Saving placement failed: [_1]", $place->errstr)); } - $app->redirect($app->uri . "?__mode=edit_placements&entry_id=$entry_id&" . - 'blog_id=' . $blog_id . '&saved=1'); + $app->redirect($app->uri . "?__mode=edit_placements&entry_id=$entry_id&" . + 'blog_id=' . $blog_id . '&saved=1'); } sub _build_category_list { @@ -3072,7 +3090,7 @@ $param{saved} = $q->param('saved'); $param{saved_deleted} = $q->param('saved_deleted'); my $blog = MT::Blog->load(scalar $q->param('blog_id')); - $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); + $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); $app->add_breadcrumb($app->translate('Categories')); $param{nav_categories} = 1; $app->build_page('edit_categories.tmpl', \%param); @@ -3152,8 +3170,8 @@ return $app->errtrans("The category must be given a name!") if (!$cat); - $app->redirect($app->uri . '?__mode=list_cat&blog_id=' . $blog_id . - '&saved=1&new_cat_id='.$cat->id); + $app->redirect($app->uri . '?__mode=list_cat&blog_id=' . $blog_id . + '&saved=1&new_cat_id='.$cat->id); } # sub save_categories { @@ -3200,8 +3218,8 @@ # return $app->error($app->translate( # "Saving category failed: [_1]", $cat->errstr)); # } -# $app->redirect($app->uri . '?__mode=list_cat&blog_id=' . $blog_id . -# '&saved=1'); +# $app->redirect($app->uri . '?__mode=list_cat&blog_id=' . $blog_id . +# '&saved=1'); # } sub cfg_prefs { @@ -3277,8 +3295,8 @@ } @tmpl = sort { $a->{template_name} cmp $b->{template_name} } @tmpl; $param{templates} = \@tmpl; - $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); - $app->add_breadcrumb($app->translate('Configuration'), $app->uri . '?__mode=view&_type=blog&id=' . $blog->id . '&blog_id=' . $blog->id); + $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); + $app->add_breadcrumb($app->translate('Configuration'), $app->uri . '?__mode=view&_type=blog&id=' . $blog->id . '&blog_id=' . $blog->id); $app->add_breadcrumb($app->translate('Archiving')); $param{nav_config} = 1; $app->build_page('cfg_archives.tmpl', \%param); @@ -3337,8 +3355,8 @@ $map->save; } } - $app->redirect($app->uri . "?__mode=cfg_archives&blog_id=$blog_id&saved=1" - . ($old_types ne $blog->archive_type ? '&archives_changed=1' : '')); + $app->redirect($app->uri . "?__mode=cfg_archives&blog_id=$blog_id&saved=1" + . ($old_types ne $blog->archive_type ? '&archives_changed=1' : '')); } sub cfg_archives_add { @@ -3387,8 +3405,8 @@ $map->save or return $app->error($app->translate( "Saving map failed: [_1]", $map->errstr)); - $app->redirect($app->uri . '?__mode=cfg_archives&blog_id=' - . $blog_id . '&saved_added=1'); + $app->redirect($app->uri . '?__mode=cfg_archives&blog_id=' + . $blog_id . '&saved_added=1'); } sub preview_entry { @@ -3411,12 +3429,35 @@ $entry->convert_breaks(scalar $q->param('convert_breaks')); my $ctx = MT::Template::Context->new; $ctx->stash('entry', $entry); + $ctx->stash('blog_id', $blog_id); $ctx->stash('blog', $blog); my $build = MT::Builder->new; my $preview_code = <<'HTML'; -

<$MTEntryTitle$>

-<$MTEntryBody$> -<$MTEntryMore$> + +<$MTInclude module="DTD"$> + + +Your Comment + + +

<$MTEntryTitle smarty_pants="2"$>

+
+<$MTEntryBody smarty_pants="2" process_tags="1"$> +
+<$MTEntryMore smarty_pants="2" process_tags="1"$> +
+ + +
+ + +

<$MTEntryTitle smarty_pants="2"$>

+
+<$MTEntryBody smarty_pants="2"$> +
+<$MTEntryMore smarty_pants="2"$> +
+
HTML my $tokens = $build->compile($ctx, $preview_code) or return $app->error($app->translate( @@ -3433,8 +3474,10 @@ next if $col eq 'created_on' || $col eq 'created_by' || $col eq 'modified_on' || $col eq 'modified_by' || $col eq 'author_id'; + my $val = scalar $q->param($col); +# $val =~ s/\r/ /g; push @data, { data_name => $col, - data_value => scalar $q->param($col) }; + data_value => $val }; } for my $date (qw( created_on_old created_on_manual )) { push @data, { data_name => $date, @@ -3486,7 +3529,7 @@ $param{index_tmpl_name} = $tmpl->name; } $app->add_breadcrumb($blog->name, - $app->uri . '?__mode=menu&blog_id=' . $blog->id); + $app->uri . '?__mode=menu&blog_id=' . $blog->id); $app->add_breadcrumb($app->translate('Rebuild Site')); $param{rebuild_option_loop} = \@RebuildOptions; $app->build_page('rebuild_confirm.tmpl', \%param); @@ -3561,8 +3604,8 @@ eval "require " . $API{$type}; my $obj = $API{$type}->load($id) or die "object_edit_uri could not find $type object $id"; - $app->uri() . '?__mode=view&_type=' . $type . '&blog_id=' - . $obj->blog_id. '&id=' . $_[1]; + $app->uri() . '?__mode=view&_type=' . $type . '&blog_id=' + . $obj->blog_id. '&id=' . $_[1]; } sub rebuild_pages { @@ -3611,14 +3654,26 @@ } elsif ($type eq 'index') { return $app->error($app->translate("Permission denied.")) unless $perms->can_rebuild; - $app->rebuild_indexes( BlogID => $blog_id ) or return; + ## + # sean willson - http://www.seanwillson.com/ + # added a rebuild type parameter so that it would only rebuild + # the indexes that i designated appropriate. + # + $app->rebuild_indexes( BlogID => $blog_id, RebuildType => 'In' ) or return; + ## } elsif ($type =~ /^index-(\d+)$/) { return $app->error($app->translate("Permission denied.")) unless $perms->can_rebuild; my $tmpl_id = $1; require MT::Template; $tmpl_saved = MT::Template->load($tmpl_id); - $app->rebuild_indexes( BlogID => $blog_id, Template => $tmpl_saved, + ## + # sean willson - http://www.seanwillson.com/ + # added a rebuild type parameter so that it would only rebuild + # the indexes that i designated appropriate. + # + $app->rebuild_indexes( BlogID => $blog_id, Template => $tmpl_saved, RebuildType => 'In', + Force => 1 ) or return; $order = $app->translate("index template '") . $tmpl_saved->name . "'"; @@ -3744,8 +3799,8 @@ $type =~ /index-(\d+)/; my $tmpl_id = $1; return $app->redirect($app->uri() - . '?__mode=view&_type=template&id=' - . ($tmpl_id) . '&blog_id=' . $blog->id); + . '?__mode=view&_type=template&id=' + . ($tmpl_id) . '&blog_id=' . $blog->id); } else { # popup--just go to cnfrmn. page return $app->build_page('rebuilt.tmpl', \%param); } @@ -3881,8 +3936,8 @@ $pe->save; } } - my $url = $app->uri . '?__mode=edit_permissions&author_id=' . $author_id . - '&saved=1'; + my $url = $app->uri . '?__mode=edit_permissions&author_id=' . $author_id . + '&saved=1'; if (my $blog_id = $q->param('add_role_mask')) { my $pe = MT::Permission->load({ author_id => $author_id, blog_id => $blog_id }); @@ -3896,7 +3951,7 @@ $pe->save; require MT::Blog; my $blog = MT::Blog->load($blog_id); - $url .= '&saved_add_to_blog=' . $blog->name; + $url .= '&saved_add_to_blog=' . $blog->name; } $app->redirect($url); } @@ -3976,8 +4031,8 @@ "Error sending mail ([_1]); try another MailTransfer setting?", MT::Mail->errstr)); } - $app->redirect($app->uri . '?__mode=view&_type=entry&blog_id=' . - $entry->blog_id . '&id=' . $entry->id . '&saved_notify=1'); + $app->redirect($app->uri . '?__mode=view&_type=entry&blog_id=' . + $entry->blog_id . '&id=' . $entry->id . '&saved_notify=1'); } sub start_upload { @@ -3989,7 +4044,7 @@ my $blog_id = $app->{query}->param('blog_id'); require MT::Blog; my $blog = MT::Blog->load($blog_id); - $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); + $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); $app->add_breadcrumb('Upload File'); $app->build_page('upload.tmpl', { local_archive_path => encode_js($blog->archive_path), @@ -4213,7 +4268,7 @@ return $app->error($app->translate("Permission denied.")) unless $perms->can_post; my $blog = MT::Blog->load(scalar $app->{query}->param('blog_id')); - $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); + $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); $app->add_breadcrumb($app->translate('Search & Replace')); $app->build_page('search_replace.tmpl', { search_cols_title => 1, search_cols_text => 1, @@ -4301,7 +4356,7 @@ $res{'search_cols_' . $col} = 1; } my $blog = MT::Blog->load(scalar $app->{query}->param('blog_id')); - $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); + $app->add_breadcrumb($blog->name, $app->uri . '?__mode=menu&blog_id=' . $blog->id); $app->add_breadcrumb($app->translate('Search & Replace'), ''); $res{nav_search} = 1; $app->build_page('search_replace.tmpl', \%res); @@ -4832,11 +4887,11 @@ $perms->save or return $app->error($app->translate( "Saving permissions failed: [_1]", $perms->errstr)); - my $url = $app->uri . '?__mode=view&_type=entry'; + my $url = $app->uri . '?__mode=view&_type=entry'; if (my $id = $q->param('entry_id')) { - $url .= '&id=' . $id; + $url .= '&id=' . $id; } - $url .= '&blog_id=' . $perms->blog_id . '&saved_prefs=1'; + $url .= '&blog_id=' . $perms->blog_id . '&saved_prefs=1'; $app->build_page('reload_opener.tmpl', { url => $url }); } @@ -4890,8 +4945,8 @@ sub reg_file { my $app = shift; my $q = $app->{query}; - my $uri = $app->base . $app->uri . '?__mode=reg_bm_js&bm_show=' . - $q->param('bm_show') . '&bm_height=' . $q->param('bm_height'); + my $uri = $app->base . $app->uri . '?__mode=reg_bm_js&bm_show=' . + $q->param('bm_show') . '&bm_height=' . $q->param('bm_height'); $app->{no_print_body} = 1; $app->set_header('Content-Disposition' => 'attachment; filename=mt.reg'); $app->send_http_header('text/plain; name=mt.reg'); @@ -5038,8 +5093,8 @@ "Setting up mappings failed: [_1]", $map->errstr)); } } - $app->redirect($app->uri . '?__mode=list&_type=template&blog_id=' . - $blog->id . '&reset=1'); + $app->redirect($app->uri . '?__mode=list&_type=template&blog_id=' . + $blog->id . '&reset=1'); } sub set_dynamicity { @@ -5149,7 +5204,7 @@ umask($old_umask); $params .= "&no_cachedir=1" unless -d $compiled_template_path; } - $app->redirect($app->uri . '?__mode=list&_type=template&dynamic_set=1&blog_id=' . $blog->id . $params); + $app->redirect($app->uri . '?__mode=list&_type=template&dynamic_set=1&blog_id=' . $blog->id . $params); } 1; --- tmpl/cms/edit_category.tmpl.orig 2005-05-24 12:37:39.000000000 -0500 +++ tmpl/cms/edit_category.tmpl 2005-05-24 12:39:27.000000000 -0500 @@ -38,9 +38,9 @@

-

+

   -

+
/>

?