Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

misc. fixes, syncs, etc.

  • Loading branch information...
commit ea5719d7baa4183c4c0fc867e6aec67039c4fe22 1 parent 158b89f
@pudge pudge authored
View
24 Slash/DB/MySQL/MySQL.pm
@@ -899,20 +899,19 @@ sub getMetamodsForUserRaw {
}
sub getCSSValuesHashForCol {
- my ($self, $col) = @_;
- my $values = $self->sqlSelectColArrayref($col, "css", "", "", { distinct => 1});
- my $result;
- %$result = map { $_ => 1 } @$values;
+ my($self, $col) = @_;
+ my $values = $self->sqlSelectColArrayref($col, 'css', '', '', { distinct => 1 });
+ my $result = { map { $_ => 1 } @$values };
return $result;
}
sub getCSS {
- my ($self) = @_;
+ my($self) = @_;
my $user = getCurrentUser();
my $page = $user->{currentPage};
- my $skid = getCurrentSkin("skid");
+ my $skid = getCurrentSkin('skid');
my $admin = $user->{is_admin};
- my $theme = $user->{light} ? "light" : "";
+ my $theme = $user->{light} ? 'light' : "";
my $constants = getCurrentStatic();
my $expire_time = $constants->{css_expire} || 3600;
@@ -927,9 +926,9 @@ sub getCSS {
my $css_skids_ref = $self->{_css_skids_cache};
my $css_themes_ref = $self->{_css_themes_cache};
- $css_pages_ref = $self->getCSSValuesHashForCol("page") if !$css_pages_ref;
- $css_skids_ref = $self->getCSSValuesHashForCol("skid") if !$css_skids_ref;
- $css_themes_ref= $self->getCSSValuesHashForCol("theme") if !$css_themes_ref;
+ $css_pages_ref = $self->getCSSValuesHashForCol('page') if !$css_pages_ref;
+ $css_skids_ref = $self->getCSSValuesHashForCol('skid') if !$css_skids_ref;
+ $css_themes_ref= $self->getCSSValuesHashForCol('theme') if !$css_themes_ref;
$page = '' if !$css_pages_ref->{$page};
$skid = 0 if !$css_skids_ref->{$skid};
@@ -957,7 +956,6 @@ sub getCSS {
$css_ref->{$skid}{$page}{$admin}{$theme} = $css;
return $css;
-
}
########################################################
@@ -4349,7 +4347,7 @@ sub setStory {
# keep the value the same.
# Note: this isn't exactly right. If the stories table is the
# only one being written to, we shouldn't set last_update
- # manually, we should let it be set iff another column changes.
+ # manually, we should let it be set if another column changes.
# Doing it this way doesn't really hurt anything though.
if (!exists($change_hr->{last_update})
@@ -9300,7 +9298,7 @@ sub getSlashConf {
)],
charrefs_bad_entity => [qw( zwnj zwj lrm rlm )],
charrefs_bad_numeric => [qw( 8204 8205 8206 8207 8236 8237 8238 )],
- charrefs_good_entity => [qw( amp lt gt euro pound yen )],
+ charrefs_good_entity => [qw( amp lt gt euro pound yen rsquo lsquo rdquo ldquo ndash mdash )],
charrefs_good_numeric => [ ],
cur_performance_stat_ops => [ ],
fixhrefs => [ ],
View
6 Slash/Utility/Anchor/Anchor.pm
@@ -676,10 +676,10 @@ EOT
# box. -- Pater
getSkinColors() unless $user->{colors};
- return sidebox('Advertisement', "<div class=\"ad$num\" align=\"center\">" . $user->{state}{ad}{$num} . "</div>", "advertisement");
- } else { return ""; }
+ return sidebox('Advertisement', qq'<div class="ad$num" align="center">' . $user->{state}{ad}{$num} . "</div>", "advertisement");
+ } else { return ''; }
} else {
- return $user->{state}{ad}{$num} ? "<div class=\"ad$num\">$user->{state}{ad}{$num}</div>": "";
+ return $user->{state}{ad}{$num} ? qq'<div class="ad$num">$user->{state}{ad}{$num}</div>': '';
}
}
View
9 Slash/Utility/Data/Data.pm
@@ -1423,7 +1423,12 @@ sub processCustomTags {
my $substr = substr($str, $pos);
if ($substr =~ m/^$close/si) {
my $len = length($1);
- my $code = strip_code($3);
+ my $codestr = $3;
+ # remove these if they were added by url2html; I know
+ # this is a rather cheesy way to do this, but c'est la vie
+ # -- pudge
+ $codestr =~ s{<a href="[^"]+" rel="url2html-$$">(.+?)</a>}{$1}g;
+ my $code = strip_code($codestr);
my $newstr = "<blockquote>$code</blockquote>";
substr($str, $pos, $len) = $newstr;
pos($str) = $pos + length($newstr);
@@ -2249,7 +2254,7 @@ sub url2html {
my $extra = '';
$extra = $1 if $url =~ s/([?!;:.,']+)$//;
$extra = ')' . $extra if $url !~ /\(/ && $url =~ s/\)$//;
- qq[<a href="$url">$url</a>$extra];
+ qq[<a href="$url" rel="url2html-$$">$url</a>$extra];
}ogie;
return $text;
View
8 Slash/Utility/Display/Display.pm
@@ -967,14 +967,6 @@ sub portalsidebox {
Print links to pages for additional comments.
-
-
-#========================================================================
-
-=head2 linkCommentPages(SID, PID, CID, TOTAL)
-
-Print links to pages for additional comments.
-
=over 4
=item Parameters
View
3  plugins/Admin/admin.pl
@@ -1520,7 +1520,7 @@ sub editStory {
});
my $ispell_comments = {
- introtext => get_ispell_comments($storyref->{introtext}),
+ introtext => get_ispell_comments("$storyref->{title} $storyref->{introtext}"),
bodytext => get_ispell_comments($storyref->{bodytext}),
} unless $user->{no_spell};
@@ -2009,6 +2009,7 @@ sub updateStory {
introtext => $form->{introtext},
relatedtext => $form->{relatedtext},
-rendered => 'NULL', # freshenup.pl will write this
+ is_dirty => 1
};
for (qw(dept bodytext relatedtext)) {
View
39 plugins/Admin/templates/aclEdit;admin;default
@@ -13,36 +13,39 @@ __name__
aclEdit
__template__
-<P>Existing ACLs and users that have their permissions:
+<p>Existing ACLs and users that have their permissions:
-<P><TABLE CELLSPACING=2 BORDER=0>
+<p><table cellspacing=2 border=0>
[% FOREACH acl = acls.keys %]
- <TR>
- <TD>[% acl | strip_nohtml %]</TD>
- <TD ALIGN="RIGHT">([% acls.$acl.size %])</TD>
- <TD>
+ <tr>
+ <td>[% acl | strip_nohtml %]</td>
+ <td align="right">([% acls.$acl.size %])</td>
+ <td>
[% FOREACH uid = acls.$acl.nsort %]
- <A HREF="[% gSkin.rootdir %]/users.pl?uid=[% uid | strip_attribute %]">[% uid %]</A>
+ <a href="[% gSkin.rootdir %]/users.pl?uid=[% uid | strip_attribute %]">[% uid %]</a>
[% END %]
- </TD>
- </TR>
+ </td>
+ </tr>
[% END %]
-</TABLE>
+</table>
-<FORM ACTION="[% env.script_name %]" METHOD="POST">
-<INPUT TYPE="HIDDEN" NAME="op" VALUE="acls">
- <P>Enter name of new ACL category to create:
- <INPUT TYPE="TEXT" NAME="thisname" VALUE="">
- <INPUT TYPE="SUBMIT" NAME="aclsave" VALUE="Create">
- <BR>(It will be assigned to you, for starters, after which you will
+<form action="[% env.script_name %]" method="post">
+<fieldset>
+<legend>ACL Editor</legend>
+<input type="hidden" name="op" value="acls">
+ <label>Enter name of new ACL category to create:</label>
+ <input type="text" name="thisname" value="">
+ <input type="submit" name="aclsave" value="Create" class="button">
+ <br>(It will be assigned to you, for starters, after which you will
be able to assign it to other users by editing them in users.pl.
To delete a category, simply remove it from all users.)
- <BR>Recognized ACL categories so far: <tt>candelcomments_always modpoints_always stats</tt>
+ <br>Recognized ACL categories so far: <tt>candelcomments_always modpoints_always stats</tt>
<br>Don't name an ACL the same as an AL2 type, or there
will be trouble! Current AL2 types: <tt>comment ban
expired nopost nopalm norss nosubmit trusted proxy</tt>
<!-- XXXSRCID The code needs to check getAL2Types() to prevent that error from even being possible -->
-</FORM>
+ </fieldset>
+</form>
__seclev__
500
View
2  plugins/BlockProxyNet/block_proxy_net.pl
@@ -39,7 +39,7 @@
}
- slashdLog("old: $old new: $new");
+ return "old: $old new: $new";
};
sub load_from_source {
View
48 plugins/Journal/journal.pl
@@ -115,7 +115,7 @@ sub displayTop {
my($journal, $constants, $user, $form, $reader) = @_;
my $journals;
- _printHead("mainhead") or return;
+ _printHead('mainhead') or return;
# this should probably be in a separate template, so the site admins
# can select the order themselves -- pudge
@@ -134,7 +134,7 @@ sub displayTop {
$journals = $zoo->topFriends;
slashDisplay('journaltop', { journals => $journals, type => 'friend' });
}
- print getData("journalfoot");
+ print getData('journalfoot');
}
@@ -146,7 +146,7 @@ sub displayFriends {
_validFormkey('generate_formkey') or return;
- _printHead("mainhead") or return;
+ _printHead('mainhead') or return;
my $zoo = getObject('Slash::Zoo');
my $friends = $zoo->getFriendsWithJournals;
@@ -156,17 +156,15 @@ sub displayFriends {
print getData('nofriends');
slashDisplay('searchusers');
}
- print getData("journalfoot");
-
-
+ print getData('journalfoot');
}
sub searchUsers {
my($journal, $constants, $user, $form, $reader) = @_;
if (!$form->{nickname}) {
- _printHead("mainhead") or return;
+ _printHead('mainhead') or return;
slashDisplay('searchusers');
return;
}
@@ -185,7 +183,7 @@ sub searchUsers {
}
# print the lovely headers
- _printHead("mainhead") or return;
+ _printHead('mainhead') or return;
# if false or empty ref, no users
if (!$results || (ref($results) eq 'ARRAY' && @$results < 1)) {
@@ -204,7 +202,7 @@ sub searchUsers {
search => 1,
});
}
- print getData("journalfoot");
+ print getData('journalfoot');
}
sub displayRSS {
@@ -342,7 +340,7 @@ sub displayArticleFriends {
$uid = $user->{uid};
}
- _printHead("friendhead", { nickname => $nickname, uid => $uid }) or return;
+ _printHead('friendhead', { nickname => $nickname, uid => $uid }) or return;
# clean it up
my $start = fixint($form->{start}) || 0;
@@ -402,7 +400,7 @@ sub displayArticleFriends {
back => $back,
forward => $forward,
});
- print getData("journalfoot");
+ print getData('journalfoot');
}
sub displayArticle {
@@ -440,7 +438,7 @@ sub displayArticle {
return displayFriends(@_);
}
- _printHead("userhead", $head_data, 1) or return;
+ _printHead('userhead', $head_data, 1) or return;
# clean it up
my $start = fixint($form->{start}) || 0;
@@ -528,7 +526,7 @@ sub displayArticle {
forward => $forward,
show_discussion => $show_discussion,
});
- print getData("journalfoot");
+ print getData('journalfoot');
if ($show_discussion) {
printComments($discussion);
@@ -545,7 +543,7 @@ sub editPrefs {
my $nickname = $user->{nickname};
my $uid = $user->{uid};
- _printHead("userhead", { nickname => $nickname, uid => $uid, menutype => 'prefs' }) or return;
+ _printHead('userhead', { nickname => $nickname, uid => $uid, menutype => 'prefs' }) or return;
my $theme = _checkTheme($user->{'journal_theme'});
my $themes = $journal->themes;
@@ -553,7 +551,7 @@ sub editPrefs {
default => $theme,
themes => $themes,
});
- print getData("journalfoot");
+ print getData('journalfoot');
}
sub setPrefs {
@@ -589,7 +587,7 @@ sub listArticle {
? $reader->getUser($form->{uid}, 'nickname')
: $user->{nickname};
- _printHead("userhead",
+ _printHead('userhead',
{ nickname => $nickname, uid => $form->{uid} || $user->{uid} },
1) or return;
@@ -606,7 +604,7 @@ sub listArticle {
} else {
print getData('noentries', { nickname => $nickname });
}
- print getData("journalfoot");
+ print getData('journalfoot');
}
sub saveArticle {
@@ -620,7 +618,7 @@ sub saveArticle {
$d =~ s/&#?[a-zA-Z0-9]+;//g; # remove entities we don't know
if ($d !~ /\S/) { # require SOME non-whitespace
unless ($ws) {
- _printHead("mainhead") or return;
+ _printHead('mainhead') or return;
print getData('no_desc_or_article');
editArticle(@_, 1);
}
@@ -674,7 +672,7 @@ sub saveArticle {
unless ($id) {
unless ($ws) {
- _printHead("mainhead") or return;
+ _printHead('mainhead') or return;
print getData('create_failed');
}
return 0;
@@ -741,9 +739,9 @@ sub articleMeta {
if ($form->{id}) {
my $article = $journal->get($form->{id});
- _printHead("mainhead") or return;
+ _printHead('mainhead') or return;
slashDisplay('meta', { article => $article });
- print getData("journalfoot");
+ print getData('journalfoot');
} else {
listArticle(@_);
}
@@ -772,7 +770,7 @@ sub editArticle {
}
unless ($nohead) {
- _printHead("mainhead") or return;
+ _printHead('mainhead') or return;
}
if ($form->{state}) {
@@ -825,7 +823,7 @@ sub editArticle {
article => $article,
format_select => $format_select,
});
- print getData("journalfoot");
+ print getData('journalfoot');
}
sub _validFormkey {
@@ -843,7 +841,7 @@ sub _validFormkey {
}
if ($error) {
- _printHead("mainhead") or return;
+ _printHead('mainhead') or return;
print $error;
return 0;
} else {
@@ -886,7 +884,7 @@ sub _printHead {
errorLog(sprintf("currentPageBusted: %s\n", Dumper([getCurrentForm(), \%ENV, $user])));
}
- slashDisplay("journalhead", $data);
+ slashDisplay('journalhead', $data);
}
sub _checkTheme {
View
2  themes/slashcode/htdocs/article.pl
@@ -142,7 +142,7 @@ sub main {
header($links, $story->{section}, {
story_title => $story->{title},
meta_desc => $meta_desc,
- Page => "article",
+ Page => 'article',
}) or return;
# Can't do this before getStoryByTime because
View
26 themes/slashcode/htdocs/index.pl
@@ -74,8 +74,8 @@ sub main {
# Decide what our issue is going to be.
my $limit;
- my $issue = $form->{issue} || "";
- $issue = "" if $issue !~ /^\d{8}$/;
+ my $issue = $form->{issue} || '';
+ $issue = '' if $issue !~ /^\d{8}$/;
# if ($issue) {
# if ($user->{is_anon}) {
# $limit = $gSkin->{artcount_max} * 3;
@@ -165,7 +165,7 @@ sub main {
return do_rss($reader, $constants, $user, $form, $stories, $skin_name) if $rss;
# Do we want to display the plug offering the user a daypass?
- my $daypass_plug_text = "";
+ my $daypass_plug_text = '';
if ($constants->{daypass}) {
# If this var is set, only offer a daypass when there
# is a future story available.
@@ -267,7 +267,7 @@ sub getSidFromRemark {
my($remark) = @_;
my $regex = regexSid();
my($sid) = $remark =~ $regex;
- return $sid || "";
+ return $sid || '';
}
sub do_rss {
@@ -411,7 +411,7 @@ sub displayStandardBlocks {
$bid,
'',
$getblocks,
- "olderstuff"
+ 'olderstuff'
) if @$older_stories_essentials;
} elsif ($bid eq 'userlogin' && ! $user->{is_anon}) {
@@ -424,7 +424,7 @@ sub displayStandardBlocks {
$boxBank->{$bid}{bid},
$boxBank->{$bid}{url},
$getblocks,
- "login"
+ 'login'
);
} elsif ($bid eq 'poll' && !$constants->{poll_cache}) {
@@ -577,8 +577,8 @@ sub displayStories {
sid => $story->{sid},
tid => $story->{tid},
skin => $story->{primaryskid},
- class => "more"
- }, "", $ls_other);
+ class => 'more'
+ }, '', $ls_other);
my $link;
@@ -595,7 +595,7 @@ sub displayStories {
tid => $story->{tid},
mode => 'nocomment',
skin => $story->{primaryskid},
- }, "", $ls_other) if $story->{body_length};
+ }, '', $ls_other) if $story->{body_length};
my @commentcount_link;
my $thresh = $threshComments[$user->{threshold} + 1];
@@ -608,7 +608,7 @@ sub displayStories {
threshold => $user->{threshold},
'link' => $thresh,
skin => $story->{primaryskid},
- }, "", $ls_other);
+ }, '', $ls_other);
}
}
@@ -618,7 +618,7 @@ sub displayStories {
threshold => -1,
'link' => $story->{commentcount} || 0,
skin => $story->{primaryskid}
- }, "", $ls_other);
+ }, '', $ls_other);
push @commentcount_link, $thresh, ($story->{commentcount} || 0);
push @links, getData('comments', { cc => \@commentcount_link })
@@ -637,11 +637,11 @@ sub displayStories {
$url = $gSkin->{rootdir} . '/' . $gSkin->{index_handler} . '?section=' . $skin->{name};
}
- push @links, [ $url, $skin->{hostname} || $skin->{title}, "", "section" ];
+ push @links, [ $url, $skin->{hostname} || $skin->{title}, '', 'section'];
}
if ($user->{seclev} >= 100) {
- push @links, [ "$gSkin->{rootdir}/admin.pl?op=edit&sid=$story->{sid}", getData('edit'), "", "edit" ];
+ push @links, [ "$gSkin->{rootdir}/admin.pl?op=edit&sid=$story->{sid}", getData('edit'), '', 'edit' ];
}
# I added sid so that you could set up replies from the front page -Brian
View
10 themes/slashcode/tasks/ircslash.pl
@@ -225,7 +225,7 @@ sub on_public {
my $constants = getCurrentStatic();
my($arg) = $event->args();
- if (my($cmd) = $arg =~ /^$nick\b\S*\s*(.+)/) {
+ if (my($cmd) = $arg =~ /^(?:\.|$nick\b\S*\s*)(\w.+)/) {
handle_cmd('irc', $cmd, $event);
}
}
@@ -303,7 +303,7 @@ sub j_on_msg {
=cut
my $event = { nick => $from };
- if (my($cmd) = $body =~ /^$jnick\b\S*\s*(.+)/) {
+ if (my($cmd) = $body =~ /^(?:\.|$jnick\b\S*\s*)(\w.+)/) {
handle_cmd('jabber', $cmd, $event);
}
}
@@ -335,6 +335,7 @@ sub getIRCData {
quote => \&cmd_quote,
lcr => \&cmd_lcr,
lcrset => \&cmd_lcrset,
+ re => \&cmd_re,
);
sub handle_cmd {
my($service, $cmd, $event) = @_;
@@ -454,6 +455,11 @@ sub cmd_exit {
$clean_exit_flag = 1;
}
+sub cmd_re {
+ my($service, $info) = @_;
+ send_msg(getIRCData('re', { nickname => $info->{event}{nick} }), { $service => 1 });
+}
+
sub cmd_ignore {
my($service, $info) = @_;
my $slashdb = getCurrentDB();
View
5 themes/slashcode/templates/data;ircslash;default
@@ -20,7 +20,10 @@ __template__
[% SWITCH value %]
[% CASE 'help' %]
- Commands: help, [un]hush, [un]ignore, slashd, ping, who, whois (uid|nick), lcr [SITE], lcrset SITE TAG, quote (symbol), dbs, [% IF plugins.daddypants %], daddypants [now|next|today|tomorrow|n days][% END %]
+ Commands: help, [un]hush, [un]ignore, slashd, ping, who, whois (UID|NICK), lcr [SITE], lcrset SITE TAG, quote SYMBOL, dbs, re[% IF plugins.daddypants %], daddypants [now|next|today|tomorrow|N days][% END %]
+
+[% CASE 're' %]
+ Welcome back, [% nickname %]
[% CASE 'exiting' %]
Exiting (slashd should restart me within a minute)
Please sign in to comment.
Something went wrong with that request. Please try again.