--- lib/MT/App.pm~ Thu May 29 02:31:53 2003 +++ lib/MT/App.pm Fri Aug 22 03:46:45 2003 @@ -52,6 +52,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" @@ -185,7 +188,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/Template/Context.pm.orig Tue Jan 13 20:41:05 2004 +++ lib/MT/Template/Context.pm Wed Jan 14 21:09:34 2004 @@ -863,7 +863,7 @@ my $show_email = 1 unless exists $args->{show_email}; my $show_url = 1 unless exists $args->{show_url}; if ($show_url && $a->url) { - return sprintf qq(%s), $a->url, $name; + return sprintf qq(%s), $a->url, $name; } elsif ($show_email && $a->email) { my $str = "mailto:" . $a->email; $str = spam_protect($str) if $args->{'spam_protect'}; @@ -1186,7 +1186,7 @@ my $cgi_path = MT::ConfigMgr->instance->CGIPath; $cgi_path =~ s#([^/])$#$1/#; my $comment_script = MT::ConfigMgr->instance->CommentScript; - return sprintf(qq(%s), + return sprintf(qq(%s), $cgi_path, $comment_script, $url, $name); } elsif ($show_email && $c->email) { my $email = remove_html($c->email); --- schemas/mysql.dump.orig Wed Feb 5 19:00:42 2003 +++ schemas/mysql.dump Thu May 29 14:54:57 2003 @@ -80,12 +80,16 @@ comment_email varchar(75), comment_url varchar(255), 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, comment_modified_by integer, index (comment_created_on), index (comment_entry_id), + index (comment_parent_id), index (comment_blog_id) ); @@ -192,6 +196,7 @@ template_linked_file varchar(255), template_linked_file_mtime varchar(10), template_linked_file_size mediumint, + template_rebuild_type text, unique (template_blog_id, template_name), index (template_type) ); --- lib/MT/App/CMS.pm.orig Sat Apr 5 13:26:01 2003 +++ lib/MT/App/CMS.pm Wed May 14 12:15:55 2003 @@ -525,6 +525,12 @@ $param{has_rebuild} = $obj->type eq 'index'; $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') { $blog_id = $obj->id; my $at = $obj->archive_type; @@ -677,6 +683,12 @@ $param{has_outfile} = $q->param('type') eq 'index'; $param{has_rebuild} = $q->param('type') eq 'index'; $param{rebuild_me} = 1; + ## + # sean willson - http://www.seanwillson.com/ + # + $param{rebuild_type} = 'EnCo'; + $param{'rebuild_type_enco'} = 1; + ## } elsif ($type eq 'blog') { $param{server_offset_0} = 1; } @@ -1150,6 +1162,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; @@ -2150,10 +2168,29 @@ $ctx->stash('entry', $entry); $ctx->stash('blog', $blog); my $build = MT::Builder->new; + $ctx->stash('blog_id', $blog_id); 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( @@ -2291,14 +2328,25 @@ } 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 = "index template '" . $tmpl_saved->name . "'"; --- lib/MT/App/Comments.pm.orig Mon Feb 24 11:16:12 2003 +++ lib/MT/App/Comments.pm Wed May 14 12:21:57 2003 @@ -106,9 +106,15 @@ $comment->subject($q->param('subject')); $comment->parent_id($q->param('parent_id')); $comment->save; - $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 => 'Co' ) or return $app->error($app->translate( "Rebuild failed: [_1]", $app->errstr)); + ## $app->rebuild_entry( Entry => $entry ) or return $app->error($app->translate( "Rebuild failed: [_1]", $app->errstr)); --- tmpl/cms/edit_template.tmpl.orig Mon Feb 24 11:15:19 2003 +++ tmpl/cms/edit_template.tmpl Wed May 14 12:27:08 2003 @@ -150,12 +150,33 @@ + + + + + + + + +
+
--- tmpl/cms/list_template.tmpl.orig Mon Feb 24 11:15:19 2003 +++ tmpl/cms/list_template.tmpl Wed May 14 12:29:43 2003 @@ -149,16 +149,21 @@ + + + + - @@ -167,7 +172,10 @@
+ + --- lib/MT.pm.orig Fri Mar 7 16:28:37 2003 +++ lib/MT.pm Wed May 14 12:32:49 2003 @@ -175,7 +175,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; + ## } 1; } @@ -234,7 +240,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 @@ -460,8 +473,28 @@ ## 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; + + ## + # 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; + ## + + ## + # 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)); + + next if ((! $param{Force}) && + ($rebuildType !~ /in/gi) && + ($tmplRebuildType !~ /$rebuildType|all/gi)); + ## my $ctx = MT::Template::Context->new; my $html = $tmpl->build($ctx); --- lib/MT/Template.pm.orig Mon Feb 24 11:15:19 2003 +++ lib/MT/Template.pm Wed May 14 12:35:49 2003 @@ -25,7 +25,7 @@ columns => [ 'id', 'blog_id', 'name', 'type', 'outfile', 'text', 'linked_file', 'linked_file_mtime', 'linked_file_size', - 'rebuild_me', + 'rebuild_me','rebuild_type', ], indexes => { blog_id => 1, --- lib/MT/App/Trackback.pm.orig Wed May 14 11:46:58 2003 +++ lib/MT/App/Trackback.pm Wed May 14 12:39:27 2003 @@ -197,10 +197,15 @@ } require MT::Blog; my $blog = MT::Blog->load($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)); - + ## if ($app->{cfg}->GenerateTrackBackRSS) { ## Now generate RSS feed for this trackback item. my $rss = _generate_rss($tb, 10); @@ -213,6 +218,16 @@ $fmgr->errstr)); } + ## + # sean willson - http://www.seanwillson.com/ + # added because i wanted to rebuild an entry after a trackback was submitted + # automatically. i added it after the previous block because i wasn't sure + # if the entry was going to need the trackback rss entry. + # + $app->rebuild_entry( Entry => $entry ) + or return $app->error($app->translate( + "Rebuild failed: [_1]", $app->errstr)) if ($entry); + ## if ($blog->email_new_pings) { require MT::Mail; my($author, $subj, $body);