Skip to content

Commit

Permalink
Add template_cache_request for special test mode (clear template cach…
Browse files Browse the repository at this point in the history
…e on each new request); add new comments_wsfactor var for changing default whitespace factor for comments
  • Loading branch information
pudge committed Mar 4, 2002
1 parent 6d2214f commit 58a0a4a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Slash/Apache/User/User.pm
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ sub handler {
createEnv($r) if $cfg->{env};
authors($r) if $form->{'slashcode_authors'};

# a special test mode for getting a new template
# object (hence, fresh cache) for each request
if ($constants->{template_cache_request}) {
undef $dbcfg->{template};
}

# Weird hack for getCurrentCache() till I can code up proper logic for it
{
my $cache = getCurrentCache();
Expand Down
2 changes: 2 additions & 0 deletions sql/mysql/defaults.sql
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ INSERT INTO vars (name, value, description) VALUES ('comments_moddable_archived'
INSERT INTO vars (name, value, description) VALUES ('comments_moddable_hours','336','Num hours after being posted that a comment may be moderated');
INSERT INTO vars (name, value, description) VALUES ('comments_response_limit','5','interval between reply and submit');
INSERT INTO vars (name, value, description) VALUES ('comments_speed_limit','120','seconds delay before repeat posting');
INSERT INTO vars (name, value, description) VALUES ('comments_wsfactor','1.0','Whitespace factor');
INSERT INTO vars (name, value, description) VALUES ('commentstatus','0','default comment code');
INSERT INTO vars (name, value, description) VALUES ('cookiedomain','','Domain for cookie to be active (normally leave blank)');
INSERT INTO vars (name, value, description) VALUES ('cookiepath','/','Path on server for cookie to be active');
Expand Down Expand Up @@ -514,6 +515,7 @@ INSERT INTO vars (name, value, description) VALUES ('submiss_view','1','allow us
INSERT INTO vars (name, value, description) VALUES ('submission_bonus','3','Bonus given to user if submission is used');
INSERT INTO vars (name, value, description) VALUES ('submissions_speed_limit','300','How fast they can submit');
INSERT INTO vars (name, value, description) VALUES ('submit_categories','Back','Extra submissions categories');
INSERT INTO vars (name, value, description) VALUES ('template_cache_request','0','Special boolean to cache templates only for a single request');
INSERT INTO vars (name, value, description) VALUES ('template_cache_size','0','Number of templates to store in cache (0 = unlimited)');
INSERT INTO vars (name, value, description) VALUES ('template_post_chomp','0','Chomp whitespace after directives (0 = no, 1 = yes, 2 = collapse; 0 or 2 recommended)');
INSERT INTO vars (name, value, description) VALUES ('template_pre_chomp','0','Chomp whitespace before directives (0 = no, 1 = yes, 2 = collapse; 0 or 2 recommended)');
Expand Down
6 changes: 3 additions & 3 deletions themes/slashcode/htdocs/comments.pl
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ sub previewForm {
\$tempComment, \$tempSubject, $error_message, 1,
($form->{posttype} == CODE
? $constants->{comments_codemode_wsfactor}
: 1.0) )
: $constants->{comments_wsfactor} || 1) )
or return;

$tempComment = addDomainTags($tempComment);
Expand Down Expand Up @@ -857,7 +857,7 @@ sub submitComment {
\$tempComment, \$tempSubject, $error_message, 1,
($form->{posttype} == CODE
? $constants->{comments_codemode_wsfactor}
: 1.0) )
: $constants->{comments_wsfactor} || 1) )
) {
$slashdb->resetFormkey($form->{formkey});
editComment(@_, $error_message);
Expand Down Expand Up @@ -1292,7 +1292,7 @@ sub deleteThread {
my @delList;
$comments_deleted = \@delList if !$level;

return unless $user->{seclev} > 100;
return unless $user->{seclev} >= 1000;

my $delkids = $slashdb->getCommentChildren($cid);

Expand Down

0 comments on commit 58a0a4a

Please sign in to comment.